• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RM 1.1 Updating date on existing resource?

Floren

Well-known member
#1
I need to update the date for a specific resource. I believe this is not possible to be done through a simple edit, unless I'm missing the way to do it. Is it possible to tell me what query I should run, in order to update the resource entry to a different (more recent) date? I cannot delete the resource and re-post it again, the date needs to be 5 days in the past.

Thank you for your help.
 

Floren

Well-known member
#3
Thanks @Chris D, much appreciated your suggestion. However, I don't plan to fix the resource date on a regular basis, this occurs very rarely. From your experience, do you think a MySQL query will suffice? I don't like to install any add-ons as principle, I only have the Resources and XES installed on my forums.
 
Last edited:

Chris D

XenForo developer
Staff member
#4
Yeah a query ought to do it. There's a few different columns though that can impact the date. If you want to change the date and also change the date of the most recent update:

Code:
UPDATE xf_resource SET resource_date = resource_date - (86400 * 5), last_update = resource_date WHERE resource_id = ?;
UPDATE xf_resource_update SET post_date = post_date - (86400 * 5) WHERE resource_id = ? ORDER BY resource_update_id DESC LIMIT 1;
Change the ? for the actual resource ID you wish to change. 86400 * 5 should reduce the date by 5 days.
 

Floren

Well-known member
#5
Thanks @Chris D, this is what I used to define an exact date for the resource:
Code:
$ date -d '20140828 1400' +%s
1409248800
> UPDATE xf_resource SET resource_date = 1409248800 WHERE resource_id = 13;