PHP script for different Adsense ads and locations?

  • HHawk
  • Novice
  • Novice
  • HHawk
  • Posts: 22

Post 3+ Months Ago

I am wondering if anyone knows a PHP script which can do the following:

1. Display random Google ads. E.g. 125x125 and when you hit refresh 120x240,etc.

2. Display Google ads in (in selected) random places. E.g. top of the page and on refresh in the middle.

If somebody knows a script which can do this, please share.
Also I don't know PHP, maybe it's very easy for someone te create it?

Thanks in advance!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

I would use JS for this for two reasons off the top of my head.

  • Using PHP would make it tougher to cache static HTML versions of pages
  • The browser needs to have JS enabled for Adsense to work anyways, so it's not breaking anything new

Here's an example of using JS to have different sized Adsense units depending on the size of the visitors screen. I think it should be fairly easy to apply the same idea to random ad sizes.
javascript-tutorials/tutorial-dynamic-adsense-units-t97591.html

As for random ad spots, that would need a global variable for each slot to check in with to determine if another ad from the same group has already displayed itself.
  • HHawk
  • Novice
  • Novice
  • HHawk
  • Posts: 22

Post 3+ Months Ago

Great! Thanks for the reply.
I did use the search function, however I have seem to missed this topic.

Seems like what I need. Thank you very much!
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

  • HHawk
  • Novice
  • Novice
  • HHawk
  • Posts: 22

Post 3+ Months Ago

I am already using different adsense formats from a random ad displayer script. The only thing I want is, adsense showing up on different sections on the page.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Isn't that what "layout" means ? :scratchhead:
  • HHawk
  • Novice
  • Novice
  • HHawk
  • Posts: 22

Post 3+ Months Ago

Damn... I misread, my bad. :(

/me blames my headache.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 159 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.