Tâm trạng hàng ngày | Hạnh phúc 2-7-2025 09:43 PM |
|---|
Đã viết: 13 ngày [LV.3]Spam 3
|
Mời bạn đăng ký để giao lưu kết bạn nhé <3
Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký
x
source/network.php
find: $shownum = 10;
change to $shownum = 8;
go to line 206,
insert codes below:- //uchome调用discuz最新主题/回复及热帖,作者:仝飞,演示网站:www.kxss.net
- //最新主题/回复
- $cachefile = S_ROOT.'./data/cache_network_diz_thread.txt';
- if(check_network_cache('dizthread')) {
- $diz_threadlist = unserialize(sreadfile($cachefile));
- } else {
- //显示数量
- $shownum = 10;
-
- $diz_threadlist = array();
- $query = $_SGLOBAL['db']->query("SELECT t.tid,t.subject,p.author,p.authorid,t.fid,f.name
- FROM `cdb_threads` t left join `cdb_forums` f on t.fid=f.fid left join `cdb_posts` p on (t.tid=p.tid AND t.lastposter=p.author AND t.lastpost=p.dateline)
- ORDER BY t.lastpost desc
- LIMIT 0,$shownum");
- //$no=1; //如果帖子序号想从1开始排序,可加入这个变量
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- //$value['no'] = $no;
- //$no++;
- $value['shortsubject'] = getstr($value['subject'], 50);
- $diz_threadlist[] = $value;
- }
- if($_SGLOBAL['network']['thread']['cache']) {
- swritefile($cachefile, serialize($diz_threadlist));
- }
- }
- foreach($diz_threadlist as $key => $value) {
- realname_set($value['uid'], $value['username']);
- $diz_threadlist[$key] = $value;
- }
- //热帖
- $cachefile = S_ROOT.'./data/cache_network_diz_hot_thread.txt';
- if(check_network_cache('dizhotthread')) {
- $diz_hot_threadlist = unserialize(sreadfile($cachefile));
- } else {
- //显示数量
- $shownum = 12;
-
- $diz_hot_threadlist = array();
- $query = $_SGLOBAL['db']->query("SELECT subject,tid FROM `cdb_threads`
- ORDER BY (`cdb_threads`.`replies`*20+`cdb_threads`.`views`) DESC
- LIMIT 0,$shownum");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- //$value['tagname'] = getstr($value['tagname'], 20);
- $value['shortsubject'] = getstr($value['subject'], 26);
- $diz_hot_threadlist[] = $value;
- }
- if($_SGLOBAL['network']['thread']['cache']) {
- swritefile($cachefile, serialize($diz_hot_threadlist));
- }
- }
- foreach($diz_hot_threadlist as $key => $value) {
- realname_set($value['uid'], $value['username']);
- $diz_hot_threadlist[$key] = $value;
- }
- //结束,uchome调用discuz最新帖子/回复及热帖,作者:仝飞,演示网站:www.kxss.net
Sao chép mã /template/default/network.htm
replace line 270 to 298 with codes blow:- <style>
- #hotpost .side_rbox_c{height:347px;}
- #hotpost ul{padding:10px;}
- #hotpost li{width: 100%; background: url(/home/template/default/image/dot.gif) no-repeat 0 49%; text-indent: 10px; overflow: hidden; text-overflow: ellipsis; padding:3px; }
- </style>
- <div class="nbox">
- <div class="nbox_c">
- <h2 class="ntitle"><span class="r_option"><a href="/bbs">更多帖子</a></span>开心大杂院最新主题/回复 raquo;</h2>
- <div class="tlist">
- <table cellpadding="0" cellspacing="1">
- <tbody>
- <!--如果序号想从1开始,可将下面的$key换成$value[no]-->
- <!--{loop $diz_threadlist $key $value}-->
- <tr <!--{if $key%2==1}-->class="color_row"<!--{/if}-->>
- <td class="ttopic"><div class="ttop"><div><span>$key</span></div></div><a href="/bbs/viewthread.php?tid=$value[tid]" title="$value[subject]" target="_blank">$value[shortsubject]</a></td>
- <td class="tuser"><a href="space.php?uid=$value[authorid]" target="_blank"><!--{avatar($value[authorid],small)}--></a> <a href="space.php?uid=$value[authorid]" target="_blank">$value[author]</a></td>
- <td class="tgp"><a href="/bbs/forumdisplay.php?fid=$value[fid]" target="_blank">$value[name]</a></td>
- </tr>
- <!--{/loop}-->
- </tbody>
- </table>
- </div>
- </div>
- <div id="hotpost" class="nbox_s side_rbox side_rbox_w">
- <div class="side_rbox_c">
- <h2 class="ntitle"><span class="r_option"><a href="/bbs">更多帖子</a></span>热帖 raquo;</h2>
- <ul>
- <!--{loop $diz_hot_threadlist $key $value}-->
- <li><a href="/bbs/viewthread.php?tid=$value[tid]" title="$value[subject]" target="_blank">$value[shortsubject]</a></li>
- <!--{/loop}-->
- </ul>
- </div>
- </div>
- </div>
Sao chép mã change line 328 to 347 with codes below:- <script language="javascript">
- function tfshow(v){
- if(v==1){
- document.getElementById("tfmore").innerHTML="<a href='space.php?do=threadview=all'>更多话题</a>";
- document.getElementById("tfsort").style.display="none";
- document.getElementById('tfcontent1').style.display="";
- document.getElementById('tfcontent2').style.display="none";
- document.getElementById("tftitle1").style.color="#000";
- document.getElementById("tftitle1").style.width="100px";
- document.getElementById("tftitle2").style.color="#999";
- document.getElementById("tftitle2").style.width="50px";
- }
- if(v==2){
- document.getElementById("tfmore").innerHTML="<a href='space.php?do=eventview=recommend'>更多活动</a>";
- document.getElementById("tfsort").style.display="";
- document.getElementById('tfcontent1').style.display="none";
- document.getElementById('tfcontent2').style.display="";
- document.getElementById("tftitle1").style.color="#999";
- document.getElementById("tftitle1").style.width="50px";
- document.getElementById("tftitle2").style.color="#000";
- document.getElementById("tftitle2").style.width="100px";
- }
- return true;
- }
- </script>
- <div class="nbox">
- <div class="nbox_c">
- <h2 class="ntitle"><span class="r_option" id="tfmore"><a href="space.php?do=threadview=all">更多话题</a></span>
- <div onmouseover="tfshow(1);" id="tftitle1" style="width:100px; float:left;color:#000;cursor:pointer">话题 raquo; </div>
- <div onmouseover="tfshow(2);" id="tftitle2" style="width:50px; float:left; color:#999;cursor:pointer">活动 raquo; </div>
- <span id="tfsort" style="display:none">
- <!--{loop $_SGLOBAL[eventclass] $value}-->
- nbsp; <a href="space.php?do=event&view=all&type=going&classid=$value[classid]">$value[classname]</a></li>
- <!--{/loop}-->
- </span>
- </h2>
- <div class="tlist" id="tfcontent1" style="height:250px">
- <table cellpadding="0" cellspacing="1">
- <tbody>
- <!--{loop $threadlist $key $value}-->
- <tr <!--{if $key%2==1}-->class="color_row"<!--{/if}-->>
- <td class="ttopic"><div class="ttop"><div><span>$value[hot]</span></div></div><a href="space.php?uid=$value[uid]do=thread&id=$value[tid]" target="_blank">$value[subject]</a></td>
- <td class="tuser"><a href="space.php?uid=$value[uid]" target="_blank"><!--{avatar($value[uid],small)}--></a> <a href="space.php?uid=$value[uid]" target="_blank">{$_SN[$value[uid]]}</a></td>
- <td class="tgp"><a href="space.php?do=mtagtagid=$value[tagid]">$value[tagname]</a></td>
- </tr>
- <!--{/loop}-->
- </tbody>
- </table>
- </div>
- <ul class="elist" id="tfcontent2" style="display:none">
- <!--{loop $eventlist $value}-->
- <li>
- <h3><a href="space.php?do=eventid=$value[eventid]" target="_blank">$value[title]</a></h3>
- <p class="eimage"><a href="space.php?do=eventid=$value[eventid]" target="_blank"><img src="$value[pic]" alt=""/></a></p>
- <p><span class="gray">时间:</span> <!--{date('n-j H:i',$value[starttime])}--> - <!--{date('n-j H:i',$value[endtime])}--></p>
- <p><span class="gray">地点:</span> $value[province] $value[city] $value[location]</p>
- <p><span class="gray">发起:</span> <a href="space.php?uid=$value[uid]">{$_SN[$value[uid]]}</a></p>
- <p class="egz">$value[membernum] 人参加<span class="pipe">|</span>$value[follownum] 人关注</p>
- </li>
- <!--{/loop}-->
- </ul>
- </div>
Sao chép mã Update cache. Nhớ backup file trước khi làm |
|