Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple PHP CMS for editing content ? 1

Status
Not open for further replies.

MrMiyagi

Technical User
Feb 11, 2009
43
FI
Hello,

I am building a simple informative website for a client. My problem is that the client needs a tool for editing text content on the site. I would just edit these few paragraph tags inside the html file and upload with ftp, but for the client some browser based solution is needed.

So is there some reliable, user friendly and simple CMS that would provide a login based solution for editing few simple paragraph tag content on the site?

Would not want to go with wordpress or joomla etc because that would include hassle with making my code work with templates etc.. I know some php, but would not want to code the cms myself unless I find a really good tutorial. There has to be some extremely simple cms for this purpose. Thanks for all answers.
 
despite what you say, wordpress is an extremely simple cms.

if even that is too complex then your best bet is to write something yourself. you need only have a textarea and some simple processing code. no need even for a database if you don't want version control; just write directly to the html file

Code:
//note the template tags.
if (isset($_POST['submit'])){
 $contents = file_get_contents('path/to/page.html');
 mv('/path/to/page.html', 'path/to/page.html_'.time());
 $newcontents = preg_replace('/(<!---TEMPLATE--->).*?(<!---ENDTEMPLATE--->)/','$1'.nl2br(trim($_POST['textarea'])).'$2', $contents);
 file_put_contents('path/to/page.html', $newContents);
}
 
If I choose Wordpress can I first write my xhtml/css with some javascript(prototype/scriptaculous) and flash elements and implement this page with wordpress? I would only need wordpress for updating these few paragraphs every now and then.

I think your code example could also be my solution. Could you explain it a bit further? Thanks for help.

//note the template tags.
if (isset($_POST['submit'])){
$contents = file_get_contents('path/to/page.html');
mv('/path/to/page.html', 'path/to/page.html_'.time());
$newcontents = preg_replace('/(<!---TEMPLATE--->).*?(<!---ENDTEMPLATE--->)/','$1'.nl2br(trim($_POST['textarea'])).'$2', $contents);
file_put_contents('path/to/page.html', $newContents);
}
 
with wordpress you can do anything you like that you can do with php. the feature that is most useful for non-blog pages are called ... pages ! you can specify what template you want with what page. so you would create a template with everything therein except for the dynamic content. the dynamic content you would edit through the wp admin setting.

i posted the code above to show how you could use a simple textarea to update a static html file. there is nothing more to explain. you would need to create the form yourself and to implement whatever user level controls you want. perhaps .htaccess would be the simplest for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top