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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[修改] 免费下载---首页六格(图+最新主题+最新回复+本周热门+随即精华+24小时发帖排名)

[复制链接]
yongwa2 发表于 2008-10-20 18:16:46 | 显示全部楼层 |阅读模式
插件发布
插件名称: 首页六格(图+最新主题+最新回复+本周热门+随即精华+24小时发帖排名)
插件来源:
适用版本: Discuz! 6.1
语言编码: GBK简体 
最后更新时间:
插件作者: 此插件原作者为xuon
插件简介: 首页六格(图+最新主题+最新回复+本周热门+随即精华+24小时发帖排名)
本帖最后由 yongwa2 于 2008-10-25 21:56 编辑

Discuz!6.1.0 首页六格 演示网站:http://94fad.cn (可以友情链接一下嘛!)
效果

[localimg=180,59]1[/localimg]
数据库升级:无

修改模板:1个

修改PHP:1个

加入文件: 两个图片一个FLASH(附件2&1)

修改文件:
         index.php
         templates/你使用模板目录下/discuz.htm


详细安装步骤:

第一步:上传相关文件:

包含文件:

pic.php         请上传至论坛根目录
images文件夹    请将目录下的三个文件(两个图片一个FLASH)上传至论坛images目录下

第二步:修改index.php(修改前请先做好备份,以防万一)

查找
$rsshead = $rssstatus

在其上加入如下代码:
复制内容到剪贴板
代码:
//----首页六格代码开始
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
//新贴
$hack_cut_str = 100; //标题字数
$hack_cut_strauthor = 9;
$new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.dateline DESC LIMIT 0, 10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = ereg_replace('<[^>]*>','',$nthread['name']);
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $new_post_threadlist[] = $nthread;
}

//新回复
$hack_cut_str = 100; //标题字数
$hack_cut_strauthor = 9;
$new_reply_threadlist = array();
$rthread = array();
$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 f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.lastpost DESC LIMIT 0, 10");
while($rthread = $db->fetch_array($query)) {
        $rthread['forumname'] = ereg_replace('<[^>]*>','',$rthread['name']);
        $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
        $rthread['view_lastposter'] = cutstr($rthread['lastposter'],$hack_cut_strauthor);
                $rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
        $rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread[lastpost] + ($timeoffset * 3600));
        if($rthread['highlight']) {
                $string = sprintf('%02d', $rthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $rthread['highlight'] = 'style="';
                $rthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $rthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $rthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $rthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $rthread['highlight'] .= '"';
        } else {
                $rthread['highlight'] = '';
        }
        $new_reply_threadlist[] = $rthread;
}

//热帖
$hack_cut_str = 100; //标题字数
$hack_cut_strauthor = 9;
$new_hot_threadlist = array();
$mthread = array();
$ctime=$timestamp-3600*24*7;//最后7是天数为本周  
$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>$ctime AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.replies DESC LIMIT 0, 10");
while($mthread = $db->fetch_array($query)) {
        $mthread['forumname'] = ereg_replace('<[^>]*>','',$mthread['name']);
        $mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
        $mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
                $mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
        $mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread[lastpost] + ($timeoffset * 3600));
        if($mthread['highlight']) {
                $string = sprintf('%02d', $mthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $mthread['highlight'] = 'style="';
                $mthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $mthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $mthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $mthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $mthread['highlight'] .= '"';
        } else {
                $mthread['highlight'] = '';
        }
        $new_hot_threadlist[] = $mthread;
}

//精华帖
$hack_cut_str = 100; //标题字数
$hack_cut_strauthor = 9;
$new_digest_threadlist = array();
$dthread = array();
$dtime=$timestamp-3600*24*30;//最后30是天数为本月  
$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>$dtime AND t.digest in (1,2,3) AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.replies DESC LIMIT 0, 10");
while($dthread = $db->fetch_array($query)) {
        $dthread['forumname'] = ereg_replace('<[^>]*>','',$dthread['name']);
        $dthread['view_subject'] = cutstr($dthread['subject'],$hack_cut_str);
        $dthread['view_lastposter'] = cutstr($dthread['lastposter'],$hack_cut_strauthor);
                $dthread['date']= gmdate("$dateformat $timeformat", $dthread['dateline'] + $timeoffset * 3600);
        $dthread['lastreplytime']= gmdate("$dateformat $timeformat", $dthread[lastpost] + ($timeoffset * 3600));
        if($dthread['highlight']) {
                $string = sprintf('%02d', $dthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $dthread['highlight'] = 'style="';
                $dthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $dthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $dthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $dthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $dthread['highlight'] .= '"';
        } else {
                $dthread['highlight'] = '';
        }
        $new_digest_threadlist[] = $dthread;
}

//发帖排行
$today = array();
$query = $db->query("SELECT uid, username, posts FROM {$tablepre}members ORDER BY posts DESC LIMIT 10");
while($variable = $db->fetch_array($query)) {
        $today[] = array('uid'=>$variable['uid'], 'username'=>$variable['username'], 'posts'=>$variable[posts]);
}
//----首页六格代码结束
第三步:修改templates/你使用模板目录下/discuz.htm文件:

找到:
<div id="ad_text"></div>

再其下加入如下代码:
{template foruminfo}
更新缓存!恭喜你,安装成功!
discuz技术交流!!~

http://94fad.cn/forum-70-1.html

jekinok 发表于 2008-10-24 15:32:10 | 显示全部楼层
需要啊@@@@
回复

使用道具 举报

淮安人论坛 发表于 2008-10-24 17:20:00 | 显示全部楼层
楼主打个包 多好啊
回复

使用道具 举报

thesea 发表于 2008-10-25 00:22:23 | 显示全部楼层
谢谢楼主
回复

使用道具 举报

thesea 发表于 2008-10-25 00:26:11 | 显示全部楼层
楼主没有发布pic.php哦
回复

使用道具 举报

yjt141 发表于 2008-10-25 08:56:33 | 显示全部楼层
文件都没下载的地方
回复

使用道具 举报

 楼主| yongwa2 发表于 2008-10-25 21:56:32 | 显示全部楼层
附件已补上!!!~
回复

使用道具 举报

 楼主| yongwa2 发表于 2008-10-26 16:54:16 | 显示全部楼层
回复

使用道具 举报

啸月天狼 发表于 2008-10-26 17:04:48 | 显示全部楼层
不错的说!
回复

使用道具 举报

kduleo 发表于 2008-10-26 23:58:27 | 显示全部楼层
谢谢楼主......
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-18 22:31 , Processed in 0.133059 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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