Mod 如下:
代碼: 選擇全部
###############################################
## Hack Title: Rank images drop down menu.
## Hack Version: 1.0.0
## Author: Antony Bailey
## Description: Changes the rank image selection to a drop down colum of all available images.
## Compatibility: 2.0.0 - 2.0.4
##
## Installation Level: Easy/Moderate/Difficult
## Installation Time: <minutes>
## Files To Edit: <#>
## admin_ranks.php
## ranks_edit_body.tpl
##
## History:
## 1.0.0: Came back from the pub and had a great idea.
##
## Author Notes:
## The worlds, most useless hack.
##
## Support: http://www.phpbbhacks.com/forums
## Copyright: ?003 Rank images drop down menu 1.0.0 -Antony Bailey
##
###############################################
## You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
## Please visit http://www.phpbbhacks.com/forums for support.
###############################################
##
###############################################
## This hack is released under the GPL License.
## This hack can be freely used, but not distributed, without permission.
## Intellectual Property is retained by the hack author(s) listed above.
###############################################
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_ranks.php
#
#-----[ FIND ]------------------------------------------
#
#
$rank_is_not_special = ( !$rank_info['rank_special'] ) ? "checked=\"checked\"" : "";
#
#-----[ ADD AFTER ]------------------------------------------
#
$rep = "../images/ranks/";
$dir = opendir($rep);
$l = 0;
while($file = readdir($dir)) \r
{
if (strpos($file, '.gif'))
{
$file1[$l] = $file;
$l++;
}
}
closedir($dir);
$ranks_list = "<option value=\"" . $rank_info['rank_image'] . "\" selected>" . str_replace($rep, "", $rank_info['rank_image']) . "</option>";
for($k=0; $k<=$l;$k++)
{
if ($file1[$k] != "")
{
$ranks_list .= "<option value=\"" . $rep.$file1[$k] . "\">" . $file1[$k] . "</option>";
}
}
#
#-----[ FIND ]------------------------------------------
#
#
"IMAGE_DISPLAY" => ( $rank_info['rank_image'] != "" ) ? '<img src="../' . $rank_info['rank_image'] . '" />' : "",
#
#-----[ ADD AFTER ]------------------------------------------
#
"RANK_LIST" => $ranks_list,
"RANK_IMG" => "../" . $rank_info['rank_image'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/ranks_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
#
<h1>{L_RANKS_TITLE}</h1>
#
#-----[ ADD BEFORE ]------------------------------------------
#
<script language="javascript" type="text/javascript">
<!--
function update_rank(newimage)
{
document.rank_image.src = newimage;
}
//-->
</script>
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1" width="38%"><span class="gen">{L_RANK_IMAGE}:</span><br />
<span class="gensmall">{L_RANK_IMAGE_EXPLAIN}</span></td>
<td class="row2"><input type="text" name="rank_image" size="40" maxlength="255" value="{IMAGE}" /><br />{IMAGE_DISPLAY}</td>
</tr>
#
#------[ REPLACE WITH ]-------------------------------------
#
<tr>
<td class="row1" width="38%"><span class="gen">{L_RANK_IMAGE}:</span></td>
<td class="row2"><select name="rank_image" onchange="update_rank(this.options[selectedIndex].value);">{RANK_LIST}</select> <img name="rank_image" src="{RANK_IMG}" border="0" alt="" /> </td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM2.我已在 /var/www/html/phpBB20/images/ 下建了一個 ranks的資料夾,並且置放了幾個等級圖示於其中
3.我修改了 admin/admin_ranks.php 中的
代碼: 選擇全部
"RANK_IMG" => "../" . $rank_info['rank_image'],代碼: 選擇全部
"RANK_IMG" => "../[color=red]ranks/[/color]" . $rank_info['rank_image'],如:等級圖示如期出現下拉式選單....選擇完的等級圖示也都能在後台正常顯示...
但是退出回到瀏覽文章時,左側發表人的等級圖示卻變成叉燒包...
對著叉燒包圖示按右鍵檢查,發現路徑是錯誤的!!
如:http://www.sjs.idv.tw/images/ranks/ranka.gif
如何才能將路徑改為如下正確的路徑呢?
http://www.sjs.idv.tw/phpBB20/images/ranks/ranka.gif
查看錯誤連結:http://www.sjs.idv.tw/phpBB20/viewtopic.php?t=62
請大家幫忙
