广告广告
  加入我的最爱 设为首页 风格修改
首页 首尾
 手机版   订阅   地图  繁体 
您是第 12704 个阅读者
 
发表文章 发表投票 回覆文章
  可列印版   加为IE收藏   收藏主题   上一主题 | 下一主题   
netman 手机
个人文章 个人相簿 个人日记 个人地图
贴图大师奖
版主
级别: 版主 该用户目前不上站
版区: 好康分享, 新品贩售, 二手拍卖, 租屋&找屋, 工商建议区
推文 x115 鲜花 x613
分享: 转寄此文章 Facebook Plurk Twitter 版主评分 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片
推文 x1
[7.0][分享] 首页四格显示 for Discuz 7.0 [BIG5&UTF-8繁体]  (UTF8-繁)
【插件资讯】

插件名称:首页四格显示 for Discuz 7.0 [BIG5&UTF-8繁体]
适用版本:7.0
语言编码:UTF8-繁
插件作者:alan888
版权所属:alan888
原帖连结:http://www.alan888.com/Discuz/...-1-1.html###
支持网站:http://www.al....com

【插件说明】

首页四格显示 for Discuz 7.0 [BIG5&UTF-8繁体][20090201 20:35更新]

繁体版

作  者︰alan888
D7修改︰EricB
适用版本︰Discuz 7.0
修改地方︰index.php, logging.php, topicadmin.php, include/newthread.inc.php, include/newreply.inc.php, include/editpost.inc.php, include/counter.inc.php, include/cache.func.php, discuz 模板, 后台
加入文件︰foruminfo 模板 (附件 1 & 2)

免安装版只适合全新论坛。
本贴部份代码参考自http://www.alan888.com/Discuz/...p?tid=160050(tengho)

安装程序
1. 修改 include/cache.func.php (UTF-8版储存时请将编码改为UTF-8)
修改完成此文件后请即时到后台 -> 更新缓存




更换为

'medals'        => array('medals'),
'newtopic'      => array('newtopic'),
'newreply'      => array('newreply'),
'todaynewmems'        => array('todaynewmems'),
'todayvisit'    => array('todayvisit'),






再找


               case 'medals':
                        $table = 'medals';
                        $cols = 'medalid, name, image';
                        $conditions = "WHERE available='1'";
                        break;









在下面加上 (注意先填妥红字部份)
填上不需要显示帖子区域

由于使用快取档型式, 故某些私密区不能判断会员权限来显示发帖及回帖, 所以要先修改及取代下红字部份 "填上不需要显示帖子区域的 fid 编号, 以逗号作分格, 最后一个不用加上逗号" 部份, 例如希望不显示 fid 1,3,5 便填上 "$fids="1,3,5";"
如果希望全部显示者, 请将下两段的 NOT IN ($fids) (蓝色字显示部份)删除, 否则会出现数据错误的显示
QUOTE: 

            case 'newtopic':
                        $table = 'threads t, '.$tablepre.'forums f';
                        $cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
                        $fids="填上不需要显示发新帖区域的 fid 编号, 以逗号作分格, 最后一个不用加上逗号";//例如 "1,2,3";
                        $conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN ($fids) ORDER BY t.dateline DESC LIMIT 0, 11";
                        break;
                case 'newreply':
                        $table = 'threads t, '.$tablepre.'forums f';
                        $cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
                        $fids="填上不需要显示回帖区域的 fid 编号, 以逗号作分格, 最后一个不用加上逗号";//例如 "1,2,3";
                        $conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN ($fids) AND  t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 11";
                        break;
                case 'todaynewmems':
                        $table = 'members';
                        $cols = 'COUNT(*)';
                        $datecut = time() - (3600 * 24);
                        $conditions = "WHERE regdate>='$datecut'";
                        break;
                case 'todayvisit':
                        $table = 'members';
                        $cols = "COUNT(*)";
                        $datecut = time() - (3600 * 24);
                        $conditions = "WHERE lastactivity>='$datecut' ORDER BY lastvisit DESC";
                        break;



                case 'magics':
                        while($magic = $db->fetch_array($query)) {
                                $data[$magic['magicid']]['identifier'] = $magic['identifier'];
                                $data[$magic['magicid']]['available'] = $magic['available'];
                                $data[$magic['magicid']]['name'] = $magic['name'];
                                $data[$magic['magicid']]['description'] = $magic['description'];
                                $data[$magic['magicid']]['weight'] = $magic['weight'];
                                $data[$magic['magicid']]['price'] = $magic['price'];
                        }
                        break;


下面加上

                case 'newreply':
                        $hack_cut_str = 26;
                        $new_reply_threadlist = array();
                        $rthread = array();
                        $colorarray = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282');
                        while($rthread = $db->fetch_array($query)){
                                $rthread['forumname'] = $rthread['name'];
                                $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
                                $rthread['subject'] = cutstr($rthread['subject'],46);
                                $rthread['date']= gmdate('Y-n-j G:i', $rthread['dateline'] + 8 * 3600);
                                $rthread['lastreplytime']= gmdate('Y-n-j G:i', $rthread['lastpost'] + 8 * 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 = "<a href=\"redirect.php?tid=$rthread[tid]&goto=lastpost#lastpost\" title=\"论坛: $rthread[forumname]\r\n标题: $rthread[subject]\r\n作者: $rthread[author]\r\n发表时间: $rthread[date]\r\n浏览次数: $rthread[views] 次\r\n回覆: $rthread[replies] 次\r\n最后回覆: $rthread[lastreplytime]\r\n最后发表: $rthread[lastposter]\" $rthread[highlight]>$rthread[view_subject]</a><br />";
                                $data[] = array('content' => $new_reply_threadlist);
                        }
                        break;
                case 'newtopic':
                        $hack_cut_str = 26;
                        $new_post_threadlist = array();
                        $nthread = array();
                        $colorarray = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282');
                        while($nthread = $db->fetch_array($query)){
                                $nthread['forumname'] = $nthread['name'];
                                $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
                                $nthread['subject'] = cutstr($nthread['subject'],46);
                                $nthread['date']= gmdate('Y-n-j G:i', $nthread['dateline'] + 8 * 3600);
                                $nthread['lastreplytime']= gmdate('Y-n-j G:i', $nthread[lastpost] + 8 * 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 = "<a href=\"viewthread.php?tid=$nthread[tid]\" title=\"论坛: $nthread[forumname]\r\n标题: $nthread[subject]\r\n作者: $nthread[author]\r\n发表时间: $nthread[date]\r\n浏览次数: $nthread[views] 次 \r\n回覆: $nthread[replies] 次\r\n最后回覆: $nthread[lastreplytime]\r\n最后发表: $nthread[lastposter]\" $nthread[highlight] >$nthread[view_subject]</a><br />";
                                $data[] = array('content' => $new_post_threadlist);
                        }
                        break;


2. 修改 include/newthread.inc.php



showmessage('post_newthread_succeed', "viewthread.php?tid=$tid&extra=$extra"); 


在上面加上

require DISCUZ_ROOT.'./include/cache.func.php';
                updatecache('newtopic');


3. 修改 include/newreply.inc.php


[table=95.01%][tr][td]showmessage($replymessage, "viewthread.php?tid=$tid&pid=$pid&page=".(@ceil(($thread['special'] ? $thread['replies'] + 1 : $thread['replies'] + 2) / $ppp))."&extra=$extra#pid$pid"); [/td][/tr][/table]

在上面加上



4. 修改 include/editpost.inc.php
找到及删除







在下面加上






在下面加上






在下面加上



5. 修改 include/counter.inc.php




更换为

if (!$sessionexists || $discuz_uid) {
        if (ereg("MAXTHON ([a-z0-9.]+)", $visitor['agent'], $browser)) {
                $browser_ver = $browser[1];
                $visitor_browser = "Maxthon " . $browser_ver;
                $visitor['browser'] = 'Maxthon';
        } elseif (ereg("MSIE ([a-z0-9.]+)", $visitor['agent'], $browser)) {
                $browser_ver = $browser[1];
                $visitor_browser = "Internet Explorer " . $browser_ver;
                $visitor['browser'] = 'MSIE';
        } elseif (ereg("Firefox/([a-z0-9.]+)", $visitor['agent'], $browser)) {
                $browser_ver = $browser[1];
                $visitor_browser = "Mozilla Firefox " . $browser_ver;
                $visitor['browser'] = 'Mozilla';
        } elseif (ereg("Chrome/([a-z0-9.]+) Safari/", $visitor['agent'], $browser)) {
                $browser_ver = $browser[1];
                $visitor_browser = "Google Chrome " . $browser_ver;
                $visitor['browser'] = 'Chrome';
        } elseif (ereg("Version/([a-z0-9.]+)([a-zA-Z0-9/ ]*) Safari/", $visitor['agent'], $browser)) {
                $browser_ver = $browser[1];
                $visitor_browser = "Apple Safari " . $browser_ver;
                $visitor['browser'] = 'Safari';
        } elseif (strpos($visitor['agent'], "PSP")) {
                $visitor_browser = "PSP Browser";
                $visitor['browser'] = 'PSP Browser';
        } elseif (ereg("Opera/([a-z0-9.]+)", $visitor['agent'], $browser)) {
                $browser_ver = $browser[1];
                $visitor_browser = "Opera " . $browser_ver;
                $visitor['browser'] = 'Opera';
        } elseif (strpos($visitor['agent'], "Netscape")) {
                $visitor_browser = "Netscape";
                $visitor['browser'] = 'Netscape';
        } elseif (strpos($visitor['agent'], "Lynx")) {
                $visitor_browser = "Lynx";
                $visitor['browser'] = 'Lynx';
        } elseif (strpos($visitor['agent'], "Konqueror")) {
                $visitor_browser = "Konqueror";
                $visitor['browser'] = 'Konqueror';
        } elseif (strpos($visitor['agent'], "Mozilla/5.0")) {
                $visitor_browser = "Mozilla";
                $visitor['browser'] = 'Mozilla';
        } else {
                $visitor_browser = "其它";
                $visitor['browser'] = 'Other';
        }
        if (strpos($visitor['agent'], "NT 6.1")) {
                $visitor_os = "Windows 7";
                $visitor['os'] = 'Windows';
        } elseif (strpos($visitor['agent'], "NT 6.0")) {
                $visitor_os = "Windows Vista";
                $visitor['os'] = 'Windows';
        } elseif (strpos($visitor['agent'], "NT 5.1")) {
                $visitor_os = "Windows XP";
                $visitor['os'] = 'Windows';
        } elseif (strpos($visitor['agent'], "PSP")) {
                if (ereg("system=(.*)\)", $_SERVER["HTTP_X_PSP_BROWSER"], $os)) {
                        $visitor_os = "PSP $os[1]";
                        $visitor['os'] = "PSP $os[1]";
                }
        } elseif (strpos($visitor['agent'], "NT 5.2")) {
                $visitor_os = "Windows Server 2003";
                $visitor['os'] = 'Windows';
        } elseif (strpos($visitor['agent'], "NT 5")) {
                $visitor_os = "Windows 2000";
                $visitor['os'] = 'Windows';
        } elseif (strpos($visitor['agent'], "4.9")) {
                $visitor_os = "Windows ME";
                $visitor['os'] = 'Windows';
        } elseif (strpos($visitor['agent'], "NT 4")) {
                $visitor_os = "Windows NT 4.0";
                $visitor['os'] = 'Windows';
        } elseif (strpos($visitor['agent'], "98")) {
                $visitor_os = "Windows 98";
                $visitor['os'] = 'Windows';
        } elseif (strpos($visitor['agent'], "95")) {
                $visitor_os = "Windows 95";
                $visitor['os'] = 'Windows';
        } elseif (strpos($visitor['agent'], "Mac")) {
                $visitor_os = "Macintosh";
                $visitor['os'] = 'Macintosh';
        } elseif (strpos($visitor['agent'], "Linux")) {
                $visitor_os = "Linux";
                $visitor['os'] = 'Linux';
        } elseif (strpos($visitor['agent'], "Unix")) {
                $visitor_os = "Unix";
                $visitor['os'] = 'Other';
        } elseif (strpos($visitor['agent'], "FreeBSD")) {
                $visitor_os = "FreeBSD";
                $visitor['os'] = 'FreeBSD';
        } elseif (strpos($visitor['agent'], "SunOS")) {
                $visitor_os = "SunOS";
                $visitor['os'] = 'SunOS';
        } elseif (strpos($visitor['agent'], "OS/2")) {
                $visitor_os = "OS/2";
                $visitor['os'] = 'OS/2';
        } elseif (strpos($visitor['agent'], "AIX")) {
                $visitor_os = "AIX";
                $visitor['os'] = 'AIX';
        } elseif (preg_match("/(Bot|Crawl|Spider)/i", $visitor['agent'])) {
                $visitor_os = "Spiders";
                $visitor['os'] = 'Spiders';
        } else {
                $visitor_os = "其它";
                $visitor['os'] = 'Other';
        }



6. 修改 topicadmin.php



在下面加上







在上面加上



7. 修改 logging.php



在下面加上



8. 修改 index.php




在上面加上
版本1

//-----------hack AL8 Info
if(!$statstatus && $discuz_uid){
require_once DISCUZ_ROOT.'./include/counter.inc.php';
$unreadpmnum = $db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pms WHERE msgtoid='$discuz_uid' AND new=1");
}
require_once DISCUZ_ROOT.'./include/misc.func.php';
$mem_home = convertip($onlineip, $datadir = "./");
require_once DISCUZ_ROOT.'./forumdata/cache/cache_todayvisit.php';
$todayvisit = $_DCACHE['todayvisit']['0']['COUNT(*)'];
require_once DISCUZ_ROOT.'./forumdata/cache/cache_todaynewmems.php';
$todaynewmems = $_DCACHE['todaynewmems']['0']['COUNT(*)'];
@include './forumdata/cache/cache_newtopic.php';
@include './forumdata/cache/cache_newreply.php';
//-----------hack AL8 Info End



版本2


//-----------hack AL8 Info
if(!$statstatus && $discuz_uid){
require_once DISCUZ_ROOT.'./include/counter.inc.php';
$unreadpmnum = $db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pms WHERE msgtoid='$discuz_uid' AND new=1");
$member_avatar = $db->result_first("SELECT avatar FROM {$tablepre}memberfields WHERE uid='$discuz_uid'");
        if(!$member_avatar){
                $member_avatar = "images/avatars/noavatar.gif";
        } else {
                list($width, $height) = getimagesize($member_avatar);
                $avatar['width'] = 150;
                $avatar['height'] = $avatar['width'] * $width / $height;
        }
}
require_once DISCUZ_ROOT.'./include/misc.func.php';
$mem_home = convertip($onlineip, $datadir = "./");
require_once DISCUZ_ROOT.'./forumdata/cache/cache_todayvisit.php';
$todayvisit = $_DCACHE['todayvisit']['0']['COUNT(*)'];
require_once DISCUZ_ROOT.'./forumdata/cache/cache_todaynewmems.php';
$todaynewmems = $_DCACHE['todaynewmems']['0']['COUNT(*)'];
@include './forumdata/cache/cache_newtopic.php';
@include './forumdata/cache/cache_newreply.php';
//-----------hack AL8 Info End


9. 修改 register.php

在上面加上
8. 修改 discuz 模板

更换为
10. 进入后台
全局 >> 优化设置 >> 搜索引擎优化
在「其他头部信息」中加入
版本1

<style type="text/css">
<!--
#announce { border-top: 1px solid #888; line-height: 36px; height: 36px; overflow: hidden; }
#announce div { padding: 0 10px; line-height: 35px !important; height: 36px; overflow-y: hidden;}
#announce li { float: left; margin-right: 20px; padding-left: 10px; background: url('images/default/arrow_right.gif') no-repeat 0 50%; white-space: nowrap; }
#announce li em { font-size: 0.83em; margin-left: 5px; color: {TEXT}; }
.listinfo p {line-height: 1.5em; }
.listinfo a { color: {TEXT}; }
.listinfo th { border-top: 1px solid #888; vertical-align: top; color:{TEXT}; text-align: left; padding: 5px; }
.listinfo cite { font: 1em Lucia Console; font-weight: bold; }
.listinfo strong { font-weight: bold; }
.listinfo th.rborder { border-right: 1px solid {CATBORDER}; }
button.submitmini { margin-left: 0.5em; padding: 0 2px; }
#loginstatus { font-weight: normal; }
span.bold { font-weight: bold; }
//-->
</style>


版本2

<style type="text/css">
<!--
#announce { border-top: 1px solid #888; line-height: 36px; height: 36px; overflow: hidden; }
#announce div { padding: 0 10px; line-height: 35px !important; height: 36px; overflow-y: hidden;}
#announce li { float: left; margin-right: 20px; padding-left: 10px; background: url('images/default/arrow_right.gif') no-repeat 0 50%; white-space: nowrap; }
#announce li em { font-size: 0.83em; margin-left: 5px; color: {TEXT}; }
.listinfo p {line-height: 1.5em; }
.listinfo a { color: {TEXT}; }
.listinfo th { border-top: 1px solid #888; vertical-align: top; color:{TEXT}; text-align: left; padding: 5px; }
.listinfo cite { font: 1em Lucia Console; font-weight: bold; }
.listinfo strong { font-weight: bold; }
.listinfo th.rborder { border-right: 1px solid {CATBORDER}; }
button.submitmini { margin-left: 0.5em; padding: 0 2px; }
#loginstatus { font-weight: normal; }
span.bold { font-weight: bold; }
#info p {
        padding: 0px 0px 0px 12px;
        background: url('images/common/dot_list.gif')  no-repeat 0px 2px;
}
#info p[style] {
        padding: 0px;
        background: none;
}
#newtopic a, #newreply a {
        padding: 0px 0px 0px 14px;
}
#newtopic a {
        background: url('images/common/dot_1.gif')  no-repeat 0px 2px;
}
#newreply a {
        background: url('images/common/dot_2.gif')  no-repeat 0px 2px;
}
//-->
</style>


12. 下载附件 foruminfo.htm, 并执行
a. 根据自身讨论区对下一段作出调整
CODE:来自 $mem_home 的访客, 现{lang register}成为会员即获赠现金 100 点, 用作参予本讨论区的活动之用。
b. 上载至 templates/default 目录下
c. 如果修改时漏了 "更新缓存"步骤, 可把 forumdata/cache 目录下的档案删掉便可

~完成~


本帖包含附件
zip images.rar   (2022-06-09 14:12 / 10 KB)  
说明: 版本2图片
下载次数:11
zip [仿]AL8首页四格 by EricB (BIG5).rar   (2022-06-09 14:12 / 69 KB)  
说明: 免安装版
下载次数:7
zip 首页四格 by EricB (UTF-8).rar   (2022-06-09 14:12 / 78 KB)  
说明: 免安装版
下载次数:33
zip 首页四格 by EricB (BIG5).rar   (2022-06-09 14:12 / 79 KB)  
说明: 免安装版
下载次数:4
zip [仿]AL8首页四格 by EricB (UTF-8).rar   (2022-06-09 14:12 / 69 KB)  
说明: 免安装版
下载次数:23
zip 首页四格 by EricB (BIG5).rar   (2022-06-09 14:12 / 79 KB)  
说明: 首页四格 by EricB (BIG5)
下载次数:16
zip 版本1 (UTF-8版).rar   (2022-06-09 14:12 / 3 KB)  
说明: 版本1 (UTF-8版)
下载次数:7
zip 版本2 (BIG5版).rar   (2022-06-09 14:12 / 3 KB)  
说明: 版本2 (BIG5版)
下载次数:5
zip 版本2 (UTF-8版).rar   (2022-06-09 14:12 / 3 KB)  
说明: 版本2 (UTF-8版)
下载次数:14


[ 此文章被netman在2009-09-01 11:51重新编辑 ]

此文章被评分,最近评分记录
财富:100 (by aa) | 理由: 感谢分享..^^



献花 x1 回到顶端 [楼 主] From:台湾新世纪资通股份有限公司 | Posted:2009-09-01 11:27 |

首页  发表文章 发表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.031110 second(s),query:15 Gzip disabled
本站由 瀛睿律师事务所 担任常年法律顾问 | 免责声明 | 本网站已依台湾网站内容分级规定处理 | 连络我们 | 访客留言