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.
Comments
  #2  
Old 16 Aug 2006, 15:27
ChrisSy ChrisSy is offline
 
Join Date: Mar 2002
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.
Reply With Quote
  #3  
Old 16 Aug 2006, 16:05
bairy bairy is offline
 
Join Date: Oct 2005
Real name: Chris
Originally Posted by ChrisSy
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?
Whatever you like. All this script does is tells you if images linked in posts are working or not. If not, you (or the post owner) can edit the post to either update the link or delete it.

Originally Posted by ChrisSy
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.
I should think so but it's not something I'll be developing.
Reply With Quote
  #4  
Old 16 Aug 2006, 17:35
Jay... Jay... is offline
 
Join Date: Jan 2006
is there anyway this can be done for all links? Thats what i am looking for
Reply With Quote
  #5  
Old 16 Aug 2006, 18:04
bairy bairy is offline
 
Join Date: Oct 2005
Real name: Chris
I'll probably knock one out for [url=] at some point, the code won't be too different.
Reply With Quote
  #6  
Old 16 Aug 2006, 18:13
Jay... Jay... is offline
 
Join Date: Jan 2006
Originally Posted by bairy
I'll probably knock one out for [url=] at some point, the code won't be too different.
nice one, if i press install will you be keeping us updated?
Reply With Quote
  #7  
Old 16 Aug 2006, 19:11
ntock ntock is offline
 
Join Date: Jun 2006
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
Reply With Quote
  #8  
Old 16 Aug 2006, 19:49
Gryphon's Avatar
Gryphon Gryphon is offline
 
Join Date: Oct 2001
Real name: Ryan Snook
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:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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

and


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


Last edited by Gryphon; 16 Aug 2006 at 20:01.
Reply With Quote
  #9  
Old 16 Aug 2006, 19:56
bairy bairy is offline
 
Join Date: Oct 2005
Real name: Chris
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.
Reply With Quote
  #10  
Old 16 Aug 2006, 20:03
Gryphon's Avatar
Gryphon Gryphon is offline
 
Join Date: Oct 2001
Real name: Ryan Snook
There was also another issue, I edited my post.
Reply With Quote
  #11  
Old 16 Aug 2006, 20:03
Mr Chad's Avatar
Mr Chad Mr Chad is offline
 
Join Date: Jul 2005
wouldnt this use alot of bandwidth?
__________________
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
  #12  
Old 16 Aug 2006, 20:03
rmxs's Avatar
rmxs rmxs is offline
 
Join Date: Apr 2006
Thanks installed
__________________
:banana::bunny: :banana:
Reply With Quote
  #13  
Old 16 Aug 2006, 20:07
rmxs's Avatar
rmxs rmxs is offline
 
Join Date: Apr 2006
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>
__________________
:banana::bunny: :banana:

Last edited by rmxs; 16 Aug 2006 at 20:28.
Reply With Quote
  #14  
Old 16 Aug 2006, 20:51
bairy bairy is offline
 
Join Date: Oct 2005
Real name: Chris
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
Reply With Quote
  #15  
Old 16 Aug 2006, 21:23
ForYou ForYou is offline
 
Join Date: Nov 2001
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
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 11:43.

Layout Options | Width: Wide Color: