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

Disabling images that were posted before a specific date?

Discussion in 'XenForo Development Discussions' started by STORMS, Aug 16, 2013.

  1. STORMS

    STORMS Active Member

    Recently, I've been trying to remove images that were posted before last weekend and so far I've been able to disable the tag using this in EXTRA.css:

    /* Block all images*/
    .bbCodeImage {
    display: none !important;
    }

    Is it possible to display only IMG's that were posted after a specified date using this method?
     
  2. JulianD

    JulianD Well-Known Member

    There is no easy way (by easy, I mean there is not Admin Panel for something like this) to do it but I think every possible solution to achieve this involves programming.

    Do you want to remove attached images, or external images posted using the [​IMG]
     
  3. STORMS

    STORMS Active Member

    External images.
     
  4. JulianD

    JulianD Well-Known Member

    I know that MySQL supports regular expressions but I'm not sure if that's enough to do what you're asking. Maybe a small php script that loops through the messages doing a regular expression replace would be fine, but unfortunately I don't know much about regular expressions. I can't help you :(
     
  5. The Forum Heroes

    The Forum Heroes Well-Known Member

    You could use

    Code:
    delete FROM `xf_attachment` WHERE `attachment_id` >='145478451258';
    replacing the 145478451258 with the expression date of the last image you want to keep.
     

Share This Page