PDA

View Full Version : Need alittle help with php


Psyd0x
12-04-2011, 12:21 PM
How do I do that if the feedback score above 0 the score will be green, and if the feedback score below 0, the score will be red?
thanks for answer here is my code.


<b>

<vb:if condition="$vboptions['itrader_postbit_location'] == 'postbit_userinfo_left'"><span class="usertitle">
{vb:rawphrase itrader_feedback_score} <vb:if condition="$show['rateinfolink']"><a title="{vb:rawphrase itrader_total_feedback}"href="{vb:raw vboptions.bburl}/itrader.php?{vb:raw session.sessionurl}u={vb:raw post.userid}"></vb:if>{vb:raw post.itrader_total}<vb:if condition="$show['rateinfolink']"></a></vb:if><vb:if condition="$post['itrader_total']"> ({vb:raw post.itrader_pcnt}%)</vb:if></span>
<vb:else />
<vb:if condition="$vboptions['itrader_postbit_location'] == 'postbit_userinfo_right'"><dl class="userinfo_extra"></vb:if>
<dt>{vb:rawphrase itrader_feedback_score}</dt><dd><vb:if condition="$show['rateinfolink']"><a title="{vb:rawphrase itrader_total_feedback}" href="{vb:raw vboptions.bburl}/itrader.php?{vb:raw session.sessionurl}u={vb:raw post.userid}"></vb:if>{vb:raw post.itrader_total}<vb:if condition="$show['rateinfolink']"></a></vb:if><vb:if condition="$post['itrader_total']"> ({vb:raw post.itrader_pcnt}%)</vb:if></dd>
<vb:if condition="$vboptions['itrader_postbit_location'] == 'postbit_userinfo_right'"></dl></vb:if></b>
</vb:if>

LifesGreatestGift
12-04-2011, 05:22 PM
then general guide would be

<vb:if condition="$post['itrader_total'] > '0'">
<!-- if itrader total greater than 0 -->
<font color="green">{vb:raw post.itrader_total}</font>
<vb:elseif condition="$post['itrader_total'] < '0'">
<!-- if itrader total less than 0 -->
<font color="red">{vb:raw post.itrader_total}</font>
<vb:elseif condition="$post['itrader_total'] == 0">
<!-- if itrader total equals 0 -->
<font color="black">{vb:raw post.itrader_total}</font>
</vb:if>

Psyd0x
12-04-2011, 06:36 PM
Great works thanks you :]