Jump to content

Delaying Dates for an Events Listing


haisan

Recommended Posts

I am trying to create an events calendar for the city I live in. At the moment am using a modified version of Gigpress. It is a simple events calendar, where you enter an event, and it is placed into an "upcoming" section, until the day of the event, when it is moved into a "past events" category.

 

The trouble is, the database is updated at 12:01am each day, moving each day's events automatically from "upcoming" to "past events." But it would be a lot more useful for current events to stay in the "upcoming" category until the end of the day, or even a day or two later.

 

So, I would like to modify the date check so that the database is not updated until a day or two after an event happens, instead of on the day. Any advice on how best to do this?

Link to comment
https://forums.phpfreaks.com/topic/93818-delaying-dates-for-an-events-listing/
Share on other sites

How is the database update being triggered, CRON? That is, in fact, if it is actually a database update - The code could just be pulling information from the database based on hardcoded criteria.

 

Does Gigpress have a support forum? Might be worth giving them a shout...

Thanks a lot for your replay. Sadly, Gigpress was just one guy's invention, and it does not seem to have enough adherents to warrant a forum.

 

Anyhow, yes, there is a basic database query at the start of the template, which initiates the database update. My problem is, I have not been able to find way to change when the date triggers that database change. 

 

		// Update each one's show_expire with its show_date
	if($getshows) {
		foreach($getshows as $show) {
			$setdates = $wpdb->query("
				UPDATE ".$gigpress['gigs_table']." SET show_expire = '".$show->show_date."' WHERE show_id = ".$show->show_id."
			");	
		}
	};	

 

I'm sure there is some (simple) way of setting the date so the database update is triggered two days after the real date, but I cannot find any explanation of how to do so.

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.