![]() |
Image Status Checker / Dead Image Finder
Note this hack works with vb3.6
What does this do? It scans all your posts, extracts all the img tags, and scans each of the images to see if they're still valid. Why? I had a look at all the images on my site and was alarmed at how many were now gone - deleted from photobucket accounts etc. Since the only way you can check the images on your board is to manually read every post, I decided to come up with a better way... and this is it. How does it work? The first part: In the AdminCP, under Maintenance and Update Counters... right at the bottom is this hack. It works by looking up every img tag, then requesting the image, and reading the http status code. So code 200 means 'image ok', 404/410 means 'image gone' etc. That then gets stored in a database table. A server has 15 seconds to reply to the request or the status is labelled as "Unknown" The second part: The browsing element, imagestatuscheck.php (original filename huh!). This allows you to browse all the images found in the last scan using some powerful filtering (statuses to display, search, order by). Hack features
Bad Things It's far from a perfect hack, there are many things to do. Please be aware that I won't be doing them, but if anyone else wants a crack, feel free!
Footnotes Originally I planned to throw something together quickly just for me to use but it turned into a "I may as well make a nice interface... oh and I may as well put some filtering controls in and I ..." A [url] link checker can be found here Installation Upload imagestatuscheck.php to your vB directory. Install the product, set overwrite to yes. Customizing
Screenies Shot 1 is AdminCP during scan Shot 2 is a typical Browser section output Shot 3 is no results output Changelog See attached file for specific changes. 1.00 - 16th August 06 1.01 - 17th August 06 1.02 - 27th December 06 |
Looks like a very well made hack, and i dont mean to offend you but im a bit unsure of its use. Once you've found the posts mssing images, then what?
Is it possible to include a feature that scans threads for off-site linked images and then backs the images up into a folder on your server. That way you can restore them when the img uploader sites decide to delete them. |
Quote:
Quote:
|
is there anyway this can be done for all links? Thats what i am looking for
|
I'll probably knock one out for [url] at some point, the code won't be too different.
|
Quote:
|
Looks cool, I'd install if it'd replace all dead images with an image stored on your server which looks like "3rd party image not hosted anymore." etc. Great work though :)
|
Get an error on scan. Found the offending post, but you might want to account for the odd duck who tries to post weird urls.
Also got an error when someone said [img] in their post and then later put an existing [img]http://img.jp[*/img], it tried to insert the following into the database: Code:
in their post and then later put an existing [img]http://img.jp[*/img] Code:
Database error in vBulletin 3.6.0: Code:
Invalid SQL: |
Jay... : yes
ntock : good suggestion.. though I'd rather leave the original url in so it can be corrected by the post owner if it's just been moved. Blackjack : Looks like I forgot to escape the string to account for those dodgy urls. A job for the next release. |
There was also another issue, I edited my post.
|
wouldnt this use alot of bandwidth?
|
Thanks installed :)
|
OK i try it it works byt i get many worning links with Unknown status
Y this happents? Can you tell me how can i add it also to navbar for moder admin smoder groups only?? i mean if there is no 5,6,7 dont show the link EDIT: Ok i made it its easy LOL <if condition="$bbuserinfo[usergroupid] == 6"> <td class="vbmenu_control"><a href="imagestatuscheck.php">DIF</a></td> </if> |
Chad : Each image is requested one by one and only the first 12 characters of the return are read, as they are the ones with the status code in them. After that the connection is closed. Theoretically it will use output about 200 bytes and input 12 bytes per request. Practically I don't know how web servers work, but I suspect once php has sent a close to the other server the transfer will stop. So no, not much bandwidth
|
Hello ,
there is error , Database error in vBulletin 3.6.0: Invalid SQL: INSERT INTO imagestatus VALUES (NULL, 172959, 3498, 'http://www.dohaeye.com/lyrics/3'air%20elnass.jpg', ''); MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'air%20elnass.jpg', '')' at line 1 Error Number : 1064 Date : Wednesday, August 16th 2006 @ 09:21:55 PM Script : http://www.dha.net/moda/admincp/misc...tus&cis=findem Referrer : http://www.dha.net/moda/admincp/misc...k_image_status IP Address : 213.6.1.100 Username : Admin Classname : vb_database |
The sql errors are because the image url isn't escaped. Silly oversight. I'll probably get an updated product out tomorrow along with a couple of other changes.
|
on a related note, what about scanning all posts for img tags, rehosting all remote images at a local location and editting the posts with the new url so that you don't have to worry about the images going away?
|
Quote:
Unknown generally means one of two things: 1. Server didn't reply within 15 seconds 2. Server didn't send a nice http header back Quote:
|
Thanks bairy
|
Quote:
|
Updated to 1.01 to clear up the early bugs and improve a few things:
- Misc: Install code creates empty db table - Misc: Corrected silly oversight to reduce db errors (escaping image urls) - Scanner: Added options to maintenance section - Scanner: Rewrote quite a bit of the code to work with the new options - Browser: Added "you haven't scanned yet" warning if the table is missing (unlikely but best to be handled) - Browser: isc_no_results template wasn't included in the 1.00 product for some reason. It is now and is used when there are no results - Browser: Added a perpage, lower limit 5, upper limit 100. Outside these and it defaults to 30 Reupload imagestatuscheck.php. Reimport the product xml with overwrite set to yes. |
If I click on "search/Filter" it blinks an than it shows me the startscreen of imagestatuscheck.php but no resulst.
What is wrong? GreeTz Snatch |
Have you run a scan first?
If so, how many images did it scan? |
LoL sorry, my fault.
GreeTz Snatch |
2 more questions.
1: now i runed the process for find death images. But when I go to the .php File i get this Error Code:
Datenbankfehler in vBulletin 3.6.0: 562,783 images remaining Muhahaha 2: What means the text "duplicate / dealt with" behind the ImageUrl? Show Attach! The first 2 Pages are o.k. but then only "duplicate / dealt with" GreeTz Snatch |
Error code 28 means no more space left. Either the hard drive ran out of space or your allowed disk space maxed itself.
If you really have 562k images, and I believe you do, then that's not really a surprise as the script creates a new table with all the images in it. I have 1300 images and takes up about 170k. So multiplying it up there's probably a table size of 70mb or so. However it obviously managed to get some images in at least. The duplicate/dealt with message comes up because: Lets say you have one image and it's been linked in 2 posts. There's no point scanning the same image twice since one scan will tell us if it's valid. Therefore it's scanned once and if the image comes up again it's counted as 'duplicate' or 'dealt with' (they mean the same thing in this case). Another reason is if you resume a scan (not restart it). As it will already have scanned some of the images and they'll be classed as "dealt with". If you have a lot of images saying that then it could be because you're doing another scan but not from the start, or it could be related to the error 28, depending what got inserted and what didn't. |
Does this work with VB 3.6.2?
If so, everytime I run a scanner, and then run statuscheck.php, I get: You haven't run the scanner yet. You will find it in the Admin Control Panel under Maintainance -> Update Counters, at the bottom. Non-admins don't see this message. Tried a hundred times, but keeps doing the same thing.:down: image status checker in vb options: 5,6,7 I need to get this to work. Please someone help. |
{I first posted my query in the URL checker thread}
Hi, I have a custom HTML Daily Digest that includes Images that are inserted using {IMG} tags. I want to prevent images from forcing the Digest to be too wide because they are over 750 pixels wide. I can resize it in the digest if I know the image is too wide. So I'm looking for some code that will tell my how wide an {IMG} is. Can this hack help me? Can you help me? Thanks! Barry |
Ahhh now I see.
I've just realised that basically, no. I think that in order to get the dimensions of an image, the server would have to fully download it and then analyse it as the information isn't included in the http headers. That would drain the destination server's bandwidth and take a lot longer. My only real suggestion is to load up the images you want to include in a web browser, right click them and click properties, and see the dimensions there. |
Quote:
|
Hi!
Does this mod works on vBulletin 3.6.4??? Thanks Bye! |
It works in 3.6.0 and doesn't rely on much vb code, so I would say yes it'll be fine in 3.6.4
|
Nice work, this looks like something I would need as i have lots of images.
|
Quote:
3.6.4 Run the scan in maintenance: There are a total of 8,057 images. my link above has been run I've removed 2 images to try it :( |
Did you actually run the scan (looks like screenshot 1 in the first post), or just get as far as the image count screen?
|
Quote:
But when i went to the link no images were found ? Thanks |
Hmm,
Could you go into "Execute SQL Query", just underneath "Update Counters" and run: Code:
select * from imagestatus I'm interested in what number x is. |
Quote:
All at Status 000 If this is any use to you :) |
Ah I believe it's because I missed something that throws the error message even when the table exists. Do you have a table prefix?
I'm not sure why they're all status 000, we'll deal with that after. |
Quote:
Code:
// ****** TABLE PREFIX ****** |
All times are GMT. The time now is 05:51 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|