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

Other Script to remove BBCode [ATTACHMENT] that does not have an actual attachment

Discussion in 'Custom Service/Development Requests' started by Axel B, Mar 15, 2015.

  1. Axel B

    Axel B Well-Known Member

    Hi there,

    I am almost done with converting all hot linked images to attachments with AndyB's addon Convert Image All.

    Whilst converting I noticed that a lot of image hosting parties replace 'dead links' with a dummy image (examples below).
    mijnalbum.jpg flickr.png partyflock.png imageshack.png photobucket.gif

    I first started manually removing them from the posts, but this became undoable because I had to go through 20,000 of posts, so I manually removed them via the Attachment Browser. I now have many dead links in my posts referring to attachments that are not there anymore.

    • I would like to have a script which checks all posts for BBCode Attachments and check if the attachment is really there.
    • If the attachment is not there I would like the script to remove the complete BBCode leaving the other parts of the message alone
      Code:
      [ATTACHMENT]123[/ATTACHMENT] or [ATTACHMENT=full]4567[/ATTACHMENT]
    • The script must be able to process in batches, so it won't blow up the little VPS I use ;)
    • The script must have some visuals so you can see what it is about to change (just to make me feel good) before actually removing stuff.
    One really important thing to take into account whilst making the script, is that I use the addon [bd] Attachment Store from xfrocks. My attachments are in the data directory, not in the default location of Xenforo.

    I would be really grateful if somebody could make this for me. Please send me a conversation on a quote.

    Thanks for your time :)
    Cheers, Axel
     
    batpool52! likes this.
  2. Axel B

    Axel B Well-Known Member

    @batpool52! created a little addon for me to clear the 'dead' attachments. Excellent work!
     
    batpool52! likes this.

Share This Page