Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[修改] 7.1首页横排美化

[复制链接]
fweini 发表于 2009-11-15 12:17:46 | 显示全部楼层 |阅读模式
插件发布
插件名称: 7.1首页横排美化
插件来源:
适用版本: Discuz! 7.1
语言编码: GBK简体 
最后更新时间:
插件作者: 酷萨论坛
插件简介: 7.1首页横排美化(整理版)
本帖最后由 fweini 于 2010-01-15 23:55 编辑

原帖地址:https://discuz.dismall.com/viewth ... hlight=%BA%E1%C5%C5




修改include/index_classics.inc.php

找到
  1. $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
复制代码
复制代码下面添加
  1. //帖子调用开始
  2. $hack_cut_str =60; // 这里修改标题长度
  3. $fids = array();
  4. if (file_exists("./forumdata/cache/cache_forums.php")){
  5.         require_once "./forumdata/cache/cache_forums.php";
  6.         if (is_array($_DCACHE['forums'])){
  7.                 foreach ($_DCACHE['forums'] as $k => $v){
  8.                         if (!strstr(',sub,forum,',','.$v['type'].',')) continue;
  9.                         $fids[$k] = 5; // 这里是第一处调用条数需要和后面的设置一样。
  10.                 }
  11.         }
  12. }
  13. if (count($fids) < 1){
  14.         $query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' OR type='sub'");
  15.         while ($row = $db->fetch_array($query)){
  16.                 $fids[$row['fid']] = 5; // 这里是第二处调用条数需要和前面的设置一样。
  17.         }
  18. }
  19. $limit_counts = 0;
  20. foreach ($fids as $k => $v){
  21.         $sql .= "(SELECT t.*, f.name FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f.fid = t.fid WHERE t.fid='$k' ORDER BY t.dateline DESC LIMIT $v) UNION ";
  22. }
  23. if ($sql){
  24.         $sql = substr($sql,0,strlen($sql)-6);
  25. }
  26. $query = $db->query($sql);
  27. while ($row = $db->fetch_array($query)){
  28.         $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
  29.         $row['date']= gmdate("$dateformat", $row['dateline'] + $timeoffset * 3600);
  30.         if($row['highlight']) {
  31.                         $string = sprintf('%02d', $row['highlight']);
  32.                         $stylestr = sprintf('%03b', $string[0]);
  33.                         $row['highlight'] = 'style="';
  34.                         $row['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  35.                         $row['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  36.                         $row['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  37.                         $row['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  38.                         $row['highlight'] .= '"';
  39.         } else {
  40.                         $row['highlight'] = '';
  41.         }
  42.         ${'new_no'.$row['fid'].'_threadlist'}[] = $row;
  43. }
  44. //帖子调用结束
复制代码
修改  templates/default/css_common.htm

找到
  1. .list th { background: url({IMGDIR}/forum.gif) 5px 10px no-repeat; padding-left: 45px !important; }
复制代码
复制代码修改为
  1. .list th { background: url({IMGDIR}/forum.gif) 3px 17px no-repeat; padding-left: 15px !important; }
复制代码
修改 templates/default/discuz.htm

找到
  1. <tbody id="forum$forum[fid]">
复制代码
  1. $cat['endrows']
复制代码
全部内容
复制代码替换为:
  1. <tbody id="forum$forum[fid]">
  2.                                                 <tr>
  3.                                                         <td>
  4.                                                                 $forum[icon]
  5.         <div class="left">
  6.         <h2><a href="forumdisplay.php?fid=$forum[fid]" {if $forum[redirect]}target="_blank" {/if}>$forum[name]</a> <font class="smalltext"><!--{if $forum[todayposts]}-->T: <font color="#FF3399">$forum[todayposts]</font><img src="{IMGDIR}/new.gif" align="absmiddle"><!--{else}-->T: <font color="#FF3399">0</font><!--{/if}--> P: <font color="#00CCFF">$forum[threads]</font> R: <font color="#99CC00">$forum[posts]</font></font> <!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><img src="{IMGDIR}/moderator.gif" title="论坛版主" onclick="toggle_collapse('coll_1');" style="cursor:pointer" /> <em class="moderators" id="coll_1" style="display:none">$forum[moderators]</em><!--{/if}--><!--{/if}--></h2>
  7.         <!--{if $forum[description]}--><p>$forum[description]</p><!--{/if}-->
  8.                         <!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}-->
  9.         </div>
  10.                                                         </td>
  11.                                                         <th class="forumlast"{$forum[folder]}>
  12.                                                         <!--{if $forum['permission'] == 1}-->
  13.                                                                 {lang private_forum}
  14.                                                         <!--{else}-->
  15.                                                                 <!--{if $forum['redirect']}-->
  16.                                                                        <a href="forumdisplay.php?fid=$forum[fid]">{lang url_link}</a>
  17.                                                                 <!--{elseif is_array($forum['lastpost'])}-->
  18.                                                                         <p> <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">{echo cutstr($forum[lastpost][subject], 26)}</a></p>
  19.                                                                         <cite><!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--> - $forum[lastpost][dateline]</cite>
  20.                                                                 <!--{else}-->
  21.                                                                         {lang never}
  22.                                                                         <p>{lang never}</p>
  23.                                                                 <!--{/if}-->
  24.                             <!--{/if}-->
  25.                                                         </td>
  26.                                                 </tr>
  27.                                         </tbody>
  28.                                 <!--{/loop}-->
  29.                         <!--{else}-->
  30.                                 <tr class="narrowlist">
  31.                                 <!--{loop $cat['forums'] $forumid}-->
  32.                                         <!--{eval $forum=$forumlist[$forumid];}-->
  33.                                         <!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
  34.                                                 </tr></tbody>
  35.                                                 <!--{if $forum['orderid'] < $cat['forumscount']}-->
  36.                                                         <tbody><tr>
  37.                                                 <!--{/if}-->
  38.                                         <!--{/if}-->
  39.                                         <td width="$cat[forumcolwidth]" style="vertical-align: top; background-image: none; padding:8px !important;">
  40. <div style="width:100%; "><div style="float:left; "><h2><a href="forumdisplay.php?fid=$forum[fid]" {if $forum[redirect]}target="_blank" {/if}>$forum[name]</a></h2></div><div style="float:right; "><!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><img src="{IMGDIR}/moderator.gif" title="论坛版主" onclick="toggle_collapse('coll_2');" style="cursor:pointer" /> <em class="moderators" id="coll_2" style="display:none">$forum[moderators]</em><!--{/if}--><!--{/if}-->
  41.    <!--{if $forum[todayposts]}-->
  42.       <!--{else}-->
  43.    <!--{/if}--></div></div>
  44. $forum[icon]
  45. <!--{if $forum[description]}--><div style="width:100%; ">$forum[description]</div><!--{/if}-->
  46.                         <!--{if $forum['subforums']}--><div style="width:100%; ">{lang forum_subforums}: $forum['subforums']</div><!--{/if}-->
  47. <!--{if $forum[todayposts]}-->Today: <font color="#FF3399">$forum[todayposts]</font><img src="{IMGDIR}/new.gif" align="absmiddle"><!--{else}-->Today: <font color="#FF3399">0</font><!--{/if}--> Post: <font color="#00CCFF">$forum[threads]</font> Reply: <font color="#99CC00">$forum[posts]</font></font>
  48.                                 <ul style="background-image: url(images/listbg_li.gif); padding:1px 2px 0px 10px; list-style-type: none; line-height: 20px; clear: both; margin:8px 0; ">
  49.                                 <!--{loop ${"new_no".$forum[fid]."_threadlist"} $row}-->
  50.    <div style="overflow: hidden; height:20px; width:100%"><small style="float:right; color:#9C8B88; margin: 0 0 0 5px">$row['date']</small><a href="viewthread.php?tid=$row[tid]" title="$row[subject]" target='_self'>$row[view_subject]</a></div>
  51.                                 <!--{/loop}-->
  52.                                 </ul>
  53.                                         </td>
  54.                                 <!--{/loop}-->
  55.                                 $cat['endrows']
复制代码
修改 templates/default/forumdisplay_subforum.htm

找到
  1. <!--{if !$forum['forumcolumns']}-->
复制代码
  1. <!--{loop $sublist $sub}-->
复制代码
全部内容
复制代码替换为
  1. <!--{if !$forum['forumcolumns']}-->
  2.                 <!--{loop $sublist $sub}-->
  3.                         <tbody>
  4.                                 <tr>
  5.                                         <td>
  6.                                                 $sub[icon]
  7.         <div class="left">
  8.         <h2><a href="forumdisplay.php?fid=$sub[fid]" {if $sub[redirect]}target="_blank"{/if}>$sub[name]</a> <font class="smalltext"><!--{if $sub[todayposts] && !$sub['redirect']}-->今日: <font color="#FF3399">$forum[todayposts]</font><img src="{IMGDIR}/new.gif" align="absmiddle"><!--{else}-->今日: <font color="#FF3399">0</font><!--{/if}--> 主题: <font color="#00CCFF">$forum[threads]</font> 回复: <font color="#99CC00">$forum[posts]</font></font> <!--{if $sub['moderators']}--><!--{if $moddisplay == 'flat'}--><img src="{IMGDIR}/moderator.gif" title="论坛版主" onclick="toggle_collapse('coll_3');" style="cursor:pointer" /> <em class="moderators" id="coll_3" style="display:none">$forum[moderators]</em><!--{/if}--><!--{/if}--></h2>
  9.         <!--{if $sub[description]}--><p>版块介绍: $sub[description]</p><!--{/if}-->
  10.                         <!--{if $sub['subforums']}--><p>{lang forum_subforums}: $sub['subforums']</p><!--{/if}-->
  11.         </div>
  12.                                                         </td>
  13.                                         <th class="forumlast"{$forum[folder]}>
  14.                                         <!--{if $sub['permission'] == 1}-->
  15.                                                 {lang private_forum}
  16.                                         <!--{else}-->
  17.                                                 <!--{if $sub['redirect']}-->
  18.                                                         <a href="forumdisplay.php?fid=$sub[fid]">{lang url_link}</a>
  19.                                                 <!--{elseif is_array($sub['lastpost'])}-->
  20.                                                         <p>最新主题: <a href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost">{echo cutstr($sub[lastpost][subject], 20)}</a></p>
  21.                                                         <cite><!--{if $sub['lastpost']['author']}-->作者相关: $sub['lastpost']['author']<!--{else}-->作者相关: {lang anonymous}<!--{/if}--> - $sub[lastpost][dateline]</cite>
  22.                                                 <!--{else}-->
  23.                                                         最新主题: {lang never}
  24.                                                                                                                 <p>作者相关: {lang never}</p>
  25.                                                 <!--{/if}-->
  26.                                         <!--{/if}-->
  27.                                         </td>
  28.                                 </tr>
  29.                         </tbody>
  30.                 <!--{/loop}-->
  31.         <!--{else}-->
  32.                 <tr class="narrowlist">
  33.                 <!--{loop $sublist $sub}-->
复制代码
附件里面是修改的好 直接覆盖即可!!!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
minger2manfi 发表于 2009-11-15 12:33:33 | 显示全部楼层
不错的吖...帮顶了..!
回复

使用道具 举报

popuppp 发表于 2009-11-15 12:36:43 | 显示全部楼层
支持一下。
回复

使用道具 举报

goldlink 发表于 2009-11-16 16:05:30 | 显示全部楼层
支持下...喜借宝地招友情链接,谢谢。 www.p2ping.com  要求百度google收录正常,做的PM或者Q我。
回复

使用道具 举报

abcnic18 发表于 2009-11-16 16:08:32 | 显示全部楼层
感谢分享!
回复

使用道具 举报

wolon 发表于 2009-11-20 14:30:27 | 显示全部楼层
终于找到了。收藏一下。
感谢楼主
回复

使用道具 举报

成武社区 发表于 2010-3-2 20:39:44 | 显示全部楼层
$newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
回复

使用道具 举报

sanreqiwang 发表于 2010-3-2 20:44:40 | 显示全部楼层
无私奉献精神,顶一下
回复

使用道具 举报

soo888 发表于 2010-3-12 13:07:23 | 显示全部楼层
广东交通论坛强烈支持!
回复

使用道具 举报

yamenkou 发表于 2010-3-12 15:10:25 | 显示全部楼层
回复 1# fweini


    附件里面是修改的好 直接覆盖即可!!!

我下载了,上传后,发现首页仍然没有什么变化,这是为什么?
请各位指教一二
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-6-2 10:43 , Processed in 0.125691 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表