PDA

View Full Version : <vb:if condition= Current user


clubvr4
03-16-2012, 11:39 AM
Is if possible to show content only to the user currently logged in and not everyone.

An example might be the visitor messages, i'd like to add a conditional so that only that user can see the messages and not everyone.

Is there such a conditional? - I've googled a fair bit but nothing popping up that i can use.

Thanks
Ba

MadMakz
03-16-2012, 12:19 PM
not sure if i got you right but try
<vb:if condition="$bbuserinfo['userid'] != 0">
YOUR CODE HERE
</vb:if>
if you want to show something explicitly to guests/not logged in userses then
<vb:if condition="$bbuserinfo['userid'] == 0">
YOUR CODE HERE
</vb:if>
is what you want.

clubvr4
03-16-2012, 01:38 PM
Hi, thanks for responding.

What i'm actually looking for is the ability to restrict access to the visitors messages to everyone but the current user logged in..

For example, userid 3 has some visitor messages which he can read, if userid 3 goes to userid 4's profile he can post messages but not read any of userid 4's messages.

If userid 3 goes to userid 4's profile he cannot see any of userid 4's messages, but userid 4 can read his own messages from his own profile.

Does that make sense? :D

Iain M
03-16-2012, 01:49 PM
Hey clubvr4,

Try this around the visitor messages...
<vb:if condition="$userinfo['userid'] == $bbuserinfo['userid']">
VISITOR MESSAGE CODE
</vb:if>

clubvr4
03-16-2012, 02:56 PM
Perfect, thank you very much!