Knowledgeroot 开源知识管理系统简要介绍

[url]http://blog.sina.com.cn/s/blog_701dfa430101hsyt.html[/url]

[color=red][b]Knowledgeroot[/b][/color] 开源知识管理系统(KMS)
官方网站:Knowledgeroot.org - 当前版本: version: 1.0.3

Knowledgeroot可用于文档管理,知识库管理。

1.基于php开发,支持linux ,windows.
2.支持mysql ,sqlite, postgreSQL
3.支持任意类型附件(目前版本使用数据库base64后保存文件,需要调整mysql 参数max_allowed_packet,否则大于1M文件不能保存),使用数据库保存附件这个特性,如果附件很多,很大的情况,会是个问题。需要改造。
4.支持插件功能,官方网站下载插件,后台管理import,然后install, enable。
5.官方插件CKEditor (当前版本 2.6.2) 可与KCFinder 2.5.1 配合实现文件上传(已经支持中文)
6.官方插件ContentHistory 实现版本历史功能,类似diff查看版本,以及系统全部 last changes
7.支持中文,如需要修改原始翻译,可使用 msgfmt 可自主转换 po to mo.
8.tips:针对每个page.可以在edit page时设定content是否在点击page时自动展开还是只列title。创建时不能指定?
9.编辑冲突问题解决:原始版本编辑content时,首先在content_open表插入数据。然后打开content内容。第二个用户编辑时,也是先写入到content_open表,然后检查是否有其他用户打开数据,如果有,在打开内容上方显示警告。如果强制编辑,会出现一方修改信息被另一方覆盖的问题。
解决方法是采用排他编辑模式,如果内容被编辑中,其他人再试图编辑,直接提示有其他人编辑,返回。不能进入编辑。提示信息中有正在编辑此内容的user id。以方便协调。
主要修改2个文件:
class-knowledgeroot-content.php
function edit_content
class-knowledgeroot.php
function openContent

10.注意插件多不支持中文,修改插件的language.php参照 en_US 增加zh_CN配置,(UTF-8 no bom )
11. 使用CKEditor 时,配合KCFinder支持文件上传
修改CKEditor目录下config.js 指向KCFinder
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';

config.filebrowserBrowseUrl = '/kcfinder/browse.php?type=files';
config.filebrowserImageBrowseUrl = '/kcfinder/browse.php?type=images';
config.filebrowserFlashBrowseUrl = '/kcfinder/browse.php?type=flash';
config.filebrowserUploadUrl = '/kcfinder/upload.php?type=files';
config.filebrowserImageUploadUrl = '/kcfinder/upload.php?type=images';
config.filebrowserFlashUploadUrl = '/kcfinder/upload.php?type=flash';
};

修改kcfinder 中config.php ,加入:
$_SESSION['KCFINDER']['disabled'] = false,
完成。
注意如果在linux系统中使用了软链接www root,需要配置kcfinder的uploadurl地址。
12. 升级CKEditor .
出于安全考虑, CKEditor使用 新版本 3.6.6.1替换原始版本3.6.2。
直接替换原始extension/ckeditor/ckeditor,然后修改config.js 同11.
13.修改email 发送为异步发送方式方法:
需求:由于远程邮件服务器访问缓慢,打开邮件提醒功能后,操作缓慢,影响用户体验。
数据库增加表:
DROP TABLE IF EXISTS mail_queue;
CREATE TABLE mail_queue (
id int(11) unsigned NOT NULL auto_increment,
subject varchar(255) NOT NULL,
bodytext text ,
bodyhtml text ,
emailto varchar(255) not null,
createtime timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (id)

) ENGINE=MyISAM DEFAULT CHARSET=utf8

修改:class-email-notification.php 文件的函数:
function sendEmail($config, $subject, $bodyText, $bodyHtml = null) {

$emailto = $config->to;
$sql = sprintf("INSERT into mail_queue (subject, bodytext,bodyhtml,emailto) VALUES( '%s', '%s', '%s', '%s')",
addslashes($subject),addslashes($bodyText),addslashes($bodyHtml),$emailto);
$this->CLASS['db']->query($sql );
return true;
}

建立一个读取mail_queue表中数据然后通过SMTP发送邮件的php文件。
mailqueue_send_job.php
<?php
// mailqueue_send_job.php
// tank add 2013.
$timer = microtime();
$starttime = ((double)strstr($timer, ' ') + (double)substr($timer,0,strpos($timer,' ')));

if (!is_file("config/app.ini")) {
echo "No configuration file found! ";
exit();
}
// load requiered files
require_once ('include/init.php');
$config = $CLASS['config']->email;
$res = $CLASS['db']->query("SELECT id, subject,bodytext,bodyhtml,emailto FROM mail_queue order by id ");
$cnt = $CLASS['db']->num_rows($res);
while($row = $CLASS['db']->fetch_assoc($res)) {
$id = $row['id'];
$res2 = $CLASS['db']->query(sprintf("delete FROM mail_queue where id = %d ",$id));
sendEmail($config,$row['emailto'], $row['subject'], $row['bodytext'], $row['bodyhtml']) ;
}
function sendEmail($config, $emailto,$subject, $bodyText, $bodyHtml = null) {
try {
$transport = null;

if($config->host != '') {
$smtpConfig = array();
if($config->auth != '') {
$smtpConfig['auth'] = $config->auth;
$smtpConfig['username'] = $config->username;
$smtpConfig['password'] = $config->password;
}

if($config->port != '') {
$smtpConfig['port'] = $config->port;
}

if($config->ssl != '') {
$smtpConfig['ssl'] = $config->ssl;
}

$transport = new Zend_Mail_Transport_Smtp($config->host, $smtpConfig);
}
$mail = new Zend_Mail('UTF-8');
$mail->addHeader('X-MailGenerator', 'Knowledgeroot');
$mail->setBodyText($bodyText);
if($bodyHtml != null) $mail->setBodyHtml($bodyHtml);
$mail->setFrom($config->from, $config->from_name);
foreach(explode(",", $emailto) as $value) {
if(trim($value) != "") {
$mail->addTo($value);
}
}
$mail->setSubject($config->subject_prefix . $subject);
$mail->send($transport);
echo 'Sent OK\n';
return true;
} catch(Zend_Mail_Transport_Exception $e) {
$ErrorMsg = $e->getMessage();
echo '\nError 1:' .$ErrorMsg;
return false;
} catch(Exception $e) {
$ErrorMsg = $e->getMessage();
echo '\nsError 2:' . $ErrorMsg;
return false;
}
}
?>


此php脚本只能使用wget访问执行,在cron 中增加执行shell
#!/bin/sh
wget -O result http://localhost/mailqueue_send_job.php >> log.txt


14.官方插件CKEditor 对于尖括号 <> 不兼容问题修复:
修改 class-ckeditor.php :
function show($text="") {
$texthtml = htmlspecialchars($text);
$texthtml = $text;
return "<textarea class="ckeditor" id="content" name="content">".$texthtml."</textarea>";
}

15. 增加首页显示last changes功能:

a. 在include目录中创建类:class-lastchanges.php
var $CLASS;
function start(&$CLASS) {
$this->CLASS =& $CLASS;
}

function getlastchanges() {
... 参考class-history.php类中:function showLastChanges() 方法。
}
-----------------------------------------------------------
b.修改init.php
在最后增加:
require_once($base_path."include/class-lastchanges.php");
//
$CLASS['lastchanges'] = new lastchanges();
$CLASS['lastchanges']->start($CLASS);
------------------------------------------------------------

c.修改:class-knowledgeroot_content.php
1650行附近:
echo "<div class="welcome">".$this->CLASS['translate']->_('Welcome to Knowledgeroot')."</div>\n";
修改为:

$out = $this->CLASS['lastchanges']->getlastchanges();
echo $out;
=========================================
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值