Log in

View Full Version : Adsense Conditionals for Vbulletin Archive and Secondary Groups ?


David_R
06-12-2005, 09:01 AM
I am looking for adsense conditional for our forums, to disable google advertisements for Premier Group (this is a secondary group which sponsors/supports us).

Currently, I have setup adsense conditional for Administrator usergroup as follows,this works perfect on entire forum: Advertisements are disabled to Administrator usergroup.
<if condition="$bbuserinfo['usergroupid'] != 6">
Google Adsense Code
</if>

However, when i am trying to use
<if condition="$bbuserinfo['usergroupid'] != 6" OR "$bbuserinfo['usergroupid'] != 78">
Google Adsense Code
</if>
This code wont work.

I would also need to disable Advertisements appearing on archive pages for both the above groups.
Can someone direct me to correct code ?



Thanks.

Marco van Herwaarden
06-12-2005, 10:50 AM
You should use AND instead of OR.

David_R
06-12-2005, 11:19 AM
You should use AND instead of OR.
Tested with AND but it wont work, if I am adding the same conditionals to my archive, this wont work as well..

I assume there should be some different modification for archive ?

Marco van Herwaarden
06-12-2005, 02:59 PM
Try:
<if condition="$bbuserinfo['usergroupid'] != 6 AND $bbuserinfo['usergroupid'] != 78">
Google Adsense Code
</if>

Regs
06-12-2005, 04:34 PM
Unless you had administrators who were also premium members, that conditional wouldn't hide the code from anyone, correct?

David_R
06-14-2005, 12:38 AM
Try:
<if condition="$bbuserinfo['usergroupid'] != 6 AND $bbuserinfo['usergroupid'] != 78">
Google Adsense Code
</if>
Hey Marcho,
Thanks for helping till here, but this code is not working for any users who are members of Secondary Usergroup 78.. :(

Morever, If i am putting the conditional for ads under archive this wont work even for administrator group.

Still Need help.
Thanks.

David_R
06-15-2005, 11:04 PM
bumping back again, please help me, I have a premium members (secondary group) usergroup who are requesting me to disable google adsense advertisements.

thanks.

Andreas
06-15-2005, 11:10 PM
<if condition="!is_member_of($bbuserinfo, 6) AND !is_member_of($bbuserinfo, 78)">
Adsense here
</if>

David_R
06-15-2005, 11:19 PM
<if condition="!is_member_of($bbuserinfo, 6) AND !is_member_of($bbuserinfo, 78)">
Hi KirbyDE,
This works great, thanks for the updations KirdyDE, can you please also suggest the modifications to be made to the archive ?

I appreciate your time for this, since i had been looking for this since a very long time :)

Andreas
06-15-2005, 11:25 PM
Well, if's basically the same ;)


if (!is_member_of($bbuserinfo, 6) AND !is_member_of($bbuserinfo, 78))
{
?>
<!-- Put your Adsense Code here -->
<?php
}

David_R
06-20-2005, 06:06 PM
Well, if's basically the same ;)


if (!is_member_of($bbuserinfo, 6) AND !is_member_of($bbuserinfo, 78))
{
?>
<!-- Put your Adsense Code here -->
<?php
}

thats very much appreciated :)
Works perfect on forums, but wont work on archive.

Big thanks again for helping with forums fix...

Andreas
06-20-2005, 06:09 PM
I am pretty sure it does work in the archive :)
Just place the code in archive/index.php where you want to have Adsense.

David_R
06-20-2005, 06:10 PM
I am pretty sure it does work in the archive :)
Just place the code in archive/index.php where you want to have Adsense.
I have the same code (square box ads) on my forums as well archive, it hidden on forums but not on archive..

Not sure, if I am missing anything ??

Andreas
06-20-2005, 06:12 PM
Put the code I posted (# 10) in archive/index.php - should work.

David_R
06-20-2005, 06:27 PM
Put the code I posted (# 10) in archive/index.php - should work.
Hi there,
Sorry to bother ya again, I have the same code in my forum templates as well archive, Adsense ads are now hidden everywhere on forums for those 2 usergroups but sill visible for both administrator and secondary usergroup...

I am confused.

Andreas
06-20-2005, 06:31 PM
I can only repeat myself:
Put the code I posted (#10) in archive/index.php where your Adsense Code is currently located.

Or in other words:

Open archive/index.php with your favoured editor, locate your Adsense-Code, cut it out, paste the code I posted (# 10) where you have just cut out your Adsense code, then replace the Comment within this Code with your Adsense Code, save the file and upload it to your server.