vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Image Cache (https://vborg.vbsupport.ru/showthread.php?t=123338)

y2ksw 08-06-2006 10:00 PM

Image Cache
 
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

The Chief 08-07-2006 10:10 PM

this looks amazing, good work!!

Eagle Creek 08-08-2006 01:16 AM

Sounds great!

But isn't this a great increase of your bandwith? I asked my members to user sites like imageshack to upload their pictures.
When I'm going to cache it all, they can just upload it as an attachment. Can't they?

hotma1l 08-08-2006 02:31 AM

What If i have an upload script for members, So they can upload their images and files, when they upload they get the link, then they will post the new topic, and the images are already on my server,it be uploaded again to the cache image ,,

So is there is away to exclude links for example any images that have been uploaded to http://up.domain.com/uploads/ should be excluded,

if there is an option in the admin control page to exclude links that would be great.

anyway thanks for the great work

y2ksw 08-08-2006 09:59 AM

Quote:

Originally Posted by Eagle Creek
Sounds great!

But isn't this a great increase of your bandwith? I asked my members to user sites like imageshack to upload their pictures.
When I'm going to cache it all, they can just upload it as an attachment. Can't they?

It increases the bandwidth quite a lot, and members can make attachments.

However, over the years, we experienced that most forum members don't like attachments, and prefer to insert the pictures in their messages as required. Not much an issue for just one image, but quite some if you have to tell about mathematic, scientific or medical research. And specifically in these areas a missing image source may void the whole discussion.

KoC 08-08-2006 10:02 AM

The New Version is 3.6.0

y2ksw 08-08-2006 10:04 AM

Quote:

Originally Posted by hotma1l
What If i have an upload script for members, So they can upload their images and files, when they upload they get the link, then they will post the new topic, and the images are already on my server,it be uploaded again to the cache image ,,

So is there is away to exclude links for example any images that have been uploaded to http://up.domain.com/uploads/ should be excluded,

if there is an option in the admin control page to exclude links that would be great.

anyway thanks for the great work

The script is intended to use where other scripts aren't available, or image sources are too slow, as most of the free image hosting sites.

Loading images from the own site has been always the best solution, although it has a cost: bandwidth and web space. ;)

kether1 08-08-2006 06:06 PM

This looks great! I wonder if it will work with the Lightbox mod? I was thinking of installing that mod and using thumbnails on my forum. Would there be a conflict with 'Image Cache'? I am guessing no, but let me know if you think their might be.

Thanks so much.

Kether

Cole2026 08-09-2006 01:27 AM

Quote:

Originally Posted by kether1
This looks great! I wonder if it will work with the Lightbox mod? I was thinking of installing that mod and using thumbnails on my forum. Would there be a conflict with 'Image Cache'? I am guessing no, but let me know if you think their might be.

Thanks so much.

Kether

It will not.

y2ksw 08-09-2006 09:09 AM

Quote:

Originally Posted by kether1
This looks great! I wonder if it will work with the Lightbox mod? I was thinking of installing that mod and using thumbnails on my forum. Would there be a conflict with 'Image Cache'? I am guessing no, but let me know if you think their might be.

Thanks so much.

Kether

I don't have any experience with the Lightbox mod. However I would assume it would not conflict, since the Image Cache catches the image contents and redirects the URL's to the local server. So even if there is another plugin or modification to elaborate further (like vBulletin does itself, after caching), there should be really no problem.

gamebrink 08-25-2006 01:22 AM

I love you.

Would you consider adding an option that will rezise the image in the post and link it to the full size image?

y2ksw 08-25-2006 03:37 PM

Quote:

Originally Posted by gamebrink
I love you.

Would you consider adding an option that will rezise the image in the post and link it to the full size image?

You mean thumbnailing?

I've been thinking about it, actually it isn't that big job, but it's also a question of reputation; just 5 installs mean, it isn't that great plugin and needed only from a few forum holders, of course, the quality-over-quantity-oriented ones ;)

I think if this plugin becomes more widely used, it also would become standard part of vBulletin itself, since it would be only a natural evolution of the actual attachments - dynamically attached items.

It is quite some time people are asking this feature at the official boards and sooner or later it will happen - only a question of time, and as far as I remember, was already working in some of the early beta versions of 3.0.x.

So generally spoken I don't mind to see deeper into the problem but will also wait a little, to see if this pugin becomes more used after the summer holidays :)

ChurchMedia 08-26-2006 07:15 PM

Could this be made to work in the user's signatures also? I have a lot of members putting userbars (www.userbars.com) in their sig. The problem is, when userbars.com goes down it slows my pages down. I'd love to be able to cache those userbars...

y2ksw 08-27-2006 12:33 AM

Quote:

Originally Posted by ChurchMedia
Could this be made to work in the user's signatures also? I have a lot of members putting userbars (www.userbars.com) in their sig. The problem is, when userbars.com goes down it slows my pages down. I'd love to be able to cache those userbars...

vBulletin 3.6.0 allows to save the signature picture as long as it is only one. I will think about it ;)

ChurchMedia 08-27-2006 03:23 AM

Quote:

Originally Posted by y2ksw
vBulletin 3.6.0 allows to save the signature picture as long as it is only one. I will think about it ;)

These are multiple images that would need to be cached. I'm not ready to upgrade to 3.6 until more hacks have been ported.

I'm willing to pay for the plug-in. :cool:

y2ksw 08-27-2006 02:04 PM

Quote:

Originally Posted by ChurchMedia
These are multiple images that would need to be cached. I'm not ready to upgrade to 3.6 until more hacks have been ported.

I'm willing to pay for the plug-in. :cool:

I've added IMG caching of signatures.

Although this product/plugin is free, a voluntary payment (donation) for new feature requests would greatly help to add them in a reasonable time. For this reason we have added a donation button inside readme.htm for a symbolic contribution of EUR 5.00.

ChurchMedia 08-27-2006 03:21 PM

Thanks! I really appreciate it. Great hack! :)

Donation sent

y2ksw 08-27-2006 04:46 PM

Quote:

Originally Posted by ChurchMedia
Thanks! I really appreciate it. Great hack! :)

Donation sent

Thank you, you're welcome! :)

grazianno 09-12-2006 12:04 PM

thx y2ksw for this mod,
can you tell me plz where images are hosted ? because i dont see any images in imgcache

y2ksw 09-12-2006 12:40 PM

If the images cannot be stored in the imgcache folder, the links to the original source remain intact, thus are hosted as if the plugin wasn't installed.

Please make sure to give at least the read/write rights to the imgcache folder, or storage will fail.

adwade 09-23-2006 06:29 PM

Quote:

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.

adwade 09-23-2006 06:33 PM

One other question, I run vBadvanced's CMPS. Is there a way to get this to cache what pics show up on that page as well?

y2ksw 09-23-2006 08:56 PM

Quote:

Originally Posted by adwade
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.

y2ksw 09-23-2006 08:57 PM

Quote:

Originally Posted by adwade
One other question, I run vBadvanced's CMPS. Is there a way to get this to cache what pics show up on that page as well?

I don't know, but I suppose it is. However I have no time to look into that too ;)

adwade 09-23-2006 09:04 PM

Quote:

Originally Posted by y2ksw
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!

adwade 10-24-2006 12:20 PM

Out of curiosity, is there any way to view the image cache file to see what all it contains?

y2ksw 10-24-2006 08:14 PM

Maybe not online, but by downloading and using an image (pre)viewer I'm pretty sure you may see the file contents. ;)

adwade 10-25-2006 03:18 AM

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!

JohnBee 10-27-2006 08:20 PM

Strange phenomenon here.

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..

Any ideas how to fx this, its a little confusing?

y2ksw 10-27-2006 09:12 PM

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.

JohnBee 10-27-2006 10:18 PM

Quote:

Originally Posted by y2ksw
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.

It is a great hack I will give it this.
If you could arrange for it to maintain standard image format filenames it would really help integrate it with other image functions within vBulletin. I will uninstall it for the time being, only because my members are confused about this. But I do hope you can change this because this is a very useful and helpful approach to an age old problem.

maaref 10-29-2006 08:27 AM

Great mod you made y2ksw
I like it.

some admins have a limited space to store images in their site, I have some suggestions for future update (if possible)...

add options in ACP to enable/diable:
- signature storage
- storage based on usergroups, users names... this will be excellent for proffesional forums/images describe process by certain members.
- store images in different server/site...because of space limitation. the new location could be owned by same admin.

genius mod, thanks again.

y2ksw 10-29-2006 03:53 PM

Quote:

Originally Posted by maaref
Great mod you made y2ksw
I like it.

some admins have a limited space to store images in their site, I have some suggestions for future update (if possible)...

add options in ACP to enable/diable:
- signature storage
- storage based on usergroups, users names... this will be excellent for proffesional forums/images describe process by certain members.
- store images in different server/site...because of space limitation. the new location could be owned by same admin.

genius mod, thanks again.

The storage based on forums and/or usergroups has been requested already, but I'm in a sort of stall right now (too many jobs) and cannot concentrate much on adding features.

Storing mages on another server may create many authentication problems, and in the end, if that server is down, the problem of unlinked images reappears again, reason for which this plugin has actually been created :p

maaref 10-30-2006 07:32 AM

Thank for the effoer,

Zia 12-05-2006 08:25 AM

sounds a nice mod...
caching external image..
vb3.6.4 has been released....
its supported by vb 3.6.4 ?
any new feature is coming or any update ?

y2ksw 12-27-2006 12:40 PM

Sure, it's fully compatible with vBulletin 3.6.4

adhari_com 01-31-2007 04:53 PM

then shouldn't it be moved into 3.6.4?

y2ksw 01-31-2007 07:18 PM

Quote:

Originally Posted by adhari_com (Post 1171406)
then shouldn't it be moved into 3.6.4?

Yeah, maybe :p

Still, there are many users of v. 3.5 which can't upgrade because of their server/PHP/MySQL limitations, and this forum is much less crowded than anywhere else.

Let's say, when I assume v. 3.5 is definitively dead, I will ask to move the thread to the 3.6 forums :)

KingPin6 02-19-2007 07:58 PM

thank you for an awesome mod, is there anywhere I can specify to ignore sig images? or even better, images from the forums domain? we have a default sig for each user that needs to stay updated with stats from game server, stats are based from same domain. being able to turn off cache for same domain would be awesome, thank you.

y2ksw 02-19-2007 10:16 PM

You may disable the specific plugin for signatures. When diabled, signatures are not considered :)


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01391 seconds
  • Memory Usage 1,842KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete