Exclude some JS code on another page?

Roparadise

BANNED
Joined
May 25, 2011
Messages
784
Reaction score
1,422
I have a image hosting website where after I upload the images it directs me to the uploaded page which uses the code from view.php file. I put a adbrite code on the view.php file So when someone looks at a picture an ad is displayed. How can I exclude the ad from displaying on the uploaded page?
 
A little php code should do the trick.

Something like if page title = view then JS.

Let's wait for jazzc to give his input :p
 
Do you mean the view.php is included in image page and uploaded page? If so

on image page



view.php


So the ad will show only when the $display variable is set to true.

I tried setting that code up,but it doesn't work for some reason.
 
Post the code that 's responsible for the ad showing up so that we can provide you with a fix :)
 
<!-- Begin: Black Label Ads, Generated: 2012-07-05 19:12:25 -->
<script type="text/javascript">
var AdBrite_Title_Color = '0000FF';
var AdBrite_Text_Color = '000000';
var AdBrite_Background_Color = 'FFFFFF';
var AdBrite_Border_Color = 'CCCCCC';
var AdBrite_URL_Color = '008000';
try{var AdBrite_Iframe=window.top!=window.self?2:1;var AdBrite_Referrer=document.referrer==''?document.location:document.referrer;AdBrite_Referrer=encodeURIComponent(AdBrite_Referrer);}catch(e){var AdBrite_Iframe='';var AdBrite_Referrer='';}
</script>
<span style="white-space:nowrap;"><script type="text/javascript">document.write(String.fromCharCode(60,83,67,82,73,80,84));document.write(' src="http://ads.adbrite.com/mb/text_group.php?sid=xxxxxxx&zs=xxxxxxxxxxxx&ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+'" type="text/javascript">');document.write(String.fromCharCode(60,47,83,67,82,73,80,84,62));</script>
<a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=xxxxxxx&afsid=xxxxx"><img src="http://files.adbrite.com/mb/images/adbrite-your-ad-here-leaderboard.gif" style="background-color:#CCCCCC;border:none;padding:0;margin:0;" alt="Your Ad Here" width="14" height="90" border="0" /></a></span>
<!-- End: Black Label Ads -->

The red x's are ID numbers I censored out. thanks in advance
 
I didn't mean the ad code, the view.php code around it. I.e. what we want to see is how this adbrite code is served, so that we can make you a proper if/else loop. Please upload view.php to pastebin and let us know how the page you do not want the ad to display is called (e.g. upload.php).
 
This is the code of the page I want ads on http://pastebin.com/cT2UsFk6
And this is the code of the page I dont want ads on http://pastebin.com/YVGjPcvN
 
Thanks Roparadise. Please also upload the code of view.php.
 
Back
Top