WordPress2.1所见即所得文本编辑器无效的问题
在使用WP2.1的时候,默认系统是提供了一个简单的富编辑器,虽然该编辑器在我本机的测试环境中是正确有效的,但是,在我的FREEBSD环境上,就无法出现该编辑器。个人认为这个绝对是WP的一个BUG。在我修改代码之后,一切回复正常。
后来发现是在我的选项中并没有打开该编辑器的选项。但是打开以后发现仍然无法显示,从firefox中查看到以下错误信息:
- <strong>Warning</strong>: file_get_contents() [<a href="function.file-get-contents" xhref="function.file-get-contents">function.file-get-contents</a>]: Unable to access /wwwroot/wp-includes/js/tinymce/plugins/bold/editor_plugin.js in <strong>/wwwroot/wp-includes/js/tinymce/tiny_mce_gzip.php</strong> on line <strong>178</strong>
- <strong>Warning</strong>: file_get_contents(/wp-includes/js/tinymce/plugins/bold/editor_plugin.js) [<a href="function.file-get-contents" xhref="function.file-get-contents">function.file-get-contents</a>]: failed to open stream: No such file or directory in <strong>/wwwroot/wp-includes/js/tinymce/tiny_mce_gzip.php</strong> on line <strong>178</strong>
奇怪的是,不知道为何会读取“/wp-includes/js/tinymce/plugins/bold/”这样不存在的目录。
从/wp-home/wp-includes/js/tinymce/tiny_mce_gzip.php源代码中,我们可以看到是如下部分代码:
- if ($pluginFile)
- TinyMCE_echo(file_get_contents($pluginFile));
后来我改为以下代码:
- if ($pluginFile && file_exists($pluginFile))
- TinyMCE_echo(file_get_contents($pluginFile));
则发现富编辑器可以正常使用了,高兴之余又郁闷了,正在写这篇文章的时候发现,自动保存无法现实,报以下错误:
- } else { // Don't run while the TinyMCE spellcheck is on. if(tinyMCE.selectedInstance.spellcheckerOn) return; tinyMCE.wpTriggerSave(); autosaveAjax.setVar("content", form.content.value); }
错误:
- tinyMCE.wpTriggerSave is not a function 源文件:http://127.0.0.1/wordpress/wp-includes/js/autosave-js.php?ver=20070116 行:109
更加不懂的是,并不是完全出错,应该是隔2分钟可以自动保存,但是那个JS错误不知道什么原因。
感谢您的关注。您现在可以 阅读留言(1) 或 留下通告地址 。
相关信息
该文章 2007年02月08日 提交,位于分类 PHP编程相关, wordpress 下. 标签: .上一篇: python去掉html标签的函数 »
下一篇: Python下的Lucene,PyLucene(转) »


4月 1st, 2007 03:29
大哥,我的也有这个问题~
但我看了好多遍都不知道你说的是要改哪个php文件哪~~
你写出来吧