Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Image Status Checker / Dead Image Finder Details »»
Image Status Checker / Dead Image Finder
Version: 1.02, by bairy bairy is offline
Developer Last Online: Jul 2023 Show Printable Version Email this Page

Version: 3.5.7 Rating:
Released: 08-15-2006 Last Update: 12-26-2006 Installs: 33
DB Changes Uses Plugins
Additional Files  
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 08-17-2006, 06:32 PM
bairy bairy is offline
 
Join Date: Oct 2005
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #23  
Old 08-18-2006, 05:17 AM
Snatch Snatch is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #24  
Old 08-18-2006, 07:21 AM
bairy bairy is offline
 
Join Date: Oct 2005
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you run a scan first?
If so, how many images did it scan?
Reply With Quote
  #25  
Old 08-18-2006, 07:43 AM
Snatch Snatch is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LoL sorry, my fault.

GreeTz
Snatch
Reply With Quote
  #26  
Old 08-18-2006, 07:50 AM
Snatch Snatch is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

Invalid SQL:

	SELECT
	i.id AS iid, i.postid, i.userid, i.imageurl, i.status,
	u.username,
	t.forumid, t.title AS threadtitle,
	f.title AS forumtitle
	FROM imagestatus i
	LEFT JOIN user u ON (i.userid = u.userid)
	LEFT JOIN post p ON (i.postid = p.postid)
	LEFT JOIN thread t ON (p.threadid = t.threadid)
	LEFT JOIN forum f ON (t.forumid = f.forumid)
	WHERE i.`status` IN (401,402,403,404,405,406,407,409,410,411,412,413,414,415,416,417,000,0,100,101,201,202,203,204,205,300,301,303,305,400,408,500,501,502,503,504,505)
	AND t.forumid NOT IN (0)
	
	ORDER BY u.username asc
	LIMIT 0, 30;

MySQL-Fehler : Got error 28 from storage engine
Fehler-Nr.   : 1030
Datum        : Friday, August 18th 2006 @ 10:48:58 AM
Skript       : http://www.celebritymarkt.de/imagestatuscheck.php
Referrer     : 
IP-Adresse   : 
Benutzername : 
Klassenname  : vb_database
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
Reply With Quote
  #27  
Old 08-18-2006, 09:54 AM
bairy bairy is offline
 
Join Date: Oct 2005
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #28  
Old 10-26-2006, 04:04 AM
osso12 osso12 is offline
 
Join Date: Feb 2006
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #29  
Old 12-18-2006, 03:32 PM
bchertov's Avatar
bchertov bchertov is offline
 
Join Date: Dec 2004
Location: Sonoma County, CA
Posts: 259
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

{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
  #30  
Old 12-18-2006, 04:47 PM
bairy bairy is offline
 
Join Date: Oct 2005
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #31  
Old 12-19-2006, 03:18 PM
bchertov's Avatar
bchertov bchertov is offline
 
Join Date: Dec 2004
Location: Sonoma County, CA
Posts: 259
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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


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

Forum Jump


All times are GMT. The time now is 04:04 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04893 seconds
  • Memory Usage 2,316KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete