Manyou诚邀开发者加盟 | 常见问题
《站长》俱乐部官方群公布 城市联络员机会多多
立即免费下载 Discuz!7.0.0 正式版
安装升级指南 | 用户手册 | 新手建站学堂
基于.net架构的Discuz!NT2.6正式版发布
Comsenz公司2009年招贤纳士,期待您的加盟
Discuz!收费服务内容及价格
7月重庆、成都、西安三地社区运营实战特训速报名
Discuz!/UCHome 专用官方虚拟主机
牧场新服一起联运:豆浆机免费带回家
基于Discuz!的免费论坛空间5D6D
康盛创想《站长》俱乐部18城市互动之旅报名ing
返回列表 回复 发帖

(10.1)首页四格-随机图片调用+最新话题+最新回复+精华帖/本周热门/本月热门

******************************************************************************
*
*   HACK名称:首页4格-随机图片调用+最新话题+最新回复+精华帖/本周热门/本月热门
*   适用版本:dz 5.0正式版  (最好打完目前所有补丁)
*   原  作 者: 不祥
*   安装难度: 简单
*   数  据 表: 无
*   修改文件:index.php、discuz.htm
*   增加文件:pic.php、pic.htm、pixviewer.swf、slide.js
*   注意:安装所有首页4格插件“子论坛”的标题最好不要加入颜色等代码,否则安装后版面会凌乱。
******************************************************************************


论坛演示
http://bbs.bbx8.com/index.php


1、修改index.php

找到:
  1. require_once DISCUZ_ROOT.'./include/forum.func.php';
复制代码
下面添加:
  1. require_once DISCUZ_ROOT.'./include/misc.func.php';
复制代码
继续找:
  1. $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
复制代码
下面添加:
  1. //---------------hack Meminfo start
  2. if(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 6.0")) {
  3.                 $visitor_browser = "Internet Explorer 6.0";
  4.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 5.5")) {
  5.                 $visitor_browser = "Internet Explorer 5.5";
  6.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 5.0")) {
  7.                 $visitor_browser = "Internet Explorer 5.0";
  8.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 4.01")) {
  9.                 $visitor_browser = "Internet Explorer 4.01";
  10.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NetCaptor")) {
  11.                 $visitor_browser = "NetCaptor";
  12.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Netscape")) {
  13.                 $visitor_browser = "Netscape";
  14.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Lynx")) {
  15.                 $visitor_browser = "Lynx";
  16.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Opera")) {
  17.                 $visitor_browser = "Opera";
  18.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Konqueror")) {
  19.                 $visitor_browser = "Konqueror";
  20.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Mozilla")) {
  21.                 $visitor_browser = "Mozilla";
  22.         } else {
  23.                 $visitor_browser = "其它";
  24.         }
  25. //上面的是浏览器//
  26.         if(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5.1")) {
  27.                 $visitor_os = "Windows XP";
  28.         }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5.2")) {
  29.                 $visitor_os = "Windows Server 2003";
  30.         }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5")) {
  31.                 $visitor_os = "Windows 2000";
  32.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "4.9")) {
  33.                 $visitor_os = "Windows ME";
  34.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 4")) {
  35.                 $visitor_os = "Windows NT 4.0";
  36.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "98")) {
  37.                 $visitor_os = "Windows 98";
  38.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "95")) {
  39.                 $visitor_os = "Windows 95";
  40.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Mac")) {
  41.                 $visitor_os = "Mac";
  42.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Linux")) {
  43.                 $visitor_os = "Linux";
  44.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Unix")) {
  45.                 $visitor_os = "Unix";
  46.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "FreeBSD")) {
  47.                 $visitor_os = "FreeBSD";
  48.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "SunOS")) {
  49.                 $visitor_os = "SunOS";
  50.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "BeOS")) {
  51.                 $visitor_os = "BeOS";
  52.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "OS/2")) {
  53.                 $visitor_os = "OS/2";
  54.         } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], ";PC")) {
  55.                 $visitor_os = "Macintosh";
  56.         }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "AIX")) {
  57.                 $visitor_os = "AIX";
  58.         } else {
  59.                 $visitor_os = "其他";
  60.         }
  61.         $mem_home = convertip($onlineip, $datadir = "./");
  62. //info//
  63. $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
  64. //新贴//
  65. $hack_cut_str =29; //修改标题显示字数
  66. $hack_cut_strauthor = 9;
  67. $new_post_threadlist = array();
  68. $nthread = array();
  69. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 8");
  70. while($nthread = $db->fetch_array($query)) {
  71.         $nthread['forumname'] = $nthread['name'];
  72.         $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
  73.         $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
  74.         $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
  75.         $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
  76.         if($nthread['highlight']) {
  77.                 $string = sprintf('%02d', $nthread['highlight']);
  78.                 $stylestr = sprintf('%03b', $string[0]);
  79.                 $nthread['highlight'] = 'style="';
  80.                 $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  81.                 $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  82.                 $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  83.                 $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  84.                 $nthread['highlight'] .= '"';
  85.         } else {
  86.                 $nthread['highlight'] = '';
  87.         }
  88.         $new_post_threadlist[] = $nthread;
  89. }
  90. //新贴//
  91. //新回覆
  92. $hack_cut_str = 29; //修改标题显示字数
  93. $hack_cut_strauthor = 9;
  94. $new_reply_threadlist = array();
  95. $rthread = array();
  96. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 8");
  97. while($rthread = $db->fetch_array($query)) {
  98.         $rthread['forumname'] = $rthread['name'];
  99.         $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
  100.         $rthread['view_lastposter'] = cutstr($rthread['lastposter'],$hack_cut_strauthor);
  101. $rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
  102.         $rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread[lastpost] + ($timeoffset * 3600));
  103.         if($rthread['highlight']) {
  104.                 $string = sprintf('%02d', $rthread['highlight']);
  105.                 $stylestr = sprintf('%03b', $string[0]);
  106.                 $rthread['highlight'] = 'style="';
  107.                 $rthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  108.                 $rthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  109.                 $rthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  110.                 $rthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  111.                 $rthread['highlight'] .= '"';
  112.         } else {
  113.                 $rthread['highlight'] = '';
  114.         }
  115.         $new_reply_threadlist[] = $rthread;
  116. }
  117. //热帖//
  118. //精华帖
  119. $hack_cut_str =29; //修改标题显示字数
  120. $hack_cut_strauthor = 9;
  121. $new_digest_threadlist = array();
  122. $dthread = array();
  123. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE digest>'0' AND t.fid<>'$fid' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 8"); //修改显示帖子条数
  124. while($dthread = $db->fetch_array($query)) {
  125.         $dthread['forumname'] = $dthread['name'];
  126.         $dthread['view_subject'] = cutstr($dthread['subject'],$hack_cut_str);
  127.         $dthread['view_author'] = cutstr($dthread['author'],$hack_cut_strauthor);
  128.         $dthread['date']= gmdate("$dateformat $timeformat", $dthread['dateline'] + $timeoffset * 3600);
  129.         $dthread['lastreplytime']= gmdate("$dateformat $timeformat", $dthread[lastpost] + ($timeoffset * 3600));
  130.         if($dthread['highlight']) {
  131.                 $string = sprintf('%02d', $dthread['highlight']);
  132.                 $stylestr = sprintf('%03b', $string[0]);
  133.                 $dthread['highlight'] = 'style="';
  134.                 $dthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  135.                 $dthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  136.                 $dthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  137.                 $dthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  138.                 $dthread['highlight'] .= '"';
  139.         } else {
  140.                 $dthread['highlight'] = '';
  141.         }
  142.         $new_digest_threadlist[] = $dthread;
  143. }
  144. //精华帖,四格代码结束//
复制代码
2.打开/templates/default/discuz.htm找到:
  1. <!--{if !empty($advlist['text'])}-->
复制代码
上面添加:
  1. <!--首页四格开始-->
  2. <div class="spaceborder" style="width: {TABLEWIDTH}">
  3. <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center" >
  4.     <tr class="header">
  5.     <td class="header" width="25%" align="center"><b><img src={IMGDIR}/dot.gif BORDER=0>≡论坛图片≡</b></td>
  6.     <td class="header" width="25%" align="center"><b><img src={IMGDIR}/dot.gif BORDER=0>≡最新话题≡</b></td>
  7.     <td class="header" width="25%" align="center"><b><img src={IMGDIR}/dot.gif BORDER=0>≡最新回复≡</b></td>
  8.     <td class="header" width="25%" align="center"><b><img src={IMGDIR}/dot.gif BORDER=0>≡论坛精华≡</b></td>
  9.   </tr>
  10.   <tr>
  11.     <td class="altbg1" align="center"><iframe name="I1" src="pic.php" width="270" height="210" frameborder=0 scrolling=no marginwidth="9" marginheight="2" align="right"></iframe>
  12.     </td>
  13.     <td><!--{loop $new_post_threadlist $nthread}-->
  14.         <table border="0" width='100%' cellspacing="2">
  15.           <tr>
  16.             <td height="12" width='100%'><FONT face=Wingdings>z</FONT>
  17.                 <!--{if $nthread[replies]}-->
  18.                 <a href="viewthread.php?tid=$nthread[tid]" $nthread['highlight'] title="最新话题 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}最后回复: $nthread[lastreplytime]{LF}{lang lastpost}: $nthread[lastposter]" >$nthread[view_subject]</a>
  19.                 <!--{else}-->
  20.                 <a href="viewthread.php?tid=$nthread[tid]" $nthread['highlight'] title="最新话题 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间{lang time}: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}{lang replies}: 暂时没有回复" >$nthread[view_subject]</a>
  21.               <!--{/if}-->
  22.             </td>
  23.           </tr>
  24.         </table>
  25.       <!--{/loop}--></td>
  26.     <td><!--{loop $new_reply_threadlist $rthread}-->
  27.         <table border="0" width='100%' cellspacing="2">
  28.           <tr>
  29.             <td height="12" width='100%'><FONT face=Wingdings>z</FONT>  </font><a href="viewthread.php?tid=$rthread[tid]" $rthread['highlight'] title="最新回复 {LF}所在论坛: $rthread[forumname]{LF}主题标题: $rthread[subject]{LF}主题作者: $rthread[author]{LF}发表时间: $rthread[date]{LF}浏览次数: $rthread[views] 次{LF}回复次数: $rthread[replies] 次{LF}最后回复: $rthread[lastreplytime]{LF}{lang lastpost}: $rthread[lastposter]">$rthread[view_subject]</a></td>
  30.           </tr>
  31.         </table>
  32.       <!--{/loop}--></td>
  33. <td>
  34. <!--{loop $new_digest_threadlist $dthread}-->
  35.        <table border="0" width='100%' cellspacing="2">
  36.           <tr>
  37.             <td height=12 width='76%'><FONT face=Wingdings>z</FONT>  </font><a href="viewthread.php?tid=$dthread[tid]"  $dthread['highlight'] title="精华文章 {LF}所在论坛: $dthread[forumname]{LF}主题标题: $dthread[subject]{LF}主题作者: $dthread[author]{LF}发表时间: $dthread[date]{LF}浏览次数: $dthread[views] 次{LF}回复次数: $dthread[replies] 次{LF}最后回复: $dthread[lastreplytime]{LF}{lang lastpost}: $dthread[lastposter]">$dthread[view_subject]</a></td>         
  38.           </tr>
  39.         </table>
  40.       <!--{/loop}--></td>
  41.   </tr>
  42. </table></div>
  43. <!--首页四格结束-->
复制代码
上面的修改已经完成,可以连附件一起上传。

A、默认显示标题为10条,如果需要改变的,请在index.php文件里修改以下代码,
共有三处需要修改;把10改为你需要显示的标题数:
  1. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 10");
复制代码
B、图片大小的调整:
(1)修改(之前已经改好的)discuz.htm文件,270和210这两个数便是,见下面的代码:
  1. <td class="altbg1" align="center"><iframe name="I1" src="pic.php" width="270" height="210" frameborder=0 scrolling=no marginwidth="9" marginheight="2" align="right"></iframe>
复制代码
(2)修改附件里面的pic.php文件,250和190这两个数便是,见下面的代码:
  1. var focus_width=250
  2. var focus_height=190
复制代码
改动图片大小时请特别注意:
在图片下面有完整的帖子标题显示。discuz.htm的数值设定必须要比pic.php的数值大20,用于显示标题。如果两个文件的设定数值相等,则图片下面无法显示标题。



如果修改图片个数,以及多少,请修改附件内 PIC.php文件,里面有解释!

[ 本帖最后由 vvvdong 于 2007-2-22 11:30 编辑 ]

首页四格附件.rar (14.16 KB)

2

评分次数

  • 軒動我心

  • goldfish5

把“精华帖”改为“热门话题”的方法:
A、修改(已经改好的)discuz.htm
1、把下面的代码
  1. <!--{loop $new_digest_threadlist $dthread}-->
  2.        <table border="0" width='100%' cellspacing="2">
  3.           <tr>
  4.             <td height=12 width='76%'><FONT face=Wingdings>z</FONT>  </font><a href="viewthread.php?tid=$dthread[tid]"  $dthread['highlight'] title="精华文章 {LF}所在论坛: $dthread[forumname]{LF}主题标题: $dthread[subject]{LF}主题作者: $dthread[author]{LF}发表时间: $dthread[date]{LF}浏览次数: $dthread[views] 次{LF}回复次数: $dthread[replies] 次{LF}最后回复: $dthread[lastreplytime]{LF}{lang lastpost}: $dthread[lastposter]">$dthread[view_subject]</a></td>
复制代码
替换为
  1. <!--{loop $new_hot_threadlist $mthread}-->
  2.         <table border="0" width='100%' cellspacing="2">
  3.           <tr>
  4.             <td height="12" width='100%'><FONT face=Wingdings>z</FONT>  </font><a href="viewthread.php?tid=$mthread[tid]" $mthread['highlight'] title="热门话题 {LF}所在论坛: $mthread[forumname]{LF}主题标题: $mthread[subject]{LF}主题作者: $mthread[author]{LF}发表时间: $mthread[date]{LF}浏览次数: $mthread[views] 次{LF}回复次数: $mthread[replies] 次{LF}最后回复: $mthread[lastreplytime]{LF}{lang lastpost}: $mthread[lastposter]">$mthread[view_subject]</a></td>
复制代码
2、把相应的标题改掉
  1. <td class="header" width="25%" align="center"><b><img src={IMGDIR}/dot.gif BORDER=0>≡论坛精华≡</b></td>
复制代码
改为:
  1. <td class="header" width="25%" align="center"><b><img src={IMGDIR}/dot.gif BORDER=0>≡论坛热门≡</b></td>
复制代码
B、修改(已经改好的)index.php
将精华帖的代码
  1. //精华帖
  2. $hack_cut_str =28; //修改标题显示字数
  3. $hack_cut_strauthor = 9;
  4. $new_digest_threadlist = array();
  5. $dthread = array();
  6. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE digest>'0' AND t.fid<>'$fid' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 10"); //修改显示帖子条数
  7. while($dthread = $db->fetch_array($query)) {
  8.         $dthread['forumname'] = $dthread['name'];
  9.         $dthread['view_subject'] = cutstr($dthread['subject'],$hack_cut_str);
  10.         $dthread['view_author'] = cutstr($dthread['author'],$hack_cut_strauthor);
  11.         $dthread['date']= gmdate("$dateformat $timeformat", $dthread['dateline'] + $timeoffset * 3600);
  12.         $dthread['lastreplytime']= gmdate("$dateformat $timeformat", $dthread[lastpost] + ($timeoffset * 3600));
  13.         if($dthread['highlight']) {
  14.                 $string = sprintf('%02d', $dthread['highlight']);
  15.                 $stylestr = sprintf('%03b', $string[0]);
  16.                 $dthread['highlight'] = 'style="';
  17.                 $dthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  18.                 $dthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  19.                 $dthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  20.                 $dthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  21.                 $dthread['highlight'] .= '"';
  22.         } else {
  23.                 $dthread['highlight'] = '';
  24.         }
  25.         $new_digest_threadlist[] = $dthread;
  26. }
  27. //精华帖,四格代码结束//
复制代码
替换为:
  1. //热帖
  2. $hack_cut_str = 28; //修改标题显示字数
  3. $hack_cut_strauthor = 9;
  4. $new_hot_threadlist = array();
  5. $mthread = array();
  6. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.views DESC LIMIT 0, 10"); //修改显示帖子条数
  7. while($mthread = $db->fetch_array($query)) {
  8.         $mthread['forumname'] = $mthread['name'];
  9.         $mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
  10.         $mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
  11. $mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
  12.         $mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread[lastpost] + ($timeoffset * 3600));
  13.         if($mthread['highlight']) {
  14.                 $string = sprintf('%02d', $mthread['highlight']);
  15.                 $stylestr = sprintf('%03b', $string[0]);
  16.                 $mthread['highlight'] = 'style="';
  17.                 $mthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  18.                 $mthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  19.                 $mthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  20.                 $mthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  21.                 $mthread['highlight'] .= '"';
  22.         } else {
  23.                 $mthread['highlight'] = '';
  24.         }
  25.         $new_hot_threadlist[] = $mthread;
  26. }
  27. //热帖,四格代码结束//
复制代码
C、或替换为受时间限制的热帖,
共有下面两步:
同样是修改(已经改好的)index.php:

1、找到:
  1. $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
复制代码
在下面加入:
  1. $today  = mktime (0,0,0,date("m")  ,date("d"),date("Y"));
  2. $build_date = mktime (0,0,0,12,31,2005);//里面的三个数字,分别代表你论坛运行第一天的月,日,年。
  3. $build_days = (int)(($today-$build_date)/(24*3600));
复制代码
2、继续找
  1. //热帖
  2. $hack_cut_str = 29; //修改标题显示字数
  3. $hack_cut_strauthor = 9;
  4. //这个可以选择安装或者不安装//
  5. //热贴指定天数//
  6. $this_time= time();
  7. $sort_time = $today - ( 60*60*24*30); //30天内,或者改成7天也就是一周
  8. $new_hot_threadlist = array();
  9. $mthread = array();
  10. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 and t.dateline > $sort_time ORDER BY t.views DESC LIMIT 0, 8"); //修改显示帖子条数
  11. while($mthread = $db->fetch_array($query)) {
  12.         $mthread['forumname'] = $mthread['name'];
  13.         $mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
  14.         $mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
  15. $mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
  16.         $mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread[lastpost] + ($timeoffset * 3600));
  17.         if($mthread['highlight']) {
  18.                 $string = sprintf('%02d', $mthread['highlight']);
  19.                 $stylestr = sprintf('%03b', $string[0]);
  20.                 $mthread['highlight'] = 'style="';
  21.                 $mthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  22.                 $mthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  23.                 $mthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  24.                 $mthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  25.                 $mthread['highlight'] .= '"';
  26.         } else {
  27.                 $mthread['highlight'] = '';
  28.         }
  29.         $new_hot_threadlist[] = $mthread;
  30. }
  31. //热帖,四格代码结束//
复制代码
[ 本帖最后由 vvvdong 于 2006-9-30 22:57 编辑 ]
............................
有没有演示的啊!!!
楼主能搞个bbs.txlife.cn的4格不
up
upupup
ddddddddddddddddd
用了不顶  看了不顶 非人类也~~~~~~~~
~
顶啊.看帖不回帖者丢。。。用帖不回帖者踩。。。。
帮顶@@!!!
返回列表