tags:

views:

243

answers:

6

Hi guys,

I'm working on a site which requires a very simple CMS - basically there's a block of text on the homepage that needs to be editable by the client. Their current hosting plan doesn't allow for a database, and including one will cost an extra $X a month which I think is unnecessary for such a basic system.

The site is currently built using Codeignitor. I'm planning to write the CMS part of it using either flat PHP or TXT files, are there alternative methods worth considering, and what are the pros/cons?

A: 

I once solved this problem by simply putting markers in an HTML file, as HTML comments, and then had my PHP script parse the file and insert the desired text in between the markers. Done this way, you need no other files other than the PHP that handles the form submission from the CMS and a static HTML page.

In words, read the file into a string, explode() the string using the marker as the delimiter, modify the second (if you have a single editable section enclosed by the markers) array element to contain the new text submitted by the user, then implode the array back into the string, then write the string back as the complete file.

RibaldEddie
+1  A: 

Have a loot at flatCMS, very small cms and does not require database, good for situations like you described.

Sarfraz
A: 

What about sqlite? it is just a file, no need to install anything? But if this is also not welcome, you could just keep the contents in txt files and have a php to read it, put to your template.

Marcin
A: 

Try http://www.opensourcecms.com/

example of some that might interest you

  • PivotX
  • pluck
  • razorCMS
arthurprs
+1  A: 

Okay, so further to this, I've opted for a custom flatfile system. I looked at a few of the recommended non DB CMS systems and they seem quite good - particularly this one which I later found: http://get-simple.info/

The reason for building my own is mainly due to the fact that the site is already on the Codeignitor Framework, and I don't want to rebuild it using a different one.

So my question now is - if my system is storing data in two txt files: one for userdata and one for site content, are there massive security issues if I set the sitecontent file permissions to RW? The site is quite small and I can't imagine anyone would want to hack it, but I'd still like to know if there are any major security implications.

pingu
+1  A: 

cushyCMS

its ftp's into your hosting account, reads your html, and looks for tags that have a class="cushy" and makes those content feilds editable. its good forwhat your wanting.

lukemh