Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Conflict between FCKeditor and Preview Post 2.1?

I finally got FCKeditor to work, and hats off to the developer.

Just now, though, I also installed Preview Post, which seems not to work so long as FCKeditor extension is enabled. When FCKeditor is disabled, Preview Post works like a charm. I'm wondering if there is a conflict between the two? Has anyone successfully used them together?

Comments

  • edited October 2006
    ok open up preview.js
    look for this line
    text = (encodeURIComponent) ? encodeURIComponent(form.Body.value) : escape(form.Body.value.replace(/\+/g, '%2B'));

    replace it with
    var oEditor = FCKeditorAPI.GetInstance('Body') ; text = oEditor.GetXHTML( true ) ;

    make sure u enable previewpost after u enable fckeditor else preview post won't find the function
    thats solves the fckeditor preview headache as well. now i can remove its build in preview function
  • did u try it out or no.
  • I actually tried this method, but can't get it to work... Is there a permission that needs to be set somewhere?

    I installed fckeditor, user tooltip, then downloaded and installed preview post extension. I chaged the lines mentioned in preview.js, but when I go to preview a post, I just get a box with a grey "Preview" in the background, my username and the date. None of the posts contents show up in the preview.

    Thanks :)
  • edited October 2006
    its working here.
    btw a_j can u give me ur forum url
  • edited October 2006
    btw fckeditor comes with a smily thingy too. those vanillicons are not compatible with fckeditor
    hehehe nothing is compatible with fckeditor.

    i can see ur using an old version of fckeditor plugin, u need the new version so userinfotooltip works
    ur not using ajaxquote. why?

    u have a million and one extensions running. finding the source of conflict is going to be a pain
    can u try disabling the Yshout plugin. how many do u need. u have 4 of em
    <script type="text/javascript" src="/talk/yshout/js/yshout.js"></script> <script type="text/javascript" src="/talk/js/yshout.js"></script> <script type="text/javascript" src="/talk/yshout/js/yshout.js"></script> <script type="text/javascript" src="/talk/js/yshout.js"></script>
  • That's actually my testing server, so all of the extensions on there aren't really accurate.

    I've got the fckeditor almost fully functioning. Photo uploads (which is awesome), youtubes, swf's, it's aweseoeoeome.

    The only things still broken are spellcheck and preview post.

    But HUGE thanks on the work. It looks great.
  • edited October 2006
    can u try disabling all ur extesnions and leaving just fckeditor and preview post and forget about spellcheck. it never going to work
  • edited October 2006
    looks like preview post works on ur forum. Just verified it with IE and Firefox. (you forgot to put the Video folder in its right place. read the readme). so it must be a conflict with other extension. just enable one at a time and see when it stops working. next try ajaxquote. Its good to know i didn't muck it up YAY :)
  • Yeah, video folder is in the wrong place on the testing site. It's correct on the live site (I ALWAYS read the readme before doing anything with an extension-- if there is one).

    Couldn't figure out what exactly was breaking IE. I noticed it was working on the testing site. So I deleted the fckeditor extension folder, re-uploaded, and re-did the code changes. Everything is working great. I musthave fudged something in default.php.

    Thanks very much for all the hard work, and for the help. It's much appreciated.

    Cheers!
  • I've got Preview Post 2.1 working with FCKeditor as per the comments in this thread, but I'm having a problem - it seems like sometimes (not all of the time), certain posts will break Preview Post.. if i just put text with some simple formatting it previews fine, but if I add anything a little bit more complicated nothing shows up in the preview... any suggestions?
  • edited April 2007
    ok here is the code. replace this
    text = (encodeURIComponent) ? encodeURIComponent(form.Body.value) : escape(form.Body.value.replace(/\+/g, '%2B'));
    with this
    var oEditor = FCKeditorAPI.GetInstance('Body') ; text = oEditor.GetXHTML( true ) ; text = (encodeURIComponent) ? encodeURIComponent(text) : escape(text.replace(/\+/g, '%2B'));

    tested it with complex table with divs and all and it worked.
  • I made the change, tested with everything possible and it worked fine ! Thanks :D
  • Here's a problem I'm having. I want to put FCKEditor in the forum, but I don't want every user to be forced to use it. Some users might still prefer doing things the old way. This kind of fix will make PreviewPost work for FCKEditor users, but it will make it no longer work for non-FCKEditor users. What should I check for in an if statement to determine if a user is using FCKEditor and execute the correct code accordingly?
  • AprecheApreche
    edited May 2007
    I've solved the problem. Here is a patch I propose be made to the PreviewPost extension. It will allow the extension to work just fine whether FCKEditor is being used or not. I tested it out on my forum, and PreviewPost will work for all users, whether they have visual editing enabled or not.
    if( typeof FCKeditorAPI != "undefined" ){ var oEditor = FCKeditorAPI.GetInstance('Body'); text = oEditor.GetXHTML( true ) ; text = (encodeURIComponent) ? encodeURIComponent(text) : escape(text.replace(/\+/g, '%2B')); }else{ text = (encodeURIComponent) ? encodeURIComponent(form.Body.value) : escape(form.Body.value.replace(/\+/g, '%2B')); }
    If you do this, I suggest you remove the Preview button from FCKEditor so users do not get confused with two different preview options.
This discussion has been closed.