Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Adbrite not working in panel

Asked Modified Viewed 3,307 times
T
TwifanUK
T
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
asked
Junior Member

Hi,

I've been trying to get Adbrite to work in a panel on my site. It's top/centre on the page and the panel is as follows:

openside("");  
echo "<center><!-- Begin: adBrite, Generated: 2012-01-02 13:39:46  -->
<script type='text/javascript'>
var AdBrite_Title_Color = 'ce079e';
var AdBrite_Text_Color = '000000';
var AdBrite_Background_Color = 'FFFFFF';
var AdBrite_Border_Color = 'ffffff';
var AdBrite_URL_Color = '018dd3';
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=2075152&zs=3436385f3630&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=2075152&afsid=1'><img src='http://files.adbrite.com/mb/images/adbrite-your-ad-here-banner.gif' style='background-color:#ffffff;border:none;padding:0;margin:0;' alt='Your Ad Here' width='11' height='60' border='0' /></a></span>
<!-- End: adBrite --></center>";
closeside();


I changed all " to ' (as far as I can see) but it still doesn't appear properly. You can see it on the site @ http://www.gigglesnort.net

Thanks
0 replies

6 posts

J
JoiNNN
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
answered
Veteran Member

When comes to use inline javascript code in a panel I think is better to not replace the quotes and leave it as is and use ?> before the code and <?php after.

Quote

openside("Inline javascript"wink;
?>
<script type='text/javascript'>
inline javascript
</script>
<?php
closeside();
0 replies
T
TwifanUK
T
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
answered
Junior Member

Hi,

I tried adding that and leaving the rest of the code with the " but I got parse errors on it. I changed them to ' and added that extra bit (and removed the echo bit) so my code looks like this:

openside(""); 
?>
<center><!-- Begin: adBrite, Generated: 2012-01-02 15:53:24  -->
<script type='text/javascript'>
var AdBrite_Title_Color = 'ce079e';
var AdBrite_Text_Color = '000000';
var AdBrite_Background_Color = 'FFFFFF';
var AdBrite_Border_Color = 'ffffff';
var AdBrite_URL_Color = '018dd3';
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=2075152&zs=3436385f3630&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=2075152&afsid=1'><img src='http://files.adbrite.com/mb/images/adbrite-your-ad-here-banner.gif' style='background-color:#ffffff;border:none;padding:0;margin:0;' alt='Your Ad Here' width='11' height='60' border='0' /></a></span>
<!-- End: adBrite --></center>
<?php
closeside();


It doesn't seem to have worked as the panel looks exactly the same as it did before.
0 replies
J
JoiNNN
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
answered
Veteran Member

Quote

JoiNNN wrote:

...is better to not replace the quotes and leave it as is...

Use should the original code.
The thing is, you converted the quotes and some lines must be wrapped in " " not in ' '.
wrong

Quote

document.write(' src='http://ads.adbrite.com/mb/text_group.php?sid=2075152&zs=3436385f3630&ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+'' type='text/javascript'>');

right

Quote

document.write(" src='http://ads.adbrite.com/mb/text_group.php?sid=2075152&zs=3436385f3630&ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+'' type='text/javascript'>");

if you want to echo it you must escape the quotes

Quote

echo "document.write(\" src='http://ads.adbrite.com/mb/text_group.php?sid=2075152&zs=3436385f3630&ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+'' type='text/javascript'>\");";

So just use ?> original javascript/html code <?php and should work just fine.
0 replies
T
TwifanUK
T
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
answered
Junior Member

Thanks for your help. That worked perfectly. :D

I'm a bit of an idiot when it comes to php so I struggle somewhat. :(
0 replies
D
DawciuPotter
D
Do you have a problem?
Solve it on my site! °° English-speaking forum
DawciuPotter.pl - the whole world in one place
  • Junior Member, joined since
  • Contributed 23 posts on the community forums.
  • Started 1 thread in the forums
answered
Junior Member

You can also start and end echo with ', so you can have inside echo "

example:

echo '<a href="http://www.php-fusion.co.uk/">It will work</a>';
0 replies
— 8 months later —
S
Skeeve
S
Skeeve 10
"The world is my country, and do good is my religion." - Thomas Paine
  • Member, joined since
  • Contributed 81 posts on the community forums.
  • Started 19 threads in the forums
answered
Member



saved the day. my code is working now. thanks
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 6 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

S
S
Skeeve 10
"The world is my country, and do good is my religion." - Thomas Paine
  • Member, joined since
  • Contributed 81 posts on the community forums.
  • Started 19 threads in the forums
J
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
T
T
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
D
D
Do you have a problem?
Solve it on my site! °° English-speaking forum
DawciuPotter.pl - the whole world in one place
  • Junior Member, joined since
  • Contributed 23 posts on the community forums.
  • Started 1 thread in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet