請記得去下載樣本圖檔與說明檔
代碼: 選擇全部
## Random image
##############################################################
## MOD Title: Random image 隨機圖片
## MOD Author: Artemas http://oops.cafepark.com
## MOD Description: Adds the Random images to page header.
##
## Installation Level: easy
## Installation Time: 3 Minutes
## Files To Edit: (1) overall_header.tpl
## Included Files: (1) page_header.php,
## Add Files: (folder) random_img/8 sample pictures 新增圖片資料夾含8張樣本圖,
##############################################################
#
#-----[ OPEN 打開 ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND 尋找 ]------------------------------------------
#
// Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility
#
#-----[ ABOVE, ADD 上面加入 ]------------------------------------------
#
//
// Random images
//
mt_srand((double)microtime()*1000000);
$imgs = dir('images/random_img');
while ($file = $imgs->read()) {
if (eregi("gif", $file) || eregi("jpg", $file)) {
$imglist .= "$file ";
}
}
closedir($imgs->handle);
$imglist = explode(" ", $imglist);
$a = sizeof($imglist)-2;
$random = mt_rand(0, $a);
$image = $imglist[$random];
$content_img = "<img src=images/random_img/$image border='0' HSPACE='10' alt='Random images'>";
// Random images
#
#-----[ FIND 尋找 ]------------------------------------------
#
'PRIVMSG_IMG' => $icon_pm,
#
#-----[ ABOVE, ADD 上面加入 ]------------------------------------------
#
'RANDOM_IMG' => $content_img,
#
#-----[ OPEN 打開 ]------------------------------------------
#
templates/template_name 風格夾/overall_header.tpl
#
#-----[ FIND 尋找 ]------------------------------------------
#
<td><a href="{U_INDEX}">
#
#-----[ OPTIONAL 選擇性更改 ]------------------------------------------
#(OPTIONAL ADD to valign="top") (選擇性加入valign="top")
<td valign="top"><a href="{U_INDEX}">
#
#-----[ FIND 尋找 ]------------------------------------------
#(The "middle" OPTIONAL REPLACE to "top") (選擇性把"middle"改成"top")
<td align="center" width="100%" valign="middle"><span class="maintitle">{SITENAME}
#
#-----[ ABOVE, ADD 上面加入 ]------------------------------------
#
<td valign="top">{RANDOM_IMG}</td>
#
#-----[ COPY ADD 拷貝新增 ]------------------------------------------
#
copy folder (random_img) to ..phpBB2\images
put into any image files(jpg or gif) can be random to show up.
拷貝 random_img 資料夾放置到 ..phpBB2\images
裡面附贈8個樣本圖即可隨機撥放,自己也可以放入任何jpg或gif圖片,名稱任意取(切勿用中文)即可\r
#
#-----[ SAVE/CLOSE ALL FILES 完成 ]--------------------------
#
![ㄏㄏㄏ :mrgreen:](./images/smilies/icon_mrgreen.gif)
附註:若對於 <td valign="top">{RANDOM_IMG}</td> 所放置的位置自己覺得不理想
只要把{RANDOM_IMG}找到自己喜歡的地方擺也可以,前提是只能在overall_header.tpl檔案中移動
除非自己有把握把修改 // Random images 這一組移到別的頁面。
參考展示網頁 http://mabinogi.opisite.com/
---------------------------------------------------
這個mod適用phpbb與nuke+(BB首頁)通通都能用啦\r
只不過nuke的overall_header.tpl這個檔案是在\r
..html\themes\DeepBlue風格夾\forums
---------------------------------------------------