当然了,Fck的原版非常大,如果用在个人blog上你当然不指望后台慢成蜗牛,
也不指望在后台装个“word”oblog原版自带的UBB编辑器功能实在有限。
所以我自己改良了编辑器
首先在admin目录下建立一个文件夹叫"editor",然后将fck的所有文件解压,并上上传到admin/editor目录下,这时,目录结构应该是这样的:
./admin.
├─editor
│ └─editor
│ ├─css
│ │ ├─behaviors
│ │ └─images
│ ├─dialog
│ │ ├─common
│ │ │ └─images
│ │ ├─fck_flash
│ │ ├─fck_image
│ │ └─fck_link
│ ├─images
│ ├─js
│ ├─lang
│ └─skins
│ └─default
│ ├─images
│ └─toolbar
├─editor
│ └─editor
│ ├─css
│ │ ├─behaviors
│ │ └─images
│ ├─dialog
│ │ ├─common
│ │ │ └─images
│ │ ├─fck_flash
│ │ ├─fck_image
│ │ └─fck_link
│ ├─images
│ ├─js
│ ├─lang
│ └─skins
│ └─default
│ ├─images
│ └─toolbar
然后打开admin/admin.php搜索
$action == "addBlog"
向下找到:
$FORM->editor(array("text" => "内容","note" => "日志的内容,使用UBB格式的编码"));
将它注释掉,以后要还原直接打开就可以,
CODE:
//$FORM->editor(array("text" => "内容","note" => "日志的内容,使用UBB格式的编码"));
在它下面添加如下的内容:
require_once("admin/editor/fckeditor.php");
$Editor = new FCKeditor('message') ;
$Editor->BasePath = $blogurl."admin/editor/" ;
echo "<tr ".$FORM->getrowbg(1)." nowrap>\n";
echo "<td><B>日志内容</B></td>\n";
echo "<td>";
echo "".$Editor->Create()."";
echo "</td>\n</tr>\n";
$Editor = new FCKeditor('message') ;
$Editor->BasePath = $blogurl."admin/editor/" ;
echo "<tr ".$FORM->getrowbg(1)." nowrap>\n";
echo "<td><B>日志内容</B></td>\n";
echo "<td>";
echo "".$Editor->Create()."";
echo "</td>\n</tr>\n";
然后搜索
$content = checkPost(htmlspecialchars($_POST['message']));
将它修改为:
$content = checkPost($_POST['message']);
是为了免得入库后将html的标签都转换了。
然后再搜索:
$action == "modBlog"
向下查找到:
CODE:
$FORM->editor(array("text" => "内容","note" => "日志的内容,使用UBB格式的编码","value" => $blogs['content']));
将这句注释掉:
//$FORM->editor(array("text" => "内容","note" => "日志的内容,使用UBB格式的编码","value" => $blogs['content']));
并在下面加入:
CODE:
require_once("admin/editor/fckeditor.php");
$Editor = new FCKeditor('message') ;
$Editor->BasePath = $blogurl."admin/editor/";
$Editor->Value = $blogs['content'];
echo "<tr ".$FORM->getrowbg(1)." nowrap>\n";
echo "<td><B>日志内容</B></td>\n";
echo "<td>";
echo "".$Editor->Create()."";
echo "</td>\n</tr>\n";
$Editor = new FCKeditor('message') ;
$Editor->BasePath = $blogurl."admin/editor/";
$Editor->Value = $blogs['content'];
echo "<tr ".$FORM->getrowbg(1)." nowrap>\n";
echo "<td><B>日志内容</B></td>\n";
echo "<td>";
echo "".$Editor->Create()."";
echo "</td>\n</tr>\n";
然后再搜索:
$content = checkPost(trim(htmlspecialchars($_POST['message'])));
改成:
CODE:
$content = checkPost(trim($_POST['message']));
然后我们还需要改3处,这3处如果在你的文件中找不到,那就不用改了:
打开 ./class/article.php
搜索:
$oneRe['content'] = str_replace(" "," ",$oneRe['content']);
改成:
$oneRe['content'] = str_replace(" "," ",$oneRe['content']);
打开 ./class/list.php
搜索:
$blogRe['content'] = str_replace(" "," ",$blogRe['content']);
改成:
$blogRe['content'] = str_replace(" "," ",$blogRe['content']);
打开 ./admin/class/build.php
搜索:
$oneRe['content'] = str_replace(" "," ",$oneRe['content']);
改成:
$oneRe['content'] = str_replace(" "," ",$oneRe['content']);
就OK了
fck的精简版下载在附件里
附件: fckeditor2.1.2.rar 
