星期四 阴转多云 16~23℃
uch2.0“好友的记录”改为不包括自己的
uch2.0 点击“好友的记录”默认会把“自己的记录”包含进去,如果不想包含“自己的记录”,作如下修改:
source/space_doing.php
$wheresql = "uid IN ($space[feedfriend],$space[uid])";
改为
$wheresql = "uid IN ($space[feedfriend])";
uch2.0 群组话题页侧栏加这个圈子的热门回复、热门话题
source/space_mtag.php
原:
$list = array();
$count = 0;if($mtag['allowview']) {
$count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM ".tname(‘thread’)." main WHERE main.tagid=’$tagid’ $wheresql"),0);
if($count) {
$query = $_SGLOBAL['db']->query("SELECT main.* FROM ".tname(‘thread’)." main
WHERE main.tagid=’$tagid’ $wheresql
ORDER BY main.displayorder DESC, main.lastpost DESC
LIMIT $start,$perpage");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['uid'], $value['username']);
realname_set($value['lastauthorid'], $value['lastauthor']);
$list[] = $value;
}
}
//分页
$multi = multi($count, $perpage, $page, $theurl);realname_get();
}
改(增加 $listhot,同时判断 replynum>0 ):
$list = $listhot = array();
$count = 0;if($mtag['allowview']) {
$count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM ".tname(‘thread’)." main WHERE main.tagid=’$tagid’ $wheresql"),0);
if($count) {
$query = $_SGLOBAL['db']->query("SELECT main.* FROM ".tname(‘thread’)." main
WHERE main.tagid=’$tagid’ $wheresql
ORDER BY main.displayorder DESC, main.lastpost DESC
LIMIT $start,$perpage");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['uid'], $value['username']);
realname_set($value['lastauthorid'], $value['lastauthor']);
$list[] = $value;
}
//热门回复
$query = $_SGLOBAL['db']->query("SELECT main.* FROM ".tname(‘thread’)." main
WHERE main.tagid=’$tagid’ $wheresql
AND main.replynum>’0′
ORDER BY main.replynum DESC
LIMIT 0,10");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['uid'], $value['username']);
realname_set($value['lastauthorid'], $value['lastauthor']);
$listhot[] = $value;
}
}
//分页
$multi = multi($count, $perpage, $page, $theurl);realname_get();
}
模板调用(参考):
space_mtag_list.htm
<!–{if $listhot}–>
<div class="sideOne">
<h2 class="s_tiBg bgSide">热门回复</h2>
<div class="s_con">
<ul>
<!–{loop $listhot $key $value}–>
<li><a href="space.php?uid=$value[uid]&do=thread&id=$value[tid]">$value[subject]<span class="c_999">$value[replynum]</span></a></li>
<!–{/loop}–>
</ul>
</div>
</div>
<!–{/if}–>
同理,把 replynum 改为 hot,则列出“热门话题”(此概念参考下面的“热度”疑问)。
uch2.0 的“热度”疑问
查到“热度值是所有参与人数的总和”,而在文字上的显示是“** 人推荐”,有点误导,因为“参与”不一定就是“推荐”。
把“** 人推荐”改为“** 人参与”就好理解了。
友吧今天
嵌套话题列表页、详细页。
发表评论