Wysiwyg editor is gone!

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

okay... I'll test more!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Shimrod
Posts: 4
Joined: Mon Oct 17, 2005 10:15 am

Post by Shimrod »

I've got the same problem (with both IE and Firefox), which is very annoying because this feature was the one who seduced my boss and let him agree to use phpMyFaq :-)
Shimrod
Posts: 4
Joined: Mon Oct 17, 2005 10:15 am

Post by Shimrod »

Ok I think I found it...

By using the javascript debugger of Firefox, I've seen an error which caused the js to stop loading.

This error is appearing when there is a quote ( ' ) in the title of your faq.

Can somenone experiencing the same problem try to see if he gots the same behaviour ?
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

I found the bug and trying to fix it.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

maybe I found a patch. Please try this code for admin/header.php:

Code: Select all

<?php
/**
* $Id: header.php,v 1.8.2.7 2005/10/12 05:53:34 thorstenr Exp $
*
* header of the admin area
*
* @author       Thorsten Rinne <thorsten@phpmyfaq.de>
* @since        2003-02-26
* @copyright    (c) 2001-2005 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/

if (!defined('IS_VALID_PHPMYFAQ_ADMIN')) {
    header('Location: http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']));

    exit();
}

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-type: text/html; charset=".$PMF_LANG["metaCharset"]);
header("Vary: Negotiate,Accept");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $PMF_LANG["metaLanguage"]; ?>" lang="<?php print $PMF_LANG["metaLanguage"]; ?>">
<head>
    <title><?php print $PMF_CONF["title"]; ?> - powered by phpMyFAQ</title>
    <meta name="copyright" content="(c) 2001-2005 phpMyFAQ Team" />
    <meta http-equiv="Content-Type" content="text/html; charset=<?php print $PMF_LANG["metaCharset"]; ?>" />
    <style type="text/css"> @import url(../template/admin.css); </style>
    <script language="JavaScript" type="text/javascript" src="../inc/functions.js"></script>
<?php
if (isset($_REQUEST["aktion"]) && ($_REQUEST["aktion"] == "editentry" || $_REQUEST["aktion"] == "news" || $_REQUEST["aktion"] == "editpreview" || $_REQUEST["aktion"] == "takequestion") && !emptyTable(SQLPREFIX."faqcategories")) {
?>
    <style type="text/css"> @import url(editor/htmlarea.css); </style>
    <script type="text/javascript">
    //<![CDATA[
    _editor_url = "editor";
    _editor_lang = "en";
    //]]>
    </script>
    <script type="text/javascript" src="editor/htmlarea.js"></script>
    <script type="text/javascript" src="editor/plugins/ImageManager/image-manager.js"></script>
    <script type="text/javascript">
    //<![CDATA[
        HTMLArea.init();
        HTMLArea.loadPlugin("ImageManager");
        HTMLArea.onload = function() {
        var editor = new HTMLArea("content");
        var config = new HTMLArea.Config();
        config.width = "565px";
        config.height = "400px";
        var phpMyFAQLinks = {
<?php
    $output = "'Include internal links' : '',\n";
    $result = $db->query('SELECT '.SQLPREFIX.'faqdata.id AS id, '.SQLPREFIX.'faqdata.lang AS lang, '.SQLPREFIX.'faqcategoryrelations.category_id AS category_id, '.SQLPREFIX.'faqdata.thema AS thema FROM '.SQLPREFIX.'faqdata LEFT JOIN '.SQLPREFIX.'faqcategoryrelations ON '.SQLPREFIX.'faqdata.id = '.SQLPREFIX.'faqcategoryrelations.record_id AND '.SQLPREFIX.'faqdata.lang = '.SQLPREFIX.'faqcategoryrelations.record_lang ORDER BY '.SQLPREFIX.'faqcategoryrelations.category_id, '.SQLPREFIX.'faqdata.id');
    while ($row = $db->fetch_object($result)) {
        $_title = addslashes(PMF_htmlentities(str_replace(array("\n", "\r", "\r\n"), "", $row->thema), ENT_NOQUOTES, $PMF_LANG['metaCharset']));
        $output .= sprintf("'%s' : '<a href=\"index.php?action=artikel&cat=%d&id=%d&artlang=%s\">%s<\/a>',\n", $_title, $row->category_id, $row->id, $row->lang, $_title);
    }
    $output = substr($output, 0, -2);
    print $output;
?>
        };
        var internalLinks = {
                    id      :   "internalLinks",
                    tooltip :   "internal Link",
                    options :   phpMyFAQLinks,
                    action  :   function(editor)
                                {
                                    var elem = editor._toolbarObjects[this.id].element;
                                    editor.insertHTML(elem.value);
                                    elem.selectedIndex = 0;
                                },
                    refresh :   function(editor) { }
        };
        config.registerDropdown(internalLinks);
        config.toolbar = [ [ "fontsize", "space", "formatblock", "space", "bold", "italic", "underline", "strikethrough", "separator", "subscript", "superscript", "separator", "copy", "cut", "paste", "space", "undo", "redo", "space", "removeformat", "killword" ], [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "lefttoright", "righttoleft", "separator", "orderedlist", "unorderedlist", "outdent", "indent", "separator", "forecolor", "hilitecolor", "separator", "inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode" ], [ "internalLinks" ] ];
        config.formatblock = {
		"Heading 3": "h3",
		"Heading 4": "h4",
		"Heading 5": "h5",
		"Heading 6": "h6",
		"Normal": "p",
		"Address": "address",
		"Formatted": "pre",
        	"Code": "code"
	};
	HTMLArea.replace("content", config);
	}
    //]]>
    </script>
<?php
}
?>
</head>
<body id="body" dir="<?php print $PMF_LANG["dir"]; ?>"><a name="top"></a>
<!-- Header -->
<div id="header">
    <h1>phpMyFAQ <?php print $PMF_CONF["version"]; ?></h1>
</div>

<!-- Navigation -->
<div class="sideBox">
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

YUP!!

Post by jazcyk »

Works here with IE6-SP2 and Firefox 1.5 beta 2.

Thanks!

:!: :D :) :wink: :!: :wink: :) :D :!:
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Great!

Thanks for testing! Thanks to Shimrod for the hint!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Shimrod
Posts: 4
Joined: Mon Oct 17, 2005 10:15 am

Post by Shimrod »

I tested too, and it works even with quotes now :-)

great job, and glad I could help :-) (All in all it's just another brick in the wall ^_^)
andune
Posts: 2
Joined: Wed Nov 09, 2005 4:07 pm
Location: Buenos Aires
Contact:

Editor is gone in 1.5.3

Post by andune »

The editor is also gone in Firefox 1.0 (Fedora Core 3) and IE 6.0 (Win XP).
No matter how many times I refresh the page in either, it never shows the HTML editor.
andune
Posts: 2
Joined: Wed Nov 09, 2005 4:07 pm
Location: Buenos Aires
Contact:

Fixed

Post by andune »

Sorry, my previous post was misplaced. I have tested the fix in Firefox 1.0 (Fedora Core 3) and IE 6.0 (Win XP) and it works.
I only find one little problem, in IE 6.0, the layer with the edition form is rendered below its usual position, exactly below the menu. In my case, I don't really have a problem with that, but thought I'd commento on it.
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

I'll try to fix the CSS issue on IE6.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

not completely fixed ...

Post by jazcyk »

From time to time I still experience that the Wysiwyg editor does not open.

This one for instance http://www.webyog.com/faq/5_7_en.html (a big one) never does.
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

hm... I'll test this!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply