Diễn đàn Trái Tim Yên Bái 2024

 Quên mật khẩu
 Đăng ký
Xem: 1707|Trả lời: 2
Thu gọn cột thông tin

[Ucenter Home] Hiện thông tin bài mới Discuz ra ngoài Ucenter Home 2.0

[Lấy địa chỉ]
  • 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

    Đăng lúc 18-5-2010 11:05 AM | Xem tất |Chế độ đọc

    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:
    1. //uchome调用discuz最新主题/回复及热帖,作者:仝飞,演示网站:www.kxss.net
    2. //最新主题/回复
    3. $cachefile = S_ROOT.'./data/cache_network_diz_thread.txt';
    4. if(check_network_cache('dizthread')) {
    5.         $diz_threadlist = unserialize(sreadfile($cachefile));
    6. } else {
    7.         //显示数量
    8.         $shownum = 10;
    9.         
    10.         $diz_threadlist = array();
    11.         $query = $_SGLOBAL['db']->query("SELECT t.tid,t.subject,p.author,p.authorid,t.fid,f.name
    12.                 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)
    13.                 ORDER BY t.lastpost desc
    14.                 LIMIT 0,$shownum");
    15.         //$no=1; //如果帖子序号想从1开始排序,可加入这个变量
    16.         while ($value = $_SGLOBAL['db']->fetch_array($query)) {
    17.                 //$value['no'] = $no;
    18.                 //$no++;
    19.                 $value['shortsubject'] = getstr($value['subject'], 50);
    20.                 $diz_threadlist[] = $value;
    21.         }
    22.         if($_SGLOBAL['network']['thread']['cache']) {
    23.                 swritefile($cachefile, serialize($diz_threadlist));
    24.         }
    25. }
    26. foreach($diz_threadlist as $key => $value) {
    27.         realname_set($value['uid'], $value['username']);
    28.         $diz_threadlist[$key] = $value;
    29. }
    30. //热帖
    31. $cachefile = S_ROOT.'./data/cache_network_diz_hot_thread.txt';
    32. if(check_network_cache('dizhotthread')) {
    33.         $diz_hot_threadlist = unserialize(sreadfile($cachefile));
    34. } else {
    35.         //显示数量
    36.         $shownum = 12;
    37.         
    38.         $diz_hot_threadlist = array();
    39.         $query = $_SGLOBAL['db']->query("SELECT subject,tid FROM `cdb_threads`
    40.                 ORDER BY (`cdb_threads`.`replies`*20+`cdb_threads`.`views`) DESC
    41.                 LIMIT 0,$shownum");
    42.         while ($value = $_SGLOBAL['db']->fetch_array($query)) {
    43.                 //$value['tagname'] = getstr($value['tagname'], 20);
    44.                 $value['shortsubject'] = getstr($value['subject'], 26);
    45.                 $diz_hot_threadlist[] = $value;
    46.         }
    47.         if($_SGLOBAL['network']['thread']['cache']) {
    48.                 swritefile($cachefile, serialize($diz_hot_threadlist));
    49.         }
    50. }
    51. foreach($diz_hot_threadlist as $key => $value) {
    52.         realname_set($value['uid'], $value['username']);
    53.         $diz_hot_threadlist[$key] = $value;
    54. }
    55. //结束,uchome调用discuz最新帖子/回复及热帖,作者:仝飞,演示网站:www.kxss.net
    Sao chép mã
    /template/default/network.htm

    replace line 270 to 298 with codes blow:
    1. <style>
    2.         #hotpost .side_rbox_c{height:347px;}
    3.                 #hotpost ul{padding:10px;}
    4.                         #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; }
    5. </style>
    6. <div class="nbox">
    7.         <div class="nbox_c">
    8.                 <h2 class="ntitle"><span class="r_option"><a href="/bbs">更多帖子</a></span>开心大杂院最新主题/回复 raquo;</h2>
    9.                 <div class="tlist">
    10.                         <table cellpadding="0" cellspacing="1">
    11.                                 <tbody>
    12.                 <!--如果序号想从1开始,可将下面的$key换成$value[no]-->
    13.                                 <!--{loop $diz_threadlist $key $value}-->
    14.                                         <tr <!--{if $key%2==1}-->class="color_row"<!--{/if}-->>
    15.                                                 <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>
    16.                                                 <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>
    17.                                                 <td class="tgp"><a href="/bbs/forumdisplay.php?fid=$value[fid]" target="_blank">$value[name]</a></td>
    18.                                         </tr>
    19.                                 <!--{/loop}-->
    20.                                 </tbody>
    21.                         </table>
    22.                 </div>
    23.         </div>
    24.     <div id="hotpost" class="nbox_s side_rbox side_rbox_w">
    25.             <div class="side_rbox_c">
    26.             <h2 class="ntitle"><span class="r_option"><a href="/bbs">更多帖子</a></span>热帖 raquo;</h2>
    27.                         <ul>
    28.                         <!--{loop $diz_hot_threadlist $key $value}-->
    29.                                 <li><a href="/bbs/viewthread.php?tid=$value[tid]" title="$value[subject]" target="_blank">$value[shortsubject]</a></li>
    30.                         <!--{/loop}-->
    31.                         </ul>
    32.                 </div>
    33.         </div>
    34. </div>
    Sao chép mã
    change line 328 to 347 with codes below:
    1. <script language="javascript">
    2. function tfshow(v){
    3.         if(v==1){
    4.                 document.getElementById("tfmore").innerHTML="<a href='space.php?do=threadview=all'>更多话题</a>";
    5.                 document.getElementById("tfsort").style.display="none";
    6.                 document.getElementById('tfcontent1').style.display="";
    7.                 document.getElementById('tfcontent2').style.display="none";
    8.                 document.getElementById("tftitle1").style.color="#000";
    9.                 document.getElementById("tftitle1").style.width="100px";
    10.                 document.getElementById("tftitle2").style.color="#999";
    11.                 document.getElementById("tftitle2").style.width="50px";
    12.         }
    13.         if(v==2){
    14.                 document.getElementById("tfmore").innerHTML="<a href='space.php?do=eventview=recommend'>更多活动</a>";
    15.                 document.getElementById("tfsort").style.display="";
    16.                 document.getElementById('tfcontent1').style.display="none";
    17.                 document.getElementById('tfcontent2').style.display="";        
    18.                 document.getElementById("tftitle1").style.color="#999";
    19.                 document.getElementById("tftitle1").style.width="50px";
    20.                 document.getElementById("tftitle2").style.color="#000";
    21.                 document.getElementById("tftitle2").style.width="100px";
    22.         }
    23.         return true;
    24. }
    25. </script>
    26. <div class="nbox">
    27.         <div class="nbox_c">
    28.         <h2 class="ntitle"><span class="r_option" id="tfmore"><a href="space.php?do=threadview=all">更多话题</a></span>
    29.             <div onmouseover="tfshow(1);" id="tftitle1" style="width:100px; float:left;color:#000;cursor:pointer">话题 raquo; </div>
    30.         <div onmouseover="tfshow(2);" id="tftitle2" style="width:50px; float:left; color:#999;cursor:pointer">活动 raquo; </div>
    31.         <span id="tfsort" style="display:none">
    32.         <!--{loop $_SGLOBAL[eventclass] $value}-->
    33.             nbsp; <a href="space.php?do=event&view=all&type=going&classid=$value[classid]">$value[classname]</a></li>
    34.         <!--{/loop}-->
    35.         </span>
    36.         </h2>
    37.             <div class="tlist" id="tfcontent1" style="height:250px">
    38.                         <table cellpadding="0" cellspacing="1">
    39.                                 <tbody>
    40.                                 <!--{loop $threadlist $key $value}-->
    41.                                         <tr <!--{if $key%2==1}-->class="color_row"<!--{/if}-->>
    42.                                                 <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>
    43.                                                 <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>
    44.                                                 <td class="tgp"><a href="space.php?do=mtagtagid=$value[tagid]">$value[tagname]</a></td>
    45.                                         </tr>
    46.                                 <!--{/loop}-->
    47.                                 </tbody>
    48.                         </table>
    49.                 </div>
    50.                 <ul class="elist" id="tfcontent2" style="display:none">
    51.                 <!--{loop $eventlist $value}-->
    52.                         <li>
    53.                                 <h3><a href="space.php?do=eventid=$value[eventid]" target="_blank">$value[title]</a></h3>
    54.                                 <p class="eimage"><a href="space.php?do=eventid=$value[eventid]" target="_blank"><img src="$value[pic]" alt=""/></a></p>
    55.                                 <p><span class="gray">时间:</span> <!--{date('n-j H:i',$value[starttime])}--> - <!--{date('n-j H:i',$value[endtime])}--></p>
    56.                                 <p><span class="gray">地点:</span> $value[province] $value[city] $value[location]</p>
    57.                                 <p><span class="gray">发起:</span> <a href="space.php?uid=$value[uid]">{$_SN[$value[uid]]}</a></p>
    58.                                 <p class="egz">$value[membernum] 人参加<span class="pipe">|</span>$value[follownum] 人关注</p>
    59.                         </li>
    60.                 <!--{/loop}-->
    61.                 </ul>
    62.         </div>
    Sao chép mã
    Update cache. Nhớ backup file trước khi làm
    Đăng lúc 21-8-2011 03:39 PM | Xem tất
    Cái này áp dụng cho discuz mấy nhỉ?
    Còn tớ hôk lầm thì cái discuz X2 thì hôk đc vì trong đó kô có table pre_forums
  • Tâm trạng hàng ngày
    Tức giận
    15-12-2011 02:13 AM
  • Đã viết: 2 ngày

    [LV.1]Spam 1

    Đăng lúc 12-4-2012 01:10 AM | Xem tất
    Bạn không nên dùng cái này nếu call một hàm ra  uchome nên dùng api của discuz thì hơn
    Bạn phải đăng nhập mới được đăng bài Đăng nhập | Đăng ký

    Quy tắc điểm

    Đóng

    Thông báoTrước /1 Sau

    Phòng tối|Lưu trữ|Diễn đàn Yên Bái 2024 Community Guidelines |

    GMT+7, 5-12-2026 06:03 PM , Processed in 0.028847 second(s), 18 queries .

    Powered by Discuz! X3.4

    © 2001-2013 Comsenz Inc.

    Trả lời nhanh Lên trên Trở lại danh sách