首頁四格,首頁五格For6.0(GBK)(UTF-8)[12種組合][9-18][版主安裝測試通過]_PHP教程

來源:互聯網
上載者:User
下載萬次的首頁四格,首頁五格For6.0(GBK)(UTF-8)[12種組合][9-18][版主安裝測試通過]
引用:
本外掛程式由版主sakurakawaii於07年9月8日15:30分
在Windows XP Discuz!6.0.0標準模版 IE6 Mysql4.1下測試安裝無錯
本測試僅代表此外掛程式安裝無錯,不包括今後長期使用中可能出現的問題引用:
聲明:本程式引用了部分5.0四格的代碼,若是源碼作者有意見請簡訊我,一定刪除發布!
經過大量修改和flash設定增加了好多自訂設定,此外掛程式可以說是壇內功能最全,美觀最好的一個!慶祝本外掛程式通過版主測試!

更新列表及外掛程式優點:

9-18:應朋友要求增加首頁六格(圖+新帖+回複+本周熱門+本月精華+今日排行)請到附件包最下面下載
9-15:更新了有少數朋友伺服器不支援導致圖片不顯示的問題。(直接下載包然後覆蓋pic.php就可以了)
9-13:應壇友要求加入四格帶建站天數不帶圖片的調用組合!(示範見附件最下面)
9-10:加入壇內很少有的 UTF-8 版四格和五格,請大家下載使用!(見附件最下面)
9-9 8:00 更新:
引用:
修正了所有組合中的當螢幕解析度小或開啟分欄時文章標題換行的問題!
9-8 14:00 
應有朋友要求,新改四格風格,目前共有七種調用方法(見附件)。
應大家要求新加了下面兩種組合(發行)
1,圖片,新帖,最新回複,本周熱門,今日發帖排行(首頁五格)
2,新帖,最新回複,本周熱門,精華帖
9-7:解決了敏感詞語過濾後仍在四格顯示的問題!
9-6:突破:一改以往flash樣式,改變文字在下的不美觀,並解決好多朋友提出的圖片卡,flash 調用問題!現在速度飛快,而且可以自行定製flash 中按鍵,文字,背景顏色以及背景透明度。真正人性化,滿足你配套論壇風格色彩的要求!
9-6:特別更新:當論壇開通了主題資源回收筒時,不再出現文章放到主題資源回收筒後仍在首頁四格顯示的情況!

關於各種可以自行設定的參數注釋 (鑒於有很多朋友不知道設定方法,現將可以設定的內容全部寫在下面,以供大家使用)
1/3: pic.php 中
複製代碼 代碼如下:
$shownums = 5;//示範個數 6以內
$searchnums = 50;//搜尋總數.
$cachelife = 1800;//緩衝時間.
$orderby = 'dateline';//搜尋順序:按日期dateline.按瀏覽次數downloads.隨機rand.
$cachename = 'showpic';//緩衝名.若與何外掛程式衝突請修改,只要不衝突不會影響使用.
$searchfid = '';//搜尋fid範圍.不限制留空.請用逗號相隔,如'1,2,3'.

var config='5|0xffffff|0x0099ff|50|0xffffff|0x0099ff|0x000000'
//-- config 參數 -- 自動播放時間(秒)|文字顏色|文字背景色|文字背景透明度|按鍵數字顏色|當前按鍵顏色|普通按鍵色彩
var swf_width=255 設定flash 寬
var swf_height=175 設定flash 高2/3

index.php中
複製代碼 代碼如下:

$hack_cut_str = 26; //標題字數
DESC LIMIT 0, 10" //設定顯示條數

如果不想調用某個版或某個區或者某些版的文章可在index.php預留給大家的位置增加:(共三處)
and f.fid not in (0)
增加為:
and f.fid not in (1,2,3)其中123為 不想調用的 fid,
或者只想調用 1 2 3 改為:and f.fid in (1,2,3)3/3: discuz.htm 中引用:
如果想把最新回複中的連結開啟時指向最後回複此帖的位置,只需將discuz.htm 中的:
複製代碼 代碼如下:

改為:
複製代碼 代碼如下:

需要像官方一樣每個區加入伸縮點擊功能的請在discuz.htm 中改寫(五格的,如果是四格就根據

≡ 本周熱門 ≡


複製代碼 代碼如下:

今日發帖






為:
複製代碼 代碼如下:



今日發帖







示範圖:(根據要求新寫的風格,使得在官方的六種風格中更加配套完善。。。)

使用本外掛程式需要增加的檔案有:

pic.php //調用論壇圖片資料,
list.gif 和listbg.gif //標題處的圖片
focus.swf //調用圖片的flash [此swf 與以往的大不相同,個人覺得更不錯]
需修改的檔案有:

index.php
discuz.htm
======================= 開始增加和修改 ============================
步驟:共分4步

將pic.php / list.gif / listbg.gif / focus.swf 按下載到的附件結構傳到FTP(網站)
其中:pic.php 在論壇根目錄
list.gif / listbg.gif / focus.swf 在images檔案夾下
開啟 index.php
尋找:
複製代碼 代碼如下:
$rsshead = $rssstatus

在之上加:
複製代碼 代碼如下:
//----首頁四格代碼開始
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
//新貼
$hack_cut_str = 26; //標題字數
$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 = 26; //標題字數
$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 = 26; //標題字數
$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;
}
//----首頁四格代碼結束

開啟 templates/default/discuz.htm
尋找:
複製代碼 代碼如下:


複製代碼 代碼如下:

















≡ 論壇圖片 ≡

≡ 最新文章 ≡

≡ 最新回複 ≡

≡ 本周熱門 ≡












$nthread[view_subject]

$nthread[view_subject]











$rthread[view_subject]










$mthread[view_subject]






上傳剛才修改過的 index.php 及 discuz.htm
==========================================================================
如果你沒有修改過這兩個檔案可以下載附件(請注意為:0904最新6.0.0正式版)直接覆蓋就可以了!
==========================================================================
附件中的每個包都是獨立的,請根據喜愛及版本區別下載直接上傳就可以使用了,不需要任何資料庫設定!
最後:請記得每次覆蓋或改寫檔案後一定要更新緩衝!

請大家支援一下我的另一個原創外掛程式:論壇音樂區所有歌曲連播[圖]
請安裝好的朋友留下您的網站地址!可以話請評分一下哦!謝謝!
希望大家喜歡!
暈,更新後,下載次數被我刪除了,原先已有5000次左右!
所有檔案打包

http://www.bkjia.com/PHPjc/318420.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/318420.htmlTechArticle下載萬次的首頁四格,首頁五格For6.0(GBK)(UTF-8)[12種組合][9-18][版主安裝測試通過] 引用: 本外掛程式由版主sakurakawaii於07年9月8日15:30分 在WindowsXP...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.