vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Any way to block ads from being shown in perticular forums or pages ? (https://vborg.vbsupport.ru/showthread.php?t=179603)

anantthakor 05-18-2008 02:51 AM

Any way to block ads from being shown in perticular forums or pages ?
 
Is there any way to stop from being shown ads in perticular forums of site ?

This is will be good help for those who have adult sites and want to use google adsense revenue sharing :)

veenuisthebest 05-18-2008 03:08 AM

Wrap your Ad code in the following conditional ..

Code:

<if condition="$forumid != X">

Your Ad Code here

</if>


where X is your forum ID where you do not want to display Ad

anantthakor 05-18-2008 03:11 AM

but where ? in which template. please give me example using any google adsense modification :)

veenuisthebest 05-18-2008 03:15 AM

For vB 3.7, you now have Ad Location Templates, paste the Google Adsense code in any of the desired templates like ad_header_logo.

And simply wrap that code in the conditional i.e.

Code:

<if condition="$forumid != X">

YOUR
GOOGLE
ADSENSE
CODE
HERE

</if>


where X is the forum ID where you do NOT want to show the Ad. Hope this helpsss

anantthakor 05-18-2008 03:24 AM

I tried this but while adding i am having this error

Quote:

Parse error: syntax error, unexpected ',' in /public_html/includes/adminfunctions_template.php(3717) : eval()'d code on line 1

veenuisthebest 05-18-2008 03:26 AM

Post your complete code.. that you applied to the template !!

anantthakor 05-18-2008 03:30 AM

<if condition="$forumid != 12,235,236,267">

my adsense code

</if>

I used this bcoz i dont want show these ads more above these 4 forums

veenuisthebest 05-18-2008 03:32 AM

Code:

<if condition="$forumid != 12,235,236,267">
this is wrong, it won't accept an array of ID's..
the conditional I provided works for just 1 forum like this

Code:

<if condition="$forumid != X">

anantthakor 05-18-2008 03:33 AM

But i want to bock this in 4 forums like i tried :(

Please provide me codes for that :)

veenuisthebest 05-18-2008 03:35 AM

okk... try this for multiple forums.. not sure if it works !!

Code:

<if condition="out_array($forum['forumid'], array(12,235,236,267))">

anantthakor 05-18-2008 03:38 AM

It shows this message

Quote:

The following template conditional expression contains function calls:

<if condition="out_array($forum['forumid'], array(12,235,236,267))">

Function Name Usage in Expression
out_array out_array($forum['forumid'], array(12,235,236,267)

With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.

The following functions are allowed in template conditional expressions:
in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg() is_browser() is_member_of()

veenuisthebest 05-18-2008 03:41 AM

okay... then do one thinggggg !! use this conditional instead

Code:

<if condition="in_array($forum['forumid'], array(X,X,X,X,X,X,X,X,X))">
But this time replace the X's with the forum ID's where YOU WANT to show the Ads.

anantthakor 05-18-2008 03:47 AM

Its working 100%

Btw try to get blocking code also if you can :)

I have more than 100 forums :D

veenuisthebest 05-18-2008 03:55 AM

ya.. I understand lol

okayy... try this and tell me if it works !!!

Code:

<if condition="in_array(!$forum['forumid'], array(12,235,236,267))">

anantthakor 05-18-2008 04:32 AM

Now not needed :D I made whole list :)

Thanks alot for your fast and perfect support :)


All times are GMT. The time now is 08:04 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01016 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete