jfarthing Posted April 10, 2008 Share Posted April 10, 2008 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 More sharing options...
jfarthing Posted April 10, 2008 Author Share Posted April 10, 2008 Anybody? Link to comment https://forums.phpfreaks.com/topic/100426-timed-advertisements/#findComment-514050 Share on other sites More sharing options...
Zhadus Posted April 10, 2008 Share Posted April 10, 2008 Do you intend it to be all automated or will they pay you directly and you go ahead and activate them for a specific feature? Link to comment https://forums.phpfreaks.com/topic/100426-timed-advertisements/#findComment-514062 Share on other sites More sharing options...
cooldude832 Posted April 10, 2008 Share Posted April 10, 2008 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 More sharing options...
jfarthing Posted April 13, 2008 Author Share Posted April 13, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.