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

Mass Edit Icons for Resource Manager

Discussion in 'Resource Manager Support' started by The Dark Wizard, Nov 3, 2013.

  1. The Dark Wizard

    The Dark Wizard Well-Known Member

    Is there a way to give a bunch of resources the same icon?

    We have a bunch of old resources past a certain age(since we used Chris Deeming's date changer to bring stuff over) and no one is going to come back and give those an icon so we just want to give them all the same icon.

    Any help would be appreciated.

    I assume a way to do this would be with an SQL query.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Why don't you just change the default icon to something else?
     
  3. The Dark Wizard

    The Dark Wizard Well-Known Member

    Because the idea is to just do it for resources past a certain date and the icon wouldn't fit for everything.

    But if its not possible I can consider that.
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    The difficulty is, the only thing that tells XenForo that there is a resource icon is the resource having an icon_date in the xf_resource table.

    If there is a date in that field in the xf_resource table, then XenForo expects there to be an icon in the relevant folder...

    e.g. data/resource_icons/0/1.jpg

    Where data is the external data path, 0 is the resource ID divided by 1000 rounded down to the nearest whole number and 1 is the resource ID.

    So if your resources are all IDs 1 to 100 you would need to update the xf_resource table like this:

    Code:
    UPDATE xf_resource SET icon_date = 1 WHERE resource_id <= 100
    And then you would need to populate the data/resource_icons/0 directory with 1.jpg, 2.jpg, 3.jpg etc. all the way to 100.jpg.

    That would have the desired effect.
     
  5. The Dark Wizard

    The Dark Wizard Well-Known Member

    I'll give it a shot.
     

Share This Page