Re: Date stamp and purging
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 17792
interpreted = N
texte = Why bother with all the extra database fields? Just put something like thefollowing into a page somewhere in the site (assuming you already have afield for the date the ad was posted):[Delete db=yourdatabase.db&leDatePosteddatarq=[mathdate]{[Date]}-90[/math]&DatePostedtype=date_mdy]Or, if you're worried about the performance hit this may cause, put it onits own page somewhere and use PageSentry to hit that page once a day...-DaveAt 9:53 AM 5/20/98, Bob Minor wrote:>Gil Poulsen wrote:>>>> When the ad is placed, encode today's date + 90 days in a field and call it>> [expiredate]. Then just set up a template that deletes any of those records>> that have an [expiredate] field that is older than today's date, and hit the>> template every few days. Around the end of August, the oldest records will>> begin to be deleted. Ken Grome posted some real useful date formatting>> guidelines a few days ago; you might weant to search the archives for that.>>>> Allan Morrison wrote:>> >>> > I'm setting up a classified ad site, and I'd like to have ads older than>> > 90 days purged automatically. How would I go about setting up something>> > like this.>>How about keeping a record in the database that stores the date that>your database was last purged then when someone hits the entry page of>your classifieds it looks at this field to see if it is todays date if>not then it runs a purge of all the old dates and sets the purge field>to todays date. The next time someone shows up it will look in the>database and see that the database has been updated and won't attempt to>run the purge routine. This will work for any page up to and including>your main display page.o--------------- Dave MacLeay --+o----------- Digital Frontier --+o--- dave@digitalfrontier.com --+
Associated Messages, from the most recent to the oldest:
Why bother with all the extra database fields? Just put something like thefollowing into a page somewhere in the site (assuming you already have afield for the date the ad was posted):[Delete db=yourdatabase.db&leDatePosteddatarq=[mathdate]{
[date]}-90[/math]&DatePostedtype=date_mdy]Or, if you're worried about the performance hit this may cause, put it onits own page somewhere and use PageSentry to hit that page once a day...-DaveAt 9:53 AM 5/20/98, Bob Minor wrote:>Gil Poulsen wrote:>>>> When the ad is placed, encode today's date + 90 days in a field and call it>> [expiredate]. Then just set up a template that deletes any of those records>> that have an [expiredate] field that is older than today's date, and hit the>> template every few days. Around the end of August, the oldest records will>> begin to be deleted. Ken Grome posted some real useful date formatting>> guidelines a few days ago; you might weant to search the archives for that.>>>> Allan Morrison wrote:>> >>> > I'm setting up a classified ad site, and I'd like to have ads older than>> > 90 days purged automatically. How would I go about setting up something>> > like this.>>How about keeping a record in the database that stores the date that>your database was last purged then when someone hits the entry page of>your classifieds it looks at this field to see if it is todays date if>not then it runs a purge of all the old dates and sets the purge field>to todays date. The next time someone shows up it will look in the>database and see that the database has been updated and won't attempt to>run the purge routine. This will work for any page up to and including>your main display page.o--------------- Dave MacLeay --+o----------- Digital Frontier --+o--- dave@digitalfrontier.com --+
Dave MacLeay
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Bug Report, maybe (1997)
Stop page auto. refreshing (2004)
[SHOWIF AND/OR] (1997)
OS and/or browser problems? (2002)
Creating a folder with WebCat? (2000)
minimalist shopping cart. (1997)
Help!!!! (1999)
[protect admin] (1997)
FAX orders (1996)
ListFields and [name] (1997)
REPLACE and/or APPEND (2002)
Help with Shipping Costs (1997)
[GROUPS] followup (1997)
Make sure I understand this??? (1997)
email preferences on NT (1997)
NumFound (1999)
Image Pirating [protecting against] (2003)
Re:Has this happened to you? (1997)
RE: Can't get appendfile to work (1997)
Replacing a price with text (1998)