Log in

View Full Version : If conditional for when it's not current user??


chickadee
10-02-2007, 04:23 PM
Is there a condition that says <if not current user, display this?

Hope that makes sense....

Opserty
10-02-2007, 04:30 PM
Are you comparing it to a set variable or something?

(For userids:)

<if condition="$bbuserinfo['userid'] == 1">
CURRENT USER VIEWING PAGE HAS USERID OF 1
</if>

chickadee
10-02-2007, 04:38 PM
No not quite,

I think this means current user: <if condition="$bbuserinfo[userid] == $userinfo[userid]">
So I guess I'm looking for the opposite, I want to show an 'add to buddylist' link on memberinfo show to everyone who is not that user.

efc9
10-02-2007, 10:21 PM
If you want to do it in the memberinfo template, then you can just use:
<if condition="$show['addbuddylist']">
that'll show to anyone who can add the person as a buddy.

now for it to show to anyone, you can use:
<if condition="$bbuserinfo[userid] != $userinfo[userid]">
or
<if condition="$bbuserinfo[userid] <> $userinfo[userid]">
but that'll also show the add buddy link to users that person has ignored, who will get an error when they try to add to the person to their buddylist.

chickadee
10-03-2007, 08:15 AM
Thanks, I'll see if I can play around with that!

WhaLberg
10-03-2007, 11:17 AM
No not quite,

I think this means current user: <if condition="$bbuserinfo[userid] == $userinfo[userid]">
So I guess I'm looking for the opposite, I want to show an 'add to buddylist' link on memberinfo show to everyone who is not that user.

Don't you have "Add x to Your Buddy List" in member profiles? That's a vBulletin default.

chickadee
10-04-2007, 12:40 PM
Quite possibly, but I've changed my memberinfo template to beyond recognition.

I also have other uses for this sort of code.

Don't you have "Add x to Your Buddy List" in member profiles? That's a vBulletin default.

--------------- Added at 15:28 ---------------

If you want to do it in the memberinfo template, then you can just use:
<if condition="$show['addbuddylist']">
that'll show to anyone who can add the person as a buddy.

now for it to show to anyone, you can use:
<if condition="$bbuserinfo[userid] != $userinfo[userid]">
or
<if condition="$bbuserinfo[userid] <> $userinfo[userid]">
but that'll also show the add buddy link to users that person has ignored, who will get an error when they try to add to the person to their buddylist.

This works perfectly, thanks!