woff 發表於 2008-5-19 00:45:27

【超級美化】AL8 首頁六格顯示 for Discuz 6.0.0(正式版)

插件名稱:【超級美化】AL8 首頁六格顯示 for Discuz 6.0.0
適合版本:Discuz 6.0.0
原作者: alan888
出處:http://www.alan888.com/Discuz/vi ... 7&highlight=al8
DZ 5.0補增益版:By djkevin (在AL8首頁4格的個人資料加入個人圖像 For 5.0)
DZ 5.5修改整理:By 范倫鐵諾(修正5.5與5.0不同處並整理)
DZ 5.5超級美化:By 范倫鐵諾(2007.04.02完成)
DZ 6.0修改美化:By 范倫鐵諾(2007.09.30完成)
演示:http://www.k-song.com/index.php
數據庫升級:無
修改模板:1個
修改PHP:8個
加入文件: foruminfo.htm 及圖片(附件1&2)
修改文件:
/index.php
/logging.php
/topicadmin.php
/register.php
/include/newthread.inc.php
/include/newreply.inc.php
/include/counter.inc.php
/include/cache.func.php
/templates/default/discuz.htm

解說:

因為6.0的改動有滿多地方的,所以自身並未急著於第一時間在

官方釋出DZ 6.0正式版時同時間進行升級,直到近日有需多站

長友人詢問DZ 6.0的手動方式修正,加上研究6.0有一段時間後,

這才開始修改,這次與5.5版的修正方式並無太大差異,除了細部

較不同的字串外,對模板也稍微進行了美化(增加部份圖及格線調整)

,最後,也是一樣的原因,這是由AL8衍生的六格,短期內只會分享

在AL8,希望各位會喜歡這插件。題外話一下,目前正整合更新的首頁

N格,會做更大幅度的修正,預計10月底釋出,有相關建議的歡迎指教

提出。

                         By【K歌黨】系統顧問暨管理顧問@范倫鐵諾

注意:

『1』此版安裝程繁雜,安裝前請記得備份,初學者需再詳細確認步驟。

『2』修正之前熱門精華無法自動更新問題。

『3』盼站長注意各論壇編碼,勿單純以筆記本做編碼存檔動作,修正過的請善用ConvertZ軟體轉碼後再上傳。

『4』此版本小弟自我測試無錯誤,若有因為過程上造成使用者的問題或其它損害,小弟並不負責任何責任

『5』歡迎指教。

說明:

1. 修改 include/cache.func.php
修改完成此文件後請即時到後台→更新緩存
找'medals'      => array('medals'),更換為'medals'      => array('medals'),
                'newtopic'      => array('newtopic'),
                'newreply'      => array('newreply'),
                'topdigest'   => array('topdigest'),再找case 'medals':
                        $table = 'medals';
                        $cols = 'medalid, name, image';
                        $c;
                        break;在下面加上 (注意填妥"填上不需要顯示回帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號")
填上不需要顯示帖子區域
由於使用快取檔型式, 故某些私密區不能判斷會員權限來顯示發帖及回帖, 所以要先修改及取代下紅字部份 "填上不需要顯示帖子區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號" 部份, 例如希望不顯示 fid 1,3,5 便填上 "$fids="1,3,5";"
如果希望全部顯示者, 請將下面三段的 NOT IN ($fids) (藍色字顯示部份)刪除, 否則會出現數據錯誤的顯示                case newtopic:
                        $table = 'threads t';
                        $cols = "t.tid, t.typeid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name, tt.name AS idname";
                        $fids="填上不需要顯示回帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";
                        $c;
                        break;

                case newreply:
                        $table = 'threads t';
                        $cols = "t.tid, t.typeid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name, tt.name AS idname";
                        $fids="填上不需要顯示回帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";
                        $c;
                        break;

                case topdigest:
                        $table = 'threads t';
                        $cols = "t.tid, t.typeid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name, tt.name AS idname";
                        $fids="填上不需要顯示回帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";
                        $c;
                        break;

               case todayvisit:
                        $table = 'members';
                        $cols = "COUNT(*)";
                        $datecut = time() - (3600 * 24);
                        $c;
                        break;找$GLOBALS['totalmembers'] = $data['totalmembers'] = $db->result($query, 0);在下面加上                        $datecut = time() - (3600 * 24);
                        $query = $db->query("SELECT COUNT(*) FROM {$tablepre}members WHERE regdate>='$datecut'");
                        $GLOBALS['todaynewmems'] = $data['todaynewmems'] = $db->result($query, 0);找case 'forumlinks':
                        global $forumlinkstatus;上面加上                case 'newreply':
                $hack_cut_str = 36;
                $new_reply_threadlist = array();
                $rthread = array();
                $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
                while($rthread = $db->fetch_array($query)){
                $rthread['forumname'] = $rthread['name'];
                $rthread['view_subject'] = $rthread ? cutstr( "$rthread $rthread",$hack_cut_str) : 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);
                $rthread['highlight'] = 'style="';
                $rthread['highlight'] .= $stylestr ? 'font-weight: bold;' : '';
                $rthread['highlight'] .= $stylestr ? 'font-style: italic;' : '';
                $rthread['highlight'] .= $stylestr ? 'text-decoration: underline;' : '';
                $rthread['highlight'] .= $string ? 'color: '.$colorarray[$string] : '';
                $rthread['highlight'] .= '"';
                } else {
                $rthread['highlight'] = '';
                }
                $new_reply_threadlist = "<a href=\"redirect.php?tid=$rthread&goto=lastpost#lastpost\" title=\"論壇rthread\r\n標題rthread\r\n作者rthread\r\n發表時間rthread\r\n瀏覽次數rthread 次\r\n回覆rthread 次\r\n最後回覆rthread\r\n最後發表rthread\" $rthread>$rthread</a>

";
                $data[] = array('content' => $new_reply_threadlist);
                        }
                break;
                case 'newtopic':
                $hack_cut_str = 36;
                $new_post_threadlist = array();
                $nthread = array();
                $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
                while($nthread = $db->fetch_array($query)){
                $nthread['forumname'] = $nthread['name'];
                $nthread['view_subject'] = $nthread ? cutstr( "$nthread $nthread",$hack_cut_str) : 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 + 8 * 3600);
                if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string ? 'color: '.$colorarray[$string] : '';
                $nthread['highlight'] .= '"';
                } else {
                $nthread['highlight'] = '';
                }
      $new_post_threadlist = $nthread ? "<a href=\"redirect.php?tid=$nthread&goto=lastpost#lastpost\" title=\"論壇nthread\r\n標題nthread\r\n作者nthread\r\n發表時間nthread\r\n瀏覽次數nthread 次 \r\n回覆nthread 次\r\n最後回覆nthread\r\n最後發表nthread\" $nthread >$nthread</a>

" : "<a href=\"redirect.php?tid=$nthread&goto=lastpost#lastpost\" title=\"論壇nthread\r\n標題nthread\r\n作者nthread\r\n發表時間nthread\r\n瀏覽次數nthread 次\r\n回覆: 暫時沒有回覆\" $nthread >$nthread</a>

";
                $data[] = array('content' => $new_post_threadlist);
                        }
                break;
case 'topdigest':
                $hack_cut_str = 75;
                $top_digest_threadlist = array();
                $rthread = array();
                $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
                while($rthread = $db->fetch_array($query)){
                $rthread['forumname'] = $rthread['name'];
                $rthread['view_subject'] = $rthread ? cutstr( "$rthread $rthread",$hack_cut_str) : 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);
                $rthread['highlight'] = 'style="';
                $rthread['highlight'] .= $stylestr ? 'font-weight: bold;' : '';
                $rthread['highlight'] .= $stylestr ? 'font-style: italic;' : '';
                $rthread['highlight'] .= $stylestr ? 'text-decoration: underline;' : '';
                $rthread['highlight'] .= $string ? 'color: '.$colorarray[$string] : '';
                $rthread['highlight'] .= '"';
                } else {
                $rthread['highlight'] = '';
                }
                $top_digest_threadlist = "<a href=\"redirect.php?tid=$rthread&goto=lastpost#lastpost\" title=\"論壇rthread\r\n標題rthread\r\n作者rthread\r\n發表時間rthread\r\n瀏覽次數rthread 次\r\n回覆rthread 次\r\n最後回覆rthread\r\n最後發表rthread\" $rthread>$rthread</a>

";
                $data[] = array('content' => $top_digest_threadlist);
                        }
                break;2. 修改 include/newthread.inc.php
找showmessage('post_newthread_succeed', "viewthread.php?tid=$tid&extra=$extra".(!empty($frombbs) ? "&frombbs=$frombbs" : ''));在上面加上require DISCUZ_ROOT.'./include/cache.func.php';
      updatecache('newtopic');3. 修改 include/newreply.inc.php
找showmessage($replymessage, "viewthread.php?tid=$tid&pid=$pid&page=".(@ceil(($thread['special'] ? $thread['replies'] + 1 thread['replies'] + 2) / $ppp))."&extra=$extra#pid$pid");在上面加上require DISCUZ_ROOT.'./include/cache.func.php';
updatecache(array('newreply', 'newtopic'));4. 修改 include/counter.inc.php
找if(!$sessionexists) {
      if(strpos($visitor['agent'], 'Netscape')) {
                $visitor['browser'] = 'Netscape';
      } elseif(strpos($visitor['agent'], 'Lynx')) {
                $visitor['browser'] = 'Lynx';
      } elseif(strpos($visitor['agent'], 'Opera')) {
                $visitor['browser'] = 'Opera';
      } elseif(strpos($visitor['agent'], 'Konqueror')) {
                $visitor['browser'] = 'Konqueror';
      } elseif(strpos($visitor['agent'], 'MSIE')) {
                $visitor['browser'] = 'MSIE';
      } elseif(substr($visitor['agent'], 0, 7) == 'Mozilla') {
                $visitor['browser'] = 'Mozilla';
      } else {
                $visitor['browser'] = 'Other';
      }

      if(strpos($visitor['agent'], 'Win')) {
                $visitor['os'] = 'Windows';
      } elseif(strpos($visitor['agent'], 'Mac')) {
                $visitor['os'] = 'Mac';
      } elseif(strpos($visitor['agent'], 'Linux')) {
                $visitor['os'] = 'Linux';
      } elseif(strpos($visitor['agent'], 'FreeBSD')) {
                $visitor['os'] = 'FreeBSD';
      } elseif(strpos($visitor['agent'], 'SunOS')) {
                $visitor['os'] = 'SunOS';
      } elseif(strpos($visitor['agent'], 'OS/2')) {
                $visitor['os'] = 'OS/2';
      } elseif(strpos($visitor['agent'], 'AIX')) {
                $visitor['os'] = 'AIX';
      } elseif(preg_match("/(Bot|Crawl|Spider)/i", $visitor['agent'])) {
                $visitor['os'] = 'Spiders';
      } else {
                $visitor['os'] = 'Other';更換為if(!$sessionexists || $discuz_uid) {
if(strpos($visitor['agent'], "MSIE 7.0")) {
                $visitor_browser = "Internet Explorer 7.0";
                $visitor['browser'] = 'MSIE';
      } elseif(strpos($visitor['agent'], "MSIE 6.0")) {
                $visitor_browser = "Internet Explorer 6.0";
                $visitor['browser'] = 'MSIE';
      } elseif(strpos($visitor['agent'], "MSIE 5.5")) {
                $visitor_browser = "Internet Explorer 5.5";
                $visitor['browser'] = 'MSIE';
      } elseif(strpos($visitor['agent'], "MSIE 5.0")) {
                $visitor_browser = "Internet Explorer 5.0";
                $visitor['browser'] = 'MSIE';
      } elseif(strpos($visitor['agent'], "MSIE 4.01")) {
                $visitor_browser = "Internet Explorer 4.01";
                $visitor['browser'] = 'MSIE';
      } 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'], "Opera")) {
                $visitor_browser = "Opera";
                $visitor['browser'] = 'Opera';
      } elseif(strpos($visitor['agent'], "Konqueror")) {
                $visitor_browser = "Konqueror";
                $visitor['browser'] = 'Konqueror';
      } elseif(strpos($visitor['agent'], "Firefox")) {
                $visitor_browser = "Firefox";
                $visitor['browser'] = 'Mozilla';
      } elseif(strpos($visitor['agent'], "Mozilla/5.0")) {
                $visitor_browser = "Mozilla";
                $visitor['browser'] = 'Mozilla';
      } else {
                $visitor_browser = "其它";
                $visitor['browser'] = 'Other';
      }
      if(strpos($visitor['agent'], "NT 5.1")) {
      if(strpos($visitor['agent'], "SV1")){
                $visitor_os = "Windows XP SP2";
                $visitor['os'] = 'Windows';
      }else{
                $visitor_os = "Windows XP";
                $visitor['os'] = 'Windows';
      }
      }elseif(strpos($visitor['agent'], "NT 6.0")) {
                $visitor_os = "Win Vista";
                $visitor['os'] = 'Windows';
      }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 = "Mac";
                $visitor['os'] = 'Mac';
      } 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';
      }5. 修改 topicadmin.php
找 (第一段約第 15 行那句)require_once DISCUZ_ROOT.'./include/misc.func.php';在下面加上require_once DISCUZ_ROOT.'./include/cache.func.php';找showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'), $resultarray['redirect']);在上面加上 updatecache(array('newreply', 'newtopic', 'topdigest'));6. 修改 logging.php
找$sessionexists = 0;在下面加上require_once DISCUZ_ROOT.'./include/cache.func.php';
                              updatecache('todayvisit');7. 修改 index.php
找$rsshead = $rssstatus ? ('<link rel="alternate" type="application/rss+xml" title="'.$bbname.'" href="'.$boardurl.'rss.php?auth='.$rssauth."\" />\n") : '';下方加入//------------圖像 by keven
      $member_query = $db->query("SELECT * FROM {$tablepre}members m, {$tablepre}memberfields mf
                WHERE m.uid='$discuz_uid' AND mf.uid='$discuz_uid'");
      $member = $db->fetch_array($member_query);
      $member['lastvisit'] = gmdate("$dateformat $timeformat", $member['lastvisit'] + ($timeoffset * 3600));
      $member['usernameenc'] = rawurlencode($member['username']);
      $allowfriendcheck = array($member['allowfriend'] => 'checked');
      $avatypecheck = array($member['avatype'] => 'checked');
if(!$member){
      $member="images/avatars/noavatar.gif";
}
//-------------圖像 END找$catlist = $forumlist = $sublist = $pmlist = array();在上面加上//-----------hack AL8 Info
if(!$statstatus && $discuz_uid){
require_once DISCUZ_ROOT.'./include/counter.inc.php';
}
require_once DISCUZ_ROOT.'./include/misc.func.php';
$mem_home = convertip($onlineip, $datadir = "./");
@include './forumdata/cache/cache_newtopic.php';
@include './forumdata/cache/cache_newreply.php';
@include './forumdata/cache/cache_topdigest.php';
//-----------hack AL8 Info End找'forumlinks', 'birthdays', 'supe_updateusers'在後面插入, 'foruminfo'9. 修改 register.php
找$styleid = $styleid ? $styleid _DCACHE['settings']['styleid'];在下面加上$datecut = time() - (3600 * 24);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}members WHERE regdate>='$datecut'");
$todaynewmems = $db->result($query, 0);找updatesettings();在上面加上$_DCACHE['settings']['todaynewmems'] = $todaynewmems;8. 修改 discuz 模板
找<table summary="HeadBox" class="portalbox" cellpadding="0" cellspacing="1">
      <tr>
      <!--{if $supeitemsstatus || $hottagstatus}-->上面加{template foruminfo}

gtr804 發表於 2011-7-4 01:05:01

幫你頂,人還是厚道點好
頁: [1]
查看完整版本: 【超級美化】AL8 首頁六格顯示 for Discuz 6.0.0(正式版)