Stating the obvious:
1: Many people are asking how to use FCKeditor to edit their web pages and implement the editor.
2: They don't want to use a database or can't.
3: There is no real clear documentation on how to do this (the Wiki should have examples… I say no more).
4: I AM NOT A PHP CODE GURU. My coding is very bad; so do not beat up on me! I am only trying to help…
What I needed and what I came up with:
I needed an editor that would let me edit existing pages and not use a database. I have a customer who has a site that needs a 'points' page updated daily throughout the summer (it is a racing site) and a DB would be overkill.
My solution and mini tutorial:
The following code is NOT PERFECT and just a starting point! If a real code guru could clean this up or shorten the steps that would be great. Also, this document was very helpful (PDF); http://www.linux-magazine.com/issue/59/FCKEditor.pdf
And you might want an activity spinner: http://mentalized.net/activity-indicators/
1: I created four pages (call them what you want, my names are for clarity):
public.php (the page that the world will see)
editor.php (this is the FCKeditor page - the one that no one sees but the editor/admin person)
saved-data.php (the actual page that gets edited - it needs to be totally blank and make sure you have 'write permissions'.
compiler.php (it has the code that saves the web page edits to the 'saved-data.php' page and has a cool spinner on it)
How it all works:
The 'public' page has a php include call in it that pulls the 'saved-date' page like this: <?php include stripslashes('saved-data.php'); ?>
Re: How to Edit a Web Page - No DB Tutorial
Hello,
First, thank you for this solution, wich was helpfull with Fckeditor.
But, as the function Create() is no longer usable in CKeditor, can someone explain how to do it in CKEditor ?
Tks.
Regards.
Re: How to Edit a Web Page - No DB Tutorial
In CKEditor, th function cerate() no longer exists
So does someone knows how to do that :
<body>
<form action="compiler.php" method="post" name="FCKeditor1" id="FCKeditor1">
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '/FCKeditor/';
$oFCKeditor->Value = file_get_contents (stripslashes("saved-data.php"));
$oFCKeditor->Width = '100%' ;
$oFCKeditor->Height = '600' ;
$oFCKeditor->Create() ;?>
<input type="submit" value="Submit">
</form>
Tks.