PDA

View Full Version : Custom Postbit for Specific Members


ShatterStudios
06-16-2007, 07:48 AM
Let me preface this by saying I don't know much at all about coding. So, please forgive me if my questions don't make sense, and I will appreciate any patience you can spare me. Apologies in advance if this gets a little long, but I want to be as clear and thorough as possible.

I want to customize the way an individual member's postbit looks like. I've got it setup currently so that reputation is displayed as the actual number underneath the post count, like so ―

https://vborg.vbsupport.ru/external/2007/06/1.pngInstead of calling up the stored rep value for that particular member, I want the postbit to simply display to everyone some text of my choosing (the symbol for infinity, in this case).

I was hoping I'd be able to stumble my way through the code and get what I wanted, but my efforts were met with frustration. I found the part of the postbit template for displaying rep, and it looked like this ―

<span id="repdisplay_$post[postid]_$post[userid]"><b>Reputation:</b> $post[reputation]</span>My best guess to accomplish what I set out to do was to have two copies of that in an if/else deal, where the conditional was looking for the specific user and would display the infinity symbol if true or default to the original code if false. My attempt at that resulted in this code ―

<if condition="$userid[14]">
<span id="repdisplay_$post[postid]_$post[userid]"><b>Reputation:</b> ∞</span>
<else />
<span id="repdisplay_$post[postid]_$post[userid]"><b>Reputation:</b> $post[reputation]</span>
</if>Nothing happened, hence this thread. If the above is laughable, remember that I don't know the first thing about coding and have pity.

So, how can I get it to do what I want?

UltimateOreo!
06-16-2007, 08:16 AM
You have to use two conditional statements for each postbit you want displayed.

ShatterStudios
06-16-2007, 08:27 AM
Sorry, not quite sure what you mean. I think the best way to help me would be to just give me the code for what I want to do (if I've explained what I want to do clearly enough), because I'm not ready for understanding.

Dismounted
06-16-2007, 09:39 AM
That kind of makes me laugh...."I think the best way to help me would be to just give me the code for what I want to do". Anyway, you had half the code.
<if condition="$vbulletin->userinfo['userid'] == 14">
<span id="repdisplay_$post[postid]_$post[userid]"><b>Reputation:</b> ∞</span>
<else />
<span id="repdisplay_$post[postid]_$post[userid]"><b>Reputation:</b> $post[reputation]</span>
</if>

ShatterStudios
06-16-2007, 10:02 AM
Heh, yeah. I wasn't in the mood for learning, and I was trying to express that delicately.

Anyways, thanks for responding, but I still can't get it working. I don't suppose it makes a difference if I'm using the legacy postbit (I am making the changes in the correct template).

Dismounted
06-16-2007, 11:16 AM
Are you sure your userid is 14?

tehste
06-16-2007, 12:23 PM
$vbulletin->userinfo['userid'] == 14
should be
$post[userid]==14
or:
$bbuserinfo[userid]==14
cause it's a template.

ShatterStudios
06-16-2007, 05:19 PM
That did the trick. Thank you very much, tehste, and thanks to Dismounted as well.

Brad
06-16-2007, 08:45 PM
$vbulletin->userinfo['userid'] == 14
should be
$post[userid]==14
or:
$bbuserinfo[userid]==14
cause it's a template.
It has nothing to do with begin in a template or not.

$vbulletin->userinfo[] and $bbuserinfo[] point to the same thing and both can be used in the templates without any problems. However both of them contain user data for the user currently viewing the page

So in this case you'd want to use $post[].