PDA

View Full Version : Conditional Help


grey_goose
12-21-2009, 12:39 AM
<if condition="is_member_of($vbulletin->userinfo, 5, 6)">
<font size="1"><div class="info" align="center"><center>$post[field41]<center><br></div></font>
</if>

This displays custom profile field 41 on the postbit_legacy if a user is a super-mod or admin. How can I make it *also* display to the user themself?

thanks!

kh99
12-21-2009, 01:21 AM
Try changing the condition to :

<if condition="is_member_of($vbulletin->userinfo, 5, 6) OR ($post[userid] == $vbulletin->userinfo[userid])">

grey_goose
12-21-2009, 01:45 AM
awesome! ty!

grey_goose
03-19-2010, 02:25 PM
Doesn't seem to be working... any other ideas?

imported_silkroad
03-20-2010, 04:20 PM
(removed.... sorry did not read the entire question... please delete, thanks.)

kh99
03-20-2010, 04:59 PM
Hmm...maybe try using $bbuserinfo in place of $vbulletin->userinfo?

grey_goose
03-23-2010, 11:56 AM
That didn't work either :(

grey_goose
11-08-2010, 06:23 PM
Anyone else want to give it a shot? The full code is:

I want the tab to show to Admins, Mods, Usergroup 32, *AND* the poster themselves. Everything's working except the original poster can't see the tab.

<!--TAB CONTENT -->
<div id="tab8$post[postid]" class="tabcontent">
<if condition="$post['field57']">
<div style="background-color:#1A1A1A; padding:5px; border: 1px dimgrey solid">
<div class="info"><if condition="$post['field57']">$post[field57]</if></div>
<if condition="is_member_of($bbuserinfo, 5,32) OR $show['moderatethread']">
<font size="1"><div class="info" align="center"><center>$post[field70]<center><br></div></font>
</if>
<div class="info" align="center"><if condition="$post['field51']">
<img src="$post[field51]" width="100" border="1" /><br></if></div>
<div class="info"><if condition="$post['field63']"><br><font size="1"> $post[field63]</font></if></div>
</div>
</if>
</div>

kh99
11-08-2010, 07:01 PM
Hey, I remember this :)

Anyway, I just tried this in my postbit_legacy template:


<if condition="$bbuserinfo[userid] == $post[userid]">
This is my post!!!
</if>


and it worked as expected, so it seems like


<if condition="is_member_of($bbuserinfo, 5,32) OR $show['moderatethread'] OR $bbuserinfo[userid] == $post[userid]">


should work for you.

(If not, this is really my last try...)

Simon Lloyd
11-09-2010, 12:23 AM
I use that first part myself kh99, take a look here for some conditionals http://tech6.com/f51/vbulletin-template-conditionals-list-t112/

kh99
11-09-2010, 01:09 AM
Thanks for the link. The problem with my first try (almost a year ago now!) is that $vbulletin isn't available in postbit so it has to be $bbuserinfo. I realized that later, so I'm not sure why the second try didn't work. Anyway, this time I decided to test it.

Simon Lloyd
11-09-2010, 03:00 AM
Thanks for the link. The problem with my first try (almost a year ago now!) is that $vbulletin isn't available in postbit so it has to be $bbuserinfo. I realized that later, so I'm not sure why the second try didn't work. Anyway, this time I decided to test it.Yep, i had to learn that lesson too........i went over and over, reading and re-reading and was adamant i'd done it right but couldn't get it to work, stumbled across that site, tried the one you have above and bingo!

Served me right back then for being obstinate :)

grey_goose
11-09-2010, 07:53 PM
Got it. I had them set as "Private" fields in Wired1's Extra Profile Fields. Taking off the 'private' flag did the trick. Now... why private would hide it from the user themselves... lol

Thanks so much.