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
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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.