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

Discussion in 'Resource Manager Support' started by Floren, Aug 29, 2014.

  1. Floren

    Floren Well-Known Member

    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.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

  3. Floren

    Floren Well-Known Member

    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: Aug 29, 2014
  4. Chris D

    Chris D XenForo Developer Staff Member

    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 likes this.
  5. Floren

    Floren Well-Known Member

    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;
     
    Chris D likes this.

Share This Page