原来装mysql的时候直接装的4.1.x版的,KBS装blog的时候才发现有些问题
主要是blog首页打不开,一开就死,还有发文日期格式不对。
最后改了点代码,搞定了,这里总结一下,呵呵。
出现问题的主要原因是4.0.x和4.1.x中时间戳格式不同,4.1.x中是0000-00-00 00:00:00的格式,而4.0.x中为00000000000000,因此 htdocs/pc/index.php的pc_get_archfile函数中
$startYear = (int)($pc["CREATED"] / 10000000000 算出来的是0,按原来的程序就会显示从当前一直到0年1月的档案,造成页面太大,死掉。
主要修改两个地方。
在pc/index.php中function pc_get_archfile($pc,$wrap=FALSE)中,
$startYear = (int)($pc["CREATED"] / 10000000000);
$startMonth = (int)(($pc["CREATED"]-$startYear*10000000000) / 100000000);
改为
$startYear = (int)(substr($pc["CREATED"],0,4));
$startMonth = (int)(substr($pc["CREATED"],5,2));
还有pc/pcfuncs.php中function pc_load_infor($link,$userid=FALSE,$uid=0)中
$pc = array(
"NAME" => html_format($rows[corpusname]),
"USER" => $rows[username],
"UID" => $rows[uid],
"DESC" => html_format($rows[description]),
"THEM" => $pcThem,
"TIME" => $rows[createtime],
...
);
将"TIME" => $rows[createtime],
改为
"TIME" => substr($rows[createtime],0,4)."".substr($rows[createtime],5,2)."".
substr($rows[createtime], 8,2)."".substr($rows[createtime], 11,2)."".
substr($rows[createtime], 14,2)."".substr($rows[createtime], 16,2),
改的比较丑,呵呵,大牛可以帮忙再改改:)
目前我的blog应用正常,可能还有一些需要改动的地方,还没有发现。
--
FROM 211.151.90.*