PDA

View Full Version : Guest only Ads


givemeplain
12-26-2004, 06:35 PM
Hey,
Is there a way to make it so that only guests can see advertisements. (one you log in, you do not see advertisements on board)

Thank you!

Gio~Logist
12-26-2004, 06:59 PM
Look at this thread on VBT


http://www.vbulletintemplates.com/mods/showthread.php?t=25



Hope this helps






Gio

givemeplain
12-26-2004, 07:00 PM
thanks a lot! =)!

manguish
12-27-2004, 05:01 PM
Why not just use :


<if condition="!is_member_of($bbuserinfo, X)">
CODE HERE
</if>


Inserting the number of the usergroup(s) you DON'T want seeing the ads in place of X

givemeplain
12-27-2004, 05:19 PM
wow thats a lot simpler! but is there a way to make it so more than one usergroup doesnt see the ad?

when I attempt to put it inside the header I get

The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected ';' in /home/shiburao/public_html/includes/adminfunctions_template.php(3055) : eval()'d code on line 33

manguish
12-27-2004, 07:12 PM
To use the code just place it wherever you want your ad code to display.

As for your error - it must be your ad code as the code i gave you doesn't have any ; in it.

Post the whole ad code here if you want it to be debugged.

You dont put this into php files by the way - use it in the template you want it to display in.

manguish
12-27-2004, 07:17 PM
if(($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x))
{
CODE HERE
}

If you must do it in php this'll work.... You get the idea.......

givemeplain
12-27-2004, 08:05 PM
I went to style manager and edited templates. Is that what I am supposed to do? It doesn't work and gives me some weird code

if(($bbuserinfo[usergroupid] == 2) OR ($bbuserinfo[usergroupid] == 6) )
{
<script type="text/javascript"><!--
google_ad_client = "pub-4735661945647510";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
}

N8
12-27-2004, 09:06 PM
Just do this:

<if condition="$bbuserinfo['userid'] == 0">
<script type="text/javascript"><!--
google_ad_client = "pub-4735661945647510";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</if>


and if you want something to display to everyone but guests:

<if condition="$bbuserinfo['userid'] == 0">
<script type="text/javascript"><!--
google_ad_client = "pub-4735661945647510";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<else>
member code here...
</if>

givemeplain
12-28-2004, 12:10 AM
Thanks!

manguish
12-29-2004, 08:42 PM
Within the templates you don't need the { }

In the php files themselves you do.

Michael Morris
12-29-2004, 09:38 PM
God you guys come up with some convoluted solutions to this problem.

If you want to limit something to guests only then use

<if condition="is_member_of($bbuserinfo, 1)"> ad </if>

manguish
12-30-2004, 08:58 AM
Why not just use :


<if condition="!is_member_of($bbuserinfo, X)">
CODE HERE
</if>


Inserting the number of the usergroup(s) you DON'T want seeing the ads in place of X


Like i said in the first place :p

Michael Morris
12-30-2004, 04:53 PM
No, your conditional is !is_member of (Not is member of). The original poster only wants to show the ads to one group only - the guests, so the conditional should be is_member_of

:)

manguish
01-01-2005, 12:48 PM
Like i posted within my post though.

If someone doesn't know the ! operator makes it an inverse, should they really be playing with the code ;)