Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Image Cache Details »»
Image Cache
Version: 1.0.3.0, by y2ksw y2ksw is offline
Developer Last Online: Feb 2023 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 08-06-2006 Last Update: 08-20-2007 Installs: 77
DB Changes Uses Plugins
Additional Files  
No support by the author.

Y2K Software Image Cache

Compatible at least with vBulletin 3.5.4 and 3.6.4

Please click here for the product Import External Images for vBulletin 4

This product caches images from external sites to a local board folder (including signatures) located at:

http://www.domain.tld/[forum/]imgcache

Installation
  1. 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)
  2. Create an empty index.html file in this folder to avoid file exploring and direct download on some systems.
  3. Copy the y2kswimgcache.php file to your vBulletin board (forum home) directory.
  4. Close your forum temporarily to the public.
  5. 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.
  6. Test the product: New thread, reply, edit. If errors occur (or white pages), make sure your imgcache/ folder has the required access rights.
  7. Reopen your forum to the public.
  8. 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

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
dartho, xorex

Comments
  #122  
Old 08-22-2008, 10:59 PM
Mazinger's Avatar
Mazinger Mazinger is offline
 
Join Date: Nov 2006
Location: Egypt
Posts: 355
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What are system requirements?
Reply With Quote
  #123  
Old 08-23-2008, 07:35 AM
y2ksw's Avatar
y2ksw y2ksw is offline
 
Join Date: Aug 2003
Location: Italy
Posts: 1,418
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mazinger View Post
What are system requirements?
The access to external files through the file_get_contents() function must be granted, thus fopen() on URL's must work.
Reply With Quote
  #124  
Old 08-23-2008, 03:03 PM
Mazinger's Avatar
Mazinger Mazinger is offline
 
Join Date: Nov 2006
Location: Egypt
Posts: 355
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!

Working now with safe mode off.
Reply With Quote
  #125  
Old 09-22-2008, 01:48 PM
snotek snotek is offline
 
Join Date: Mar 2005
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would seem as though we have a need for this, but some updates and new features would be nice - so long as vB 3.7.x doesn't allow this already. We're not going to install this until we update though. Soon.

We run an information based site and notable threads get placed in our archives. Currently the mods have to manually edit the source of every external image and upload it as an attachment before moving the thread(s) to the archives.

This mod would make this work effort obsolete.

Questions:
If two people link to the same offsite image but in different threads, does this mod track that and link to the same image? Or does it simply cache it again.

Can this mod be made so that instead of caching the images it simply makes them an "attachment" as the user that posted the thread?

Are any future updates planned for this mod or is it final as-is?

Are there options that allow us to determine which images get cached and which don't?

Is there a way to clean up the cache over time for images that are in threads that we are not archiving and are no longer relevant?
Reply With Quote
  #126  
Old 09-22-2008, 03:44 PM
y2ksw's Avatar
y2ksw y2ksw is offline
 
Join Date: Aug 2003
Location: Italy
Posts: 1,418
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by snotek View Post
It would seem as though we have a need for this, but some updates and new features would be nice - so long as vB 3.7.x doesn't allow this already. We're not going to install this until we update though. Soon.

We run an information based site and notable threads get placed in our archives. Currently the mods have to manually edit the source of every external image and upload it as an attachment before moving the thread(s) to the archives.

This mod would make this work effort obsolete.

Questions:
If two people link to the same offsite image but in different threads, does this mod track that and link to the same image? Or does it simply cache it again.

Can this mod be made so that instead of caching the images it simply makes them an "attachment" as the user that posted the thread?

Are any future updates planned for this mod or is it final as-is?

Are there options that allow us to determine which images get cached and which don't?

Is there a way to clean up the cache over time for images that are in threads that we are not archiving and are no longer relevant?
It works on my 3.7.x forums as-is perfectly well.
  • If two people link to the same offsite image but in different threads, does this mod track that and link to the same image? Or does it simply cache it again? The images are cached again. However, if a user copies an already cached image, it will just copy the reference.
  • Can this mod be made so that instead of caching the images it simply makes them an "attachment" as the user that posted the thread? This would create a cached image of any copy and thus raise the memory amount sensibly.
  • Are any future updates planned for this mod or is it final as-is? There is an unpublished modification which retrieves also images from imageshack and many other services, together with preview icons and expanded images. However it is rather complicated to use and maintain. So at the moment it remains as-is.
  • Are there options that allow us to determine which images get cached and which don't? None yet.
  • Is there a way to clean up the cache over time for images that are in threads that we are not archiving and are no longer relevant? You may look at the FTP time stamp of the files and delete those which are probably out of date.
Reply With Quote
  #127  
Old 10-03-2008, 10:13 AM
Shamil. Shamil. is offline
 
Join Date: Sep 2008
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would you be able to add a watermarking option to this mod?
Reply With Quote
  #128  
Old 10-03-2008, 11:41 AM
y2ksw's Avatar
y2ksw y2ksw is offline
 
Join Date: Aug 2003
Location: Italy
Posts: 1,418
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ct2k7 View Post
Would you be able to add a watermarking option to this mod?
Yes, sure (GD only). Please note, that adding a watermark could require quite some resources, since the image(s) must be loaded into memory. On the other hand, this would allow also to resize and save in a common file format.
Reply With Quote
  #129  
Old 10-07-2008, 11:06 AM
mac-warez mac-warez is offline
 
Join Date: Oct 2008
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works good on vbulletin 3.73 i have had it running for about a month with no problems
Reply With Quote
  #130  
Old 10-25-2008, 05:08 PM
Super Jinni Super Jinni is offline
 
Join Date: Mar 2008
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for the great mod Giovanni

I've a question?
is there anyway to change the images extension from the png to the original image extension (gif, jpg, etc..)? or even to another extension instead of png extension?
I want this cause I've most of users use IE 5 and 6 which they have issues with pngs transparency.

hope to here soon from you..

thanks

Reply With Quote
  #131  
Old 10-25-2008, 06:22 PM
y2ksw's Avatar
y2ksw y2ksw is offline
 
Join Date: Aug 2003
Location: Italy
Posts: 1,418
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Super Jinni View Post
thanks for the great mod Giovanni

I've a question?
is there anyway to change the images extension from the png to the original image extension (gif, jpg, etc..)? or even to another extension instead of png extension?
I want this cause I've most of users use IE 5 and 6 which they have issues with pngs transparency.

hope to here soon from you..

thanks

You may try to change the png extension at line 103 (y2kswimgcache.php) to something else. The change will apply to new images only.

The images are not transformed though, thus they may or may not work either way. The png extension was given to avoid XSS issues by Internet Explorer 6/7, but in fact the extension does not dictate in any way how images are shown.
Reply With Quote
Reply

Thread Tools

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 02:41 AM.


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.04834 seconds
  • Memory Usage 2,323KB
  • Queries Executed 26 (?)
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
  • (4)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
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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