標題: [D6.0] 首頁四格之附件圖片,最新主題,回覆,熱門 D6.0正式版((增加主題分類及手動語法9/12))
 pole1010
 0038972
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5

頭銜: King

帖子: 660

精華: 0

積分: 7840 點

現金: 622 元

存款: 500 元

閱讀權限: 30

註冊: 2006-1-20

狀態: 離線
 
發表於 2007-8-29 10:35  資料  個人空間  短消息  加為好友 
首頁四格之附件圖片,最新主題,回覆,熱門 D6.0正式版((增加主題分類及手動語法9/12))

首頁四格之附件圖片,最新主題,回覆,熱門 D6.0正式版(只修改部份)

------------------------------------------------------------------------->
參照
QUOTE:
插件版本:Discuz! 5.5.0 繁體中文正式版
安裝難度:簡單
數據升級:有
修改文件:5個
原  作 者:oytktk
最後繁化:傻丁
示範論壇:http://hotlove.siuyin.net/index.php

插件修改版本:Discuz! 6.0.0 繁體中文正式版
修改部份:toplist.htm及discuz.htm
演示論壇:
http://www.polewords.com/bbs/index.php
<-------------------------------------------------------------------------

解壓後按目錄格式上傳所有附件~~~

------------------------------------------------------------------------->
1.數據升級
INSERT INTO `cdb_settings` VALUES ('Hiddenfid', '0');
INSERT INTO `cdb_settings` VALUES ('show_toplist', '1');

<-------------------------------------------------------------------------

2.修改admin/settings.inc.php
查找
showsetting('settings_nocacheheaders', 'settingsnew[nocacheheaders]', $settings['nocacheheaders'], 'radio');

下加
showsetting('settings_Hiddenfid', 'settingsnew[Hiddenfid]', $settings['Hiddenfid'], 'text');
showsetting('settings_show_toplist', 'settingsnew[show_toplist]', $settings['show_toplist'], 'radio');

------------------------------------------------------------------------->

3.編輯模版 templates/default/admincp.lang.php
查找
'settings_forumjump_comment' => '選擇“是”將在列表頁面下部顯示快捷跳轉菜單。注意: 當分論壇很多時,本功能會嚴重加重服務器負擔',

下加
'settings_show_toplist' => '顯示首頁四格',
'settings_show_toplist_comment' => '選“是”將在首頁顯示首頁四格',
'settings_Hiddenfid' => '不在首頁四格顯示的版塊:',
'settings_Hiddenfid_comment' => '輸入FID,多個請用用英文逗號隔開',

<-------------------------------------------------------------------------

4.修改 index.php
require_once DISCUZ_ROOT.'./include/forum.func.php';

下加
require_once DISCUZ_ROOT.'./include/misc.func.php';
require_once DISCUZ_ROOT.'./include/toplist.php';

------------------------------------------------------------------------->

5. templates/default/discuz.htm
查找
<!--{if !empty($newpmexists) || $announcepm}-->
        <div style="clear: both; margin-top: 5px" id="pmprompt">
        {template pmprompt}
        </div>
<!--{/if}-->

下加
<!--------首頁四格 開始-------->
<!--{if empty($gid)}-->
<!--{if $show_toplist}-->
<div style="clear: both; margin-top: 5px">
{template toplist}
<br>
</div>
<!--{/if}-->
<!--{/if}-->
<!--------首頁四格 結束-------->

<-------------------------------------------------------------------------
~~~~~~~~~~~~~~安裝全部完畢 請後台更新緩存~~~~~~~~~~~~~~~~~~

你可能需要修改一些適合你的論壇的東西,請打開附件中的文件查找修改

反安裝:
DELETE FROM `cdb_settings` WHERE `variable` = 'Hiddenfid' ;
DELETE FROM `cdb_settings` WHERE `variable`= 'show_toplist' ;

QUOTE:
完整附件請上傳相關位置
1.之前未安裝過請用第二附件
2.已經安裝過請注意discuz.htm修改即第一個附件上傳即可
3.如果安裝正確仍發生無法顯示圖片請用第三個附件上傳到templates\default覆蓋
4.增加主題分類不經後台設定方法
QUOTE:
1.否則你可以把後檯設定移除改為以下
2.打開include/toplist.php


$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 ($Hiddenfid) AND t.displayorder>=0 ORDER BY t.dateline DESC LIMIT 0, 10");

替換

$query = $db->query("SELECT t.*, f.name, y.name as typename FROM {$tablepre}threads t, {$tablepre}forums f,  {$tablepre}threadtypes y WHERE t.fid<>'$fid' AND f.fid=t.fid AND t.typeid=y.typeid AND t.fid NOT IN (81,82,84,85,86,87,88,104,136) ORDER BY t.dateline DESC LIMIT 0, 10");




$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 ($Hiddenfid) AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND t.displayorder>=0 ORDER BY t.lastpost DESC LIMIT 0, 10");


替換

$query = $db->query("SELECT t.*, f.name, y.name as typename FROM {$tablepre}threads t, {$tablepre}forums f,  {$tablepre}threadtypes y WHERE t.fid<>'$fid' AND f.fid=t.fid AND t.typeid=y.typeid AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND t.fid NOT IN (81,82,84,85,86,87,88,104,136) ORDER BY t.lastpost DESC LIMIT 0, 10");


熱門部份

$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 ($Hiddenfid) AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND '$timestamp'-t.dateline < $sort_time AND t.displayorder>=0 ORDER BY t.views DESC LIMIT 0, 10");

替換
$query = $db->query("SELECT t.*, f.name, y.name as typename FROM {$tablepre}threads t, {$tablepre}forums f,  {$tablepre}threadtypes y WHERE t.fid<>'$fid' AND f.fid=t.fid AND t.typeid=y.typeid AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND t.fid NOT IN (81,82,84,85,86,87,88,104,136) ORDER BY t.views DESC LIMIT 0, 10");

PS: (81,82,84,85,86,87,88,104,136)<<改數據FID
4.再把附件上傳至templates\default覆蓋.增加主題分類(主題分類要後台先設定.發帖時沒增加主題分類首頁四格不會出現)




QUOTE:
手動加入圖片就變得不是自動了
我提共一種方式
演示
http://www.polewords.com/xp/index.php?styleid=9
【複製步驟一】
<script language="javascript">
        var ImageMax = 10;                        //圖片的最後一張+1
        var imgValue = 0;                        //圖片一開始的編號,範例從0開始
function change_image(){
        imgValue++
        if(imgValue==ImageMax){
          //使用三個之中的功能 請把"//"刪除,不要全刪除,
          alert("圖片已經撥放完畢");                                //跳出訊息
          //window.top.location.href='http://dob.tnc.edu.tw/';        //轉到某一頁
          //imgValue = 0   ;setTimeout('change_image()', 5000);        //切換回第二張如果要切到第一張就要改為-1
        }

        else{
          document.top_img.src='java_script_01_' + imgValue + '.gif';
          setTimeout('change_image()', 4000);                //輪撥速度
        }
}
</script>   

【標記】 〔按此可快速標記並複製第一部份的程式碼〕

【貼上】然後切換到您的網頁,按『Ctrl+V』將剛剛複製的程式碼貼在</head>之前。
  

【複製步驟二】
onload="setTimeout('change_image()', 2000)"   

【標記】 〔按此可快速標記並複製第二部份的程式碼〕

【貼上】然後切換到您的網頁,按『Ctrl+V』將剛剛複製的程式碼貼在<body>標籤裡面。
  

【複製步驟三】
<center>
<script language="javascript">
  document.write('<img src="java_script_01_' + imgValue + '.gif" name="top_img">');
</script>
</center>   

【標記】 〔按此可快速標記並複製第三部份的程式碼〕

【貼上】然後切換到您的網頁,按『Ctrl+V』將剛剛複製的程式碼貼在<body>之後任何位置。
  
【程式說明】
1. ImageMax = 10 圖片的最後一張編號+1 範例中是java_script_01_9.gif 是最後一張 加1就是10拉(廢話...=.=|||)

2. imgValue = 0; 圖片一開始的編號 範例從0開始

3. <body onload="setTimeout('change_image()', 2000)"> 4000是第一張切換第二張的時間,有些第一張是開場~所以可以調整久一點

4. setTimeout('change_image()', 4000); 4000是每一張圖片切換的速度 為1000分之1秒 1000=1秒,數字越大時間越久喔!!

5. 判斷式後面可以自行更換任何Java script碼,建議不會改的人不要隨便改唷!!
PS
a我提共附件放入templates\default覆蓋
b相片gif檔放入根目錄即可



[ 本帖最後由 pole1010 於 2008-7-18 16:35 編輯 ]



 附件: 您所在的用戶組無法下載或查看附件



 AL8 Forum © All rights reserved.
頂部
 童話
 0043485
Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6

頭銜: Forum Legend

帖子: 1201

精華: 0

積分: 7214 點

現金: 510 元

存款: 0 元

閱讀權限: 70

註冊: 2006-4-15

狀態: 離線
 
發表於 2007-8-29 10:48  資料  個人空間  主頁 短消息  加為好友 
支持......




 AL8 Forum © All rights reserved.
頂部
 harris147
 0017806
Rank: 3Rank: 3Rank: 3

頭銜: Conqueror

帖子: 202

精華: 0

積分: 1170 點

現金: 28 元

存款: 0 元

閱讀權限: 20

註冊: 2005-3-17

來自: 跑馬地

狀態: 離線
 
發表於 2007-8-29 10:55  資料  個人空間  主頁 短消息  加為好友  添加 harris147 為MSN好友 通過MSN和 harris147 交談 ICQ 狀態
沒有toplist.php

[ 本帖最後由 harris147 於 2007-8-29 10:58 編輯 ]




 AL8 Forum © All rights reserved.
頂部
 pole1010
 0038972
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5

頭銜: King

帖子: 660

精華: 0

積分: 7840 點

現金: 622 元

存款: 500 元

閱讀權限: 30

註冊: 2006-1-20

狀態: 離線
 
發表於 2007-8-29 10:57  資料  個人空間  短消息  加為好友 
QUOTE:
原帖由 harris147 於 2007-8-29 10:55 發表
沒有toplist.php

已經放入第二個附件論壇四格




 AL8 Forum © All rights reserved.
頂部
 harris147
 0017806
Rank: 3Rank: 3Rank: 3

頭銜: Conqueror

帖子: 202

精華: 0

積分: 1170 點

現金: 28 元

存款: 0 元

閱讀權限: 20

註冊: 2005-3-17

來自: 跑馬地

狀態: 離線
 
發表於 2007-8-29 10:59  資料  個人空間  主頁 短消息  加為好友  添加 harris147 為MSN好友 通過MSN和 harris147 交談 ICQ 狀態
QUOTE:
原帖由 pole1010 於 2007-8-29 10:57 發表

已經放入第二個附件論壇四格

ok~thx 已安裝了
http://hk-today.com/bbs




 AL8 Forum © All rights reserved.
頂部
 你朋友
 0037435
Rank: 3Rank: 3Rank: 3
點擊查看 你朋友 的詳細資料

頭銜: Conqueror

帖子: 105

精華: 0

積分: 1470 點

現金: 128 元

存款: 0 元

閱讀權限: 20

註冊: 2005-12-23

狀態: 離線
 
發表於 2007-8-29 12:28  資料  個人空間  短消息  加為好友 
我唔得呀=0="次次都係咁///...\\\



 附件: 您所在的用戶組無法下載或查看附件



 AL8 Forum © All rights reserved.
頂部
 abc060893
 0046811
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5
點擊查看 abc060893 的詳細資料

頭銜: King

帖子: 628

精華: 0

積分: 6410 點

現金: 146 元

存款: 0 元

閱讀權限: 30

註冊: 2006-6-18

狀態: 離線
 
發表於 2007-8-29 12:41  資料  個人空間  短消息  加為好友 
我發現左個bugs
黑色方格果度
同一個標題, 分左行
點解決?



 附件: 您所在的用戶組無法下載或查看附件



 AL8 Forum © All rights reserved.
頂部
 翼雪風
 0072105
Rank: 2Rank: 2

頭銜: Member

帖子: 51

精華: 0

積分: 910 點

現金: 70 元

存款: 0 元

閱讀權限: 15

註冊: 2007-4-4

狀態: 離線
 
發表於 2007-8-29 13:00  資料  個人空間  短消息  加為好友 
THX!!!樓主..安裝來試試看..




 AL8 Forum © All rights reserved.
頂部
 pole1010
 0038972
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5

頭銜: King

帖子: 660

精華: 0

積分: 7840 點

現金: 622 元

存款: 500 元

閱讀權限: 30

註冊: 2006-1-20

狀態: 離線
 
發表於 2007-8-29 13:09  資料  個人空間  短消息  加為好友 
QUOTE:
原帖由 abc060893 於 2007-8-29 12:41 發表
我發現左個bugs
黑色方格果度
同一個標題, 分左行
點解決?

通常是因為解稀度或是風格窄所至
你可以打開toplist.php修改主題長度




 AL8 Forum © All rights reserved.
頂部
 pole1010
 0038972
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5

頭銜: King

帖子: 660

精華: 0

積分: 7840 點

現金: 622 元

存款: 500 元

閱讀權限: 30

註冊: 2006-1-20

狀態: 離線
 
發表於 2007-8-29 13:11  資料  個人空間  短消息  加為好友 
QUOTE:
原帖由 你朋友 於 2007-8-29 12:28 發表
我唔得呀=0="次次都係咁///...\\\

再重新安裝試試..先反安裝移除資料庫




 AL8 Forum © All rights reserved.
頂部
 abc060893
 0046811
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5
點擊查看 abc060893 的詳細資料

頭銜: King

帖子: 628

精華: 0

積分: 6410 點

現金: 146 元

存款: 0 元

閱讀權限: 30

註冊: 2006-6-18

狀態: 離線
 
發表於 2007-8-29 13:12  資料  個人空間  短消息  加為好友 
QUOTE:
原帖由 pole1010 於 2007-8-29 13:09 發表

通常是因為解稀度或是風格窄所至
你可以打開toplist.php修改主題長度

我找不到toplist.php
還有,應該如何改?




 AL8 Forum © All rights reserved.
頂部
 pole1010
 0038972
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5

頭銜: King

帖子: 660

精華: 0

積分: 7840 點

現金: 622 元

存款: 500 元

閱讀權限: 30

註冊: 2006-1-20

狀態: 離線
 
發表於 2007-8-29 13:19  資料  個人空間  短消息  加為好友 
QUOTE:
原帖由 abc060893 於 2007-8-29 13:12 發表

我找不到toplist.php
還有,應該如何改?

include/toplist.php在附件上傳的地方
你沒上傳嗎??




 AL8 Forum © All rights reserved.
頂部
 abc060893
 0046811
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5
點擊查看 abc060893 的詳細資料

頭銜: King

帖子: 628

精華: 0

積分: 6410 點

現金: 146 元

存款: 0 元

閱讀權限: 30

註冊: 2006-6-18

狀態: 離線
 
發表於 2007-8-29 13:25  資料  個人空間  短消息  加為好友 
QUOTE:
原帖由 pole1010 於 2007-8-29 13:19 發表

include/toplist.php在附件上傳的地方
你沒上傳嗎??

哦..果個
但係..係邊度改-,-
and
我果個風格係discuz!6.0默認風格-,-




 AL8 Forum © All rights reserved.
頂部
 powerwolf
 0026735
Rank: 1

頭銜: Newbie

帖子: 34

精華: 0

積分: 740 點

現金: 0 元

存款: 0 元

閱讀權限: 10

註冊: 2005-7-19

狀態: 離線
 
發表於 2007-8-29 14:18  資料  個人空間  短消息  加為好友 
要怎麼改顯示哪些圖片??




 AL8 Forum © All rights reserved.
頂部
 pole1010
 0038972
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5

頭銜: King

帖子: 660

精華: 0

積分: 7840 點

現金: 622 元

存款: 500 元

閱讀權限: 30

註冊: 2006-1-20

狀態: 離線
 
發表於 2007-8-29 14:23  資料  個人空間  短消息  加為好友 
打開toplist.php紅字部份.可以修改字數長度
QUOTE:
<?php

/*
        [Discuz!] (C)2001-2006 Comsenz Inc.
        This is NOT a freeware, use is subject to license terms

        $RCSfile: index.php,v $
        $Revision: 1.23.2.3 $
        $Date: 2006/09/26 08:27:30 $
*/

$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
//新貼//
$hack_cut_str = 28; //修改標題顯示字數
$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 ($Hiddenfid) AND t.displayorder>=0 ORDER BY t.dateline DESC LIMIT 0, 10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $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 = 28; //修改標題顯示字數
$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 f.fid NOT IN ($Hiddenfid) AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND t.displayorder>=0 ORDER BY t.lastpost DESC LIMIT 0, 10");
while($rthread = $db->fetch_array($query)) {
        $rthread['forumname'] = $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 = 28; //修改標題顯示字數
$hack_cut_strauthor = 9;
//指定熱帖時間
$sort_time = 60*60*24*30; //最後一位數代表x天內
$new_hot_threadlist = array();
$mthread = 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 ($Hiddenfid) AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND '$timestamp'-t.dateline < $sort_time AND t.displayorder>=0 ORDER BY t.views DESC LIMIT 0, 10");
while($mthread = $db->fetch_array($query)) {
        $mthread['forumname'] = $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;
}
//熱帖//
?>




 AL8 Forum © All rights reserved.
頂部
 你朋友
 0037435
Rank: 3Rank: 3Rank: 3
點擊查看 你朋友 的詳細資料

頭銜: Conqueror

帖子: 105

精華: 0

積分: 1470 點

現金: 128 元

存款: 0 元

閱讀權限: 20

註冊: 2005-12-23

狀態: 離線
 
發表於 2007-8-29 14:51  資料  個人空間  短消息  加為好友 
唔得啵.....