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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[参赛作品] 首页直排美化For DZ 7.1

[复制链接]
bnzzy 发表于 2009-10-21 16:57:35 | 显示全部楼层 |阅读模式
插件发布
插件名称: 首页直排美化For DZ 7.1
插件来源:
适用版本: Discuz! 7.1
语言编码: GBK简体 
最后更新时间:
插件作者: 不详
插件简介: 首页直排美化
本帖最后由 bnzzy 于 2009-10-27 19:06 编辑

应大家的强烈要求,本插件免费提供

首页直排美化For DZ 7.1
演示网站:www.bnzzy.net
作者:不详


========================================================================
安装步骤如下:

-------------------------------------------------------------------------
一、修改include/index_classics.inc.php

    找到$newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
    下面添加:

//帖子调用开始
$hack_cut_str =60; // 这里修改标题长度
$fids = array();
if (file_exists("./forumdata/cache/cache_forums.php")){
        require_once "./forumdata/cache/cache_forums.php";
        if (is_array($_DCACHE['forums'])){
               foreach ($_DCACHE['forums'] as $k => $v){
                        if (!strstr(',sub,forum,',','.$v['type'].',')) continue;
                        $fids[$k] = 5; // 这里是第一处调用条数需要和后面的设置一样。
                }
        }
}
if (count($fids) < 1){
        $query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' OR type='sub'");
        while ($row = $db->fetch_array($query)){
                $fids[$row['fid']] = 5; // 这里是第二处调用条数需要和前面的设置一样。
        }
}
$limit_counts = 0;
foreach ($fids as $k => $v){
        $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 ";
}
if ($sql){
        $sql = substr($sql,0,strlen($sql)-6);
}
$query = $db->query($sql);
while ($row = $db->fetch_array($query)){
        $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
        $row['date']= gmdate("$dateformat", $row['dateline'] + $timeoffset * 3600);
        if($row['highlight']) {
                        $string = sprintf('%02d', $row['highlight']);
                        $stylestr = sprintf('%03b', $string[0]);
                        $row['highlight'] = 'style="';
                        $row['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                        $row['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                        $row['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                        $row['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                        $row['highlight'] .= '"';
        } else {
                        $row['highlight'] = '';
        }
        ${'new_no'.$row['fid'].'_threadlist'}[] = $row;
}
//帖子调用结束

-------------------------------------------------------------------------
二、修改templates/default/css_common.htm

    找到:
.list th { background: url({IMGDIR}/forum.gif) 5px 10px no-repeat; padding-left: 45px !important; }

    修改为:
.list th { background: url({IMGDIR}/forum.gif) 3px 17px no-repeat; padding-left: 15px !important; }
-------------------------------------------------------------------------
三、修改 templates/default/discuz.htm

    找到:
<tbody id="forum$forum[fid]">

    至  

$cat['endrows']


全部内容替换为:
<tbody id="forum$forum[fid]">
<tr>
<td>
$forum[icon]
<div class="left">
<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>
<!--{if $forum[description]}--><p>$forum[description]</p><!--{/if}-->
<!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}-->
</div>
</td>
<th class="forumlast"{$forum[folder]}>
<!--{if $forum['permission'] == 1}-->
{lang private_forum}
<!--{else}-->
<!--{if $forum['redirect']}-->
<a href="forumdisplay.php?fid=$forum[fid]">{lang url_link}</a>
<!--{elseif is_array($forum['lastpost'])}-->
<p> <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">{echo cutstr($forum[lastpost][subject], 26)}</a></p>
<cite><!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--> - $forum[lastpost][dateline]</cite>
<!--{else}-->
{lang never}
<p>{lang never}</p>
<!--{/if}-->
<!--{/if}-->
</td>
</tr>
</tbody>
<!--{/loop}-->
<!--{else}-->
<tr class="narrowlist">
<!--{loop $cat['forums'] $forumid}-->
<!--{eval $forum=$forumlist[$forumid];}-->
<!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
</tr></tbody>
<!--{if $forum['orderid'] < $cat['forumscount']}-->
<tbody><tr>
<!--{/if}-->
<!--{/if}-->
<td width="$cat[forumcolwidth]" style="vertical-align: top; background-image: none; padding:8px !important;">
<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}-->
<!--{if $forum[todayposts]}-->
<!--{else}-->
<!--{/if}--></div></div>
$forum[icon]
<!--{if $forum[description]}--><div style="width:100%; ">$forum[description]</div><!--{/if}-->
<!--{if $forum['subforums']}--><div style="width:100%; ">{lang forum_subforums}: $forum['subforums']</div><!--{/if}-->
<!--{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>
<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; ">
<!--{loop ${"new_no".$forum[fid]."_threadlist"} $row}-->
<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>
<!--{/loop}-->
</ul>
</td>
<!--{/loop}-->
$cat['endrows']
-------------------------------------------------------------------------
四、修改 templates/default/forumdisplay_subforum.htm

    找到:
<!--{if !$forum['forumcolumns']}-->

    至  

<!--{loop $sublist $sub}-->

全部内容替换为
<!--{if !$forum['forumcolumns']}-->
<!--{loop $sublist $sub}-->
<tbody>
<tr>
<td>
$sub[icon]
<div class="left">
<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>
<!--{if $sub[description]}--><p>版块介绍: $sub[description]</p><!--{/if}-->
<!--{if $sub['subforums']}--><p>{lang forum_subforums}: $sub['subforums']</p><!--{/if}-->
</div>
</td>
<th class="forumlast"{$forum[folder]}>
<!--{if $sub['permission'] == 1}-->
{lang private_forum}
<!--{else}-->
<!--{if $sub['redirect']}-->
<a href="forumdisplay.php?fid=$sub[fid]">{lang url_link}</a>
<!--{elseif is_array($sub['lastpost'])}-->
<p>最新主题: <a href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost">{echo cutstr($sub[lastpost][subject], 20)}</a></p>
<cite><!--{if $sub['lastpost']['author']}-->作者相关: $sub['lastpost']['author']<!--{else}-->作者相关: {lang anonymous}<!--{/if}--> - $sub[lastpost][dateline]</cite>
<!--{else}-->
最新主题: {lang never}
<p>作者相关: {lang never}</p>
<!--{/if}-->
<!--{/if}-->
</td>
</tr>
</tbody>
<!--{/loop}-->
<!--{else}-->
<tr class="narrowlist">
<!--{loop $sublist $sub}-->

-------------------------------------------------------------------------
最后将images文件夹上传至根目录覆盖源文件。

下载地址:

本帖子中包含更多资源

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

x
古龙逸飞 发表于 2009-10-21 17:38:58 | 显示全部楼层
没钱花了,对吧!
回复

使用道具 举报

billgaijiao 发表于 2009-10-21 22:58:31 | 显示全部楼层
jue dui shi a!
回复

使用道具 举报

smellc520 发表于 2009-10-22 02:12:24 | 显示全部楼层
雖然不能下載
都是支持你吧=.=
回复

使用道具 举报

makeyjx 发表于 2009-10-22 10:12:25 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

chujoy 发表于 2009-10-22 19:42:23 | 显示全部楼层
不错不错啊
回复

使用道具 举报

cg865 发表于 2009-10-22 23:32:25 | 显示全部楼层
要钱啊.....
回个贴看看我有多少钱先
回复

使用道具 举报

bogee 发表于 2009-10-23 13:09:06 | 显示全部楼层
要钱啊.....
回个贴看看我有多少钱先
回复

使用道具 举报

chen758521 发表于 2009-10-23 16:55:05 | 显示全部楼层
回复

使用道具 举报

perku 发表于 2009-10-23 18:34:37 | 显示全部楼层
钱啊,钱啊,你这杀人不见血的刀。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-1 06:27 , Processed in 0.137684 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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