Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Image Status Checker / Dead Image Finder Details »
Image Status Checker / Dead Image Finder
Mod Version: 1.02, by bairy (Member) bairy is offline
Developer Last Online: Aug 2014 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.5.7 Rating: (1 vote - 5.00 average) Installs: 33
Released: 16 Aug 2006 Last Update: 27 Dec 2006 Downloads: 176
Not Supported DB Changes Uses Plugins Additional Files  

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
  • General
  • Fully phrased.
  • Templates are grouped. Who's online handled.
  • Part 1 - Admin
  • Reads the post table, scans all the [img] tags on demand and records the actual http status code returned.
  • If it gets stuck during the scan, you can restart the section it's currently doing.
  • If an image appears in more than one post, it's only checked once.
  • Start from, per page and timeout options for scanning.
  • Part 2 - Browser
  • Status codes are put into one of three descriptions for simplicity: Working, Dead, Unknown. Unknown is if the server didn't respond or similar - on the basis that a temporary timeout doesn't necessarily mean the image has gone.
  • In the browser, image urls are force wrapped. Unless people post using all caps, you have a low screen resolution, or the font size is big, the table should never stretch.
  • Filtering allows you to show just the working/dead/unknown images, and there's a search facility for a variety of fields.
  • Convenient link to edit the post (if a dead link is found). This works by can_moderate - edit links only appear for people who own the post, or can moderate the forum it's in.
  • Works by canview - if someone can't view a particular forum (e.g. staff forum) normally, they can't view the images within it.
  • Uses css for common stuff to reduce the size of the outputted pages.


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!
  • Only supports http://, not https://
  • Can only handle replies like: HTTP 1.x 200 as the first line.
  • Only supports [img] tags. If you have HTML turned on in any forums it won't see <img src=> images.
  • Biggie: There's no way to update a single post or image without a full re-scan. That means if someone edits their post to update or remove a dead link, it will not change on the browser until a full re-scan is done. I did play with various update methods but most are flawed in one way or another. A planned feature will be to update the table dynamically whenever a post is made, edited or deleted, and on demand using a link.
  • No cron job.
  • No session variables. (People without cookies will be logged out a lot).


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
  • By default it's set to only allow moderators, super-moderators and administrators to view the browser. This can be changed with the setting in AdminCP > vB Options.
  • The phrases all start with ics_ if you want to change them.
  • You can add a link to imagestatuschecker.php on the navbar (or anywhere) if you want your members to be able to view it.


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

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	1.png
Views:	807
Size:	27.7 KB
ID:	52233   Click image for larger version

Name:	2.png
Views:	726
Size:	83.6 KB
ID:	52234   Click image for larger version

Name:	3.png
Views:	520
Size:	16.7 KB
ID:	52235  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #16  
Old 17 Aug 2006, 00:33
bairy bairy is offline
 
Join Date: Oct 2005
Real name: Chris
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.
Reply With Quote
  #17  
Old 17 Aug 2006, 00:58
EasyTarget EasyTarget is offline
 
Join Date: Nov 2004
Real name: Dave
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?
__________________
Looking for a photo gallery, files or multimedia center or a links database? Links and Downloads is the hack for you. Its feature-rich, well-coded, well-supported and free.
Reply With Quote
  #18  
Old 17 Aug 2006, 08:42
bairy bairy is offline
 
Join Date: Oct 2005
Real name: Chris
Originally Posted by rmxs
OK i try it it works byt i get many worning links with Unknown status

Y this happents?
Sorry. Missed this question.
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


Originally Posted by EasyTarget
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?
Copyright issues. The idea is quite good though. I might include a way to allow you to manually do that.
Reply With Quote
  #19  
Old 17 Aug 2006, 16:11
rmxs's Avatar
rmxs rmxs is offline
 
Join Date: Apr 2006
Thanks bairy
__________________
:banana::bunny: :banana:
Reply With Quote
  #20  
Old 17 Aug 2006, 19:21
Mr Chad's Avatar
Mr Chad Mr Chad is offline
 
Join Date: Jul 2005
Originally Posted by bairy
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
ahh thanks that clears it up, good job coding it.
__________________
If anyone wants any of my past modifications please PM me... I will provide you with a link to them. I have decided to remove all my modifications from VB.org because of a small incident...

You can get my popular hacks here: Coders Shack
Reply With Quote
  #21  
Old 17 Aug 2006, 20:32
bairy bairy is offline
 
Join Date: Oct 2005
Real name: Chris
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.

Last edited by bairy; 17 Aug 2006 at 20:38.
Reply With Quote
  #22  
Old 18 Aug 2006, 07:17
Snatch Snatch is offline
 
Join Date: Jan 2004
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
Reply With Quote
  #23  
Old 18 Aug 2006, 09:21
bairy bairy is offline
 
Join Date: Oct 2005
Real name: Chris
Have you run a scan first?
If so, how many images did it scan?
Reply With Quote
  #24  
Old 18 Aug 2006, 09:43
Snatch Snatch is offline
 
Join Date: Jan 2004
LoL sorry, my fault.


GreeTz
Snatch
Reply With Quote
  #25  
Old 18 Aug 2006, 09:50
Snatch Snatch is offline
 
Join Date: Jan 2004
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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Or is it so, that I can only use the php file if the search are finisched ?
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
Attached Images
File Type: jpg sdf.JPG (29.5 KB, 17 views)

Last edited by Snatch; 18 Aug 2006 at 10:07.
Reply With Quote
  #26  
Old 18 Aug 2006, 11:54
bairy bairy is offline
 
Join Date: Oct 2005
Real name: Chris
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.
Reply With Quote
  #27  
Old 26 Oct 2006, 06:04
osso12 osso12 is offline
 
Join Date: Feb 2006
Thumbs down

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.

image status checker in vb options: 5,6,7
I need to get this to work.
Please someone help.
Reply With Quote
  #28  
Old 18 Dec 2006, 17:32
bchertov's Avatar
bchertov bchertov is offline
 
Join Date: Dec 2004
Location: Sonoma County, CA
Real name: Barry
{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
Reply With Quote
  #29  
Old 18 Dec 2006, 18:47
bairy bairy is offline
 
Join Date: Oct 2005
Real name: Chris
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.
Reply With Quote
  #30  
Old 19 Dec 2006, 17:18
bchertov's Avatar
bchertov bchertov is offline
 
Join Date: Dec 2004
Location: Sonoma County, CA
Real name: Barry
Originally Posted by bairy View Post
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.
Thanks, but I was trying to find some automated way of doing this. I guess I'll check the image resizing hacks to see how they do it. Thanks anyway.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 19:05.

Layout Options | Width: Wide Color: