1
HarryB
Banner script that works for Google adsense
  • 2014/5/30 9:43

  • HarryB

  • Just popping in

  • Posts: 9

  • Since: 2013/12/30


Hi, I have been searching high and low, but can't get this to work. I have tried Javascript and PHP but still nothing. The problem: I'm using the xoops banner system and it works great, but I want to have a rotator script that can rotate different sizes of google ads too. Any advice?

2
HarryB
Re: Banner script that works for Google adsense
  • 2014/5/30 10:42

  • HarryB

  • Just popping in

  • Posts: 9

  • Since: 2013/12/30


Never mind. I found it. Add to a PHP block with adsense codes:

$random[] = '<a href="http://www.all4yourwebsite.com/" title="Website templates, dreamweaver templates, flash intro templates"><img src="images/banners/all4webBanner468_60.jpg" alt="all4yourWebsite.com - web design templates" /></a>';

$random[] = '<a href="http://www.designers-website.eu/" title="Premium Web Design Templates"><img src="/images/banners/designers_website_468_60.jpg" alt="Designers Website" /></a>';

// ad more banners if you like

$random[] = '<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxx";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_page_url = document.location;
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>'
;

$i rand(0count($random)-1);

3
HarryB
Re: Banner script that works for Google adsense
  • 2014/5/30 13:16

  • HarryB

  • Just popping in

  • Posts: 9

  • Since: 2013/12/30


And with this plugin for blocks anywhere, it made my day
http://www.xuups.com/modules/publisher/item.php?itemid=10

4
HarryB
Re: Banner script that works for Google adsense
  • 2014/5/30 13:22

  • HarryB

  • Just popping in

  • Posts: 9

  • Since: 2013/12/30


Forgot. Add to the PHP block:

echo $random[$i];

Login

Username:
Password:

Lost Password? Register now!

Who's Online

66 user(s) are online (39 user(s) are browsing Support Forums)


Members: 0


Guests: 66


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jun 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits