最后效果如图所示:
添加这个功能有助于方便编辑帖子。如果帖子内容太长要跑到帖子最下面去很麻烦哦~~
优化方法:
1.找到 template/default/forum/viewthread_node.htm
搜索
<!--{elseif getstatus($post['status'], 5)}--> <!--{if !$_G['setting']['authoronleft']}--><a href="javascript:;" class="xi2">$post[author]</a><!--{/if}--> <em id="authorposton$post[pid]">{lang poston} $post[dateline]</em> <!--{elseif $post['authorid'] && $post['username'] && $post['anonymous'] || !$post['authorid'] && !$post['username']}--> $_G[setting][anonymoustext] <em id="authorposton$post[pid]">{lang poston} $post[dateline]</em> <!--{/if}-->
如果长代码搜索不到请查看短代码,然后定位好了在对比一下整个代码。这个是经验和方法。下次不会再说了
<!--{elseif getstatus($post['status'], 5)}
再这段代码下面添加
<!--{if (($_G['forum']['ismoderator'] && $_G['group']['alloweditpost'] && (!in_array($post['adminid'], array(1, 2, 3)) || $_G['adminid'] <= $post['adminid'])) || ($_G['forum']['alloweditpost'] && $_G['uid'] && ($post['authorid'] == $_G['uid'] && $_G['forum_thread']['closed'] == 0) && !(!$alloweditpost_status && $edittimelimit && TIMESTAMP - $post['dbdateline'] > $edittimelimit)))}--> <span class="pipe">|</span><a href="forum.php?mod=post&action=edit&fid=$_G[fid]&tid=$_G[tid]&pid=$post[pid]{if !empty($_GET[modthreadkey])}&modthreadkey=$_GET[modthreadkey]{/if}&page=$page"> <!--{if $_G['forum_thread']['special'] == 2 && !$post['message']}-->{lang post_add_aboutcounter}<!--{else}-->{lang edit}</a><!--{/if}--> <!--{elseif $_G['uid'] && $post['authorid'] == $_G['uid'] && $_G['setting']['postappend']}--><a href="forum.php?mod=misc&action=postappend&tid=$post[tid]&pid=$post[pid]&extra=$_GET[extra]&page=$page" onClick="showWindow('postappend', this.href, 'get', 0)">{lang postappend}</a> <!--{/if}-->
完事后更新缓存下次也不再说了!
谢谢赞赏
(微信扫一扫或长按识别)