/********************************************************************************/
/* Crossday Discuz! Board							*/
/* ========================      						*/
/* 歡迎使用 Discuz! 論壇,在您開始使用之前,請務必完整閱讀本軟件附帶的全部說明檔	*/
/********************************************************************************/
/* Welcome to http://www.crossday.com & http://www.Discuz.net			*/
/********************************************************************************/


    論壇新帖功能

    I. 功能簡介

    您可以看到 Discuz! 目錄中的 whatsnew.php 文件.這是一個可以用 javascript 調用的
在 html 頁面顯示論壇新貼的程序.您可以通過給定不同的參數,來實現在 html 頁面自由調用
論壇主題的功能.

    II. 基本設置

    使用之前需對 whatsnew.php 進行以下設置:

	$enabled = 0;				// Whether enable what's new feature, 1=yes, 0=no
						// 是否啟用 what's new 功能, 1=是, 0=否

	$num = 10;				// Default amount of new threads
						// 默認顯示新貼數量

	$length = 50;				// Max. length of title(bytes)
						// 標題最大字節數

	$pre = '
  • '; // Prefix of title // 標題顯示前綴 請根據旁邊的註釋設置相應的值,一般情況下是不需要改動的,但特別提醒如果需要使用本 功能,務必將 $enabled 設置為 1. III. 動態參數 (1) num 指定特殊的顯示新帖數量,可不按照默認設置(whatsnew.php 中的 $num)顯示 (2) finin 讀取某些指定論壇的新帖,多個論壇 id 之間,以 "_" 分隔 (3) finout 不讀取某些指定論壇的新帖,多個論壇 id 之間,以 "_" 分隔 IV. 調用實例 在您的主頁中需要放置論壇新貼的地方加入如下代碼(地址需改動): 地址中 "YOUR_PARAMETERS" 為條件查詢所設置.目前提供可選讀取論壇和可選不讀取論壇 功能,即可以顯示出某一個(或幾個)論壇的新貼,或排除/不顯示某一個(或幾個)論壇新帖.要用 此功能的朋友需先得到論壇的 fid.Discuz! 首頁論壇鏈接為 ../forumdisplay.php?fid=x 格 式,其中 x 就是論壇的 fid 號碼. 例如: 需要顯示 fid 為 2 的論壇的新帖,代碼為 再如: 顯示 fid 為 2 和 10 兩個論壇的新帖,代碼 fid 之間用下劃線(_)分割即可. 再如: 顯示除了 fid 為 2 和 10 以外所有論壇的新帖,且條目數為 100,代碼 或: 顯示全部論壇新帖,且條目數為 50 這樣就可以在 html 頁面裡顯示論壇的新帖和鏈接了. V. 注意事項 從 Discuz! 3.1.2 開始,whatsnew.php 被重新編寫,可支持使用文件 cache,每 100 秒自 動更新.效率上比以往提高非常多,同時需要 ./forumdata 目錄屬性為 777(可讀寫),並且可以 正常使用 unlink() 函數刪除過期的 cache 文件. 不滿足以上條件將無法使用 whatsnew.php 調用新帖. VI. 常見錯誤提示 功能未啟用,請將 whatsnew.php 中 $enabled 變為設置為 1 即可.提示如下 Access denied. If you'd like to display new threads in html pages, please switch $enabled to "1" in whatsnew.php and try again. ./forumdata 無法寫入或不存在,請將該目錄屬性設置為 777,並刪除其中的 whatsnew_xxx.php 文件.提示如下: Unable to write to whatsnew's cache file! Please chmod ./forumdata to 777, delete all "whatsnew_xxx.php" files and try again. Crossday Studio, 2003-10-16 10:42 http://www.discuz.com http://www.crossday.com
  •     Source: geocities.com/hk/chanyathong1

                   ( geocities.com/hk)