![]() |
I'm sorry to be a pain, but this is what I used and the ads are still showing up on every forum. I have one particular forum where sponsors answer questions. This forum as an "Ask the Expert" forum with several child forums dedicated to each individual expert. I don't want ads for competitors showing up there. What is wrong with my code now? I have included the "Ask the Expert" forum ID, along with the IDs for all the child forums. Ads cannot show up in these forums, and I don't want the "experts" usergroup to see any at ads at all...on any forum.
Code:
<center><if condition="!in_array($forum['forumid'], array(32,48,34,44,41,49,53,58,61,79,82,81,80,46,52,36,40)) AND !is_member_of($vbulletin->userinfo, 7,14)"><script type="text/javascript"><!-- |
Where are you putting this code?
Some places user different variables, instead of $forum['forumid'] try $thread['forumid'] or $foruminfo['forumdid'] or $threadinfo['forumid'] (if you're in a thread). |
I've tested it on ad_navbar_below.
--------------- Added [DATE]1296756776[/DATE] at [TIME]1296756776[/TIME] --------------- When I try the $foruminfo['forumdid'] code, the ad shows up as "page cannot be displayed". I'm gonna try the other two suggestions and see if they work. |
Quote:
|
None of these seem to work. I'm so frustrated b/c I've had a server load problem and have narrowed it down to the Adsense hack I have installed. I'm hoping to find a workaround for this by using these conditionals, but they don't want to cooperate with me. :(
--------------- Added [DATE]1296759302[/DATE] at [TIME]1296759302[/TIME] --------------- The problem is that even though it said "page cannot be displayed", it was still showing up in a forum that it shouldn't be in. I made a test user and put it in the "experts" usergroup, and could see all ads. --------------- Added [DATE]1296759410[/DATE] at [TIME]1296759410[/TIME] --------------- I'm just going to try to get it to not show up in the experts forum, and forget about blocking ads throughout the entire forum for my experts group. |
I just tested this on my forum, it's definitely $foruminfo['forumid'] to show the ad code in specific forums (forumdisplay) and threads in that forum (showthread.)
If you get the page can't be displayed message in the ad box you have an error in the code you copied from google to show the ad. The fact that the box shows means the conditional is working. |
I don't know what I'm doing wrong, but if you don't mind, can you please take a look at my code and see if anything looks wrong? I'm copying the code directly from Google. My hack works fine, but I disable it to test out the conditionals.
Code:
<if condition="!in_array($foruminfo['forumid'], array(32,48,34,44,41,49,53,58,61,79,82,81,80,46,52,36,40))"><script type="text/javascript"><!-- Also, could my PHP version be the problem? I'm running 5.2.16. --------------- Added [DATE]1296771156[/DATE] at [TIME]1296771156[/TIME] --------------- The answer is to use $GLOBALS instead of $foruminfo. Works like a charm! |
I copied your code into my forum and the condition works perfectly fine for me (in the ad_navbar_below template) which is shown in the navbar template...
What exactly isn't working? I can't test the google code obviously but it looks like it should work if you had numbers in place of the x's. DO you have a kink to a forum this is running on? |
Nope, no kinks. This code works:
Code:
<if condition="!in_array($GLOBALS['forumid'], array(32,48,34,44,41,49,53,58,61,79,82,81,80,46,52,36,40))"> AND <if condition="!is_member_of($vbulletin->userinfo, 1,2)"> Code:
<if condition="!is_member_of($bbuserinfo, 14)> --------------- Added [DATE]1296779481[/DATE] at [TIME]1296779481[/TIME] --------------- Oh, the problem was that the ads were showing up in the forums I didn't want them to show up in. They were also showing up to the usergroups I didn't want them showing up to. The "page cannot be displayed" was just a glitch with one of the image ads. That's all that was. |
i have problem in conditional coding too .
i am pasting this in one of my template ad location ad_showthread_firstpost <if condition="THIS_SCRIPT != 'adv_index' AND THIS_SCRIPT != 'register' AND $GLOBALS[forumid] != 6"> and getting this error Parse error: syntax error, unexpected ',' in /home/forum/public_html/includes/adminfunctions_template.php(3772) : eval()'d code on line 1 can anyone help ?. |
All times are GMT. The time now is 11:39 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|