Please create at your vBulletin board directory a folder called: imgcache and give it the following access rights: CHMOD 777 (read/write/modify to all users)
Create an empty index.html file in this folder to avoid file exploring and direct download on some systems.
Copy the y2kswimgcache.php file to your vBulletin board (forum home) directory.
Close your forum temporarily to the public.
Install the product product-y2kswimagecache.xml to your board (allow overwrite if already present).
The installer will add a table called '[prefix]y2ksw_imgcache' with one field (int ID AUTOINCREMENT) to your board database.
Please note: Although the uninstaller is provided, it is commented out. By removing the table, and reinstalling the plugin later, the cached images would be overwritten, because of the field counter restarting from 1.
By leaving the table in your database, you may reinstall the plugin later without collision problems.
Test the product: New thread, reply, edit. If errors occur (or white pages), make sure your imgcache/ folder has the required access rights.
Reopen your forum to the public.
DONE!
How it works
When a board user opens a new thread or message, or edits an existing one (all advanced, quick-reply and ajax), and pastes an image from all but the local cache directory (or by copy and paste, or by specifying [IMG] tags), upon submission the image is read from the external url and written to the local (server) image cache folder.
This avoids to show a placeholder image when the source link is dead or temporarily unavailable.
The link to the image is accordingly replaced.
The script scans first all image references and creates a table of unique images in the current message. It creates a new database table entry in y2ksw_imgcache for each image, reads the new ID and creates a sequence of new images for each url it happens to be readable, and creates for each successful read an imgcache/<id>.png file.
After this sequence, the files are cached locally and may disappear from their sources without leaving an unreferenced image pointer at the local board.
Known bugs
When an image link contains dynamic data, vBulletin would show the image in preview, but change also the IMG tags to URL.
This causes to loose the reference and the plugin will not attempt to recover. A possible solution is to allow dynamic contents for IMG tags on your board.
Version history
1.0.3.0 2007-08-19 Repaired browser (IE 7) issue for images of a different file extension than the officially recognized types. For this issue, newly cached files have now the *.png extension.
1.0.2.0 2006-08-27 Image caching of signatures ([IMG] tags for signatures must be enabled); added a donation button inside readme.htm for specific user requests, which will help us to keep this product always up-to-date.
1.0.1.2 2006-08-07 Release changes for vbulletin.org
1.0.1.1 2006-08-06 Image size verification to avoid caching of invalid images
1.0.1.0 2006-07-17 Collision-free unique cache ID's
1.0.0.0 2006-07-17 Product creation
Test the product: New thread, reply, edit. If errors occur (or white pages), make sure your imgcache/ folder has the required access rights.
Installed and everything seemed to go just fine. Did the above test and all seems well.
QUESTION: Should my imgcache directory I created begin to contain copies of images now? So far, I've not seen anything in there except the empty index.html file I created per the instructions.
Installed and everything seemed to go just fine. Did the above test and all seems well.
QUESTION: Should my imgcache directory I created begin to contain copies of images now? So far, I've not seen anything in there except the empty index.html file I created per the instructions.
The folder should hold images if you have pasted images from other sites in your messages. For example copy this forum logo into your edit box and save. It should cache the smilie. If it doesnt, it may be your imgcache folder has not the rights to write.
The folder should hold images if you have pasted images from other sites in your messages. For example copy this forum logo's location into your edit box and save. It should cache the smilie. If it doesnt, it may be your imgcache folder has not the rights to write.
Now I understand what you're saying. Yes, I copied the location and posted it in a test msg and, wha-la instantly a 1.imgcache file was created in the imgcache directory. Thanxx!
Yep, you are exactly right.:classic: I D/L'd the 1.imgcache, 2.imgcache, etc files to my desktop and used Quick View Plus to peek at 'em. Neat, Thanxx!
When users add inline images the cache works however when they click on the image they cannot view the full size image instead they are offered to download a .cache file..
Basically it is possible to change the script to save the cached images with another name. Still there is a basic problem I didn't solve: The cache takes any image format and saves it as-is from the source site.