这部分不只修改模板部分,还要修改程序文件,也就是说该方法经过程序版本升级等后便失效,谨慎修改!
模板里虽然评论和留言调用的样式是一样的,但这里我们要分开进行修改:
1.评论部分:
打开inc/boblog_class_run.php
找到282行在后面添加
$page
即:
global $mbcon, $section_body, $permission, $adminlist, $userdetail, $config, $categories, $weather, $t, $section_bodys, $lnc, $nowtime, $flset, $page;
再找到354行后面添加一个
'louceng'=>($page-1)*$mbcon['replyperpage']+$i+1"
即
$output_single=$t->set('comment', array('replier'=>$replier, 'replierip'=>$replierip, 'replytime'=>$replytime,'addadminreply'=>$addadminreply,'deladminreply'=>$deladminreply,'editadminreply'=>$editadminreply,'delreply'=>$delreply,'blockreply'=>$blockreply,'replycontent'=>$replycontent,'ifadminreplied'=>$ifadminreplied,'adminrepliershow'=>$adminrepliershow,'adminreplycontent'=>$adminreplycontent,'commentid'=>"com_{$eachreply['repid']}", 'adminreplybody'=>$adminreplybody, 'replieremail'=>$replieremail, 'replierhomepage'=>$replierhomepage, 'oddorcouplecss'=>$oddorcouplecss, 'louceng'=>($page-1)*$mbcon['replyperpage']+$i+1));
然后在模板elements.php文件里调用{louceng}标签即可
==================================================================
2.留言板部分:
打开inc/boblog_class_run.php
找到384行添加
$page
即:
global $mbcon, $section_body, $permission, $adminlist, $userdetail, $config, $categories, $weather, $t, $section_bodys, $lnc, $nowtime, $flset, $page;
再找到454行添加
'louceng'=>($page-1)*$mbcon['messageperpage']+$i+1
即:
$output_single=$t->set('comment', array('replier'=>$replier, 'replierip'=>$replierip, 'replytime'=>$replytime,'addadminreply'=>$addadminreply,'deladminreply'=>$deladminreply,'editadminreply'=>$editadminreply,'delreply'=>$delreply,'blockreply'=>$blockreply,'replycontent'=>$replycontent,'ifadminreplied'=>$ifadminreplied, 'adminrepliershow'=>$adminrepliershow,'adminreplycontent'=>$adminreplycontent,'commentid'=>"com_{$eachreply['repid']}", 'adminreplybody'=>$adminreplybody, 'replieremail'=>$replieremail, 'replierhomepage'=>$replierhomepage, 'oddorcouplecss'=>$oddorcouplecss,'louceng'=>($page-1)*$mbcon['messageperpage']+$i+1));
注意:以上评论和留言部分代码基本相同但不尽相同,所以请勿偷懒!
Tags:bo-blog, 代码修改, 留言, 评论
好的,那我去問問,謝謝回答~~
小琦兄您好,我照你這方法修改,但因為我的評論排序是最後評論的排放到最前,但您的方法卻是評論最前的是1樓的類推排序下去,請問如果我想將1樓跟從由最先評論的起計,那應該是怎樣改呢,希望小琦兄能指教一下,謝謝~~
sorry,最近也忙,還沒找到方法,建議去論壇提問,應該不難!