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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] 求助个人信息中控制积分显示代码

[复制链接]
暖心。 发表于 2012-11-30 19:48:10 | 显示全部楼层 |阅读模式
<!--{loop $extcredits $id $credit}--> <img src="./images/sn-post/icon_5.gif" border="0"> $credit[title]: <font color="#9900FF">{$post[extcredits.$id]} $credit[unit]</font><br><!--{/loop}-->

这是一段在show.html里控制显示个人信息中积分的代码

但它显示了所有用到的代码,而且我用了7个扩展积分,所以我只想显示某几个~~

有高手帮下修改这段代码吗??
sw08 发表于 2012-11-30 19:51:48 | 显示全部楼层
<!--{if $id!=XX}--><!--{/if}-->
用这种即可
回复

使用道具 举报

 楼主| 暖心。 发表于 2012-11-30 19:54:52 | 显示全部楼层
sw08 发表于 2012-11-30 19:51
用这种即可

<!--{if $extcredits $id $credit}--><img src="./images/sn-post/icon_5.gif" border="0"> $credit[title]: <font color="#9900FF">{$post[extcredits.$1]} $credit[unit]</font><br><!--{/if}-->

这样吗?不对呢···可不可以再给我讲细一点呀
回复

使用道具 举报

sw08 发表于 2012-11-30 19:56:11 | 显示全部楼层
<!--{loop $extcredits $id $credit}--><!--{if $id!=XX}-->XXXXXXXXXXXXXXXXXX<!--{/if}--><!--{/loop}-->
回复

使用道具 举报

MFyoyo.. 发表于 2012-11-30 20:00:28 | 显示全部楼层
暖心。 发表于 2012-11-30 19:54
$credit[title]: {$post[extcredits.$1]} $credit

这样吗?不对呢···可不可以再给我讲细一点呀

$id代表foreach的数组下标,也代表了你积分的类型数字,判断这个数字即可
if($id)
回复

使用道具 举报

 楼主| 暖心。 发表于 2012-11-30 20:06:09 | 显示全部楼层
<!--{loop $extcredits $id $credit}--><!--{if $id!=1}--><img src="./images/sn-post/icon_1.gif" border="0"> $credit[title]: <font color="#9900FF">{$post[extcredits.$id]} $credit[unit]</font><br><!--{/if}--><!--{/loop}-->
<!--{loop $extcredits $id $credit}--><!--{if $id!=2}--><img src="./images/sn-post/icon_2.gif" border="0"> $credit[title]: <font color="#9900FF">{$post[extcredits.$id]} $credit[unit]</font><br><!--{/if}--><!--{/loop}-->
<!--{loop $extcredits $id $credit}--><!--{if $id!=3}--><img src="./images/sn-post/icon_3.gif" border="0"> $credit[title]: <font color="#9900FF">{$post[extcredits.$id]} $credit[unit]</font><br><!--{/if}--><!--{/loop}-->
<!--{loop $extcredits $id $credit}--><!--{if $id!=4}--><img src="./images/sn-post/icon_4.gif" border="0"> $credit[title]: <font color="#9900FF">{$post[extcredits.$id]} $credit[unit]</font><br><!--{/if}--><!--{/loop}-->
<!--{loop $extcredits $id $credit}--><!--{if $id!=5}--><img src="./images/sn-post/icon_5.gif" border="0"> $credit[title]: <font color="#9900FF">{$post[extcredits.$id]} $credit[unit]</font><br><!--{/if}--><!--{/loop}-->
<!--{loop $extcredits $id $credit}--><!--{if $id!=6}--><img src="./images/sn-post/icon_6.gif" border="0"> $credit[title]: <font color="#9900FF">{$post[extcredits.$id]} $credit[unit]</font><br><!--{/if}--><!--{/loop}-->

呜哇···我是不是错了··变成这个样子了

本帖子中包含更多资源

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

x
回复

使用道具 举报

MFyoyo.. 发表于 2012-11-30 20:06:55 | 显示全部楼层
暖心。 发表于 2012-11-30 20:06
呜哇···我是不是错了··变成这个样子了

你在一次遍历里判断,,你遍历那么多干什么。
回复

使用道具 举报

 楼主| 暖心。 发表于 2012-11-30 20:09:22 | 显示全部楼层
MFyoyo.. 发表于 2012-11-30 20:06
你在一次遍历里判断,,你遍历那么多干什么。

我不知道该怎么改了怎么办啊··
回复

使用道具 举报

MFyoyo.. 发表于 2012-11-30 20:11:36 | 显示全部楼层
<!--{loop $extcredits $id $credit}-->
<!--{if in_array($id,array('1','2','3'))}--> //123为你要显示的积分数字,多个用都逗号分割
<img src="./images/sn-post/icon_5.gif" border="0"> $credit[title]: <font color="#9900FF">{$post[extcredits.$id]} $credit[unit]</font>
<br>
<!--{/if}-->
<!--{/loop}-->
回复

使用道具 举报

 楼主| 暖心。 发表于 2012-11-30 20:13:11 | 显示全部楼层
MFyoyo.. 发表于 2012-11-30 20:11
//123为你要显示的积分数字,多个用都逗号分割
  $credit[title]: {$post[extcredits.$id]} $credit

...

可是我想每个记分前面显示不同的图片怎么改呀
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-18 11:27 , Processed in 0.681697 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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