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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[精品] ★7.1首页横排美化 CCCY!长春车友 完美版【标题加长】

  [复制链接]
xianbo0212 发表于 2009-10-19 15:40:13 | 显示全部楼层 |阅读模式
Discuz!模板
适用版本: Discuz! 7.1
语言编码: GBK简体 
风格转换者: 仿制
本帖最后由 xianbo0212 于 2009-10-30 13:41 编辑

★7.1首页横排美化 CCCY!长春车友 完美版【标题加长】

还是老规矩 先看图



再看演示  www.cccy.net.cn

★★7.1最新第三版风格 CCCY!长春车友发布★  https://discuz.dismall.com/thread-1464860-1-1.html


然后修改下面几个文件即可:

★★★★★★★★★★★★★★★★★★★★★★★★★
修改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}-->


最后将此文件上传覆盖根目录

免费的,给回个帖

本帖子中包含更多资源

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

x

评分

1

查看全部评分

wermnb 发表于 2009-10-19 15:41:25 | 显示全部楼层
喜欢西 稀罕~~~
回复

使用道具 举报

kkj688 发表于 2009-10-19 15:51:56 | 显示全部楼层
就是要找这个!!支持!~~~~~
回复

使用道具 举报

maikongjian14a 发表于 2009-10-19 16:13:49 | 显示全部楼层
呵呵 友情支持了哟
回复

使用道具 举报

lonyi.com 发表于 2009-10-19 16:14:01 | 显示全部楼层
喜欢,顶你一个
回复

使用道具 举报

wuxinxinggg 发表于 2009-10-19 16:33:25 | 显示全部楼层
挺不错的……帮楼主顶起……希望能有更好的东西跟我们分享
回复

使用道具 举报

lonyi.com 发表于 2009-10-19 16:45:33 | 显示全部楼层
本帖最后由 lonyi.com 于 2009-10-19 16:47 编辑

用起了,看我的演示www.56023.cn
回复

使用道具 举报

underpinsky 发表于 2009-10-19 17:26:29 | 显示全部楼层
能给我发一份完整的吗,先谢谢了,邮箱:underpinsky@163.com
回复

使用道具 举报

wbpp58 发表于 2009-10-19 18:03:46 | 显示全部楼层
好~~~~~~~漂亮的网站模板啊。
楼主把模板如果放出来
回复

使用道具 举报

bingo2008 发表于 2009-10-19 18:09:45 | 显示全部楼层
楼主,把模板发出来吧。。。。好喜欢
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-27 23:34 , Processed in 0.186553 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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