About the main pages
The main pages are done using two php files index.php and misc.php. index.php has to be there as a file so that the main site knows where to go, but it simply includes misc.php. I have made the pages completely editable from an authenticated web page 'Edit your partial' which I type into using the wymeditor. The page information itself comes out of a mysql database. My code is PHP 5 with the wymeditor, I have as yet added not other helper modules.
The mysql database is as simple as I can make it, it has two tables like so:
- page
- page_id
- page
- partial
- revision
- partial
- page_id
- is_default
It took me some time to get the 'Edit your partial' page going. Its still a bit flaky but I haven't quite pinpointed why. So a breakdown of the page that in fact I'm using to type this in at the moment.
- I downloaded the code from the wymeditor site and put it into its own directory on my php server.
- I looked at and copied the most basic wymeditor example
- I found out that it was not submitting the xhtml on form submit
- I found the most useful documentation here
- debugging and reading the documentation, makes me think that it really should submit the xhtml if you use the 'update' system as per the documentation, but as I couldn't see it working, but I could get at the xhtml in javascript, I used javascript to put the xhtml back into the textarea onclick of the submit and submitted like that.
- I had all sorts of problems with escaping, but my solution is to use javascripts encodeURI fuction when I put it back and to use a peice of code I stole off of Mathews site with string_replace to get the single inverted commas when I read the file back in.
- Having got the wymeditor working I went on to link in the rest of the code, that is:
- a drop down to select your page.
- a related drop down to select a revision of the partial (one partial per page)
- another dropdown that changes the partial between pages
- a tickbox to make this revision the default one
- a button for making this revision a new revision
- a dropdown and update button that will allow you to update your partial (or in fact any related revision).
If you would like to comment, whilst I haven't put up a forum, I've put up a blog, so please do post your comments to it here.
About the CV Site
It always struck me as a fun idea to put it up a site in its own right, so I have. partcv.php that breaks it up is simply a function to apply an xslt stylesheet similar to what you might find here. The xslt that I'm using is specific to the html document that I've written (the full c.v.) but its available here if you are interested. The full c.v. that it all comes from is available from every page of the site.
If you would like to comment, I haven't put up a forum, sorry, I got a bit too much spam, do contact me via email address.