PDA

View Full Version : Image Cache


y2ksw
07 Aug 2006, 23:58
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 (http://www.vbulletin.org/forum/showthread.php?t=253309)

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

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

Installation
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

The Chief
08 Aug 2006, 00:10
this looks amazing, good work!!

Eagle Creek
08 Aug 2006, 03:16
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 Aug 2006, 04:31
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 Aug 2006, 11:59
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 Aug 2006, 12:02
The New Version is 3.6.0

y2ksw
08 Aug 2006, 12:04
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 Aug 2006, 20:06
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
09 Aug 2006, 03:27
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
09 Aug 2006, 11:09
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
25 Aug 2006, 03:22
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
25 Aug 2006, 17:37
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
26 Aug 2006, 21:15
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
27 Aug 2006, 02:33
Could this be made to work in the user's signatures also? I have a lot of members putting userbars (www.userbars.com (http://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
27 Aug 2006, 05:23
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
27 Aug 2006, 16:04
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
27 Aug 2006, 17:21
Thanks! I really appreciate it. Great hack! :)

Donation sent

y2ksw
27 Aug 2006, 18:46
Thanks! I really appreciate it. Great hack! :)

Donation sent
Thank you, you're welcome! :)

grazianno
12 Sep 2006, 14:04
thx y2ksw for this mod,
can you tell me plz where images are hosted ? because i dont see any images in imgcache

y2ksw
12 Sep 2006, 14:40
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
23 Sep 2006, 20:29
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
23 Sep 2006, 20:33
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
23 Sep 2006, 22:56
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
23 Sep 2006, 22:57
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
23 Sep 2006, 23:04
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
24 Oct 2006, 14:20
Out of curiosity, is there any way to view the image cache file to see what all it contains?

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

adwade
25 Oct 2006, 05:18
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
27 Oct 2006, 22:20
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
27 Oct 2006, 23:12
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
28 Oct 2006, 00:18
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
29 Oct 2006, 10:27
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
29 Oct 2006, 17:53
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
30 Oct 2006, 09:32
Thank for the effoer,

Zia
05 Dec 2006, 10:25
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
27 Dec 2006, 14:40
Sure, it's fully compatible with vBulletin 3.6.4

adhari_com
31 Jan 2007, 18:53
then shouldn't it be moved into 3.6.4?

y2ksw
31 Jan 2007, 21:18
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
19 Feb 2007, 21:58
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
20 Feb 2007, 00:16
You may disable the specific plugin for signatures. When diabled, signatures are not considered :)

KingPin6
20 Feb 2007, 02:56
thank you.

RealitYYY
28 Mar 2007, 10:15
This is great though is it able to be for specific forums and pm messages and not the entire site...

Xplorer4x4
01 Apr 2007, 22:07
This is great though is it able to be for specific forums and pm messages and not the entire site...

Not tested but try putting

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

as the first line of every plug in for this hack. Then put </if> as the last line if each plug in for this hack.

Replace XYZ with the forums ids of the forums you want it to cache in.

y2ksw
02 Apr 2007, 12:17
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



may work for templates only (n_array does not work for sure :p )

maxicep
02 Apr 2007, 14:35
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



may work for templates only (n_array does not work for sure :p )

i do it what you write, bu take an error when posting and editing on forum than i uninstalled .:(

y2ksw
02 Apr 2007, 19:48
The plugin has been written for entire sites, not for selections of forums and subforums. Unless I will release a version which allows selecting forums, I do not suggest to make a change to templates. I corrected a typo, in a hypothetically working template modification. ;)

home9000
13 Apr 2007, 17:44
very nice product
let assume that I disable the product after one month what is the impact ?
I will lose all images , is this right ?

y2ksw
14 Apr 2007, 10:26
No, the images you have stored on your server remain. After uninstalling/disabling, newly pasted images will not be stored to your server any more. That's all :)

home9000
17 Apr 2007, 09:39
Is it possible to print logo over the images that store in the site ?

like this
http://www.vbulletin.org/forum/showthread.php?t=112829&highlight=watermark
or this
http://www.vbulletin.org/forum/showthread.php?t=141883&highlight=watermark

y2ksw
17 Apr 2007, 13:41
Not yet. It has been asked before and when I got time to review this plugin, I may add this feature.

home9000
29 Apr 2007, 09:08
Thanks y2ksw
one more question, The hack will be work for the new post . I want to include the old post is there any way like Update Counters

y2ksw
30 Apr 2007, 01:36
Not yet, sorry. Also this feature was asked in the past, but I'm unable to concentrate on addons and changes, since busy in real life ;)

If you know a little PHP you may create a new cron-job and parse the messages one by one (or a small number of messages) at each interval. It is not a huge deal with an additional table where you keep trace of the messages you already parsed, or an additional field in the post table (which I discourage).

The 'update counters' isn't a great idea on large boards, because you need to take care about script timeouts. When you time out, you have to reload the page manually. On certain systems, the timeout can be disabled for cron-jobs, and most of all, they run in the background without the need of a human clicking for hours on a stupid button :p

home9000
01 May 2007, 21:59
Thanks y2ksw

Is it possible to let each month picture have a different folder in this way the number of files not going to effect the performance and it's easy to delete the old files.

my second suggestions and it's good for next release to keep in database the old picture url and you can just replace the url if the picture missing only so the bandwidth not effect in this way

home9000
19 May 2007, 18:02
I have problem right now to add any new post because its take time .Maby the problem because all image save in one folder
I have to stop the product right now and I hope we can get fix

ChurchMedia
18 Aug 2007, 23:59
Any chance on a port to 3.6.8? It stopped working for me a couple of revs back.

y2ksw
19 Aug 2007, 09:56
Any chance on a port to 3.6.8? It stopped working for me a couple of revs back.
I check what's going on ... probably a hook location which has been changed ;)

Thanks for feedback

ChurchMedia
19 Aug 2007, 15:50
I check what's going on ... probably a hook location which has been changed ;)

Thanks for feedback

Actually it was because my imgcache folder wasn't chmod to 777. My bad. Sorry!

y2ksw
20 Aug 2007, 16:48
No problem ... there was also an issue on IE7 which may not allow to show correctly *.imgcache images. New files are named *.png now and everything works ;)

KingPin6
20 Aug 2007, 22:02
hello y2ksw thank you for the update, it was always a bit slow with this mod when making posts with pictures but now after this update I cant make posts at all if it contain a few pictures, I see the pictures in the imgcache folder but the post never gets made, I just waited almost 5 minutes and then just canceled, disabled addon and retried, the post was made in a few seconds. any tips would be much appreciated.

y2ksw
21 Aug 2007, 22:46
hello y2ksw thank you for the update, it was always a bit slow with this mod when making posts with pictures but now after this update I cant make posts at all if it contain a few pictures, I see the pictures in the imgcache folder but the post never gets made, I just waited almost 5 minutes and then just canceled, disabled addon and retried, the post was made in a few seconds. any tips would be much appreciated.
Strange ... anyway 17 seconds for a message is long. I'll upload the previous version (1.0.2.0) to allow reverting.

The changes I've made should actually use much less memory, specifically when there are more images in a message, at a single time.

KingPin6
22 Aug 2007, 16:53
17 was a typo ;) which I fixed before your post but you read it already :) thank you, I will debug my setup further and will reply back with anything I come up with.

Lethe
25 Aug 2007, 21:06
actually nice mod..thx..
i used it for 1 week but i just have to much images on my users posts so i uninstalled it.. in one week i got nearly 100 mb in the imgcache folder. i cant delete them couse all links are automaticly rewritten to the imgcache folder..
the question is ; is there a way to rewrite them back ?

y2ksw
26 Aug 2007, 11:00
actually nice mod..thx..
i used it for 1 week but i just have to much images on my users posts so i uninstalled it.. in one week i got nearly 100 mb in the imgcache folder. i cant delete them couse all links are automaticly rewritten to the imgcache folder..
the question is ; is there a way to rewrite them back ?
Sorry, there is no way, since the original URL is not stored anywhere.

Njm
06 Oct 2007, 10:29
thanx 4 the hack

some user have issue with it

when i put manny image in my post and add it .. it will take long time to show

and some time it give me server Busy ?
HTTP 408/409 Server Busy

how can i fix it ?


thanx agin my frined


vBulletin Version 3.6.8

y2ksw
07 Oct 2007, 00:53
Every image is downloaded form the source as-is, and thus may take quite some time to download. The message will not show up before all images are downloaded.

If you host on a fast server, this should not be an issue, but on shared systems it may be a problem.

hilfe-forum
13 Oct 2007, 18:53
Hmm dont work wen Pic URL is not hard-Postet....

y2ksw
14 Oct 2007, 07:00
Well, sure, an image link is always an URL and thus handled just as that.

yahoooh
14 Oct 2007, 09:43
there is an error should be fixed:


i have gallery for images and also hosting images service
when a member use images already in my gallery on on my server it will be also copied and go to imgcache and i think this is not needed so


how to exclude images that already present on my site folders ?

hilfe-forum
14 Oct 2007, 21:11
Well, sure, an image link is always an URL and thus handled just as that.


no change to work with revite URL´s?

in my Board a plugin revite this url: "www.abc.de" to this "pic.abc.de/fg.jpg"

So in post i see the picture but your plugin only see www.abc.de´... :(

booktoweb
15 Oct 2007, 05:32
its not work with me in 3.6.8

yahoooh
16 Oct 2007, 07:55
its not work with me in 3.6.8

it works with me

booktoweb
21 Oct 2007, 02:56
i dont know why its not works with me
i am using it from version 3.0.8 without any problem

========
open directory imgcache and make its CHMOD 777
upload y2kswimgcache.php
Install the product (product-y2kswimagecache.xml)
========

used old version and latest version

y2ksw
21 Oct 2007, 23:33
Do you have any other hacks installed? If yes, which?

booktoweb
22 Oct 2007, 21:30
i installed new test forum and try hack
but its not works

yahoooh
30 Oct 2007, 20:31
still i need : to not cache images that already in mu server

any update

y2ksw
30 Oct 2007, 21:20
still i need : to not cache images that already in mu server

any update
I think that is not easy to perform. However I'll look into it for the next release.

bkaul
09 Nov 2007, 21:33
its not work with me in 3.6.8
It has been working in 3.6.8 for me, but upon patching to PL2, it now generates a PHP Access Violation whenever a new post using [img] code is submitted.

y2ksw
09 Nov 2007, 21:52
I have patched and tried right now, and the is no problem at all. However I just replaced the files, not doing the full upgrade.

ChurchMedia
09 Nov 2007, 22:19
It has been working in 3.6.8 for me, but upon patching to PL2, it now generates a PHP Access Violation whenever a new post using [img] code is submitted.

I'm patched -- no problems here.

bkaul
13 Nov 2007, 23:48
I'm patched -- no problems here.
Hmm ... problem started on the same day that I patched it. Odd. No disk space or database problems... will have to poke around a bit and see what I can figure out, I guess.

bkaul
14 Nov 2007, 00:18
No idea what the cause was, but uninstalling & reinstalling the product fixed it...

BadgerDog
14 Nov 2007, 17:38
Just a clarification please.... :confused:

The instructions say:

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.

So, if I install and try this, but it doesn't work or I for whatever other reason I want to un-install it and return my system to its current state, does this mean I can't?

Thanks... :)

Regards,
Badger

y2ksw
15 Nov 2007, 18:41
Just a clarification please.... :confused:

The instructions say:



So, if I install and try this, but it doesn't work or I for whatever other reason I want to un-install it and return my system to its current state, does this mean I can't?

Thanks... :)

Regards,
Badger
It means if you uncomment the uninstallation code (remove starting /* and ending */) from the product uninstallation, it will uninstall completely.

It also means (with removed comments), if you install it later again, the numeric counter will restart from 1 and thus all previously cached images will be gradually overwritten by newly cached images.

If you leave the table in place (not removing comments), you can reinstall at any without this problem. And for this reason it is commented out.

BadgerDog
15 Nov 2007, 18:58
It means if you uncomment the uninstallation code (remove starting /* and ending */) from the product uninstallation, it will uninstall completely.

It also means (with removed comments), if you install it later again, the numeric counter will restart from 1 and thus all previously cached images will be gradually overwritten by newly cached images.

If you leave the table in place (not removing comments), you can reinstall at any without this problem. And for this reason it is commented out.

Understood.... :up:

Thank you ... :)

Regards,
Badger

Triky
15 Nov 2007, 22:28
Hi y2ksw, I like this mod. I want to support it becouse it's a really a nice idea, however I think I will not install it on my web site, becouse right now I have a standard hosting plan with not so much bandwidth and web space. :p
By the way, thank you for this modification, I've installed it.. maybe in a future it could be helpfull. :)

y2ksw
16 Nov 2007, 01:28
Thanks, it's always nice to hear from happy users :)

Mazinger
15 Feb 2008, 16:12
Didn't work with me... the images are still have their original url.

y2ksw
15 Feb 2008, 16:51
Does your imagecache folder have modify (chmod 777) permissions? Without it surely won't assign a local URL.

Mazinger
15 Feb 2008, 17:13
It does.

Plus I tried uploading the php file in ASCI and in Binary mode.

I'm using 3.6.8 pl2.

Any other clues?

... And folder name is imgcache not imagecache.

Also, I'm using IE6.

Mazinger
18 Feb 2008, 12:46
Any other clues?

y2ksw
18 Feb 2008, 16:28
It does.

Plus I tried uploading the php file in ASCI and in Binary mode.

I'm using 3.6.8 pl2.

Any other clues?

... And folder name is imgcache not imagecache.

Also, I'm using IE6.
Right :)
Any other clues?
Sorry, no other ideas ...

Mazinger
18 Feb 2008, 21:12
Is there any other php/server requirements/conditionals that this hack wouldn't work with?

y2ksw
18 Feb 2008, 23:55
Maybe if fopen() would not work. But at this point you would not be able to save attachments on your server as well.

Mazinger
27 Feb 2008, 09:08
I just checked, and fopen() is off in the php info. Is there any way to enable it via .htaccess?

y2ksw
27 Feb 2008, 15:37
Not as far as I know, sorry.

ChurchMedia
16 Mar 2008, 19:01
Hi -- I've been using Image Cache since 2006. Today the imgcache folder is completely empty except for an index.html file! ALL of the images cached for almost 2 years are GONE! Does anyone have any idea what may have caused this? Is there a directory size limit in PHP or something? I hope they are still there and just unreadable...

y2ksw
16 Mar 2008, 23:55
Would it be possible the access rights of the folder have changed and you have no READ and/or LIST permission?

ChurchMedia
17 Mar 2008, 00:10
I have a dedicated server and I have full management over it. I discovered about an hour ago that all of my profile pix have been deleted as well. Myself and a server wiz-kid from Seattle are looking into it. He doesn't think we are being hacked. It may have something to do with GD. UG! Either way it's a nightmare and I'm going to pay for daily backups now.

So, your mod is fine (it's great, in fact :))!

y2ksw
17 Mar 2008, 01:50
Phew (for me) :)

Anyway I've checked the code and there is no possibility of an accidental deletion.

GlitterKill
15 May 2008, 04:15
installed on VB 3.7 and working great! Thanks! I have been looking for something like this for a long time!

yahoooh
19 May 2008, 09:18
how to make it work with vba dynamics script and also vblog and others
i need some hint on this

y2ksw
19 May 2008, 09:59
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 ... :confused:

kether1
27 May 2008, 00:18
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

y2ksw
27 May 2008, 13:36
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.

kether1
28 May 2008, 01:04
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

y2ksw
28 May 2008, 08:42
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



:)

y2ksw
28 May 2008, 08:46
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 ;)

kether1
29 May 2008, 00:30
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.

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

y2ksw
29 May 2008, 12:25
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

kether1
30 May 2008, 01:56
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: http://www.mysite.com/forum/imagehosting/34827686d769c2.gif

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

y2ksw
30 May 2008, 08:13
At this point try to comment out the code at line 55 and see if anything changes.

kether1
30 May 2008, 14:07
At this point try to comment out the code at line 55 and see if anything changes.

I tried it, but it did not change. Sorry I missed the




Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

and

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

in the code in post 106 or I would have tested it earlier. The y2kswimgcache.php file still behaves the same way with regards to the imagehosting images and other images that are on my forum's URL. Perhaps there is another place in the code I need to edit?

Thanks again!
kether

y2ksw
30 May 2008, 16:30
Maybe these images are virtual or cannot be accessed. The procedures silently fail when a file is not readable for any reason.

kether1
31 May 2008, 03:27
Oh, no. Well, I appreciate the time you spent trying to help me. I really appreciate it and your modification. If I can discover a way to make it work, I will PM you and let you know. If you think of something else for me to try, I will be happy to give it a go.

I am just surprised that none of the images from my forum URL are cached after making that code change. I expected some of them to at least cache.

Thanks again,
Kether

booktoweb
03 Jun 2008, 09:26
after edit to
allow_url_fopen = On

this hack worked well

aisais
13 Jul 2008, 03:15
Thank you for sharing this mod.
Is it compatible with 3.7.2 ?

y2ksw
13 Jul 2008, 12:20
Yes, it is running flawlessly on my servers including the versions 3.6.x and 3.7.x :)

aisais
14 Jul 2008, 06:52
Yes, it is running flawlessly on my servers including the versions 3.6.x and 3.7.x :)
Great. :up: Thank you y2ksw.

salahunreal
12 Aug 2008, 14:36
Tested on new thread, reply edit with 3.6.8 forum and worked properly.

As other stated before me, would be good idea if there an option to exclude some directories since some forums has their own uploading script.

I agree this option should be included in the 3.7 forums. this is a must have in my opinion.

Thanks for the great work

y2ksw
13 Aug 2008, 00:13
hmmm ... seems as if I will have to make this and some other changes and upgrades soon ... ;)

Mazinger
23 Aug 2008, 00:59
What are system requirements?

y2ksw
23 Aug 2008, 09:35
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.

Mazinger
23 Aug 2008, 17:03
Thanks!

Working now with safe mode off.

snotek
22 Sep 2008, 15:48
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?

y2ksw
22 Sep 2008, 17:44
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.

Shamil.
03 Oct 2008, 12:13
Would you be able to add a watermarking option to this mod?

y2ksw
03 Oct 2008, 13:41
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.

mac-warez
07 Oct 2008, 13:06
This works good on vbulletin 3.73 i have had it running for about a month with no problems

Super Jinni
25 Oct 2008, 19:08
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

:)

y2ksw
25 Oct 2008, 20:22
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.

AnabolicResourc
18 Nov 2008, 22:15
Clicks Installed !!

Correct me if i'm wrong.
Saving a copy to the imgcache is only working with new posts ?
Old posts needs pressing the edit button and saving again ?
Is there a way to make that easier ? So every old post with linked pictures are stored in imgcache ?

A watermark option would be so very nice !!
On my gallery and vB attachments i already have it, now i only need it on linked images and allbums pics.

y2ksw
19 Nov 2008, 01:09
Clicks Installed !!

Correct me if i'm wrong.
Saving a copy to the imgcache is only working with new posts ?
Old posts needs pressing the edit button and saving again ?
Is there a way to make that easier ? So every old post with linked pictures are stored in imgcache ?

A watermark option would be so very nice !!
On my gallery and vB attachments i already have it, now i only need it on linked images and allbums pics.
I have somewhere also a procedure which imports old images from amost all kind of storages (incl. 3 different imageshack versions) but needs to be assisted a little and uses quite some resources. Also I'm lacking of time to supervise or explain it. It's only worth it to use if you have a dedicated server and may change PHP settings (timeout, no safe mode, memory usage). On shared servers it would have so many caveats that it probably will cause more problems than it solves.

But for a good start you could use this plugin :)

And oh well with vbulletin 3.5 there were no albums and so, thus really will save only pasted images of new posts...

Mazinger
04 Dec 2008, 18:44
Possible to cache images on external server?

y2ksw
05 Dec 2008, 19:00
Possible to cache images on external server?
Nope. The idea was to import the images to the local server in order to keep images permanently in reach.

If they would be stored on an external server, the problem of missing images would reappear each time the external server is down. ;)

Mazinger
06 Dec 2008, 08:09
Actually, i wanted to put images on another website (on the same server).

Something I think Yahoo! and Google follows for uploading their content images.

Yahoo!, for example have the website yimg.com which contains nearly most of the images displayed on Yahoo! and that fastens the loading speed of the parent Yahoo!, site I belive.

Having the images on the same website will consider them content images, and will slow forum.

e7saas
05 Mar 2009, 13:35
good work

y2ksw
05 Mar 2009, 15:19
You're welcome :)

yahoooh
13 Jun 2009, 06:53
is there away to make it work with :
vblog
vba dynamic

y2ksw
13 Jun 2009, 12:40
is there away to make it work with :
vblog
vba dynamic
I'm sorry, I currently don't have enough time to dedicate.

Bill from Cleve
15 Jun 2009, 03:10
Just found this hack thanks to Gasper. Are you going to update it to fix the bugs? This hack is what I am looking for, but has many issues that seem can be fixed to make it perfect.

Bill from Cleve
15 Jun 2009, 04:13
Sorry, forgot to add this, can you make it to grandfather in all the older posts before installation?

y2ksw
15 Jun 2009, 10:33
Sorry, I'm in a kind of lack of time and can't dedicate on this hack in order to make it better.

In my archives I have an application which pulls in old images from a wide variety of services (e.g. ImageShack), which I'm willing to supply, but still I can't give support on that, either. :)

bahattab
17 Aug 2009, 22:36
hi

is there any new ver. for 3.8.x

thanks
regards

Bill from Cleve
01 Sep 2009, 16:37
hi

is there any new ver. for 3.8.x

thanks
regards

worked great on my 3.8.3.

rubke
01 Sep 2009, 20:33
Sorry, I'm in a kind of lack of time and can't dedicate on this hack in order to make it better.

In my archives I have an application which pulls in old images from a wide variety of services (e.g. ImageShack), which I'm willing to supply, but still I can't give support on that, either. :)

Is this a script to check the old postings and store the image ?
where can i find it ? no support needed ;)

thanks for this mod !

mhackl
14 Oct 2009, 04:38
Three questions:

1. Does this cross any lines as far as copyrights are concerned. Since you are essentially making a copy of the image and redistributing it?

2. Is the original link no longer available for the user to reference?

3. Does this only cache remote (off domain) images? If not, is it possible to do that? Answered

Bill from Cleve
23 Nov 2009, 21:12
Is there a way I can make it NOT cache images in the .PNG format? The problem is, it caches them as .PNG's, but they are actually JPG's and GIF's. This causes watermarking apps to fail because they don't understand the format.
I have tried pretty much every single option for watermarking including the .HTACCESS, but non work with this option enabled. I really love the image cache and do not want to disable it.

Is there any easy way to convert the PNG's back to the original formats without killing anything?

sarangan
27 Nov 2009, 08:45
Your plugin is very good, i am using on my very large forum. But the problem is i have about 120000 images in the imgcache folder. Because of too much images in a single folder it crashes the server harddisk to get the images and load.

Now the suggestion: It will be good if your script can automatically create new folders for everymonth like when we are in november 2009 then folder name have to be /imgcache/112009/, for december 2009 /imgcache/122009/ etc.

If you can modify the script like this, i am sure your plugin will be the best for ever.

Thank you. :)

ThomasR
09 Feb 2010, 09:36
No plans of releasing this plugin for vb 4? I'm looking for such plugin and as the targeted forum use tons of images, like Sarangan, a new folder organization would be welcome :)

Focus2
14 Apr 2010, 14:09
Your plugin is very good, i am using on my very large forum. But the problem is i have about 120000 images in the imgcache folder. Because of too much images in a single folder it crashes the server harddisk to get the images and load.

Now the suggestion: It will be good if your script can automatically create new folders for everymonth like when we are in november 2009 then folder name have to be /imgcache/112009/, for december 2009 /imgcache/122009/ etc.

If you can modify the script like this, i am sure your plugin will be the best for ever.

Thank you. :)

Just change this:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



To this:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



No plans of releasing this plugin for vb 4? I'm looking for such plugin and as the targeted forum use tons of images, like Sarangan, a new folder organization would be welcome :)

Works on vb 4.0.1

Focus2
14 Apr 2010, 14:24
Is there a way I can make it NOT cache images in the .PNG format? The problem is, it caches them as .PNG's, but they are actually JPG's and GIF's. This causes watermarking apps to fail because they don't understand the format.
I have tried pretty much every single option for watermarking including the .HTACCESS, but non work with this option enabled. I really love the image cache and do not want to disable it.

Is there any easy way to convert the PNG's back to the original formats without killing anything?

Further edit of file will keep the original extension:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

ThomasR
14 Apr 2010, 14:40
Focus2: thanks a lot for your edits!!

rubke
15 Apr 2010, 08:58
feature request(s):

- exclude some (sub)forums from caching.
- a scan and remove of unused images
- a scan and update of images

home9000
05 Nov 2010, 06:58
Is there a way I can make it NOT cache images in the .PNG format? The problem is, it caches them as .PNG's, but they are actually JPG's and GIF's. This causes watermarking apps to fail because they don't understand the format.
I have tried pretty much every single option for watermarking including the .HTACCESS, but non work with this option enabled. I really love the image cache and do not want to disable it.

Is there any easy way to convert the PNG's back to the original formats without killing anything?

What is the watermarking apps that you use

Manoel Júnior
06 Nov 2010, 17:36
Please,

Watermark!!!

y2ksw
07 Nov 2010, 18:10
For all users who have asked for an equivalent of this product for vBulletin 4, here it is (http://www.vbulletin.org/forum/showthread.php?t=253309).

Please try and enjoy :)

Manoel Júnior
07 Nov 2010, 18:45
@y2ksw:

I have vB 3.6.8 wor for me!!! But, you can implement watermark this version?

y2ksw
08 Nov 2010, 10:22
@y2ksw:

I have vB 3.6.8 wor for me!!! But, you can implement watermark this version?
I suggest to download the images, watermark and upload them back.

Watermarking is beyond the features of image caching :)

Manoel Júnior
09 Nov 2010, 00:13
I suggest to download the images, watermark and upload them back.

Watermarking is beyond the features of image caching :)
Thanks, for feedback!

home9000
14 Nov 2010, 18:40
Is it possible to put the userId or member name part of the file name of the image

y2ksw
15 Nov 2010, 09:09
Is it possible to put the userId or member name part of the file name of the image
I don't believe so ... in theory yes, but it would add more problems than it solves, since images (links) could be copied and then they would not match the users.

home9000
15 Nov 2010, 17:29
I don't believe so ... in theory yes, but it would add more problems than it solves, since images (links) could be copied and then they would not match the users.


Yes but I can ignore any link inside the domain so if any one use the image then the original member id will be the same


If you can help I will be appreciated

Baitona
18 Mar 2011, 17:35
script working 100%
however, i have a little question,

if there was an artilce in my forum, which contanis images
all images are hyperlinked to external sites/threads

when the image is imported it will still have the url after the import...

my question is there any chance to strip the forign url, in the thread?

regards

Baitona
19 Mar 2011, 11:13
is it also possible to import the images to other domain?

y2ksw
19 Mar 2011, 12:16
script working 100%
however, i have a little question,

if there was an artilce in my forum, which contanis images
all images are hyperlinked to external sites/threads

when the image is imported it will still have the url after the import...

my question is there any chance to strip the forign url, in the thread?

regards
"Wrapping" URL's are not removed yet and maybe never will.

y2ksw
19 Mar 2011, 12:21
is it also possible to import the images to other domain?
Short answer: no :)

You would like to store the images to a media server which would need a lot of more operations. However, if you have Linux, you can use the fsftp file system in order to move imported files into another server, or a symbolic link to move it on the same server to another domain. Together with the Forum URL Replacement option, you may achieve then the desired effect. This applies however only to the newer version, here: http://www.vbulletin.org/forum/showthread.php?t=253309

Manoel Júnior
18 Jul 2011, 16:53
My bro',

Please this version update:

- update all equal to Import External Image (vb4)
- a scan and remove of unused images
- a scan and update of images
- Watermark
- Integrate automatically http://www.vbulletin.org/forum/images/editor/insertimage.gif with iMG Cache

Is it possible?

Congratulations, you're a great developer.

y2ksw
18 Jul 2011, 17:38
You may watermark your pictures with external tools (e.g. download - watermark - upload). I will not add this feature for copyright reasons.

All the other requests may be possible, I'll think about it :)

Manoel Júnior
18 Jul 2011, 18:01
You may watermark your pictures with external tools (e.g. download - watermark - upload). I will not add this feature for copyright reasons.

All the other requests may be possible, I'll think about it :)
Again, thank you for all the help. Many people still have version 3.8, an update would be very good this product to these people.

Thanks again.

Manoel Júnior
21 Jul 2011, 03:26
You may watermark your pictures with external tools (e.g. download - watermark - upload). I will not add this feature for copyright reasons.

All the other requests may be possible, I'll think about it :)
Do not forget us (vb3.8​​) please my friend.

dartho
25 Aug 2011, 00:18
Excellent. I came a cross an issuie where it would attempt to cache album pictures (vb 3.8.7), but instead it cache a 1x1px img? (vBulletin's cron ?)

This however didn't happen when attachments were used in img tags :confused:

To work around I added the following code to y2kswimgcache.php so that any images in the forums were not cached:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Manoel Júnior
08 Sep 2011, 14:50
Any news y2ksw??

Thanks

dartho
08 Sep 2011, 18:42
This works well under 3.8.7!

y2ksw
09 Sep 2011, 09:48
Any news y2ksw??

Thanks
No news yet ... overrun by work.