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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

首页横排美化+ 横排板块显示最后发表主题五笔 for 6.0 (完美修正!!)

[复制链接]
jillyz 发表于 2007-11-13 23:22:34 | 显示全部楼层 |阅读模式
。。。
2007/11/16   01:35
我發了新的了!!! 大家用新的改吧~~~~
首页横排美化+最后发表主题(进化)+版主显示依模式不同位置 for Dz6.0 (已發布)


*再次強調,修改之前,一定要備份你原有的文件!
如果你改過之後,覺得這樣的橫排慢,那就別用了。 用你原先備份的文件覆蓋回去即可。
.

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
================================================================================
2008/1/1
這個修改, 感謝 落雪★无痕 提出建議

-----------------------
若在高亮标题时会出现“   标题内容">标题内容”  
discuz.htm中
<a href="forumdisplay.php?fid=$forum[fid]" title="$forum[name]">$forum[name]</a>
应该替换为
<a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a>
================================================================================
2007/11/27 修正 Firefox 下的錯誤 (下載包無更新)
特別感謝 74 樓的 smatcn 提供了修正方法
原帖由 smatcn 于 2007-11-25 21:03 发表
修正一处该文件在firefox浏览器上显示错位的问题。将:
  1. <span style="float:left">$forum[icon]</span><span style="float:left; color:{LIGHTTEXT}">$forum[description]</span>
复制代码
改成:
  1. <span style="float:left">$forum[icon]</span><span style=" color:{LIGHTTEXT}">$forum[description]</span>
复制代码
也就是把后面那个 span 里多余的 float:left 去掉。这样做的目的很明确,即解决首页版块说明在firefox浏览器里显示错位的问题。大家不妨将前后两种修改方案应用于firefox看看显示效果!




。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
2007/11/14  下午4點修正  

發布完美修正包

修正模板 discuz.htm 的 橫排:(最新演示如附件)

-------- 排版代碼更完美
-------- 加入 最後發表, 和統計(主題數,總帖數,今日新帖)

所以只需重新查找修改 discuz.htm  模板代碼
即是重做 步驟一

或是下載最新的打包檔


--------------------------------------------------------

11/14 早上補充:

修改之前,請記得先備份!!

修改完後 請務必進行 更新緩存

如果還是不行,請回覆告知哦~~~

修改成功的,也請給個連結吧

上傳了打包檔

---------------------------------------------------------------------------------


其實是仿之前的 Maxspeed 5.2 的橫排

再加上 首頁四格的話~~ 個人感覺比 home 還實用~



1。修改模板 discuz.htm (此步驟  2007/11/14 16:23更新)

先搜尋:
<!--{loop $cat['forums'] $forumid}-->

其上面的 前3行 會看到 <!--{else}-->

修改來了,找到下面這一段: (2007/11/14 16:23更新)
  1.    <!--{else}-->
  2.      <tr>
  3.      <!--{loop $cat['forums'] $forumid}-->
  4.       <!--{eval $forum=$forumlist[$forumid];}-->
  5.       <!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
  6.        </tr></tbody>
  7.        <!--{if $forum['orderid'] < $cat['forumscount']}-->
  8.         <tbody><tr>
  9.        <!--{/if}-->
  10.       <!--{/if}-->
  11.       <th width="$cat[forumcolwidth]"{$forum[folder]}>
  12.        <h2><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a><!--{if $forum[todayposts]}--><em> ({lang index_today}: $forum[todayposts])</em><!--{/if}--></h2>
  13.        <p>{lang forum_threads}: $forum[threads], {lang forum_posts}: $forum[posts]</p>
  14.        <p>{lang forum_lastpost}:
  15.         <!--{if is_array($forum['lastpost'])}-->
  16.          <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][dateline]</a>
  17.          {lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
  18.         <!--{else}-->
  19.          {lang never}
  20.         <!--{/if}-->
  21.        </p>
  22.       </th>
  23.      <!--{/loop}-->
  24.     $cat['endrows']
  25.    <!--{/if}-->
复制代码
替換為如下內容:(2007/11/14 16:23更新)。  ------------緊湊版塊的修改方法,請參考40樓. 顯示子論壇請看39樓

你的橫版設定,
一行板塊數量若有4個,那 "<th>{lang forum_name} / 最新主题</th>" 就放4行
一行2個板塊,那 "<th>{lang forum_name} / 最新主题</th>" 就放2行
請自行改囉

  1.    <!--{else}-->
  2.     <thead class="category" align="center">
  3.      <tr>
  4.       <th>{lang forum_name} / 最新主题</th>
  5.       <th>{lang forum_name} / 最新主题</th>
  6.       <th>{lang forum_name} / 最新主题</th>
  7.      </tr>
  8.     </thead>     
  9.      <!--{loop $cat['forums'] $forumid}-->
  10.       <!--{eval $forum=$forumlist[$forumid];}-->
  11.       <!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
  12.        </tr></tbody>
  13.        <!--{if $forum['orderid'] < $cat['forumscount']}-->
  14.         <tbody><tr>
  15.        <!--{/if}-->
  16.       <!--{/if}-->
  17.       <th class="forumlist" width="$cat[forumcolwidth]" style="vertical-align: top; background-image: none; padding:8px !important;">
  18.        <h2 style="margin: 0 0 5px 0"><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a></h2>
  19.         <span style="float:left">$forum[icon]</span><span style="float:left; color:{LIGHTTEXT}">$forum[description]</span>
  20.        <ul class="list" 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;">
  21.        <!--{loop ${"new_no".$forum[fid]."_threadlist"} $row}-->
  22.         <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>
  23.        <!--{/loop}-->
  24.        </ul>
  25.        <div style="color:{LIGHTTEXT}; overflow: hidden; height: 20px; width: 100%">
  26.         <!--{if is_array($forum['lastpost'])}-->
  27.          {lang forum_lastpost}: <a style="color:{LIGHTTEXT}" href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost" title="$forum[lastpost][subject]  ($forum[lastpost][dateline])">{echo cutstr($forum[lastpost][subject], 35)}</a>
  28.          ({lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author'])<!--{else}-->{lang anonymous}<!--{/if}-->
  29.         <!--{else}-->
  30.          {lang never}
  31.         <!--{/if}-->
  32.        </div>
  33.        <div style="text-align: left; color:{LIGHTTEXT}">
  34.         {lang forum_threads}:{if $forum['redirect']}--{else}$forum[threads]{/if},
  35.         {lang forum_posts}:{if $forum['redirect']}--{else}$forum[posts]{/if},
  36.         <!--{if $forum[todayposts]}-->{lang index_today}$forum[todayposts],<!--{else}-->{lang index_today}:0<!--{/if}-->
  37.        </div>
  38.       </th>
  39.      <!--{/loop}-->
  40.     $cat['endrows']  
  41.    <!--{/if}-->
复制代码
如果不要   最後發表,  統計主題,帖數,今日新帖   這些的,

請把其中的這一段拿掉
  1.        <div style="color:{LIGHTTEXT}; overflow: hidden; height: 20px; width: 100%">
  2.         <!--{if is_array($forum['lastpost'])}-->
  3.          {lang forum_lastpost}: <a style="color:{LIGHTTEXT}" href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost" title="$forum[lastpost][subject]  ($forum[lastpost][dateline])">{echo cutstr($forum[lastpost][subject], 35)}</a>
  4.          ({lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author'])<!--{else}-->{lang anonymous}<!--{/if}-->
  5.         <!--{else}-->
  6.          {lang never}
  7.         <!--{/if}-->
  8.        </div>
  9.        <div style="text-align: left; color:{LIGHTTEXT}">
  10.         {lang forum_threads}:{if $forum['redirect']}--{else}$forum[threads]{/if},
  11.         {lang forum_posts}:{if $forum['redirect']}--{else}$forum[posts]{/if},
  12.         <!--{if $forum[todayposts]}-->{lang index_today}$forum[todayposts],<!--{else}-->{lang index_today}:0<!--{/if}-->
  13.        </div>
复制代码
-------------

2。修改程序 index.php  (代碼出自 Maxspeed 5.2)

找到
  1. $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
复制代码
在下面加上:
(其實 模版已定義了超出寬度要隱藏, 所以下面的標題長度可以不用改小)
(下面的dateline是最新發布的主題。如果要顯示最後回覆的,把dateline改成lastpost就可以了)--12/7 補充此行
  1. $hack_cut_str =60; // 这里修改标题长度
  2. $fids = array();
  3. if (file_exists("./forumdata/cache/cache_forums.php")){
  4.         require_once "./forumdata/cache/cache_forums.php";
  5.         if (is_array($_DCACHE['forums'])){
  6.                 foreach ($_DCACHE['forums'] as $k => $v){
  7.                         if (!strstr(',sub,forum,',','.$v['type'].',')) continue;
  8.                         $fids[$k] = 5; // 这里是第一处调用条数需要和后面的设置一样。
  9.                 }
  10.         }
  11. }
  12. if (count($fids) < 1){
  13.         $query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' OR type='sub'");
  14.         while ($row = $db->fetch_array($query)){
  15.                 $fids[$row['fid']] = 5; // 这里是第二处调用条数需要和前面的设置一样。
  16.         }
  17. }
  18. $limit_counts = 0;

  19. foreach ($fids as $k => $v){
  20.         $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 ";
  21. }
  22. if ($sql){
  23.         $sql = substr($sql,0,strlen($sql)-6);
  24. }
  25. $query = $db->query($sql);
  26. while ($row = $db->fetch_array($query)){
  27.         $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
  28.         $row['date']= gmdate("$dateformat", $row['dateline'] + $timeoffset * 3600);
  29.         if($row['highlight']) {
  30.                         $string = sprintf('%02d', $row['highlight']);
  31.                         $stylestr = sprintf('%03b', $string[0]);
  32.                         $row['highlight'] = 'style="';
  33.                         $row['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  34.                         $row['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  35.                         $row['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  36.                         $row['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  37.                         $row['highlight'] .= '"';
  38.         } else {
  39.                         $row['highlight'] = '';
  40.         }
  41.         ${'new_no'.$row['fid'].'_threadlist'}[] = $row;
  42. }
  43. //帖子调用结束
复制代码


-------------
3。將附件 圖片 listbg_li.gif 放到 images 目錄之下,即

./images/listbg_li.gif

4。更新緩存。(重要)

[ 本帖最后由 jillyz 于 2008-1-1 10:45 编辑 ]

本帖子中包含更多资源

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

x

评分

2

查看全部评分

ylovey_78 发表于 2007-11-13 23:28:06 | 显示全部楼层
不错,超级喜欢!!!!!!!!!!
回复

使用道具 举报

xujea1010 发表于 2007-11-13 23:56:41 | 显示全部楼层
不行,首页有错误,打不开.晕倒.
回复

使用道具 举报

eqmz 发表于 2007-11-14 00:08:04 | 显示全部楼层
回复

使用道具 举报

文文滴 发表于 2007-11-14 03:49:51 | 显示全部楼层
原帖由 xujea1010 于 2007-11-13 23:56 发表
不行,首页有错误,打不开.晕倒.

...............一样
回复

使用道具 举报

sycfifa 发表于 2007-11-14 04:01:57 | 显示全部楼层
就是`不对啊`郁闷死啊`错误啊
回复

使用道具 举报

xxghost 发表于 2007-11-14 07:33:32 | 显示全部楼层
不错
回复

使用道具 举报

孤心飘雨 发表于 2007-11-14 08:25:40 | 显示全部楼层
很不错,其实max最吸引我的地方就是这个功能!
回复

使用道具 举报

movo 发表于 2007-11-14 08:51:15 | 显示全部楼层
太性感了!~ 顶啊!!!
回复

使用道具 举报

dragon321 发表于 2007-11-14 09:38:30 | 显示全部楼层
真的很棒~~我也要來試試!!謝謝!!^^
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-10-5 15:33 , Processed in 0.443492 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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