显示效果如下:
修改如下:
打开apps/article/index.php文件,找到:
- } elseif ($a == 'friend') {
- $thisbase = $basename.'a=friend&';
- if ($friends = getFriends($winduid)) {
- $uids = array_keys($friends);
- !empty($fids) && $where .= "fid NOT IN($fids) AND ";
- $where .= "authorid IN(".S::sqlImplode($uids).") AND ifcheck=1 AND ifhide=0 AND anonymous=0";
- $where .= " AND postdate>".S::sqlEscape($timglimit);
- } else {
- //require_once(M_P.'require/header.php');
- //require_once PrintEot('m_article');
- //footer();
- list($isheader,$isfooter,$tplname,$isleft) = array(true,true,"m_article",true);
- }
- $username = $windid;
- }
上上上方添加如下代码:
- elseif ($see == 'digest') {
- !in_array($ordertype,array('lastpost','postdate')) && $ordertype = 'postdate';
- S::gp(array('posttime'));
- if ($u!=$winduid) {
- $where .= 'authorid='.S::sqlEscape($u).' AND anonymous=0 AND ifhide=0 AND fid<>0 AND digest<>0';
- $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */
- $username = $userService->getUserNameByUserId($u);
- $thisbase = $basename.'ordertype='.$ordertype.'&';
- } else {
- $where .= 'authorid='.S::sqlEscape($winduid).' AND digest<>0';
- $thisbase = $basename.'ordertype='.$ordertype.'&posttime='.$posttime.'&';
- $username = $windid;
- $u = $winduid;
- }
- if (is_numeric($posttime) && $posttime) {
- if ($posttime != '366') {
- $where .= " AND postdate>=".S::sqlEscape($timestamp - $posttime*84600);
- } elseif ($posttime == '366') {
- $where .= " AND postdate<=".S::sqlEscape($timestamp - 365*84600);
- }
- }
- }
模版修改请打开apps/article/template/m_space_article.htm文件,找到相应位置:
- } elseif ($see == 'post') { ………………}
这个判断语句的结束加上如下代码:
- elseif($see == 'digest') {print <<<EOT
- -->
- <div class="cc filter">
- <h3>类型筛选:</h3>
- <ul class="mr20"><li id="a_topic"><a href="{$basename}">主题</a></li><li id="a_post"><a href="{$basename}see=post">回复</a></li><li id="a_digest" class="current"><a href="{$basename}see=digest">精华</a></li><li id="a_goods"><a href="{$basename}a=goods&job=onsale">商品</a></li></ul>
- <h3>选择时间:</h3>
- <ul><li id="post_0"><a href="{$basename}see=digest&posttime=0">所有</a></li><li id="post_1"><a href="{$basename}see=digest&posttime=1">一天</a></li><li id="post_2"><a href="{$basename}see=digest&posttime=2">两天</a></li><li id="post_7"><a href="{$basename}see=digest&posttime=7">一星期</a></li><li id="post_30"><a href="{$basename}see=digest&posttime=30">一个月</a></li><li id="post_60"><a href="{$basename}see=digest&posttime=60">两个月</a></li><li id="post_90"><a href="{$basename}see=digest&posttime=90">三个月</a></li><li id="post_180"><a href="{$basename}see=digest&posttime=180">半年</a></li><li id="post_365"><a href="{$basename}see=digest&posttime=365">一年</a></li><li id="post_366"><a href="{$basename}see=digest&posttime=366">一年以上</a></li></ul>
- </div>
- <script language="javascript">setCurrent('post_$posttime','post_0','current');</script>
- <div style="border-top:1px solid $uskin_bdA;">
- <table width="100%" style="table-layout:fixed;">
- <tr class="tr3">
- <td colspan="2">排序方式:<a href="{$basename}see=digest&ordertype=postdate" id="a_orderpostdate"><span>发帖时间</span></a> <a href="{$basename}see=digest&ordertype=lastpost" id="a_orderlastpost"><span>回复时间</span></a>
- <script language="JavaScript">setCurrent('a_order{$ordertype}','a_orderpostdate','link_down s5');</script>
- </td>
- <td width="80">回复/人气</td>
- <td width="100">最后发表</td>
- </tr>
- </table>
- <table width="100%" class="mb10" style="table-layout:fixed;">
- <!--
- EOT;
- if (!empty($article)) {
- foreach ($article as $key => $value) {print <<<EOT
- -->
- <tr class="tr3">
- <td width="20" class="tac"><img src="images/wind/thread/topicnew.gif" /></td>
- <td class="f14">
- <a href="thread.php?fid=$value[fid]" class="mr5" target="_blank">[{$value[forum]}]</a><a href="read.php?tid=$value[tid]" target="_blank" class="s5">$value[subject]</a>
- </td>
- <td width="80" class="f10">
- <span class="s2">{$value[replies]}</span>/<span>{$value[hits]}</span>
- <p>{$value[postdate]}</p>
- </td>
- <td width="100">
- <a href="u.php?username=$value[lastposter]" class="s6">$value[lastposter]</a>
- <p class="f10">{$value[lastpost]}</p>
- </td>
- </tr>
- <!--
- EOT;
- }} else {print <<<EOT
- -->
- <tr>
- <td class="tac f14 p10" colspan="5">暂无主题!</td>
- </tr>
- <!--
- EOT;
- }print <<<EOT
- -->
- </table>
- <div class="mt10">$pages</div>
- </div>
- <!--
- EOT;
- }
其他导航的地方,同样加上精华的链接地址:
- <li id="a_digest"><a href="{$basename}see=digest">精华</a></li>
已提供phpwind85懒人包