Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Random Banners Rotation..., set by percentages
ChronicLoser
post Dec 12 2004, 05:43 AM
Post #1


Premium Member
Group Icon

Group: Members
Posts: 240
Joined: 13-November 04
From: Arizona
Member No.: 1,356



alright, I know a few different ways to make a random banner with php - where a different banner would rotate with every refresh/click. But I've had some "customers" complain how they think their banner should show up more then others for one reason or another, and I completely agree with them. So now I kinda want to have a code (most perferably php or javascript) that would have the banner rotation where I could set a peticular banner to show up say 15% of the time and another 5% so I could satisfy my more loyal members over the ones simply looking for more hits to their site. Can someone give me a way of doing this?

And I don't want to do something like this:

banner1.gif
banner1.gif
banner1.gif
banner1.gif
banner2.gif
banner2.gif
banner2.gif
banner2.gif
banner2.gif
banner3.gif
banner3.gif
banner4.gif
banner5.gif
banner6.fig

because I'm a too lazy to make those kind of calculations everytime someone joins my banner rotation system. Alright then. THanks in advance for anyone willing to help me out here
Go to the top of the page
 
+Quote Post
Hercco
post Dec 12 2004, 10:01 AM
Post #2


Super Member
Group Icon

Group: Members
Posts: 595
Joined: 4-September 04
Member No.: 228



Problem wuth that kind of system is that... If you promise one of your advertisers say 15% of the time. That meaning that of 100 page loads their ad should be displayed 15 times.
But what happens when you add new advertisers to your system? You only have 100% of page loads and if you add more advertisers the percentage of other's ads has to drop.


Anyways, let's say that you have set number of advertisers. What you can simply do is save table like this:

ad1 -> 15
ad2 -> 30
ad3 -> 50
ad4 -> 100

There ad1 and ad2 would have 15% chanhe of being vieved, ad3 20% and ad4 50% change.

Than just create random numbers ranging from 1 to 100 and loop through your table like this:

CODE

$rand = rand(1, 100);

foreach ( $ads as $ad_number => $limit )
{
if ( $rand <= $limit )
{
  $ad_to_view = $ad_number;
  break;
}
}


Go to the top of the page
 
+Quote Post
jcguy
post Dec 12 2004, 11:33 AM
Post #3


Premium Member
Group Icon

Group: Members
Posts: 382
Joined: 5-September 04
Member No.: 255



I would recommend a adserving system based on php and mysql to you. It's called phpAdsNew, a free open-source system. You can download it at http://www.phpadsnew.com. In fact i think you have this script in in your cpanel's scripts section.

Once you installed it, you basically can run an adserver like Valueclick or the other major ad firms, except perhaps phpadsnew is less "pro". Anyway, you can set priority to different banners. Say if you want banner A to appear more than banner B, then you can give a heavier weiht to banner A, and the adserver will make the calculation and serve your ads the way you want it.

hope this helps
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Photoshop Tutorial: Abstract Background I(1)
  2. Photoshop: Abstract Background Tutorial I(0)
  3. Coppermine Random Image Script(6)
  4. How To Add 3-d Effect To Banners Like Shiver7.com(5)
  5. Visual Basic: Random Strings!(10)
  6. Random Images On Eacht Pageload And Refresh.(6)
  7. Logos / Banners For Ipb Board(0)
  8. Pre-installed Cgi(0)
  9. Php: Write Random Text As Image(3)
  10. Random Chuck Norris Facts(2)
  11. Random MySQL Entry(1)
  12. Some Cute Banners(21)
  13. A Few Random Thoughts..(0)
  14. Blingo Search Engine(3)
  15. Rather Random Question(2)
  1. Automatic Title/status Text Rotation!(0)
  2. Lesson #3 - Basic Math Operators And Random #s(0)
  3. Script For Viewing A Random Image Needed(3)
  4. Google Image Labeler(11)
  5. Ad-rotation Plug-in For Joomla Or Drupal?(4)
  6. Random Name Generator(2)
  7. How To Get The Random.h Header(4)
  8. "Proud To Be Hosted By Xisto/Astahost" Banners(4)
  9. Banners, Images, Etc.(1)
  10. Random With Functions?(4)
  11. Php Random Selector(2)
  12. Random Restarting(13)
  13. Random Questions In Vb..(7)


 



- Lo-Fi Version Time is now: 5th December 2008 - 07:57 AM