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 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
  #102  
Old 05-19-2008, 07:18 AM
yahoooh yahoooh is offline
 
Join Date: Oct 2002
Posts: 567
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how to make it work with vba dynamics script and also vblog and others
i need some hint on this
Reply With Quote
  #103  
Old 05-19-2008, 07:59 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 yahoooh View Post
how to make it work with vba dynamics script and also vblog and others
i need some hint on this
I don't believe there is a simple solution - sounds rather like a major hack, if the standard hooks don't work. Maybe you're lucky with choosing similar hooks and copy & paste the code from the image cache standard hook locations as is ...
Reply With Quote
  #104  
Old 05-26-2008, 10:18 PM
kether1 kether1 is offline
 
Join Date: Jun 2006
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Giovanni,

Anyway to edit this to cache images that are from my forum URL? I am thinking of installing the imagehosting modification and would like to be able to cache the images posted in the forum using the [ img ] code so that if a user later deletes his/ her gallery photo, the image would still appear in the thread. Is there a code or something I could edit to change this to capture images from my forum that are linked?

Thanks,
Kether
Reply With Quote
  #105  
Old 05-27-2008, 11:36 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 kether1 View Post
Hi Giovanni,

Anyway to edit this to cache images that are from my forum URL? I am thinking of installing the imagehosting modification and would like to be able to cache the images posted in the forum using the [ img ] code so that if a user later deletes his/ her gallery photo, the image would still appear in the thread. Is there a code or something I could edit to change this to capture images from my forum that are linked?

Thanks,
Kether
you may edit the attached PHP file in order to read also the images from your site, but probably you will run in the problem to cache the images again and again, each time somebody makes a change or replies to a message with a cached image.
Reply With Quote
  #106  
Old 05-27-2008, 11:04 PM
kether1 kether1 is offline
 
Join Date: Jun 2006
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by y2ksw View Post
you may edit the attached PHP file in order to read also the images from your site, but probably you will run in the problem to cache the images again and again, each time somebody makes a change or replies to a message with a cached image.
Thanks for the information! :up: Is there a specific piece of code in the PHP file that I should look for to make this change?

Regards,
Kether
Reply With Quote
  #107  
Old 05-28-2008, 06:42 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 kether1 View Post
Thanks for the information! :up: Is there a specific piece of code in the PHP file that I should look for to make this change?

Regards,
Kether
Around line 55:

Code:
    /*
    // Don't change already cached files ---------------------------------------
    for($i = 0; $i < $n; $i++)
    {
        if(strpos($files[$i]['url'], $forum_home . 'imgcache/') !== FALSE)
        {
            $files[$i]['url'] = '';
        }
    }
    */
Reply With Quote
  #108  
Old 05-28-2008, 06:46 AM
y2ksw's Avatar
y2ksw y2ksw is offline
 
Join Date: Aug 2003
Location: Italy
Posts: 1,418
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyway I think you don't have to make this change because it would cache all files on your site, but the ones you already have in the imgcache folder
Reply With Quote
  #109  
Old 05-28-2008, 10:30 PM
kether1 kether1 is offline
 
Join Date: Jun 2006
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Giovanni,

Thanks for all of your replies. I am not sure I understand what I am supposed to change in the code quoted in post 106. Do I simply set it to TRUE to capture all linked images? Sorry for being so thick about this.

Quote:
Anyway I think you don't have to make this change because it would cache all files on your site, but the ones you already have in the imgcache folder
Also, I am not sure if you are telling me that making this change is a bad idea or if you mean something else.

Thanks for your help,
Kether
Reply With Quote
  #110  
Old 05-29-2008, 10:25 AM
y2ksw's Avatar
y2ksw y2ksw is offline
 
Join Date: Aug 2003
Location: Italy
Posts: 1,418
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I d'dn't check yet how album images are handled, when they are referred inside a post. I would assume they are simple IMG tags and thus the images should already be cached ... can't you make a test please? If caching works, the link should read [forumhome]/imgcache/[id].png

Regards,
Giovanni
Reply With Quote
  #111  
Old 05-29-2008, 11:56 PM
kether1 kether1 is offline
 
Join Date: Jun 2006
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by y2ksw View Post
Well I d'dn't check yet how album images are handled, when they are referred inside a post. I would assume they are simple IMG tags and thus the images should already be cached ... can't you make a test please? If caching works, the link should read [forumhome]/imgcache/[id].png

Regards,
Giovanni
Oh, I have tested it, Giovanni. It doesn't make a cache of the image. The link will simple be: [img]http://www.mysite.com/forum/imagehosting/34827686d769c2.gif[/img]

It doesn't get the /imgcache/[id].png like everything linked in from off of my URL. I *think* this is because my forum's URL is included in the link and your modification doesn't cache images from the URL that it is working within. That is why I wanted to know how to change the code in the PHP file to make it capture images that are put into post from my own forum URL.

I really appreciate you help with this. I love this modification.

Regards,
Kether
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 07:09 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.07948 seconds
  • Memory Usage 2,326KB
  • 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
  • (1)bbcode_code
  • (6)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
  • (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