View Single Post

  #16 (permalink)  
Old 09-07-2008, 12:48 PM
johned johned is offline
Coder
 
Join Date: Nov 2007
Posts: 75
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
johned will become famous soon enough
Default

I looked at cms made simple and a few others but they where ether to complicated for the end user or to big so i wrote my own cms with php and an open source javascript wysiwyg text/html editor. Now i just use include files where ever my customers want to be able to update content. Its simple enuf and just uses flat text files and pages as an array.

Still working on a gallery tho but if any one is interested in the cms the code bellow is the main part to build on.

Each page is added to the array and has a text file containing the content. Now if you build an admin page and password protect it you can use a wysiwyg javascript editor to write to the text files and wack a simple customised cms made in no time..

PHP Code:
<?php
$validPages 
= array(
'home',
'about',
'gallery',
'members',
'contact'
);
 
if (isset(
$_GET['p']) && in_array($_GET['p'], $validPages) && file_exists("includes/" $_GET['p'] . ".txt")) {
include(
"includes/" $_GET['p'] . ".txt");
} else {
include(
"includes/home.txt");
}

Last edited by johned; 09-07-2008 at 01:07 PM.
Reply With Quote