Log in

View Full Version : Ads for guests


Jase2
04-03-2008, 11:39 AM
Hi all,

I'm displaying some ads in the ad_navbar_below template, and I only want to show them to guests. However, it doesn't seem to work with:

<if condition="$post[postcount] == 1 AND !$bbuserinfo[userid]">

Any ideas why?

EDIT: Done with the following:

<if condition="$bbuserinfo['userid'] == 0">

Bradley_Wint
04-03-2008, 12:23 PM
try this


<if condition="!is_member_of($vbulletin->userinfo, 1)">
[ad code here]
</if>

Jase2
04-03-2008, 12:25 PM
Thanks, but I did it as I stated above ;)

Bradley_Wint
04-03-2008, 12:25 PM
cool

SEOvB
04-03-2008, 01:02 PM
<if condition="$show[guest]"> works as well, and is alot easier to remember :D

Yogesh Sarkar
04-03-2008, 01:25 PM
^^Exactly, thats what I am using as well.

Opserty
04-03-2008, 01:28 PM
try this


<if condition="!is_member_of($vbulletin->userinfo, 1)">
[ad code here]
</if>

What's the point in checking the usergroup, if they aren't registered they aren't going to have a UserID anyway :p

Jase2
04-03-2008, 01:40 PM
Either way, both the ones myself and FRDS suggested work.. Does it really matter which one you use? And Opserty makes a very good point :)

Opserty
04-03-2008, 01:52 PM
What FDRS suggested is practically the same as what you suggested Jase2.

Off the top of my head I think the snippet is something like this, in global.php:

if($vbulletin->userinfo['userid'])
{
$show['member'] = true;
$show['guest'] = false;
}
else
{
$show['member'] = false;
$show['guest'] = true;
}

So either way they are practically identical ways of achieving the same outcome ;)