Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[修改] (仿PHPWind)用等级图片替代星星图片FOR5.0(9月27日已更新)

[复制链接]
sxrm 发表于 2006-9-24 22:56:28 | 显示全部楼层 |阅读模式
2楼是无在线状态的修改方法


作者:sxrm
适用: DZ 5.0      
修改: 有
include/global.func.php
templates\default\viewthread.htm
templates\default\viewpro.htm
复杂程度: 简单


1、include/global.func.php

找到

  1. function showstars($num) {
  2.         global $starthreshold;

  3.         $alt = 'alt="Rank: '.$num.'"';
  4.         if(empty($starthreshold)) {
  5.                 for($i = 0; $i < $num; $i++) {
  6.                         echo '
  7. ';
  8.                 }
  9.         } else {
  10.                 for($i = 3; $i > 0; $i--) {
  11.                         $numlevel = intval($num / pow($starthreshold, ($i - 1)));
  12.                         $num = ($num % pow($starthreshold, ($i - 1)));
  13.                         for($j = 0; $j < $numlevel; $j++) {
  14.                                 echo '
  15. ';
  16.                         }
  17.                 }
  18.         }
  19. }
复制代码
下面加上

  1. function showrankstars($num) {
  2.         echo "
  3. ";
  4. }
复制代码
2、templates\default\viewthread.htm

2.1找到并删除
  1.                 $post[authortitle]
  2.                
  3. {eval showstars($post['stars']);}
  4. <!--{if $post['customstatus']}-->$post[customstatus]
  5. <!--{/if}-->
复制代码
备注:
{eval showstars($post['stars']);}

这段不删除,就可以显示星星数


2.2查找
  1.                 <!--{if $post['medals']}-->
  2.                         <!--{loop $post['medals'] $medal}-->
  3.                                
  4. &nbsp;
  5.                         <!--{/loop}-->
  6.                        

  7.                 <!--{/if}-->
复制代码
下面
  1.                 <!--{if $post['customstatus']}-->
  2. $post[customstatus]<!--{/if}-->

  3.                 {eval showrankstars($post['stars']);}
  4. <!--{if $vtonlinestatus && $post['authorid']}-->
  5.                         <!--{if ($vtonlinestatus == 2 && $onlineauthors[$post[authorid]]) || ($vtonlinestatus == 1 && ($timestamp - $post['lastactivity'] <= 10800) && !$post['invisible'])}-->
  6.                                

  7.                         <!--{else}-->
  8.                                

  9.                         <!--{/if}-->
  10.                 <!--{/if}-->



  11.                 {级别}  $post[authortitle]
复制代码
3、templates\default\viewpro.htm

找到

  1. showstars
复制代码
替换成

  1. showrankstars
复制代码
三个改后两个就行

4. 把附件的图片上传到相应目录就可以了
等级图片下载
下面2张演示图片:的区别在于步骤2.1
是否删除
  1. {eval showstars($post['stars']);}
复制代码
这段代码

[ 本帖最后由 sxrm 于 2007-1-27 17:46 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| sxrm 发表于 2006-9-24 22:56:51 | 显示全部楼层

没有在线状态条的

1、include/global.func.php

找到

  1. function showstars($num) {
  2.         global $starthreshold;

  3.         $alt = 'alt="Rank: '.$num.'"';
  4.         if(empty($starthreshold)) {
  5.                 for($i = 0; $i < $num; $i++) {
  6.                         echo '<img src="'.IMGDIR.'/star_level1.gif" '.$alt.' />';
  7.                 }
  8.         } else {
  9.                 for($i = 3; $i > 0; $i--) {
  10.                         $numlevel = intval($num / pow($starthreshold, ($i - 1)));
  11.                         $num = ($num % pow($starthreshold, ($i - 1)));
  12.                         for($j = 0; $j < $numlevel; $j++) {
  13.                                 echo '<img src="'.IMGDIR.'/star_level'.$i.'.gif" '.$alt.' />';
  14.                         }
  15.                 }
  16.         }
  17. }
复制代码


下面加上

  1. function showrankstars($num) {
  2.         echo "<img src=images/rank/$num.gif title='Rank: ".$num."'>";
  3. }
复制代码


2、templates\default\viewthread.htm

2.1找到并删除
  1.                 $post[authortitle]
  2.                 <br>{eval showstars($post['stars']);}<br><!--{if $post['customstatus']}-->$post[customstatus]<br><!--{/if}--><br>
复制代码
备注:
{eval showstars($post['stars']);}<br>
这段不删除,就可以显示星星数


2.2查找
  1.                 <!--{if $post['medals']}-->
  2.                         <!--{loop $post['medals'] $medal}-->
  3.                                 <img src="images/common/$medal[image]" border="0" alt="$medal[name]" />  
  4.                         <!--{/loop}-->
  5.                         <br>
  6.                 <!--{/if}-->
复制代码


下面
  1.                 <!--{if $post['customstatus']}--><img src="images/default/rongyu.gif" border="0" alt="头衔:$post[customstatus]" /> $post[customstatus]<!--{/if}-->
  2.                 {eval showrankstars($post['stars']);}
  3. <br>
  4.                 {级别}  $post[authortitle]<br>
复制代码


3、templates\default\viewpro.htm

找到

  1. showstars
复制代码


替换成

  1. showrankstars
复制代码


有三个改后两个就行了

4. 把附件的图片上传到相应目录就可以了

[ 本帖最后由 sxrm 于 2006-11-28 19:42 编辑 ]
回复

使用道具 举报

wlqc 发表于 2006-9-24 22:57:31 | 显示全部楼层
板凳。。
给你顶一下!`
回复

使用道具 举报

lovebbmp123 发表于 2006-9-24 23:14:54 | 显示全部楼层
貌似好像不错哦
回复

使用道具 举报

 楼主| sxrm 发表于 2006-9-24 23:49:54 | 显示全部楼层
已经上传,希望大家支持下
回复

使用道具 举报

疾风烈火 发表于 2006-9-25 00:19:57 | 显示全部楼层
哇,,那拿刀的宰猪真凶
回复

使用道具 举报

 楼主| sxrm 发表于 2006-9-25 00:24:20 | 显示全部楼层

回复 #6 疾风烈火 的帖子

回复

使用道具 举报

 楼主| sxrm 发表于 2006-9-25 00:42:31 | 显示全部楼层
貌视只看不顶,MJJ
回复

使用道具 举报

 楼主| sxrm 发表于 2006-9-25 01:02:49 | 显示全部楼层
自己再顶下,睡觉了
回复

使用道具 举报

宋客 发表于 2006-9-25 01:24:41 | 显示全部楼层
哈哈,我刚才正准备改那个,在改
楼主就删了,出了更好的了,感谢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-10-2 06:06 , Processed in 0.288255 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表