vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Hide AdSense from error page (https://vborg.vbsupport.ru/showthread.php?t=300520)

chefy 07-27-2013 03:19 PM

Hide AdSense from error page
 
Hi guys,

I have AdSense on my navbar template. I'm looking for a conditional to prevent AdSense from being displayed on the error page that you get when someone attempts to access to a deleted post. When you're on a deleted post the page is blank (no content) but only the following line of code:

Quote:

$vbphrase[invalidid]

Invalid {1} specified. If you followed a valid link, please notify the <a href="{2}">administrator</a>
How I can prevent AdSense from showing on those pages?

Thank you!

Lynne 07-28-2013 10:13 PM

Is the url always postings.php? If so, you can use THIS_SCRIPT in the condition and not show it if THIS_SCRIPT == 'postings' Or, if it's always the showpost.php page, do the same but for THIS_SCRIPT == 'showpost'

chefy 07-29-2013 12:52 PM

Thanks, it was on showpost.php pages so this one worked like a charm to prevent displaying ads on those pages: THIS_SCRIPT != 'showpost'

However it prevents ads from being displayed on all showpost.php pages even those that actually have content. Is there any easy way to prevent ads from being displayed only when the content has been remove i.e. when the system display the following error message:

Quote:

$vbphrase[invalidid]

Invalid {1} specified. If you followed a valid link, please notify the <a href="{2}">administrator</a>
Thanks.

Lynne 07-29-2013 03:12 PM

Perhaps add into your condition something regarding whether the postid exists?:

AND (!$postinfo['postid'])

(I'm not sure what template this is in, so you may need to try !$post['postid'] or !$GLOBALS['postid'] instead)

matrog 03-12-2014 06:19 PM

I'm interested in this script since adsense ban account if ads are shown on error pages, can anyone help me?

Simon Lloyd 03-13-2014 05:28 PM

Maybe a condition if($post[postcount] == 0)


All times are GMT. The time now is 08:02 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.02803 seconds
  • Memory Usage 1,723KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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