TinyMCE With a Permalink based WordPress Blog
I wrote these few lines to explain how to fix the bug of the magic plugin TinyMCE for WordPress by lifesinger to make it work correctly with WordPress blogs that use permalinks instead of the standard «index.php» based addresses. In fact the plug-in didn’t show, in these kind of blogs, the wysiwyg editor for posting comments.
Bugfixing is relly easy. Just open the tinymce_wp.php file (the plugin “main” file) and put in this text (just replace all):
<?
/*
Plugin Name: TinyMCE-Wordpress
Plugin URI: http://lifesinger.3322.org/myblog/?p=107
Description: This plugin adds TinyMCE to the editing areas of WordPress.
Version: 2.0.1 final
Author: lifesinger
Author URI: http://lifesinger.3322.org/myblog
*//* –= Add js to wp-admin files =– */
function tinymce_wordpress()
{
?>
<style type="text/css">
#quicktags { display: none };
</style>
<script language="javascript" type="text/javascript" xsrc="<? echo get_bloginfo(‘siteurl’) ?>/wp-content/plugins/tiny_mce/tiny_mce_gzip.php"></script>
<script language="javascript" type="text/javascript" xsrc="<? echo get_bloginfo(‘siteurl’) ?>/wp-content/plugins/tiny_mce/tiny_mce_init.js"></script>
<?
}
add_action(‘edit_form_advanced’,‘tinymce_wordpress’);
add_action(‘edit_page_form’,‘tinymce_wordpress’);
add_action(‘simple_edit_form’,‘tinymce_wordpress’);
add_action(‘edit_form_comment’,‘tinymce_wordpress’);
/* –= Add js to your theme files =– */
function tinymce_wordpress2()
{
?>
<script language="javascript" type="text/javascript" xsrc="<? echo get_bloginfo(‘siteurl’) ?>/wp-content/plugins/tiny_mce/tiny_mce_gzip.php"></script>
<script language="javascript" type="text/javascript" xsrc="<? echo get_bloginfo(‘siteurl’) ?>/wp-content/plugins/tiny_mce/tiny_mce_init_comment.js"></script>
<?
}
add_action(‘comment_form’,‘tinymce_wordpress2’);
?>
Btw the only important lines to change are:
Replace:
<script language="javascript" type="text/javascript" xsrc="wp-content/plugins/tiny_mce/tiny_mce_gzip.php"></script> <script language="javascript" type="text/javascript" xsrc="wp-content/plugins/tiny_mce/tiny_mce_init_comment.js"></script>
With:
<script language="javascript" type="text/javascript" xsrc="<? echo get_bloginfo(‘siteurl’) ?>/wp-content/plugins/tiny_mce/tiny_mce_gzip.php"></script> <script language="javascript" type="text/javascript" xsrc="<? echo get_bloginfo(‘siteurl’) ?>/wp-content/plugins/tiny_mce/tiny_mce_init_comment.js"></script>
Bye all and thanks again to lifesinger for this big work!