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

Run Query to insert all attachments as full image

Discussion in 'XenForo Questions and Support' started by Smooth, Apr 10, 2012.

  1. Smooth

    Smooth Active Member

    Hi guys,

    Sure this will be a quick fix, but could someone help me with the query I need to run on the DB to have all images that were posted as just an attachment to be inserted into the post as a Full Image?

    It is a fix as our app does not insert full as standard, just as an attachment.

    Many thanks,
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    UPDATE xf_post
    SET message = REPLACE(message, '[ATTACH]', '[ATTACH=full]');
    That will update all inline thumbnails to be full images.
  3. Smooth

    Smooth Active Member

    Legend. Thanks Jake!
  4. Smooth

    Smooth Active Member

    Jake - this has worked perfectly for those inserted as thumbnails, but not those that have not been inserted at all, just attached. Is there any way to grab them too?

    Many thanks once again!
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That can't be done with a simple query. It requires a custom script.
  6. Smooth

    Smooth Active Member

    Ahh ok thanks Jake. Is there any way to run that query automatically? Ie like a Cron Entry?

    Thanks again!
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes, a cron would work. You have to create the PHP script for it though.

Share This Page