晚风之家's Archiver

晚风 发表于 2005-12-18 02:08

替代星星

第1步:include/global.php
找到:
[code]
function showstars($num) {
        global $starthreshold;

        $alt = 'alt="Rank: '.$num.'"';
        if(empty($starthreshold)) {
                for($i = 0; $i < $num; $i++) {
                        echo '<img src="'.IMGDIR.'/star_level1.gif" '.$alt.'>';
                }
        } else {
                for($i = 3; $i > 0; $i--) {
                        $numlevel = intval($num / pow($starthreshold, ($i - 1)));
                        $num = ($num % pow($starthreshold, ($i - 1)));
                        for($j = 0; $j < $numlevel; $j++) {
                                echo '<img src="'.IMGDIR.'/star_level'.$i.'.gif" '.$alt.'>';
                        }
                }
        }
}
[/code]
在下面加上
[code]
function showrankstars($num) {
        echo "<img src=".IMGDIR."/lv/$num.gif title='Rank: ".$num."'>";
}  
[/code]
第2步:上传等级图标到.\images\模版\lv目录下
第3步:修改相应模版中的viewthread.htm文件
在viewthread.htm文件中,找
[code]
showstars
[/code]
替换成:
[Code]showrankstars
[/code]
好,完成了.

晚来风凉 发表于 2008-9-21 13:57

:yun: 好复杂

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.