форум vBSupport.ru > vBulletin > Old vB versions (3.0.x & 2.x.x) > vBulletin 3.6.x > Hacks, mods and scripts [3.6.x]
  • »
VBsupport перешел с домена .ORG на родной .RU Ура! Пожалуйста, обновите свои закладки - VBsupport.ru
 
 
 
 
VipeR
Private Person
Developer
 
VipeR's Avatar
Default Image Status Checker / Dead Image Finder
3

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.
  • 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 / To-do
It's far from a perfect hack, there are many things to do. Please be aware that these things may take a while / I may never do them. It depends on demand and whether I can allocate time.
  • 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.
  • The browser is currently limited to a perpage of 30. I just didn't get round to allowing that to be optional.
  • 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.
  • There are no real options for scanning. It's all or nothing.
  • No cron job at the moment.
  • No session variables. (People without cookies will be logged out a lot).
  • ... Lots ... (being a perfectionist sucks)

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 ..."
I don't want to spend time making an uber-hack if it's not going to be popular so I'm releasing it as is for now.

A [url] link checker may be on the horizon since it uses a similar concept.

No idea if it works on 3.6. It should do since it's just an admin_maintainence hook and an addon file that uses standard vb calls and it's own functions. But I haven't tested it.

Installation
Upload imagestatuscheck.php to your vB directory. Install the product.
Important: You need to run the update counters before you run the /imagestatuscheck.php or you will get a database error.

Customizing
  • By default it's set to disallow non-registered people from viewing (the main purpose of the script is to find dead links so they can be corrected/removed. Therefore there's not much point letting unregistereds view the list since they can't change any posts). If you want to let anyone view, comment out/remove lines 16, 17.
  • If you only want admins/supermods/mods to view, change line 16, 17 to:
    PHP Code:
    if (!is_member_of567// 5 = supermods, 6 = admin, 7 = moderators
    print_no_permission(); 
  • 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

Code:
http://img112.imageshack.us/img112/7032/1ne0.png
http://img313.imageshack.us/img313/4332/2dm3.png
http://img163.imageshack.us/img163/2218/3nm7.png
Attached Files
File Type: zip isc.zip (8.0 KB, 29 views)
Bot
Yandex Bot Yandex Bot is online now
 
Join Date: 05.05.2005
Реклама на форуме А что у нас тут интересного? =)
 


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




All times are GMT +4. The time now is 07:54 AM.


Powered by vBulletin® Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Loading...