Forum closed. New forum available at http://community.wymeditor.org/

How can I associate WYMeditor with a web-based file manager?

Support forum for WYMeditor.

How can I associate WYMeditor with a web-based file manager?

Postby james on Sun Feb 04, 2007 10:22 am

Hello there,

I design my websites using basic XHTML/CSS with a few PHP includes.

In the past, I would install some open source web-based file manager where the end-users (content editors) would log into a content directory and could edit a number of .txt file snippets.

These snippets are what I would include with PHP into the site content. The trouble was that it often involved some minor XHTML like paragraphs, links and headings.

How and can I integrate WYMeditor with a web-based file manager so that when an end-user tries to edit a file, WYMeditor is used as the editor.

Does this make sense?

Thanks so much in advance,

James

PS: I'm not really looking for a CMS. I've tried so many like Drupal and I don't like them because it's terribly awkward to design your own template. All I need is a way to hook up WYMeditor to some open source web-based file manager.
james
 
Posts: 6
Joined: Sun Feb 04, 2007 10:10 am
Location: Vancouver, BC

Postby jfh on Sun Feb 04, 2007 8:03 pm

No problem. Simply read the txt file and put its content into the <div id="editor">. When the users clicks on submit, update the file with the textarea (id=txthtml) value.
I guess it will work.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Postby james on Sun Feb 04, 2007 9:21 pm

Merci, Jean-François.

Can you also look at my code and tell me if this a good way to do it?

<!-- html value -->
<form method="post" action="submit.php">
<textarea name="txthtml" id="txthtml" cols="100" rows="20" onkeyup="setHTML()" style="display:none"></textarea>


<!-- the editor - saveCaret saves cursor position - setImgEvent handles click on images -->
<div contenteditable name="editor" id="editor"
onbeforedeactivate="saveCaret()"
onkeyup="saveCaret();displayClasses()"
onclick="saveCaret();release();setImgEvent();displayClasses()"
oncopy="bCleanPaste=true;displayPasteCleanup(false)"
oncut="bCleanPaste=true;displayPasteCleanup(false)"
onbeforepaste="event.returnValue=false"
onpaste="pasteData()"
ondrop="event.returnValue=false"
onresizestart="event.returnValue=false">

<?php include('../tinymce/examples/james/index.php'); ?>
</div>
<input type="submit" name="SUBMIT">
</form>


James
james
 
Posts: 6
Joined: Sun Feb 04, 2007 10:10 am
Location: Vancouver, BC

Postby jfh on Sun Feb 04, 2007 9:33 pm

Almost. You forgot to remove TinyMCE. :twisted:

BTW, put the event onclick="getCleanHTML()" on the submit button, and it will be OK.

HTH,
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Postby james on Sun Feb 04, 2007 9:41 pm

jfh wrote:Almost. You forgot to remove TinyMCE. :twisted:

BTW, put the event onclick="getCleanHTML()" on the submit button, and it will be OK.

HTH,


My submit button now looks like this:

<input type="submit" name="SUBMIT" onclick="getCleanHTML()" />

Sorry about the TinyMCE thing. I have probably evaluated 20 different scripts this weekend and am very glad I found yours. I'm not a programmer so it's been painful learning all this. I am having trouble with the submit.php code. Can you take a look? Where do i add the txthtml?
Code: Select all
<?php
$fp = fopen( "index.php", "w" );

if(!$fp)
{echo "Couldn't open the data file. Try again later.";
exit;}

$content = $_POST['content'];

fwrite( $fp, $content );
fclose( $fp );
?>

<?php include('index.php'); ?>
james
 
Posts: 6
Joined: Sun Feb 04, 2007 10:10 am
Location: Vancouver, BC

Postby jfh on Sun Feb 04, 2007 9:45 pm

Replace $_POST['content'] by $_POST['txthtml'].
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Postby james on Sun Feb 04, 2007 9:55 pm

:)

Thank you!

I did a little test and it seems to work. Now I have to figure out a way to make every page editable and easy for an end-user. Got any suggestions?

Also, I did a test and noticed that the apostrophe when saved has a slash before it like this: \' any ideas?
james
 
Posts: 6
Joined: Sun Feb 04, 2007 10:10 am
Location: Vancouver, BC

Postby jfh on Sun Feb 04, 2007 10:06 pm

james wrote:Thank you!

You're welcome!
james wrote:I did a little test and it seems to work. Now I have to figure out a way to make every page editable and easy for an end-user. Got any suggestions?

Well, I don't know your software. Create a page where you list the editable files and a link to edit them. Perhaps.
james wrote:Also, I did a test and noticed that the apostrophe when saved has a slash before it like this: \' any ideas?

Hmm, maybe PHP escapes them? Googling "php escape quotes" could help.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Postby james on Sun Feb 04, 2007 10:24 pm

jfh wrote:Well, I don't know your software. Create a page where you list the editable files and a link to edit them. Perhaps.


I'm not using any software. I mostly design static html pages with some PHP includes for sidebars, navigation and repeating content. I find most CMS software doesn't let you create your own templates, navigation bars, etc. I am looking forward to testing WYMsite CMS though. I am glad it's XML-based and not database driven. I taught myself a bit of XSL last year. I am using Sablotron. I specialize in xHTML and CSS and would be interested in helping out with WYMstyle.

jfh wrote:Hmm, maybe PHP escapes them? Googling "php escape quotes" could help.


So far no luck, but I will keep Googling.

Have a good Monday morning (it's Sunday evening here)
james
 
Posts: 6
Joined: Sun Feb 04, 2007 10:10 am
Location: Vancouver, BC

Postby jfh on Mon Feb 05, 2007 9:25 am

james wrote:I'm not using any software. I mostly design static html pages with some PHP includes for sidebars, navigation and repeating content. I find most CMS software doesn't let you create your own templates, navigation bars, etc.

OK. So you could add an 'Edit' link in your pages.

james wrote:I am looking forward to testing WYMsite CMS though. I am glad it's XML-based and not database driven. I taught myself a bit of XSL last year. I am using Sablotron. I specialize in xHTML and CSS and would be interested in helping out with WYMstyle.

Great! I'll let Daniel (who is in charge of WYMstyle) contact you.

jfh wrote:Hmm, maybe PHP escapes them? Googling "php escape quotes" could help.

james wrote:So far no luck, but I will keep Googling.

Weird. No idea for the moment.
jfh wrote:Have a good Monday morning (it's Sunday evening here)

Pareillement!
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Postby james on Mon Feb 05, 2007 9:29 pm

jfh wrote:OK. So you could add an 'Edit' link in your pages.


Either that on each page, or must an admin page with links to all the editable paragraphs. Edit links on every page may look a little funny.

jfh wrote:Great! I'll let Daniel (who is in charge of WYMstyle) contact you.


Thanks. I hope I can help.

jfh wrote:Pareillement!


That word isn't in the Google Translation.
james
 
Posts: 6
Joined: Sun Feb 04, 2007 10:10 am
Location: Vancouver, BC

any result on the escapes?

Postby dgandhi360 on Mon Apr 09, 2007 3:30 am

Did anybody find the solution to the escapes on " and ' ?

is this being delt with in the 0.3 code, or will we need to fix it post wymeditor?
dgandhi360
 
Posts: 1
Joined: Mon Apr 09, 2007 3:11 am


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest