| tero.co.uk | |
|
|
One Page CMS (Content Management System)I have written a very simple single page CMS in PHP which allows you to place comment tags in files such as <!--ONEPAGECMS-START-LEFT-COLUMN--> and <!--ONEPAGECMS-END--> and everything in between turns into an editable box. Take a look at this screen shot to see it in action. If you're familiar with FTP and basic HTML editing, it could take only a few minutes to setup. Feel free to download and use or contact me if you have any questions or comments. It now handles images too! See screen shot.
1. Download the file onepagecms.php
2. Change the settings at the top
3. Upload the file to your web site
4. Visit the file in your web browser
5. Alter the files you want to edit <div id="leftcolumn"> <!--ONEPAGECMS-START-LEFT-COLUMN--> <p>This is the editable stuff in the left column</p> <!--ONEPAGECMS-END--> </div> <div id="rightcolumn"> <!--ONEPAGECMS-START-RIGHT-COLUMN--> <p>This is the editable stuff in the right column</p> <!--ONEPAGECMS-END--> </div>
6. Test the editor
7. Logging out
8. Customisations and other features Editor buttons
<script type="text/javascript">
tinyMCE.init ({
mode : 'specific_textareas',
editor_selector : 'editor',
theme : 'advanced',
theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,|,undo,redo',
theme_advanced_buttons2 : 'link,cleanup,|,bullist,numlist,|,code',
theme_advanced_buttons3 : '',
theme_advanced_buttons4 : ''});
</script>
Frequency of backups Using a login form Editing the page title <!--ONEPAGECMS-START-META--> <title>My page title</title> <meta name="keywords" content="my page keywords" /> <!--ONEPAGECMS-END-->
9. Troubleshooting
The username and password doesn't work: Usually, you should get a grey box
popup asking for your username and password when you visit One Page CMS. If it
absolutely refuses to accept your username and password, then PHP may be running in
CGI mode, where this kind of authentication won't work. Instead you can either use
.htaccess authentication
or use the FormLogin function at the bottom of onepagecms.php (instead of PhpAuthLogin),
such as Warning: mkdir() [function.mkdir]: Permission denied: This error occurs when One Page CMS tries to create the backups or images directory and can't. The parent directory needs to be writeable and executeable by everyone (or by the web server user). Warning: fopen(filename.html) [function.fopen]: failed to open stream: Permission denied: This error can happen when you try to save a file or image. You need to make sure the file or image is writeable as above. Warning: glob() [function.glob]: open_basedir restriction in effect.: This means that your web server has a very restrictive (or secure) setup and so One Page CMS won't be able to list files or edit files. You will need to ask your web host about this one.
It doesn't find or list my files: One Page CMS tries two different methods to find
the files you've set in $ALLOWEDFILES: the PHP glob function and then the UNIX find command.
If neither of these work, then you probably can't put a wildcard * in the file names for
$ALLOWEDFILES. Instead you'll have to list all the files separately in an array. So instead
of
Advanced editor doesn't work - shows up as a text area instead: For the advanced
TinyMCE editor to work, One Page CMS filters all its files, so your web server setup must
allow for URLs like onepagecms.php/EDITOR/jscripts/tiny_mce/tiny_mce.js. If this doesn't work
I'm not sure which server setting needs to be changed, but I'd be happy if someone
could tell me.
In the mean time, change back to the simple editor, or download and use your own copy of TinyMCE.
To do this, download it from the TinyMCE website, unzip it, and change
the line in One Page CMS which refers to the TinyMCE script, to something like:
Notice: Undefined index: REQUEST_URI...: This may happen in older versions or interesting installations of PHP, and may well be related to the error above. You could try turning down error reporting by changing the line towards the bottom of onepagecms.php to: error_reporting (E_WARNING); so it only reports warnings and errors and not notices.
Donations please |