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

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.webp flickr.webp partyflock.webp imageshack.webp 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
 
Top Bottom