Stephan,
is the do you have a field in your database called "Active"? and what operating system are you running on?
if its unix then its a simple matter of creating a web page that does an update query at a certain time every day and looks for all the records where the expiredate > now() and then updates the "Active" field accordingly, , this can be fired off with a cron job
you could probably do the same with windows although I'm not really sure how the cron job could be done,
This query could also be put in to one of the events tabs but it would then fire off the query EVERY! time the page is viewed, not too much of a problem on a low traffic site but can get tricky the more traffic you get, the query would go something like this.
[codebox]$hostname="localhost";
$mysql_login="myusername";
$mysql_password="mypassword";
$database="mydatabase";
update yourtable set 'active' = "NO" where expiredate < now();
mysql_close(); [/codebox]
It may be a little rough but you get the idea,
regards
Jason
I've changed the properties table (vacation template) to show only active listings (where active= Yes) This works fine as the administrator can activate / de-activate records to display or not.
Now:
I've added a field : "expiredate" where the administrator picks a date when the entry expires. Eg. 1,2,3 months. I'd like to add some SQL Query or event that will set the Active=Yes to Active=No when the expiry date is reached.
IOW when the expiry date is set for today, the query /event needs to set active=yes to active=no from tomorrow onwards. This way, the listing will be removed from the list as it is not active anymore. How would one achieve it?
In English it would be:
when expiredate >now() set active to no.
In PHP? I don't know.
Thanks for any halp on this