Jump to content

Timed Advertisements


jfarthing

Recommended Posts

So, I wanna allow users of my website to pay to be featured on the front page.  Just for example, lets say they pay $5.00 for a 5 day feature.  Also, there is only 5 feature slots on my front page.  So, how do I make specific dates unselectable when all 5 slots are full at any given time..?

Link to comment
https://forums.phpfreaks.com/topic/100426-timed-advertisements/
Share on other sites

the better way to do this is just create a stack of ads to be displayed, don't give them choice simply just start banking up frontpage coverage. 

Then on every page load you run a simple check of:

1) Query the database for the five "live" ads where the time they have been "live" is more than five days"

2) If the rows is greater than zero then change all adds that are over the limit to expired

3) Then query for the next event(s) in line to be displayed and set their "livedate" to be NOW()

 

The presentation query is

Select * from `ads` where live = '1';


Live = 0 means its in query to be added
Live = 1 means its live
Live = 2 means its expired.


Fairly simple 

Link to comment
https://forums.phpfreaks.com/topic/100426-timed-advertisements/#findComment-514082
Share on other sites

Cool dude, that approach simply may just work.  I kind of liked the idea of the user being able to kind of "target" his campaign to a specific date and time frame but...this way I could at least show their status to them as well like if it is live and when it started and will end...

Link to comment
https://forums.phpfreaks.com/topic/100426-timed-advertisements/#findComment-515818
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.