View Full Version : Administrative and Maintenance Tools - Import External Images
y2ksw
11-06-2010, 10:00 PM
This vBulletin 4 product imports external images in your posts from external servers or paths into a specific path, normally your forum's image folder.
Differently than the previous product Image Cache for vBulletin 3.x. (https://vborg.vbsupport.ru/showthread.php?t=123338), it parses the posts at regular intervals for new images and replaces the external references in the background. Also, instead of using only a single folder, it creates folders for years and months, making it much easier to handle large quantities of images. The source and destination image URL's are stored into database, too, avoiding unnecessary duplicates.
It moves and optionally converts images from one place to another. It is a handy tool in order to keep your images local to your forums.
Version 1.0.4 is temporarily in BETA stage until the users have confirmed the newly requested features.
Version 1.0.5 is still in BETA stage. It adds a new bunch of additional features, one of which allows you to test your mathematical understanding :) ... and a few other to fine-tune CURL and socket timeouts, and resizing on the fly of too large images. If you don't know what these options do, please leave them at their default values.
gagan007
11-07-2010, 04:07 PM
Gotta install it now... :)
Thanks...MAI
LuisManson
11-07-2010, 05:01 PM
tagged, thanks,
it uses the forum as referer or the image domain?
Manoel J?nior
11-07-2010, 05:03 PM
Thanks a lot!
yahooooh
11-07-2010, 05:29 PM
thank you
BadgerDog
11-07-2010, 05:35 PM
Thanks for coding this as I think it's very useful ... :)
I don't have a development board capability, just a live site with 13,000 members and lots of IMG externally hosted pics, so I'd love to get feedback from folks who install and test this before I try it on our live site ... just in case ... ;)
ps: does it go back and bring in externally hosted pics from OLD existing posts, or just new ones posted from the time forward after the mod is installed?
Regards,
Badger
Tagged! Great mod. I'll try it out later, ;)
Thanks!
sticky
11-08-2010, 12:13 AM
So will it go through all past posts and replace those images?
Wajdan
11-08-2010, 04:13 AM
I snap shot would be highly appreciated....!
YankForum
11-08-2010, 05:11 AM
I snap shot would be highly appreciated....!
check this (http://forum.pagerobot.com/195-altri-servizi-dal-web/27900-seconda-nazionalit%E3?p=84112#post84112) thread , on his own boards
it seems every single image will be hosted on his own server in /imported folder , nice hack , but i really need to switch to dedicated servers before installing this :)
y2ksw
11-08-2010, 08:29 AM
tagged, thanks,
it uses the forum as referer or the image domain?
Internally, it skips all images containing $vbulletin->options['bburl'], and, if specified (options), the bburl replacement. Additionally, you may add (options) more folders and/or domains to skip.
Thanks for coding this as I think it's very useful ... :)
I don't have a development board capability, just a live site with 13,000 members and lots of IMG externally hosted pics, so I'd love to get feedback from folks who install and test this before I try it on our live site ... just in case ... ;)
ps: does it go back and bring in externally hosted pics from OLD existing posts, or just new ones posted from the time forward after the mod is installed?
Regards,
Badger
So will it go through all past posts and replace those images?
Yes, it parses all posts from the beginning.
I snap shot would be highly appreciated....!
It has not much to show off - maybe the options window? :)
check this (http://forum.pagerobot.com/195-altri-servizi-dal-web/27900-seconda-nazionalit%E3?p=84112#post84112) thread , on his own boards
it seems every single image will be hosted on his own server in /imported folder , nice hack , but i really need to switch to dedicated servers before installing this :)
Why dedicated server? I think it can be run on any normal server.
BadgerDog
11-08-2010, 09:56 AM
Internally, it skips all images containing $vbulletin->options['bburl'], and, if specified (options), the bburl replacement. Additionally, you may add (options) more folders and/or domains to skip.
Yes, it parses all posts from the beginning.
It has not much to show off - maybe the options window? :)
Thanks ... :)
Two clarifications ...
1. If the image is not longer available on the remote external site, where the poster has moved or deleted it, how does it handle those circumstances?
2. We use a special external reference that ties back to a Highslide display of images we store off-site on a separate special server. The syntax is http://www.pic.jog. I believe it's BBCode triggered and displays those external pics as pop-ups. We would NOT want those references changes, so does your mod skip those because there are not IMG type tags and it will work fine for us with the HSURL internal code?
Thanks again for your efforts.... :)
Regards,
Badger
y2ksw
11-08-2010, 12:28 PM
Thanks ... :)
Two clarifications ...
1. If the image is not longer available on the remote external site, where the poster has moved or deleted it, how does it handle those circumstances?
2. We use a special external reference that ties back to a Highslide display of images we store off-site on a separate special server. The syntax is http://www.pic.jog. I believe it's BBCode triggered and displays those external pics as pop-ups. We would NOT want those references changes, so does your mod skip those because there are not IMG type tags and it will work fine for us with the HSURL internal code?
Thanks again for your efforts.... :)
Regards,
Badger
1. This depends on your 'Remove Invalid Images' settings (options). Invalid images are also courtesy pages, invalid images (scripts) or anything else which can't be loaded by the image* functions of the GD image library.
2. Please add "www.pic.jog/" to the "Ignore" settings (options) in order to skip all possible image URLs containing this string. If it is BBCode wrapped differently from [IMG] tags, it won't get imported anyway.
BadgerDog
11-08-2010, 12:42 PM
2. Please add "www.pic.jog/" to the "Ignore" settings (options) in order to skip all possible image URLs containing this string. If it is BBCode wrapped differently from tags, it won't get imported anyway.
Thank you Sir .. :)
So, to the "Ignore" settings I would add "http://photos.imageevent.com" to IGNORE this HIGHSLIDE java script BBCode statement below, which appears in a lot of our posts?
[IMG]http://photos.imageevent.com/badgerdog/canadianservicerifles/1915rossmkiiisniper223/icons/DSC01967.JPG
Note: there is an IMG reference in that string for the small icon to support the larger pop-up highlside pic, but would it get ignored too, which is important and what we'd need..
Regards,
Badger
y2ksw
11-08-2010, 01:23 PM
Thank you Sir .. :)
So, to the "Ignore" settings I would add "http://photos.imageevent.com" to IGNORE this HIGHSLIDE java script BBCode statement below, which appears in a lot of our posts?
https://vborg.vbsupport.ru/external/2010/11/33.jpg
Note: there is an IMG reference in that string for the small icon to support the larger pop-up highlside pic, but would it get ignored too, which is important and what we'd need..
Regards,
Badger
The [hsurl] tag won't get parsed, thus you don't have to worry about this tag.
However, if your users are copying and pasting the image contained in [hsurl] in some way, vbulletin would wrap it with a standard tag. For this you should add photos.imageevent.com/to the ignore list, just to make sure it [I]never gets imported, no matter which tag is used.
y2ksw
11-08-2010, 01:26 PM
PS: In order to scratch off the hsurl tag, you probably will need another filter. An URL around an image remains untouched.
BadgerDog
11-08-2010, 02:22 PM
The tag won't get parsed, thus you don't have to worry about this tag.
However, if your users are copying and pasting the image contained in [hsurl] in some way, vbulletin would wrap it with a standard tag. For this you should add photos.imageevent.com/to the ignore list, just to make sure it never gets imported, no matter which tag is used.
Sorry for being so dense .... :D
So, this line of code (or any part of it) on the site would NEVER get touched by your mod when it executes .. correct?
[hsurl=http://photos.imageevent.com/badgerdog/canadianservicerifles/1915rossmkiiisniper223/DSC01967.JPG][IMG]http://photos.imageevent.com/badgerdog/canadianservicerifles/1915rossmkiiisniper223/icons/DSC01967.JPG
PS: In order to scratch off the hsurl tag, you probably will need another filter. An URL around an image remains untouched.
Another filter? Such as?
I wish there was some way I could test what this mod does and view it's impact, restricting it's cron execution to just a specific "Test Forum" ID, so it didn't act on any other data in the databse. In that way, we could make sure we didn't mess up 4 years of posts without a test. Is that possible to have a test forum ID mode that one can turn ON and OFF?
Thanks again ... :)
Regards,
Badger
y2ksw
11-08-2010, 04:07 PM
Sorry for being so dense .... :D
So, this line of code (or any part of it) on the site would NEVER get touched by your mod when it executes .. correct?
https://vborg.vbsupport.ru/external/2010/11/33.jpg
Another filter? Such as?
I wish there was some way I could test what this mod does and view it's impact, restricting it's cron execution to just a specific "Test Forum" ID, so it didn't act on any other data in the databse. In that way, we could make sure we didn't mess up 4 years of posts without a test. Is that possible to have a test forum ID mode that one can turn ON and OFF?
Thanks again ... :)
Regards,
Badger
If photos.imageevent.com/ is in the Ignore settings,
https://vborg.vbsupport.ru/external/2010/11/33.jpg
is not touched at all. If it isn't, it is touched this way:
http://www.forum.tld/images/imported/2010/11/1234.jpg
Assuming you have already 1233 JPEG images in your .../2010/11/ folder and the post comes from today.
For testing, I suggest to use it on a test board first :)
There is no such filter as forum sections, threads and so on, but if you really must filter, then you may change the query in file iei_cron.php on line 229 from:
$SQL = "SELECT postid, dateline, pagetext
FROM " . TABLE_PREFIX . "post
WHERE iei_parsed=0
AND pagetext LIKE '%[/IMG]%'
ORDER BY postid";
to:
$SQL = "SELECT postid, dateline, pagetext
FROM " . TABLE_PREFIX . "post
WHERE iei_parsed=0
AND threadid=XXX
AND pagetext LIKE '%[/IMG]%'
ORDER BY postid";
where XXX is your thread id.
At this point, please enable also the cronjob logging (modify task), in order to see in your logs which posts have been touched.
Last not least, don't forget to undo the changes after testing :D
Dr.osamA
11-09-2010, 01:43 AM
thanxx
installed but not working at all
you can try it here alra7ba.info (http://www.alra7ba.info/vb/showthread.php?t=189)
user:vBulletin
pass:123456
can i translate it to Arabic lang. and add it here plzz ?
sticky
11-09-2010, 07:55 AM
Installed but for some reason not working. I uploaded the file, created the folder set to 755, enabled the product, not sure what is up.
sticky
11-09-2010, 08:03 AM
Installed but for some reason not working. I uploaded the file, created the folder set to 755, enabled the product, not sure what is up.
Changed it to 777 and it works, awesome :)
doopz
11-09-2010, 08:31 AM
Does this also convert images posted in articles on the CMS?
y2ksw
11-09-2010, 09:10 AM
thanxx
installed but not working at all
you can try it here alra7ba.info (http://www.alra7ba.info/vb/showthread.php?t=189)
user:vBulletin
pass:123456
can i translate it to Arabic lang. and add it here plzz ?
Maybe the imported folder needs chmod 777, as stated from a user after your question.
If the plugin creates subfolders and files in the imported folder, it works. Eventually, it will need a long time to catch up to the current posts. On our production board, it took about a week to run through 800.000+ posts, with setting Maximum Post Count: 1000. Please remember, it needs a very powerful server and a long script timeout to run through 1000 posts at each time. Our timeout was set to 5 minutes in the starting phase.
After the plugin had catched up, we set the Maximum Post Count: 10, which suffices for a board with about 1000 new posts each day.
Please feel free and translate/publish the product on your site :)
y2ksw
11-09-2010, 09:11 AM
Changed it to 777 and it works, awesome :)
Thanks for testing. I'll update the help files accordingly.
sticky
11-09-2010, 10:16 PM
Are these changes permanent btw? If I uninstall, does it go back to how it was?
sticky
11-09-2010, 10:22 PM
Does this also convert images posted in articles on the CMS?
Good question, would like to know as well.
sticky
11-10-2010, 08:41 AM
This seems to be causing a good amount of database errors.
Dr.osamA
11-10-2010, 11:48 AM
Maybe the imported folder needs chmod 777, as stated from a user after your question.
If the plugin creates subfolders and files in the imported folder, it works. Eventually, it will need a long time to catch up to the current posts. On our production board, it took about a week to run through 800.000+ posts, with setting Maximum Post Count: 1000. Please remember, it needs a very powerful server and a long script timeout to run through 1000 posts at each time. Our timeout was set to 5 minutes in the starting phase.
After the plugin had catched up, we set the Maximum Post Count: 10, which suffices for a board with about 1000 new posts each day.
Please feel free and translate/publish the product on your site :)
thank you for your help
i have chmod 777 for folder and i had old version in my vb3.x.x and no new images
that main don't need more time for import images to my site only new posts and that not much :confused:
y2ksw
11-10-2010, 02:41 PM
Are these changes permanent btw? If I uninstall, does it go back to how it was?
Changes made to posts and the images stored to the file system are permanent.
y2ksw
11-10-2010, 02:43 PM
Good question, would like to know as well.
As far as I know, articles are not stored in the post table, thus the CMS remains untouched. However, if the articles are stored there, the changes apply.
y2ksw
11-10-2010, 02:48 PM
This seems to be causing a good amount of database errors.
If it does cause a lot of database errors (timeout, db "went away" errors), please reduce your maximum post count. The default value of 10 should be enough for most boards.
If you have an extremely short timeout on scripts, you will have to reduce this value even more.
y2ksw
11-10-2010, 02:52 PM
thank you for your help
i have chmod 777 for folder and i had old version in my vb3.x.x and no new images
that main don't need more time for import images to my site only new posts and that not much :confused:
If you want to skip all old posts, you may run this query:
UPDATE post SET iei_parsed=1This way, only new and edited posts are parsed.
If you decide later to reparse all old posts, too, just run
UPDATE post SET iei_parsed=0which will restart parsing all over again.
Dr.osamA
11-10-2010, 10:41 PM
thank you again sir
try it then inform you about results
BRB
abunaji
11-24-2010, 12:13 PM
If a post is deleted from the forum, will it delete the images in that post automatically?
I think that is very important for there is no need to keep images from deleted posts .. they only eat up disk sapce.
Also, is there a feature to save the images on another server?
I don't have enough space on my vps , but I have plenty on another shared hosting.
y2ksw
11-24-2010, 01:32 PM
If a post is deleted from the forum, will it delete the images in that post automatically?
I think that is very important for there is no need to keep images from deleted posts .. they only eat up disk sapce.
Also, is there a feature to save the images on another server?
I don't have enough space on my vps , but I have plenty on another shared hosting.
No images are deleted.
If you are on Linux and have direct access, you may define a symbolic link to another server. However, you also will need services, which transfers the requested data back and forth.
sticky
12-01-2010, 04:21 AM
If it does cause a lot of database errors (timeout, db "went away" errors), please reduce your maximum post count. The default value of 10 should be enough for most boards.
If you have an extremely short timeout on scripts, you will have to reduce this value even more.
I reduced the maximum post count and it worked great! Reduced the DB errors, thanks!
sticky
12-01-2010, 04:21 AM
One thing I have noticed, it only replaced images in threads and not in the CMS even if the post is promoted. Any way to address this?
dacho
12-01-2010, 08:56 AM
Thanks mate,
If I want to import the images to sub donain ?
like that : static.domain.com/imported
I change the "Imported Images Folder" to ../static.domain.com/imported
the setting of "Remove Invalid Images" on OFF
It does not work for me, it's replace the link of the image to "clear.gif" (Although marked him - not). And not import the file to Sub Domain
Do you have any ideas ?
y2ksw
12-01-2010, 01:49 PM
One thing I have noticed, it only replaced images in threads and not in the CMS even if the post is promoted. Any way to address this?
For now, CMS posts are not parsed. I may consider implementing this feature, if you are not the only one asking for it :)
y2ksw
12-01-2010, 02:01 PM
Thanks mate,
If I want to import the images to sub donain ?
like that : static.domain.com/imported
I change the "Imported Images Folder" to ../static.domain.com/imported
the setting of "Remove Invalid Images" on OFF
It does not work for me, it's replace the link of the image to "clear.gif" (Although marked him - not). And not import the file to Sub Domain
Do you have any ideas ?
I knew it wouldn't work that way ... :)
This plugin is meant to import images from other sites in order to avoid the loss, which sooner or later would happen.
If you need to store images in paths outside your forum domain, you may use symbolic links. Under Linux this is pretty simple to achieve. Additionally, with sftpfs (http://sourceforge.net/projects/sftpfs/) you may store and retrieve them at any place in the world. There are other tools for the same problem, too.
However, the image paths remain local. If you mass-wish a different storage location than the forum domain, I may have a look into it, but please don't expect me to be quick and professional ... such a thing requires a lot of testing and is surely not easy to implement. Besides a considerably higher amount of time needed to maintain the whole thing ;)
dacho
12-01-2010, 05:56 PM
Thanks for the reply.
It is possible that it will cancel the previous server link of the picture - to kill the [URL] ?
y2ksw
12-01-2010, 06:24 PM
Thanks for the reply.
It is possible that it will cancel the previous server link of the picture - to kill the [url] ?
Deciding when to delete the URL around a picture is the most difficult task. It could be a legit URL pointing to another site, and then you would not wish to delete it. In other cases, it could point nowhere (dead), or to a larger image, like it would happen to imageshack servers for example.
I believe you will have to use direct MySQL queries or handcrafted code in order to remove the links you don't like to keep. There is no magic fomula which may guess the right thing to do ;)
dacho
12-02-2010, 01:19 PM
I think it can erase all the links,
It's Better if we have the option to decide whether to cancel the links or not, or decide which links do not cancel.
It can improve product
sticky
12-05-2010, 12:40 AM
Is it possible to set this to avoid certain forums?
dcuellar
12-05-2010, 01:34 AM
Wow. Exactly what I needed. This is perfect for people who want to rewrite external links for advertising like linkbucks. Linkbucks now skips images and lytebox will work because the images are all local.
I just hope this continues to work when I upgrade to 4.1.
y2ksw
12-05-2010, 10:52 AM
Is it possible to set this to avoid certain forums?
No.
y2ksw
12-05-2010, 10:53 AM
Wow. Exactly what I needed. This is perfect for people who want to rewrite external links for advertising like linkbucks. Linkbucks now skips images and lytebox will work because the images are all local.
I just hope this continues to work when I upgrade to 4.1.
It should work for all coming versions :)
Hateman
12-17-2010, 07:04 PM
Hi Mate,
i think it dosen't work with vBulletin 4.1. I installed all thinks probably the cacher dont do his work.
Gostemilov
12-17-2010, 07:32 PM
Great mod! I nominate it! But what about CMS posts? Is it possible to parse CMS tables? I need it very, very much! Thanks a lot! (4.0.8)
y2ksw
12-18-2010, 10:53 AM
Hi Mate,
i think it dosen't work with vBulletin 4.1. I installed all thinks probably the cacher dont do his work.
I' am testing 4.1 but I'm not through yet. It should work though, unless the post table has changed (which hasn't).
y2ksw
12-18-2010, 10:54 AM
Great mod! I nominate it! But what about CMS posts? Is it possible to parse CMS tables? I need it very, very much! Thanks a lot! (4.0.8)
I'll look into it after testing 4.1 :)
urstorm.com
12-19-2010, 03:48 PM
pls testing at 4.1 ...
before i install it ,,,
bond010007
12-28-2010, 09:47 AM
<font color="DarkGreen">i really looking for one like that but what about images hosted on my web site? inside my forum or in same domain name
thanks in advance
and pls we ned it for 4.1
</font>
RustedBucket
12-28-2010, 11:35 AM
Worked fine on 4.1.0 PL2, however, while the concept is good, the plugin is very lacking in control at the moment. Right now it appears to be an all or nothing kind of thing. No control over individual forums, threads or even a single post. These would be great, plus options to exclude things like signatures would help greatly.
urstorm.com
12-28-2010, 11:42 AM
worked for me for a wile then stoped ! i dont know why ! its tranfered about 1480 inm at all 98mb then stop days left no change . but i am sure my forum have more than 50 000 img
have dedi server ..
Mofareq
12-28-2010, 01:13 PM
Hello y2ksw
i make every thing folder with chmod 777 and run the product , it make sub-folder ( 2010 ) but not have any images and the table of your product is 0 don't have any thing
i sent to my server menagment and them tolde me chmod 777 not worked with SUPHP and that must be to 755 , i change it to 755 and not worked also ...
note : i installed it for 2 weeks and no any images imported
please help me ..
thanks
Nosfer@tu
12-28-2010, 02:19 PM
GREAT PRODUCT.
I have been missing this feature, and Vb declined to implement it because of copy rigth shite :D
EXELENT, will report back when I have tested.
EDIT
BTW what happens to images already uploaded to the forum via the attachment system?
Nothing I guess ?
What about images that have a thumbnail link?
Like images on photobucket or imageshack.us ?
Will it download the largest image and thumbnail it or :D ?
demonfatal
12-28-2010, 02:19 PM
Thank you great mod!
dcuellar
12-28-2010, 04:22 PM
Any chance this can run in real time?
y2ksw
12-29-2010, 02:55 PM
i really looking for one like that but what about images hosted on my web site? inside my forum or in same domain name
thanks in advance
and pls we ned it for 4.1
You may define in the options all domains to images to keep intact.
y2ksw
12-29-2010, 02:57 PM
Hello y2ksw
i make every thing folder with chmod 777 and run the product , it make sub-folder ( 2010 ) but not have any images and the table of your product is 0 don't have any thing
i sent to my server menagment and them tolde me chmod 777 not worked with SUPHP and that must be to 755 , i change it to 755 and not worked also ...
note : i installed it for 2 weeks and no any images imported
please help me ..
thanks
Also check that you are the owner or, that Apache is the owner.
y2ksw
12-29-2010, 02:58 PM
GREAT PRODUCT.
I have been missing this feature, and Vb declined to implement it because of copy rigth shite :D
EXELENT, will report back when I have tested.
EDIT
BTW what happens to images already uploaded to the forum via the attachment system?
Nothing I guess ?
What about images that have a thumbnail link?
Like images on photobucket or imageshack.us ?
Will it download the largest image and thumbnail it or :D ?
thumbnails :)
y2ksw
12-29-2010, 03:00 PM
Any chance this can run in real time?
Nope. In order to keep the failures as low as possible, and have nearly zero impact on your server performance while people browse, and no impact on code changes as they happen too often, I have decided to adapt the cronjob technique, which is much more reliable, too.
y2ksw
12-29-2010, 03:01 PM
worked for me for a wile then stoped ! i dont know why ! its tranfered about 1480 inm at all 98mb then stop days left no change . but i am sure my forum have more than 50 000 img
have dedi server ..
disk full? 100 MB sounds like that ...
urstorm.com
12-29-2010, 04:49 PM
disk full? 100 MB sounds like that ...
i have full server 250gb nothing full!!!
do u thing if i uninstall it it and reinstall it working or what is ur advice to fix this ?
y2ksw
12-29-2010, 07:30 PM
i have full server 250gb nothing full!!!
do u thing if i uninstall it it and reinstall it working or what is ur advice to fix this ?
You said nothing else, I was just guessing :)
sticky
12-31-2010, 07:48 PM
Nope. In order to keep the failures as low as possible, and have nearly zero impact on your server performance while people browse, and no impact on code changes as they happen too often, I have decided to adapt the cronjob technique, which is much more reliable, too.
I do get failures from time to time where images will be replaced and the wrong image will be shown.
How do I cut down on these?
y2ksw
01-01-2011, 01:49 PM
I do get failures from time to time where images will be replaced and the wrong image will be shown.
How do I cut down on these?
If images have been replaced on source, there is nothing I can do about it.
sticky
01-02-2011, 10:08 AM
If images have been replaced on source, there is nothing I can do about it.
I understand, but why does it replace incorrectly sometimes?
It works about 90% of the time correctly but sometimes it will replace an image with the wrong image.
And can it be edited to use the same image name as the source?
y2ksw
01-02-2011, 11:50 AM
I understand, but why does it replace incorrectly sometimes?
It works about 90% of the time correctly but sometimes it will replace an image with the wrong image.
And can it be edited to use the same image name as the source?
If, for example, the source does not allow hot linking, they send usually a dummy image of 1x1 pixel in order to save bandwidth. If you have CURL enabled, more images are correctly downloaded, since CURL simulates a browser, while raw sockets (fopen) don't.
If you have known sites where you get always wrong images, you may include them into the Ignore list. This way the images are kept on the original server, although you may loose them over time.
kether1
01-06-2011, 04:00 PM
Thanks so much, Giovanni! I use your 3.X version of this and love it.
When upgrading to 4.x should I uninstall your 3.X version and install this version?
The 3.X appears to still work after my upgrade. I see this version puts the images in a different location and in sub-folders. I think that is a great idea. My 3.X version folder is huge. :)
Again, thanks for your good work.
Kether
Brandon Sheley
01-06-2011, 05:00 PM
I've been looking for a mod like this, I'm going to tag it for now and will check it out later
a few questions
I see you mentioned it only grabs thumbnails, can that be changed?
Also can we place the images before the forum root, like how we can optimize the attachments by pulling them out of the DB and placing them on the file server?
thx
kether1
01-12-2011, 08:23 PM
Thanks so much, Giovanni! I use your 3.X version of this and love it.
When upgrading to 4.x should I uninstall your 3.X version and install this version?
The 3.X appears to still work after my upgrade. I see this version puts the images in a different location and in sub-folders. I think that is a great idea. My 3.X version folder is huge. :)
Again, thanks for your good work.
Kether
Hi Giovanni, do I need to uninstall the 3x version before installing this version on my 4.1.0 forum? Thanks man!
Kether
y2ksw
01-13-2011, 08:30 AM
Hi Giovanni, do I need to uninstall the 3x version before installing this version on my 4.1.0 forum? Thanks man!
Kether
If the 3.x product continues to work for you on vBulletin 4.x, you need not to upgrade. However, I would try the new version on a test board, since it allows you to store images in a more efficient way and classified by date. I would not use both solutions though.
y2ksw
01-13-2011, 08:39 AM
I've been looking for a mod like this, I'm going to tag it for now and will check it out later
a few questions
I see you mentioned it only grabs thumbnails, can that be changed?
Also can we place the images before the forum root, like how we can optimize the attachments by pulling them out of the DB and placing them on the file server?
thx
Theorically it can be changed in order to download the source images and the thumbnails. However, each system has different ways and changes them from time to time, in order to avoid direct downloading. Since this is freeware and I have no income with it, nor are there enough customers for asking this feature, it is unlikely it will be ever implemented.
Similarily, the file server/gallery issue has been discussed before. If there was a consistent number of users requesting to move files to another server, I may look into moving files via FTP and/or PHP's fopen and updating queries and so stuff. But until now you are only about the third person asking for this feature. Instead, you may use fsftp for Linux, which transparently links another server to a symbolic link of your forum root subfolder of your choice. There may be other solutions too. I do not support any of those solutions ;)
BirdOPrey5
01-13-2011, 11:54 AM
I installed this on a VB 3.8 test forum and it appears to be working well. :up:
Thank You...
Ever think about an option to keep the original file name rather than renaming it to a number?
y2ksw
01-13-2011, 02:36 PM
I installed this on a VB 3.8 test forum and it appears to be working well. :up:
Thank You...
Ever think about an option to keep the original file name rather than renaming it to a number?
Yes. But under Windows, file names cannot contain ? and other strange things you may find in an image URL, some Linux versions may not love excessively + and *, and numbers are a good solution for all imaginable file systems one can come across :)
kether1
01-13-2011, 05:15 PM
Thank you, Giovanni, for answering my question! I want to use your new version on my vb4 forum instead of the vb3 version, I just wanted to know what to do before installing the vb4 version. I did not want a conflict. This has been an excellent product for me. One of my favorite modifications I use on my forum. Thank you for sharing your work and time.
Kether
BirdOPrey5
01-13-2011, 05:49 PM
Can someone who has been using this give me some idea how much disk space this uses in a real world environment? Obviously it's different for everyone but just an idea- how long you had it? how many posts you get? how much disk space is the folder taking up each month?
y2ksw
01-14-2011, 09:29 AM
Thank you, Giovanni, for answering my question! I want to use your new version on my vb4 forum instead of the vb3 version, I just wanted to know what to do before installing the vb4 version. I did not want a conflict. This has been an excellent product for me. One of my favorite modifications I use on my forum. Thank you for sharing your work and time.
Kether
There should be no conflict at all, since it uses a different table and an additional field to distinguish parsed posts from new or modified ones. Just disable the 3.x one and install this ... you are ready to go. Please don't forget to enable the product once you have chmodded the imported file folder and setup the options, since it installs disabled.
y2ksw
01-14-2011, 09:33 AM
Can someone who has been using this give me some idea how much disk space this uses in a real world environment? Obviously it's different for everyone but just an idea- how long you had it? how many posts you get? how much disk space is the folder taking up each month?
I have this installed on a site with about 3.000 pasted images each month, which translates in about 30 MB imported images monthly.
BirdOPrey5
01-14-2011, 03:42 PM
I have this installed on a site with about 3.000 pasted images each month, which translates in about 30 MB imported images monthly.
Thank you.
sticky
01-14-2011, 04:20 PM
Ever think about an option to keep the original file name rather than renaming it to a number?
That would be incredibly useful! Or to at least append #.
sticky
01-14-2011, 04:21 PM
Yes. But under Windows, file names cannot contain ? and other strange things you may find in an image URL, some Linux versions may not love excessively + and *, and numbers are a good solution for all imaginable file systems one can come across :)
Could you specify for it just to use the letters in the title, and to avoid those characters entirely?
john h
01-14-2011, 07:57 PM
When I ran this manually in the task scheduler I get this:
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in [path]/includes/cron/iei_cron.php on line 148
sticky
01-14-2011, 09:07 PM
Another reason to consider allowing the files to keep their names is how much it will help with google image searches driving a lot of traffic.
y2ksw
01-15-2011, 02:50 PM
Could you specify for it just to use the letters in the title, and to avoid those characters entirely?
I'm not particularily interested of forging file names in a different way. Progressive numbers appear to work for everybody without additional options and international conflicts. Please see this plugin as an attempt to avoid missing images over time, and not as an alternative attachment manager.
Also, while I was reasoning about your request, occasionally duplicate file names would be then really annoying. Then I would have to use what? Numbers again? And what about the case insensitivity of Windows?
No, really, I see your point, but I can't see an easy and always working solution, which will not require me to add a lot more of code and support just to make it possible to use the same file names... ;)
y2ksw
01-15-2011, 02:55 PM
When I ran this manually in the task scheduler I get this:
As a warning it will proceed. Anyways, you may comment this line out. In this case, if an image URL is redirected, it will not follow and try to get the image there, but report a missing image. You may have to add the domains with redirects to your ignore list, in order to keep the original images.
y2ksw
01-15-2011, 03:07 PM
Another reason to consider allowing the files to keep their names is how much it will help with google image searches driving a lot of traffic.
An efficient SEO also requires titles and image descriptions, which are not given by pasted images. A possible solution would be to import images as real attachments in an album, where eventually somebody will add a title and a description.
In real life nobody will add titles and descriptions to automatically added images, ever! The efford to correctly insert images in the old and new attachment system is much higher than just copying a file to one place, and the never-or-once-used additional feature would be overdoing this product.
I agree, this is not a perfect addition, but it is surely much better than having missing images after a few days, weeks or months :)
BirdOPrey5
01-15-2011, 08:18 PM
y2ksw,
This is indeed a most awesome mod- my request for the images to retain their original names wasn't to get Google image credit since I don't allow hot-linking of my images anyway I just assume Google didn't index my images. I was asking because I can see inevitably people link to inappropriate images that I won't want on my server- indeed am not allowed to even have on my server according to my hosting account rules- and I just believed finding a real name rather than a number might make my life easier later on when I'm having to manually delete files via FTP.
There is just 1 thing preventing me from using this and it is by no means the "fault" of this mod- i just want to ask here in case anyone might have had the same issue
I have multiple domains pointing to my site. By default this mod uses my "bburl" to hard code the image URL. However a number of my users browse via alternate domains because my primary (and sometimes secondary) domains end up getting blocked by web access filters at people's jobs. SO i have gone through great pain to make sure there are no hard coded links or images on my site at all- everything is relative so if you browse via juot.net, everything is on juot.net. If you browse by juot.co, everything is on juot.co, and so on.
If I use this mod as is it will hard code every image to juot.net and anyone logging in from a place where juot.net is blocked will get broken images.
I tried to put "/forums" in the replacment URL option but the [img] bb code doesn't work with relative paths.
Curious if you or anyone have any ideas about this?
Also, if I were to edit your cron job file to keep the existing file names would you be OK if I attached it in this thread so others who might want that feature could use it?
newmomsforum
01-15-2011, 11:44 PM
Hi Y2k
Firstly great mod and is just what I needed so thanks for sharing it with us :)
Quick question though.. The import worked fine at first and I have 4 folders created for 2006, 2007, 2008 and 2009 with sub folders for each month within and the images within those
The strange thing is.. No further folders have been created beyond 2009 and the import appears to have stopped... images from external sites have still been posted since 2009 and continue to be posted on a daily basis.
No memory issue and the forums running fine .. any ideas?
Cheers
Mark
y2ksw
01-16-2011, 06:46 AM
y2ksw,
This is indeed a most awesome mod- my request for the images to retain their original names wasn't to get Google image credit since I don't allow hot-linking of my images anyway I just assume Google didn't index my images. I was asking because I can see inevitably people link to inappropriate images that I won't want on my server- indeed am not allowed to even have on my server according to my hosting account rules- and I just believed finding a real name rather than a number might make my life easier later on when I'm having to manually delete files via FTP.
There is just 1 thing preventing me from using this and it is by no means the "fault" of this mod- i just want to ask here in case anyone might have had the same issue
I have multiple domains pointing to my site. By default this mod uses my "bburl" to hard code the image URL. However a number of my users browse via alternate domains because my primary (and sometimes secondary) domains end up getting blocked by web access filters at people's jobs. SO i have gone through great pain to make sure there are no hard coded links or images on my site at all- everything is relative so if you browse via juot.net, everything is on juot.net. If you browse by juot.co, everything is on juot.co, and so on.
If I use this mod as is it will hard code every image to juot.net and anyone logging in from a place where juot.net is blocked will get broken images.
I tried to put "/forums" in the replacment URL option but the [img] bb code doesn't work with relative paths.
Curious if you or anyone have any ideas about this?
Also, if I were to edit your cron job file to keep the existing file names would you be OK if I attached it in this thread so others who might want that feature could use it?
You may find the real name and new association in the iei_img for this scope. Also I may think about a unallowed file names option, which is simple and does not change the behaviour.
As for *juot.*, please add into your exception list the partial URL, which identifies your media server(s). For example,
http://juot.
or
.juot.
could be such a string. In this way, you avoid importing images from different domains, since they are pointing to the same physical installation.
Also, you may need to add a plugin at global_bootstrap_init_start with:$vbulletin->options['bburl'] = 'http://' . $_SERVER['HTTP_HOST']; in order to reflect the correct URL for each domain you are coming from. Please note that this change may affect other functions, depending on how your system is setup. Also, you may set the board title, keywords and description depending on the host. You will have to test this very carefully. It opens you a beautiful new door to solve many problems related to multiple domain redirects and/or thematic separation, but I don't support this feature ;)
You may need to add/remove a rule to your hotlinking in order to ignore your local or remote media servers for your forums, too.
y2ksw
01-16-2011, 06:59 AM
Hi Y2k
Firstly great mod and is just what I needed so thanks for sharing it with us :)
Quick question though.. The import worked fine at first and I have 4 folders created for 2006, 2007, 2008 and 2009 with sub folders for each month within and the images within those
The strange thing is.. No further folders have been created beyond 2009 and the import appears to have stopped... images from external sites have still been posted since 2009 and continue to be posted on a daily basis.
No memory issue and the forums running fine .. any ideas?
Cheers
Mark
Supposed you have (almost) unlimited disk space, maybe the folder rules have changed? They should have modification rights for the web server, such as chmod 755 or 777, and the image files 644 or 666.
Also, you may have an enormous amount of imported images, and may need to reset your lookup table. In order to see if this is the problem, please run the task manually. If there is a memory error (... could not allocate N Bytes ...), you have 2 options: reset the lookup table:TRUNCATE iei_img or add some memory to your PHP processes. By resetting the lookup table, a few images may get imported twice, but it is much cheaper than adding memory space to all PHP processes :)
BirdOPrey5
01-16-2011, 02:31 PM
Thank you for those suggestions... I don't know that the bburl override is needed. The problem is if I do that then someone adding an image (or really, when the cron job runs) will have the alternate bburl encoded in the post- but this is still a problem because it's a hard coded domain, it won't vary based on who's viewing it but on who was viewing it when the task ran.
I seem to have solved the "problem" by making a new bb code also called img, this seems to override the built in [img] bb code and allows me to use relative urls... so by putting "/foums" in your replacment url settings all images are correctly being given a relative url such as "/forums/images/imported/2011/..." and working well.
y2ksw
01-17-2011, 03:36 PM
I didn' know it was possible to redefine BB Codes :)
vietfancy
01-17-2011, 11:02 PM
hangs when editting posts
vortodox
01-17-2011, 11:06 PM
Is it possible to enable this hack only on articles and blogs?
y2ksw
01-18-2011, 07:43 AM
hangs when editting posts
Try to disable the plugins at hook location: editpost_update_process
This may be due to Unicode problems and PHP/MySQL version incompatibilities. When these plugins are disabled, edited posts are not reparsed.
y2ksw
01-18-2011, 07:43 AM
Is it possible to enable this hack only on articles and blogs?
It is only for forum posts yet.
BadgerDog
01-18-2011, 11:52 AM
I've downloaded the mod and using y2ksw's "patch" recommendations in posts 13-16 to limit the testing to just a single post, in order to make sure it works on our site, I was about to take a "leap of faith" and install the XML, but I just had another thought .. :D
We use Sevenskin's Image Resizer (https://vborg.vbsupport.ru/showthread.php?t=237650) for standard IMG files that are large. It does a great job resizing them in real time down to a more viewable (no overflow) image that can be clicked upon the show the full size image.
If we install this mod, will anything negative happen when interacting with this excellent mod and what pic will be stored internally, the resized screen pic or the full size one that is pointed to in the post's IMG code itself?
Thanks for any feedback .. :)
Regards,
Doug
y2ksw
01-18-2011, 03:25 PM
Nothing special should happen ... The ImageResizer seems to replace only the image attributes, not the image itself.
BirdOPrey5
01-18-2011, 07:13 PM
Damn... Apparently overriding my img bbcode kills my image resizer...
Back to the drawing board... I thinking a custom plugin that runs on postbit_display_complete that does a str_replace looking for www.juot.net and replaces it with the actual domain name they are using... that should solve my issues...
BadgerDog
01-18-2011, 08:10 PM
Nothing special should happen ... The ImageResizer seems to replace only the image attributes, not the image itself.
Thank you Sir.. :)
I'll give it a run as soon as I have a stretch of free time to focus on not screwing it up. I did make the PHP file change that you mentioned, to just affect a single post, so I think that will mitigate any mess I make.
Regards,
Doug
ps: maybe I'll pop a Prozac before I run it anyway .. :D
bada_bing
01-18-2011, 08:13 PM
Will this work with VB 3.8.x ?
BirdOPrey5
01-18-2011, 09:36 PM
Will this work with VB 3.8.x ?
It works for me on 3.8.6.
210665
01-19-2011, 10:27 AM
Hello
I have installed this product now and created the folder images / imported /
The folder I have assigned the following rights 777
Use System vBulletin 4.1.0 Patch Level 2
Unfortunately, this product does not work.
English translated by Google
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx
Hallo
Ich habe dieses Produkt jetzt installiert und den Ordner images/imported/ angelgt.
Dem Ordner habe ich folgende Rechte zugeordnet 777
Verwende System vBulletin 4.1.0 Patch Level 2
Nur leider arbeitet dieses Produkt nicht.
Englisch mit Google übersetzt
vortodox
01-23-2011, 10:22 PM
It is only for forum posts yet.
Thanks for answer, but is it possible to restrict ths addon just for some forums?
y2ksw
01-24-2011, 09:37 AM
Hello
I have installed this product now and created the folder images / imported /
The folder I have assigned the following rights 777
Use System vBulletin 4.1.0 Patch Level 2
Unfortunately, this product does not work.
English translated by Google
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx
Hallo
Ich habe dieses Produkt jetzt installiert und den Ordner images/imported/ angelgt.
Dem Ordner habe ich folgende Rechte zugeordnet 777
Verwende System vBulletin 4.1.0 Patch Level 2
Nur leider arbeitet dieses Produkt nicht.
Englisch mit Google ?bersetzt
If it does not work at all, probably your server cannot use sockets, CURL or is locked out for retrieving web content by a firewall.
PS: Have you enabled the product after installing?
y2ksw
01-24-2011, 09:40 AM
Thanks for answer, but is it possible to restrict ths addon just for some forums?
You may change the task code (query) in order to limit it to certain forum sections. I believe I never will add an option for selecting forum ID's since to my opinion it does not make much sense to import only images for a few sections.
sticky
01-24-2011, 09:55 AM
You may change the task code (query) in order to limit it to certain forum sections. I believe I never will add an option for selecting forum ID's since to my opinion it does not make much sense to import only images for a few sections.
Please add this option, it would be huge for me in particular :)
vortodox
01-24-2011, 10:54 AM
You may change the task code (query) in order to limit it to certain forum sections. I believe I never will add an option for selecting forum ID's since to my opinion it does not make much sense to import only images for a few sections.
Actually it has allot sense, in my case there are some SPAM forumus in which members post many humoristic picts which I don't whish on my server, but on the other hand there are review with pictures which i really wish to have on my server.
Anyway, how do I change task code? /noob here :erm:
Please add this option, it would be huge for me in particular :)
Seconded.
BirdOPrey5
01-24-2011, 12:20 PM
Just for the info of those who may need this feature, I made this edit for it to not import images from 2 specific forums... I am releasing this for info only, I don't recommend you make this change nor will I support it.
In ie_cron.php file I changed:
"SELECT postid, dateline, pagetext, forumid
FROM " . TABLE_PREFIX . "post join " . TABLE_PREFIX . "thread on (post.threadid = thread.threadid
WHERE iei_parsed=0
AND pagetext LIKE '%[/IMG]%'
ORDER BY postid";
to:
$SQL = "SELECT postid, " . TABLE_PREFIX . "post.dateline, pagetext, forumid
FROM " . TABLE_PREFIX . "post join " . TABLE_PREFIX . "thread on (" . TABLE_PREFIX . "post.threadid = " . TABLE_PREFIX . "thread.threadid)
WHERE iei_parsed = 0
AND pagetext LIKE '%[/IMG]%' AND forumid != 2 AND forumid != 4
ORDER BY postid";
This would import images from all forums EXCEPT forum id 2 and forum id 4 which were my off-topic and a private forum on my setup.
BadgerDog
01-24-2011, 01:49 PM
Just for the info of those who may need this feature, I made this edit for it to not import images from 2 specific forums... I am releasing this for info only, I don't recommend you make this change nor will I support it.
Thanks, but I think you need to clarify which version you're using?
I'm using the current 1.0.2 and my ie_cron.php file shown below does not have the additional ", forumid" on end of the $SQL string to search for?
$SQL = "SELECT postid, dateline, pagetext
FROM " . TABLE_PREFIX . "post
WHERE iei_parsed=0
AND pagetext LIKE '%[/IMG]%'
ORDER BY postid";
Regards,
Doug
BirdOPrey5
01-24-2011, 05:35 PM
Thanks, but I think you need to clarify which version you're using?
I'm using the current 1.0.2 and my ie_cron.php file shown below does not have the additional ", forumid" on end of the $SQL string to search for?
Regards,
Doug
I'm using the current version, whatever it is, I just downloaded it recently. I know there is no forumid in the ORIGINAL code (which I specified in my post) I ADDED the forumids and a JOIN statement in my code which is the second block of code in my post.
My point is to change the original code to the new code I specified.
BadgerDog
01-24-2011, 05:45 PM
I'm using the current version, whatever it is, I just downloaded it recently. I know there is no forumid in the ORIGINAL code (which I specified in my post) I ADDED the forumids and a JOIN statement in my code which is the second block of code in my post.
My point is to change the original code to the new code I specified.
Thanks... :)
I'll ignore you find part of the code search and just use the replace part .. :up:
If I use a ForumID that has sub-forums, does that mean ALL sub-forums will be ignored too?
Appreciate your efforts... :)
Regards,
Doug
BirdOPrey5
01-24-2011, 06:20 PM
No it doesn't cover subforums, each forumid must be entered manually. You can add more ANDs or consult a mysql manual for a better query.
y2ksw
01-24-2011, 06:31 PM
No it doesn't cover subforums, each forumid must be entered manually. You can add more ANDs or consult a mysql manual for a better query.
Better query :)
$SQL = "SELECT postid, " . TABLE_PREFIX . "post.dateline, pagetext, forumid
FROM " . TABLE_PREFIX . "post join " . TABLE_PREFIX . "thread on (" . TABLE_PREFIX . "post.threadid = " . TABLE_PREFIX . "thread.threadid)
WHERE iei_parsed = 0
AND pagetext LIKE '%[/IMG]%'
AND NOT forumid IN (1, 2, 3)
ORDER BY postid";
The IN clause holds all forums to exclude. Contrarily:
$SQL = "SELECT postid, " . TABLE_PREFIX . "post.dateline, pagetext, forumid
FROM " . TABLE_PREFIX . "post join " . TABLE_PREFIX . "thread on (" . TABLE_PREFIX . "post.threadid = " . TABLE_PREFIX . "thread.threadid)
WHERE iei_parsed = 0
AND pagetext LIKE '%[/IMG]%'
AND forumid IN (4, 5, 6)
ORDER BY postid";
The IN clause holds all forums to include.
As always, please try first in a sandbox ;)
BirdOPrey5
01-24-2011, 06:41 PM
I want to suggest one more change I've used successfully on my test forum that may be of use to people with established forums.
In that query change ORDER BY postid to ORDER BY postid DESC so that the newest threads are processed first since it might take days or weeks to process a large existing forum.
BadgerDog
01-24-2011, 07:54 PM
I want to suggest one more change I've used successfully on my test forum that may be of use to people with established forums.
In that query change ORDER BY postid to ORDER BY postid DESC so that the newest threads are processed first since it might take days or weeks to process a large existing forum.
Wouldn't it be better to process the oldest threads first, simply because users who fail to renew their off-site storage, or their free 30 day trials run out, would get those pics moved internally first so there's less chance of ending up with missing pics when that happens? :confused:
By the way, thanks for the tips .. :)
Regards,
Doug
BirdOPrey5
01-24-2011, 09:23 PM
Wouldn't it be better to process the oldest threads first, simply because users who fail to renew their off-site storage, or their free 30 day trials run out, would get those pics moved internally first so there's less chance of ending up with missing pics when that happens? :confused:
By the way, thanks for the tips .. :)
Regards,
Doug
The way I looked at it were older threads probably already are missing images so they don't matter as much... I'm sure it can be debated either way.
jimsflies
01-25-2011, 01:18 AM
I've gone back and forth with this issue (photo links being broken) and using this mod. How hard is it, if a member asks to have his or her photos removed to remove them from the server? I think the members still own the copyright to their photos and if they wish to pull it, it ultimately is their prerogative, right?
BirdOPrey5
01-25-2011, 02:01 AM
In my terms of service (and just about every forum TOS I ever saw) the simple act of posting anything on your forum be it text or picture grants you an irrevocable lifetime license to do with the content as you please. If the user owns the copyright they grant you a license to display it forever. The issue arises when a user posts an image they don't own the copyright to... in that case what is supposed to happen is the copyright holder sends you a take down notice you must comply with or face a lawsuit in which case you should comply.
However there is one well known company skipping the take down notice and going right to the lawsuits so it is a tough call.
y2ksw
01-25-2011, 07:13 AM
I want to suggest one more change I've used successfully on my test forum that may be of use to people with established forums.
In that query change ORDER BY postid to ORDER BY postid DESC so that the newest threads are processed first since it might take days or weeks to process a large existing forum.
So the current option requests are:
make it possible to include and/or exclude forum sections
change the order
y2ksw
01-25-2011, 07:19 AM
I've gone back and forth with this issue (photo links being broken) and using this mod. How hard is it, if a member asks to have his or her photos removed to remove them from the server? I think the members still own the copyright to their photos and if they wish to pull it, it ultimately is their prerogative, right?
I think it would be very difficult to accomplish this, because how would you handle quotes?
If I do delete posts (rarely), I hide the whole thread the author has started, but will not touch any of quoted and otherwise copied posts. Including photos. As for the Terms of Service (TOS), I never will delete any post. It has been saving me several times from getting sued by forum fighters ;)
BirdOPrey5
01-25-2011, 12:44 PM
y2ksw, if you're taking feature requests, here is some code I made to keep the original file names...
1) It takes only the file name, not the path-
2) It strips all non alpha-numeric characters besides underscores
3) It sets a max length and truncates any characters over the max length
4) It still appends an integer number to the end so there will never be any file name conflicts.
I added 1 new function replacing iei_getfile_index with:
//Custom Code To Save Filename
function iei_get_file_index_name(&$path, &$extension, $oldfilename)
{
//Get only the file name (no directory info)
$oldfilename = basename ($oldfilename, $extension);
//Strip out non alpha-numeric characters
$oldfilename = preg_replace("#[^A-Za-z0-9_]#", "", $oldfilename );
//Set max file name length to 40 characters
$oldfilename = substr($oldfilename, 0, 40);
//Increment number if file exists
for($i = 1;; $i++)
{
$filename = "$path/$oldfilename-$i.$extension";
if(!file_exists($filename))
{
return $filename;
}
}
}
And then the call to the function under the //Get File Index comment I changed it to:
$filename = iei_get_file_index_name($path, $extension, $value);
And it's working great... brings in the files with their own (clean) names... In the off chance the file has the same name as another one, it increments the counter by 1 so they always save with a unique name.
Feel free to use some, all, or none of this as you see fit. :up:
BadgerDog
01-26-2011, 11:57 AM
y2ksw, if you're taking feature requests, here is some code I made to keep the original file names...
I'm an old Fortran programmer out of the 60's, so in order to save us the potential of screwing up the existing PHP file patching it, is there any chance of getting a copy of yours for testing with those changes already made? Thanks .. :)
Second, any idea how long you think it would take to run a 150,000 post forum through this process at 10 posts per shot?
Regards,
Doug
210665
01-26-2011, 12:50 PM
If it does not work at all, probably your server cannot use sockets, CURL or is locked out for retrieving web content by a firewall.
PS: Have you enabled the product after installing?
Yes I have activated after the installation
curl but I really should be enabled
y2ksw
01-26-2011, 08:34 PM
I'm an old Fortran programmer out of the 60's, so in order to save us the potential of screwing up the existing PHP file patching it, is there any chance of getting a copy of yours for testing with those changes already made? Thanks .. :)
Second, any idea how long you think it would take to run a 150,000 post forum through this process at 10 posts per shot?
Regards,
Doug
This depends on the posts with images, external servers, script timeout, computing power of servers. On one of my customers site with a top class server, it took 1 week to catch up the latest post, out of about 900.000 posts with about 15% posts with images and a cronjob every one minute (all *).
OldSchoolDSL
01-27-2011, 12:28 AM
Question:
Wouldn't this eat bandwidth? I mean technically speaking, the more photos on your site that have to load... The slower things become, right?
I'm sure this helps in some way... I just lack the vision at this moment to see it.
Not to add the idea that it would add to your file system?
BirdOPrey5
01-27-2011, 01:29 AM
It would use more of your own bandwidth but you stop "stealing" other people's bandwidth and you have total control over the images so if someone decides to delete or change them one day you still have them.
I know I have a user who posts a weather map graphic from time to time. It gets updated every few minutes, so if I do end up using this on my live forum I should remember to put whatever domain it's from on the ignore list else the image will never update.
OldSchoolDSL
01-27-2011, 03:16 AM
Maybe I'm evil... But I'd rather eat someone else's bandwidth / server load time.
If I could find a cheap (yet fast) way of loading images on another server... I think I would.
SoloX
01-27-2011, 07:11 AM
Not sure if this has been said before but if you are installing this mod, please be careful about copyrights. Inline image links *might* save you a court date but actually downloading and serving these from your server will def. get you in trouble.
google "righthaven lawsuits" and you will know why I am posting this caution.
sticky
01-27-2011, 09:49 AM
y2ksw, if you're taking feature requests, here is some code I made to keep the original file names...
1) It takes only the file name, not the path-
2) It strips all non alpha-numeric characters besides underscores
3) It sets a max length and truncates any characters over the max length
4) It still appends an integer number to the end so there will never be any file name conflicts.
I added 1 new function replacing iei_getfile_index with:
//Custom Code To Save Filename
function iei_get_file_index_name(&$path, &$extension, $oldfilename)
{
//Get only the file name (no directory info)
$oldfilename = basename ($oldfilename, $extension);
//Strip out non alpha-numeric characters
$oldfilename = preg_replace("#[^A-Za-z0-9_]#", "", $oldfilename );
//Set max file name length to 40 characters
$oldfilename = substr($oldfilename, 0, 40);
//Increment number if file exists
for($i = 1;; $i++)
{
$filename = "$path/$oldfilename-$i.$extension";
if(!file_exists($filename))
{
return $filename;
}
}
}
And then the call to the function under the //Get File Index comment I changed it to:
$filename = iei_get_file_index_name($path, $extension, $value);
And it's working great... brings in the files with their own (clean) names... In the off chance the file has the same name as another one, it increments the counter by 1 so they always save with a unique name.
Feel free to use some, all, or none of this as you see fit. :up:
Ok, I'm going to try to install is.
So iei_getfile_index I replace with all the code you posted?
As for the last part, sorry what am I replacing exactly? What is the call to function?
vietfancy
01-27-2011, 09:58 AM
thanks for a great mod.
How do I add more tags into this mod? Right now we can only use [img] tag. I do have [IMGL] and [IMGR] on my forum to align images to the left or to the right of the post.
Thanks again for a great mod.
y2ksw
01-27-2011, 10:01 AM
Not sure if this has been said before but if you are installing this mod, please be careful about copyrights. Inline image links *might* save you a court date but actually downloading and serving these from your server will def. get you in trouble.
google "righthaven lawsuits" and you will know why I am posting this caution.
Normally you would have a TOS where you don't assume any responsibility for pasted images by your users.
As for the copyright, you don't steal images by copying them into your site. Google Images would do a great damage to all the sites they copy images from, in order to show them to everybody, don't you agree? You steal them from the moment you are using them improperly. For this reason I am a bit concerned about importing images from CMS posts, since the authors are usually administrators and thus should not steal images from other sites to make their own site nice and interesting ;)
y2ksw
01-27-2011, 10:03 AM
thanks for a great mod.
How do I add more tags into this mod? Right now we can only use [img] tag. I do have [IMGL] and [IMGR] on my forum to align images to the left or to the right of the post.
Thanks again for a great mod.
It's a good moment to ask for new features, but I'm not sure if I implement them all :)
BirdOPrey5
01-27-2011, 12:14 PM
Ok, I'm going to try to install is.
So iei_getfile_index I replace with all the code you posted?
As for the last part, sorry what am I replacing exactly? What is the call to function?
You could replace the old function with mine, or you could keep the old function and just add my function to the code.
As for the "call to the function" it's the line directly under the comment
//Get File Index
Replace the line:
$filename = iei_get_file_index($path, $extension);
With
$filename = iei_get_file_index_name($path, $extension, $value);
Or better yet just comment out the first line and add the other one below it so you have the original code if you ever want to go back:
//$filename = iei_get_file_index($path, $extension);
$filename = iei_get_file_index_name($path, $extension, $value);
BadgerDog
01-27-2011, 06:26 PM
y2ksw, if you're taking feature requests, here is some code I made to keep the original file names...
I wanted to test your PHP version against just a specific thread to see how it worked, so I added something y2ksw showed me in a previous post to his code.
$SQL = "SELECT postid, " . TABLE_PREFIX . "post.dateline, pagetext, forumid
FROM " . TABLE_PREFIX . "post join " . TABLE_PREFIX . "thread on (" . TABLE_PREFIX . "post.threadid = " . TABLE_PREFIX . "thread.threadid)
WHERE iei_parsed = 0
AND threadid=28420
AND pagetext LIKE '%[/IMG]%'
ORDER BY postid";
When I did that with your PHP file, I get an SQL error, while the same piece of code addition in y2ksw's code executed correctly ONLY against that thread ID? :confused:
I like the idea of keeping the original filenames (or a variant thereof) and thank you for showing us that method, but I wanted to ensure it would work cleanly on our site before I turned it ON live against our whole forum.
Ami I missing something? Sorry, I'm not a programmer ... :D
Regards,
Doug
sticky
01-27-2011, 07:09 PM
You could replace the old function with mine, or you could keep the old function and just add my function to the code.
As for the "call to the function" it's the line directly under the comment
//Get File Index
Replace the line:
$filename = iei_get_file_index($path, $extension);
With
$filename = iei_get_file_index_name($path, $extension, $value);
Or better yet just comment out the first line and add the other one below it so you have the original code if you ever want to go back:
//$filename = iei_get_file_index($path, $extension);
$filename = iei_get_file_index_name($path, $extension, $value);
Working great, thank you!
BirdOPrey5
01-27-2011, 08:16 PM
I wanted to test your PHP version against just a specific thread to see how it worked, so I added something y2ksw showed me in a previous post to his code.
$SQL = "SELECT postid, " . TABLE_PREFIX . "post.dateline, pagetext, forumid
FROM " . TABLE_PREFIX . "post join " . TABLE_PREFIX . "thread on (" . TABLE_PREFIX . "post.threadid = " . TABLE_PREFIX . "thread.threadid)
WHERE iei_parsed = 0
AND threadid=28420
AND pagetext LIKE '%[/IMG]%'
ORDER BY postid";
When I did that with your PHP file, I get an SQL error, while the same piece of code addition in y2ksw's code executed correctly ONLY against that thread ID? :confused:
I like the idea of keeping the original filenames (or a variant thereof) and thank you for showing us that method, but I wanted to ensure it would work cleanly on our site before I turned it ON live against our whole forum.
Ami I missing something? Sorry, I'm not a programmer ... :D
Regards,
Doug
My SQL query was altered a little so I could disable it by forum if I wanted (I added a JOIN statement), the old query was still there commented out- you could try putting the original query back in it and see what happens.
But this is my last post on this issue- this is not my mod, I'm not supporting any changes... I released my code so someone who knew what they were doing could implement it at their risk if they chose. I'm not going to pollute this mod's thread with my own code support- if the author chooses to implement and/or support it that is his business.
y2ksw
02-02-2011, 06:34 PM
I have updated this product with a BETA 1.0.4 version (1.0.2 is stable), in order to allow testing the new features, such as multiple tags, reverse order, forum ID's, original file names and so stuff.
I have tested this on my production site with 800.000+ posts and it worked. However, until I have tested this on another, much larger board, I will not make it an official release.
Thanks to all who have made contributions and have tried it so far :)
vortodox
02-02-2011, 06:42 PM
FYEAH! Thanks! I will test it :)
Xencored
02-02-2011, 07:00 PM
OH my cant belive i missed this one Thanks muchy :)
vortodox
02-02-2011, 07:10 PM
Installed, and it works fine for now :3
Thanks allot for this update!
Xencored
02-03-2011, 12:57 PM
Hmm am not sure if its working or not lol. Does it not Cache external images than am confused :(
BirdOPrey5
02-03-2011, 12:59 PM
Hmm am not sure if its working or not lol. Does it not Cache external images than am confused :(
Right click on images in your posts and check the URL to them... they should have local URLs (to your website) instead of the original URLs they had when you posted them.
It's not immediate, the task runs every 10 minutes and if you have a backlog of posts it could be days or weeks before you catch up to recent posts.
Xencored
02-03-2011, 01:01 PM
Right click on images in your posts and check the URL to them... they should have local URLs (to your website) instead of the original URLs they had when you posted them.
It's not immediate, the task runs every 10 minutes and if you have a backlog of posts it could be days or weeks before you catch up to recent posts.
So yea thats what i thought "like the old Cache mod he made"
Seems not to be working for me tho
Not sure if its because me forums is off tho
BirdOPrey5
02-03-2011, 01:14 PM
Yeah it would probably only work with forums turned on because scheduled tasks won't run if off. You could manually run the scheduled task.
Xencored
02-03-2011, 01:17 PM
Yeah it would probably only work with forums turned on because scheduled tasks won't run if off. You could manually run the scheduled task.
Yea i did manually a few times the other day still did'nt cache them tho hmm
y2ksw
02-04-2011, 11:31 AM
Yea i did manually a few times the other day still did'nt cache them tho hmm
Please turn logging of that task on, and check the logs. If an image has been imported, you can check it clicking the link in the logs ... those images should be then stored locally.
After checking, disable the logging because it may flood your logs with a tremedous number of entries, depending on the number of pasted images ... ;)
And of course, tasks are not running until forums are on.
BirdOPrey5
02-04-2011, 01:16 PM
Can you explain more about the "cache" option in the new Beta?
y2ksw
02-04-2011, 06:13 PM
Can you explain more about the "cache" option in the new Beta?
Not much more than it says in the options. If the cache option is on (default), all image references are loaded into memory by a single query (and N fetches), if it is off, every image is individually searched in the database. Thus, if you have a large forum and a huge amount of images, PHP may run out of memory and the mod stops apparently to work ("could not allocate N bytes" error). In this case you have 2 options: empty the iei_img table, or switch caching off.
BirdOPrey5
02-04-2011, 07:28 PM
Any estimate on what you'd consider a "huge amount" of images? 100,000? 1,000.000? 10,000,000? More than that?
y2ksw
02-06-2011, 08:50 AM
Any estimate on what you'd consider a "huge amount" of images? 100,000? 1,000.000? 10,000,000? More than that?
That depends on the memory you are using for each PHP process and the length of the URL's. When the plugin stops working from one day to the other, you probably have reached this limit.
On one site we have 120.000+ images and it continues to work, thus maybe that's not huge. But we also give unlimited memory to the PHP processes and the server can hold up to 16 GB. Maybe a million is huge, in this context :)
BirdOPrey5
02-06-2011, 12:10 PM
Thanks.
BadgerDog
02-06-2011, 07:04 PM
Went live today with 1.04 .... :up:
Crossed my fingers and opened up most of our forums to start importing 10 posts at a time from the oldest to newest .... :D
First few runs seemed quicker with this ordering (old to new) than the testing we did with (new to old)... also turned OFF logging after first few runs ...
Let's see how long it takes to get through our site to the latest ...
y2ksw and BirdOPrey5 ... thanks for all the help from both of you ... :)
Regards,
Doug
Update: Ok, I started the live execution yesterday at about 4:00 pm (same time as this original post) and checked the first few logs. Everything seemed to be working according to the logs and the earliest threads seemed to be processed. Out of curiosity to see where it was at this morning, I turned LOGGING back ON and waited until cycle for cron had past. I checked logs and there wasn't anything there at all. So, I manually ran the process and watched it (see pic attached). It's been sitting like that for almost 15 minutes, just supposedly processing 10 posts, so I suspect it's hung and I have no idea how long it hasn't been running since I started it at 4:00 pm yesterday. I also don't know if there's been any database damage or not due to the hanging, but the vBulletin error logs don't show any SQL errors and the board seems to be running fine.
I assume I should quite the processing on the screen attached and do what next? :confused:
Update to update: In checking actually file storage on the server under /imported, it appears that the last pics imported happened at about 5:05 pm, so it appears that the import mod ran just over an hour after I had originally started it before it stopped working .... and hasn't worked since.
Another update: I have tried turning OFF the cache and that didn't make any difference.
Another update: For info purposes, we are running on a dedicated private host and Safe Mode is OFF, so that shouldn't be a time out problem. y2ksw suspects the job is timing out, so I've asked him for some debug code to be built into a test version of the cron job for manual run testing, so we can see where this is failing and perhaps why.
PhilG
02-11-2011, 12:05 PM
I have just tested this and it's got a serious bug.
I have set "Forum URL replacement" to http://static.domain.com and alot of images get replaced with just that domain. For example there was an image "http://www.angelfire.com/oz/gbeze/images/circuit.gif" and it got replaced with "http://static.domain.com/
Apart from that great mod.
y2ksw
02-11-2011, 12:25 PM
I have just tested this and it's got a serious bug.
I have set "Forum URL replacement" to http://static.domain.com and alot of images get replaced with just that domain. For example there was an image "http://www.angelfire.com/oz/gbeze/images/circuit.gif" and it got replaced with "http://static.domain.com/
Apart from that great mod.
Is your forum path starting with http://static.domain.com (http://static.domain.com/) ? In other words, is your forum contained in the forum replacement or vice versa?
Could you please attach a setting with which I may reproduce this behaviour?
Thanks
sarangan
02-11-2011, 06:51 PM
It would be better if there was an option to exclude forums instead of include forums. :-) Looking forward to have that option also in the feature version. A super and nice plugin. I love it.. Thanks a lot friend.. :-)
PhilG
02-11-2011, 09:58 PM
Is your forum path starting with http://static.domain.com (http://static.domain.com/) ? In other words, is your forum contained in the forum replacement or vice versa?
Could you please attach a setting with which I may reproduce this behaviour?
Thanks
I have attached the settings.
I have the main forum setup on www.domain.com and images get served from static.domain.com.
Edit: It seems to only happen to images that are broken/missing.
Regards,
Phil
BadgerDog
02-21-2011, 01:51 PM
Update:
With thanks to y2ksw for building in some debug code to a special beta version to troubleshoot problems with this mod, we have been able to isolate the issues that are causing hangs (cron lock-ups), which we and others may be experiencing. He's pretty busy at work, so suggested that we post our findings here so that possibly programmers such as BirdOPrey5 or others, might be able to help us figure out how to fix the lock up issue.
It appears that the mod locks up when it encounters pics referred to with the IMG tag from other sites such as photobucket etc., that are 1024x768 pixels or larger. I original thought that it also might have something to do with byte size as well, since we do have some inconsiderate posters who IMG link to external pics that are 1 Mb and even up to 3 Mb in size.
However, after checking over over 100 pics that the mod failed and hung-up on, there are a lot that are reasonably sized (100k to 300k), but are over 1024x768 in pixel size, so my assumption is the hangs are caused by the handling of pixel sizes as opposed to file sizes. The 1024x768 number is a guess, purely based upon the fact that the mod seems to process pics with that pixel width and height, but we haven't been able to find ANY pic over that sizing that hasn't locked up the mod.
We've been able to manually circumvent the problem by running the cron job manually a forum at a time. Once it hangs, we examine the Cron Error Log and look at the code. It looks like this at the point it's locked up and stopped processing:
=======================================
vB4 Import External Images
2011-02-16 08:00:02 345 Get forum ID's
2011-02-16 08:00:02 349 Get image tags
2011-02-16 08:00:02 358 Adjust options
2011-02-16 08:00:02 379 Cache registered image URL's
2011-02-16 08:00:02 177 SELECT oldurl, newurl
FROM iei_img
2011-02-16 08:00:02 386 For each record with images ...
2011-02-16 08:00:02 389 Include an/or exclude specific forum sections
2011-02-16 08:00:02 409 SELECT postid, p.dateline, pagetext
FROM post p
INNER JOIN thread t ON p.threadid = t.threadid
WHERE iei_parsed=0
AND forumid IN (72)
ORDER BY postid
LIMIT 0, 10
2011-02-16 08:00:02 413 Post: 61775
2011-02-16 08:00:02 417 Find all embedded images
2011-02-16 08:00:02 420 Searching for tag: img
2011-02-16 08:00:02 430 Search for images to be ignored
2011-02-16 08:00:02 445 If we haven't got the image yet, download
2011-02-16 08:00:02 453 Pseudo-loop
2011-02-16 08:00:02 456 Get file from remote site
2011-02-16 08:00:02 285 Use CURL for: http://www.thefirearmblog.com/blog/wp-content/uploads/2007/10/aia-ad-compressed.jpg
2011-02-16 08:00:03 324 Content size: 788141
2011-02-16 08:00:03 464 Get file extension
2011-02-16 08:00:03 467 Make path
2011-02-16 08:00:03 471 Get file name and/or index
2011-02-16 08:00:03 139 Get only the file name (no directory info)
2011-02-16 08:00:03 142 Strip out non alpha-numeric characters
2011-02-16 08:00:03 145 Set max file name length to 40 characters
2011-02-16 08:00:03 148 Increment number if file exists
2011-02-16 08:00:03 481 See if we have valid contents
===========================================
We check the post ID, call it up on the forums and invariably, it's an IMG reference to an off-site pic that's bigger than 1024x768 pixels.
We then SAVE the pic to our local drive. Delete the reference in the post to it. Use the vBulletin advanced ATTACH javascript to upload it to the post as an attachment and SAVE the edited post.
We re-start the cron job and it now moves past this post and proceeds normally until it runs into another post with an IMG referenced pic larger than 1024x768.
Using this workaround, we've been able to work through some of our forums, but it takes 6-8 hours of manual work to do so.
So, the question is, can someone help us by looking at the code and figuring out where *and why) it's locking up on these 1024x768 pics? Perhaps it needs a pixel re-sizer function built in front of it, BEFORE it begins to import the pic?
Second problem ...
We discovered an anomaly as to file name conventions (see attached pic). It appears that in some cases the mod imports and stores the pics, but for some reason it attaches ?t=xxxxxx or ?a=xxxxx after the .jpg extension (see attached pic). In the actual post, the filename is the same way, but of course the pic doesn't show.
If I manually rename the file in both the offending post and the associated /includes directory, it fixes the problem and the pics appear in the post. Unfortunately, so far, I can't find a simple way to locate all the filenames on the server that are messed up and also find them in the actual forums so I can start manually fixing posts.
This one y2ksw says is fixable by turning ON the Always Convert Images option. Y2ksw explained why this would stop the problem from occurring in future, but not being as technical as he is, I didn't quite understand it. We're still trying to figure how to locate all the pics that have been processed already and perhaps some kind of automated handling to adjust the file names on both the server and the associated posts, so they actually appear.
Anyway, this is an excellent mod, particularly for a research site such as ours, to enable us to preserve old posts and pics for posterity. With just a bit more de-bugging and sorting out this critical hanging problem, it would be perfect....
Hope this helps other users here who may be considering using this mod for their sites, particularly larger ones with lots of pics.
Regards,
Doug
BirdOPrey5
02-22-2011, 03:17 PM
I can confirm larger images aren't importing right, such as this one:
http://www.qapla.com/ju/DSC00261.JPG
Might be a sever limitation, not sure... will see if I can figure anything out.
Can you give me a link to an image that is giving you the second problem?
dacho
02-22-2011, 06:08 PM
I have two questions please:
1. Is it possible to import the images to sub-domains or other domain?
2. If the files are not saved in my database, can also add a watermark option on imported images?
BadgerDog
02-22-2011, 07:20 PM
I can confirm larger images aren't importing right, such as this one:
http://www.qapla.com/ju/DSC00261.JPG
Might be a sever limitation, not sure... will see if I can figure anything out.
Can you give me a link to an image that is giving you the second problem?
Stand by ... :)
I think you may be onto something ... ;)
y2ksw sent me an email and suggested I try to increase my PHP memory variable from the current 16 MB, which he thought was maybe is a little low. He recommended to give it at least 8 MB more (on linux, this setting (memory_limit) should be at /etc/php5/php.ini). I've asked our tech support to increase it from 16MB to 32MB just in case.
Once they do that, I'll start re-testing the big pics....
Thanks for your testing to validate the issue ... :up:
Regards,
Doug
BadgerDog
02-23-2011, 08:29 AM
Update:
Changing PHP memory_limit variable from 16 MB to 32 MB worked great ... :up:
Fixed 90% of the hangs, however still chokes and locks up mod on any pic thats 2000x1600 referenced through IMG tag. I wish there was some automated way of recognizing members are IMG linking to pics over a certain size as it's happening, stop the process and send them an error message asking them to resize their pics.
I can't stop members from linking to those as many of our members aren't really that computer literate (most 60+ years old) so I'm going to ask our tech support to increase the PHP memory_limit variable once again, this time from 32 MB to 48 MB. I suspect that will work for the latter large pixel sizes.
Will advise when I've done that and re-tested ...
Thanks .. :)
Regards,
Doug
BadgerDog
02-24-2011, 05:52 PM
Final Update:
Problem solved ... mod working fine now with one limitation
I further increased the PHP memory again, this time from 32 MB to 64 MB....
I then tried to once again process a pic that was 2000x1600 pixels and it still hangs, so it seems that if the size is as large as this, even 64 MB of PHP memory is not enough to handle it.
I've decided to not bother trying to automate using this mod to handle any 2000x1600 pixel sized pics, opting instead to try to discourage members from linking with IMG to them, or if they do link to them, manually circumventing those posts with this mod by manually resizing the member's pics.
Is there some way of checking in advance (even a separate mod) to stop people from linking via IMG's to pics larger than a certain pixel size?
Thanks again to y2ksw and BirdOPrey5 for all the help and guidance in getting this mod going for our site. :up:
Regards,
Doug
BirdOPrey5
02-24-2011, 07:18 PM
In my admittedly quick search I couldn't find any way of finding the image dimensions without downloading the full image- and if that is what is causing the problem checking what we get would not be a solution- if it's too big it will bug out anyway.
BadgerDog
02-24-2011, 07:30 PM
In my admittedly quick search I couldn't find any way of finding the image dimensions without downloading the full image- and if that is what is causing the problem checking what we get would not be a solution- if it's too big it will bug out anyway.
I agree... a chicken and egg syndrome... :D
I wonder if there's any javascript or other already written query type code that can be run against a graphic file, in order to test for embedded pic data or something else, without having to download the whole file...
Regards,
Doug
d19rnyxx
03-06-2011, 12:14 PM
I needed to know if this mod has any issues with vbOptimise running memcache
Thanks
y2ksw
03-07-2011, 07:30 AM
I needed to know if this mod has any issues with vbOptimise running memcache
Thanks
None I can think of.
Old-Git
03-16-2011, 08:38 PM
Greta mod and I've been looking for something like this for a while.
You may change the task code (query) in order to limit it to certain forum sections. I believe I never will add an option for selecting forum ID's since to my opinion it does not make much sense to import only images for a few sections.
I don't want to grab every image that is posted to my forum, just the ones worthy of keeping. What I want to do is
1.) Create some archive forums for storing threads that are worthy of retention
2.) My archives are structured under one Category called Archives. Under that there are 7 or 8 other Sub-categories for historical eras. Under each sub-category there are 3 sub-forums.
3.) only Admins will be allowed to post in the Archives
4.) When Admin move a thread from normal posting forums to the 'Archive' forums all external images are then 'grabbed' and moved to localhost store (either in database or file system). This would mean the mod would have to treat a moved thread as a new post.
In my opinion this would make the perfect archiving solution and would mean I wasn't saving every piece of crud my users posted to the forums, just the stuff that needs saving. Yes, there's a manual element to it but then archiving is very much a manual process. So the ability to exclude all forums and set specific forums would be essential in this process.
Rgds
Pete
y2ksw
03-17-2011, 03:05 PM
Greta mod and I've been looking for something like this for a while.
I don't want to grab every image that is posted to my forum, just the ones worthy of keeping. What I want to do is
1.) Create some archive forums for storing threads that are worthy of retention
2.) My archives are structured under one Category called Archives. Under that there are 7 or 8 other Sub-categories for historical eras. Under each sub-category there are 3 sub-forums.
3.) only Admins will be allowed to post in the Archives
4.) When Admin move a thread from normal posting forums to the 'Archive' forums all external images are then 'grabbed' and moved to localhost store (either in database or file system). This would mean the mod would have to treat a moved thread as a new post.
In my opinion this would make the perfect archiving solution and would mean I wasn't saving every piece of crud my users posted to the forums, just the stuff that needs saving. Yes, there's a manual element to it but then archiving is very much a manual process. So the ability to exclude all forums and set specific forums would be essential in this process.
Rgds
Pete
Yeah, I agree :)
The philosophy of this plugin is however less archiving than saving images from disappearing over time. However, you may change the parsed sections and subfolders from time to time and achieve then a kind of archiving feature as you describe.
Old-Git
03-17-2011, 08:53 PM
The philosophy of this plugin is however less archiving than saving images from disappearing over time.
Ah....but maybe I've given you something to think about? :)
At any rate I shall be installing this on my test rig this weekend and having a play, thanks for making it available Giovanni!
Baitona
03-19-2011, 09:12 AM
HI,
is it possible to import the images to other domain?
yahooooh
03-19-2011, 11:21 AM
perfect mod,is there way to add Watermark Image at specific position
y2ksw
03-19-2011, 03:58 PM
HI,
is it 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.
y2ksw
03-19-2011, 04:07 PM
perfect mod,is there way to add Watermark Image at specific position
Watermarking is beyond the idea of this product.
I feel it's also a bit unethical to sign images as if they were yours, when they have been taken from an external site, instead. With adding watermarking, I would need to add special policies to my software in order to ensure that copyright infringement wouldn't harm me, in case you get sued. Depending on the laws in the country of the persuer, the software producer may have responsibilities regarding copyright infringements.
maznos
03-19-2011, 08:31 PM
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.
first of all thank you for your good work
secondly I have a giant forum (over 1 million posts) and I love to install your hack, I am thinking of a small script file that will do the operation of moving uploaded files to multiple domains to spread the files and reduce the multi million files to be congested in single hosting account.
I'll let you know of what result I am getting into :)
thanks again
sweetpotato
03-20-2011, 01:17 AM
I have this error for some images:
Database error in vBulletin 4.1.2:
Invalid SQL:
INSERT IGNORE INTO iei_img (
oldurl,
newurl
) VALUES (
'http://.....com/.21847008.lO70/christmasposter5.jpg',
'http://....net/images/imported/2010/12/6.jpg'
);
MySQL Error : MySQL server has gone away
Error Number : 2006
Request Date : Saturday, March 19th 2011 @ 07:08:56 PM
Error Date : Saturday, March 19th 2011 @ 07:10:43 PM
Script : http://..../cronadmin.php?do=runcron&cronid=90
Referrer : http://..../cronadmin.php?do=runcron&cronid=90
sweetpotato
03-21-2011, 10:05 AM
For now, CMS posts are not parsed. I may consider implementing this feature, if you are not the only one asking for it :)
I also vote for CMS post. Thank you for the nice mod. Now find the way to solve database error.
der_darkon
03-24-2011, 12:59 PM
Thanks for this great AddOn, and i also vote for including the CMS
yahooooh
03-24-2011, 10:39 PM
Watermarking is beyond the idea of this product.
I feel it's also a bit unethical to sign images as if they were yours, when they have been taken from an external site, instead. With adding watermarking, I would need to add special policies to my software in order to ensure that copyright infringement wouldn't harm me, in case you get sued. Depending on the laws in the country of the persuer, the software producer may have responsibilities regarding copyright infringements.
not all watermark will be illegal , on my side i will use watermark with :
hosted by mysite.com
that is it
so it depend on how is the jpg wich used in watermark not the software
Dr.osamA
04-01-2011, 09:17 PM
Thank you for update
but i have Database error
Invalid SQL:
SELECT
fd.thumbnail_dateline, fd.filesize, IF(fd.thumbnail_filesize > 0, 1, 0) AS hasthumbnail, fd.thumbnail_filesize,
a.dateline, a.state, a.attachmentid, a.counter, a.contentid, a.filename, a.userid, a.settings, a.displayorder,
at.contenttypes
FROM attachment AS a
INNER JOIN filedata AS fd ON (fd.filedataid = a.filedataid)
LEFT JOIN attachmenttype AS at ON (at.extension = fd.extension)
WHERE
a.contentid IN (81195,81203,81286,81287,81289,81290,82837)
AND
a.contenttypeid = 1
ORDER BY a.contentid, a.displayorder;
MySQL Error : Unknown column 'fd.thumbnail_filesize' in 'field list'
Error Number : 1054
Request Date : Friday, April 1st 2011 @ 04:55:45 PM
Error Date : Friday, April 1st 2011 @ 04:55:45 PM
Script : http://www.alra7ba.info/vb/showthread.php?t=12925&p=81287&viewfull=1&langid=1
Referrer :
any help plzzz
y2ksw
04-01-2011, 09:52 PM
Thank you for update
but i have Database error
Invalid SQL:
SELECT
fd.thumbnail_dateline, fd.filesize, IF(fd.thumbnail_filesize > 0, 1, 0) AS hasthumbnail, fd.thumbnail_filesize,
a.dateline, a.state, a.attachmentid, a.counter, a.contentid, a.filename, a.userid, a.settings, a.displayorder,
at.contenttypes
FROM attachment AS a
INNER JOIN filedata AS fd ON (fd.filedataid = a.filedataid)
LEFT JOIN attachmenttype AS at ON (at.extension = fd.extension)
WHERE
a.contentid IN (81195,81203,81286,81287,81289,81290,82837)
AND
a.contenttypeid = 1
ORDER BY a.contentid, a.displayorder;
MySQL Error : Unknown column 'fd.thumbnail_filesize' in 'field list'
Error Number : 1054
Request Date : Friday, April 1st 2011 @ 04:55:45 PM
Error Date : Friday, April 1st 2011 @ 04:55:45 PM
Script : http://www.alra7ba.info/vb/showthread.php?t=12925&p=81287&viewfull=1&langid=1
Referrer :any help plzzz
Sorry, but this error does not come from my plugin. I don't use vbulletin attachments, but a completely different table (iei_img) for filename storage.
y2ksw
04-01-2011, 09:54 PM
not all watermark will be illegal , on my side i will use watermark with :
hosted by mysite.com
that is it
so it depend on how is the jpg wich used in watermark not the software
I do understand your concerns, but legal watermarking or not, I would have to protect myself and I don't like it ;)
Dr.osamA
04-01-2011, 10:24 PM
this erorr shows after i upgrade
mybe not from your plugin but mybe yes i dont know how that hapend or mybe an conflicted with other plugin
anyways thank you bro
mescalin
04-07-2011, 10:27 PM
very very good idea. thank you for sharing this mod!
kether1
04-08-2011, 03:36 PM
Did you decide if you would make this work for the CMS as well? Thanks!
kether
giaguaro
04-10-2011, 11:56 AM
i imported my vbulletin from a old Snitz forum which had a different tag for image.
Would this product scan also those images?
All images link can be scanned?
And what about the absolute path images files such as ../public/data/user/image.jpg ?
Will this be scanned and substituted by a valid link? (they are no more valid link because the path is changed or vb doesnt recognize them)
y2ksw
04-11-2011, 09:57 AM
Did you decide if you would make this work for the CMS as well? Thanks!
kether
not yet :)
i imported my vbulletin from a old Snitz forum which had a different tag for image.
Would this product scan also those images?
All images link can be scanned?
And what about the absolute path images files such as ../public/data/user/image.jpg ?
Will this be scanned and substituted by a valid link? (they are no more valid link because the path is changed or vb doesnt recognize them)
As far as I recall, converted Snitz forums require HTML enabled and thus have all (external) images directly embedded. If you have different BB Code tags for images, you may try to add them to the options in order to import also those. However, it is a feature you must try first in a test bed.
Absolute paths are not recognized and you should convert those paths into valid URL's first, anyway.
giaguaro
04-11-2011, 12:16 PM
As far as I recall, converted Snitz forums require HTML enabled and thus have all (external) images directly embedded. If you have different BB Code tags for images, you may try to add them to the options in order to import also those. However, it is a feature you must try first in a test bed..
:) i feel like we talked previously in another language..
Thanks for your reply.
My snitz tag works in VB, but the problems are where images are embedded with an absolute path
Absolute paths are not recognized and you should convert those paths into valid URL's first, anyway.
This could be great. But how to do that? A "search and replace" somewhere? Or a product?
y2ksw
04-11-2011, 01:51 PM
This could be great. But how to do that? A "search and replace" somewhere? Or a product?
Probably you will need to use a query, which replaces all absolute references accordingly to your new board settings:
UPDATE post SET pagetext=REPLACE(pagetext, '../absolute/path/', 'relative/path/')
and copy or move also your images to the new relative path you define here. Please make sure to backup your post table in case your query does not work as expected.
giaguaro
04-12-2011, 06:21 AM
thanks a lot.
I am becoming friendly with products and plugin but I still pay attention to DB modification :)
I presume i have to back up the db table (by the way, i added the auto bkp thanks to a mod here) , do the query on the table and put it back in the db
mastershady
04-12-2011, 05:52 PM
first of all great work and appreciated ...
Second,
I downloaded the Mod and i created images/uploads folder with permission or 777 and i uploaded the PHP file to the includes/cron also i copied the file to includes direct ... i uploaded the the plugin and enabled it i found new folder created in the uploads --> 2011 --> 4 but nothing inside it ... till the moment nothing happened and no single image imported?!!!!!
is the issue in defining the tag which in the options of this mod which is by default img do i need to change it or what is the issue exactly!!!!!
my server:
===
Operating System:
CentOS 5
RAM:
2 GB
Total Disk Space:
30 GB
Bandwidth Quota:
1000 GB
===
or do i need to create any table in the DB ... or some permissions from the server is required for this hack?!!
y2ksw
04-13-2011, 09:40 AM
first of all great work and appreciated ...
Second,
I downloaded the Mod and i created images/uploads folder with permission or 777 and i uploaded the PHP file to the includes/cron also i copied the file to includes direct ... i uploaded the the plugin and enabled it i found new folder created in the uploads --> 2011 --> 4 but nothing inside it ... till the moment nothing happened and no single image imported?!!!!!
is the issue in defining the tag which in the options of this mod which is by default img do i need to change it or what is the issue exactly!!!!!
my server:
===
Operating System:
CentOS 5
RAM:
2 GB
Total Disk Space:
30 GB
Bandwidth Quota:
1000 GB
===
or do i need to create any table in the DB ... or some permissions from the server is required for this hack?!!
You may need to enable fopen() to access external URL's or install CURL and allow that it accesses external content. Since it is your server importing the images, it needs also access to other sites. This may be a firewall rule and/or a permission in your php.ini file (search for fopen or URL).
mastershady
04-13-2011, 01:51 PM
You may need to enable fopen() to access external URL's or install CURL and allow that it accesses external content. Since it is your server importing the images, it needs also access to other sites. This may be a firewall rule and/or a permission in your php.ini file (search for fopen or URL).
thanks for your response the property allow_url_fopen is on ... what will be other issues which prevents this hack from working ...
how i can catch the error exactly since every thing seems ok but still it is not working ...
is it becuase i used the latest version of the hack 1.0.5 ...
any support please ...
y2ksw
04-13-2011, 02:49 PM
thanks for your response the property allow_url_fopen is on ... what will be other issues which prevents this hack from working ...
how i can catch the error exactly since every thing seems ok but still it is not working ...
is it becuase i used the latest version of the hack 1.0.5 ...
any support please ...
What's about the firewall?
If you create a test.php with:
<?php
$content = file_get_contents('http://www.google.com/');
echo $content;
die;
does it show you something? (You should see the google page at least to some extent)
mastershady
04-13-2011, 02:55 PM
I created this php file and I saw google page ...
so is it a matter of the firewall ... i checked my server, and curl is already installed ....
note some of the posts was having not exists images now it has been replaced by the error image which i defined in the hack options ...
is it a matter of time outs in the hack settings? ...
or settings of the firewall?
y2ksw
04-13-2011, 04:55 PM
I created this php file and I saw google page ...
so is it a matter of the firewall ... i checked my server, and curl is already installed ....
note some of the posts was having not exists images now it has been replaced by the error image which i defined in the hack options ...
is it a matter of time outs in the hack settings? ...
or settings of the firewall?
If you ?have seen the google page, you firewall is open. So maybe you have images which cannot be imported for some reason. Do you have this product running for a long time yet? If you have for example 1 image each 1000's post, it may take quite some time before something useful happens. Are there any entries in the iei_img table?
mastershady
04-13-2011, 05:50 PM
it is around now 3 days ... the problem it replaced a regular text with the error Image?!!!!!!!
there is a data in the table ... as you can see in the attachment ... screen shoot ...
are you sure that i have to write the img in the tag field in the hack options ... or to replace it with [IMG] ?! ...
y2ksw
04-13-2011, 06:23 PM
it is around now 3 days ... the problem it replaced a regular text with the error Image?!!!!!!!
there is a data in the table ... as you can see in the attachment ... screen shoot ...
are you sure that i have to write the img in the tag field in the hack options ... or to replace it with [IMG] ?! ...
If you have had text between img tags, it takes it as an URL. This text will then fail and eventually a missing image replacement is inserted. There is not a lot I can do. Testing for a piece of text if it eventually is an URL or not, is beyond the idea of a simple product.
Text in place of URL's can come from bad formatting or from using arbitrary tags at your choice. And it reminds me that eventually I'll fall back to the easy and simple version, because I feel that a lot of options and the warnings I gave (to satisfy a few users) are simply too much for a normal forum and source of a lot of questions and additional problems I am really not happy to follow up.
The point is: it is easy to use as long as you understand what the options do. From the moment you change options, I must assume you know what they mean. However, this is not always the case, because each software has options that have to be changed in order to get it working.
From what I see in the screenshot, the product works, but it may not be able to fix problems with your posts.
I tried to install it but it takes for ever processing (hung page)!!!
I went back to the plugins page and I found it installed!
I got question
how I can put the "Imported Images Folder" (chmod 777) external to another domain for security issue? If that will take time, is having the folder at the same host domain secure for the forum?
Thank you
y2ksw
04-17-2011, 11:10 AM
I tried to install it but it takes for ever processing (hung page)!!!
I went back to the plugins page and I found it installed!
I got question
how I can put the "Imported Images Folder" (chmod 777) external to another domain for security issue? If that will take time, is having the folder at the same host domain secure for the forum?
Thank you
1) If the installation hangs, maybe it is the best to reinstall. There is nothing i can do, presumably you are on a busy server.
2) At the moment you can only import images to the forum. I am thinking about some sort of exportation, though, probably with FTP.
yahooooh
04-19-2011, 10:19 PM
i want this option:
adding thread url as link for image
when image hosted and show through [img]
on it
i need to add my thread url also as [url]
i do not allowed img url for other sites and i want to replace images also with url for thread that show this images , this perfect to make people also do not copy the thread to other froums and even they do , the links will be to the origin thread
y2ksw
04-20-2011, 05:51 AM
i want this option:
adding thread url as link for image
when image hosted and show through [img]
on it
i need to add my thread url also as [url]
i do not allowed img url for other sites and i want to replace images also with url for thread that show this images , this perfect to make people also do not copy the thread to other froums and even they do , the links will be to the origin thread
Could you please make examples? I'm not sure what you want to have added.
BadGuy
05-08-2011, 10:12 AM
Hi
Sometime I can see it in database in the same ID numbers for days .
Like today inside iei_img table the last id is 131072
its like this from 2 days
the command work every 3 hrs .
also if I run it manually , the next page I got is this :
vB4 Import External Images
that mean is not working
becuase when I see DONE that mean its working fine
some time I see it like this :
vB4 Import External Images
Done
So the problem is
Some time works and some times not auto and manually .
BadGuy
05-10-2011, 09:04 AM
Any update ?
BadGuy
05-14-2011, 02:56 PM
Problem fixed
Waiting to add CMS to the system .
TundraSoul
05-22-2011, 08:42 PM
It worked great for 24 hours, then stopped for no apparent reason.
I tried to run it manually, but got the dreaded error:
Database error in vBulletin 4.1.3:
Invalid SQL:
INSERT IGNORE INTO iei_img (
oldurl,
newurl
) VALUES (
'http://www.seven-o-heaven.com/resources/7OHsq700/Seven%20O%20Heaven%20sq700%20055%20North%20Coast%2 0Journal%20Humboldt%20County.jpg',
'http://www......./images/extras/not-available.gif'
);
MySQL Error : MySQL server has gone away
Error Number : 2006
Request Date : Sunday, May 22nd 2011 @ 04:33:53 PM
Error Date : Sunday, May 22nd 2011 @ 04:35:00 PM
Script : http://www...../admincp/cronadmin.php?do=runcron&cronid=76
Referrer : http://www....../admincp/cronadmin.php?do=modify
IP Address : ****
Username : Me
Classname : vB_Database
MySQL Version :
It has managed to import at least two months worth of images (so far).
It looks like it timed out trying to grab that last image.
Any suggestions?
y2ksw
05-23-2011, 10:00 AM
Your database connection timed out before the php script. This never should happen, though, and is a general problem to your forums.
The connection timeout of your database needs to be the same or larger than the PHP script timeout.
Normally this error appears when a query is too long, but in this case I truly believe it's the query timeout :)
TundraSoul
05-23-2011, 09:39 PM
Your database connection timed out before the php script. This never should happen, though, and is a general problem to your forums.
The connection timeout of your database needs to be the same or larger than the PHP script timeout.
Normally this error appears when a query is too long, but in this case I truly believe it's the query timeout :)
Thanks, when I went looking I discovered that too and made the correction. Now it's purring along again with several gigs of images to process. :)
sticky
05-29-2011, 11:54 PM
This modification has been working beautifully for me and has become an essential part of my forum.
Unfortunately, for whatever reason, it has stopped, yet the cron job remains there.
Any idea what could cause this? I have been having cron database errors but cronimage is in place and other cron jobs are working.
I just can't figure out the problem.
BirdOPrey5
05-30-2011, 12:03 AM
Is there an exceptionally large image it may be getting stuck on?
sticky
05-30-2011, 02:55 AM
Is there an exceptionally large image it may be getting stuck on?
I don't think so and it has imported some huge ones before.
My recent posts widget stopped populating as well so I'm pulling my hair out trying to fix this.
sticky
05-30-2011, 03:33 AM
Is there an exceptionally large image it may be getting stuck on?
You know what? That was it I believe. I removed a 3 meg image from being imported and as well as emptied the table and now it works.
y2ksw
05-30-2011, 06:05 AM
Sounds like space or memory limits to me ...
Baitona
06-01-2011, 08:19 AM
Hi,
It is working fine and i am happy with it, but there is something strange.
After few months i have discovered that imprted images are completely deleted from the imported folder. in some cases the whole month folder is deleted.. :s
i am the only root on the server, i didnot delete any thing, any idea?
y2ksw
06-01-2011, 08:37 AM
There is no unlink (file delete) in this script.
Maybe you have a service which cleans up unknown vbulletin files?
Baitona
06-01-2011, 08:43 AM
thanks :)
I am really lost of and lot of members are complaining losing their images,
the whole monthly folders are delted too not only files ....
okay what is the best way to move the imparted folder outside of the vbulletin directory?
right now it is in the basic format
images/imported -------as a result---------> domain.com/vb/images/imported
can i do it
../imported ------as a result--------> domain.com/imported
TundraSoul
06-03-2011, 02:51 AM
I noticed a very small number of images are saved with some unexpected filenames. For instance: 1.gif?t=1264708348 and so on. What should I do about those, I'm fairly sure they do not work; am I correct?
BirdOPrey5
06-03-2011, 10:11 AM
I noticed a very small number of images are saved with some unexpected filenames. For instance: 1.gif?t=1264708348 and so on. What should I do about those, I'm fairly sure they do not work; am I correct?
It seems some places will put the question-mark and an id number or such after some images. They probably due this to better track where images are being viewed.
In almost all cases you can erase the ? and everything after it and it will still work as normal.
My "fix" for it therefore was to simply enforce the extension was only 3 characters long.
If you edit the cron file, you'll see I added a line to the function near line 124 of the file.
This is what I'm using and it's working in all the tests I've tried- again the OP please feel free to include this code in the next release if you feel it is useful.
function iei_get_file_index_name($path, $extension, $oldfilename)
{
// Get only the file name (no directory info)
$oldfilename = basename($oldfilename, $extension);
// Strip out non alpha-numeric characters
$oldfilename = preg_replace('#[^A-Za-z0-9_]#', '', $oldfilename);
// Set max file name length to 40 characters
$oldfilename = substr($oldfilename, 0, 40);
// Force extension to 3 characters only
$extension = substr($extension, 0, 3);
//Increment number if file exists
for($i = 1;; $i++)
{
$filename = "$path/$oldfilename-$i.$extension";
if(!file_exists($filename))
{
return $filename;
}
}
}
BadgerDog
06-03-2011, 11:01 AM
Thanks BirdOPrey5 .... :)
My download of the latest version 1.0.5.iei4.zip showing the cron.php as Feb 14, 2011, already shows your changes above as being incorporated in that file?
Am I missing something? :confused:
Regards,
Doug
BirdOPrey5
06-03-2011, 11:23 AM
Thanks BirdOPrey5 .... :)
My download of the latest version 1.0.5.iei4.zip showing the cron.php as Feb 14, 2011, already shows your changes above as being incorporated in that file?
Am I missing something? :confused:
Regards,
Doug
It appears it wasn't the "first function" in that file but it's still there...
The relevant function included in that file is:
function iei_get_file_index_name($path, $extension, $oldfilename)
{
// Get only the file name (no directory info)
$oldfilename = basename($oldfilename, $extension);
// Strip out non alpha-numeric characters
$oldfilename = preg_replace('#[^A-Za-z0-9_]#', '', $oldfilename);
// Set max file name length to 40 characters
$oldfilename = substr($oldfilename, 0, 40);
//Increment number if file exists
for($i = 1;; $i++)
{
$filename = "$path/$oldfilename-$i.$extension";
if(!file_exists($filename))
{
return $filename;
}
}
}
My change to this function is as follows (in red):
function iei_get_file_index_name($path, $extension, $oldfilename)
{
// Get only the file name (no directory info)
$oldfilename = basename($oldfilename, $extension);
// Strip out non alpha-numeric characters
$oldfilename = preg_replace('#[^A-Za-z0-9_]#', '', $oldfilename);
// Set max file name length to 40 characters
$oldfilename = substr($oldfilename, 0, 40);
// Force extension to 3 characters only
$extension = substr($extension, 0, 3);
//Increment number if file exists
for($i = 1;; $i++)
{
$filename = "$path/$oldfilename-$i.$extension";
if(!file_exists($filename))
{
return $filename;
}
}
}
Just add those lines in red to your existing file.
BadgerDog
06-03-2011, 02:08 PM
It appears it wasn't the "first function" in that file but it's still there...
Just add those lines in red to your existing file.
Thanks .. :up:
Made that change ....
Regards,
Doug
y2ksw
06-04-2011, 10:00 AM
thanks :)
I am really lost of and lot of members are complaining losing their images,
the whole monthly folders are delted too not only files ....
okay what is the best way to move the imparted folder outside of the vbulletin directory?
right now it is in the basic format
images/imported -------as a result---------> domain.com/vb/images/imported
can i do it
../imported ------as a result--------> domain.com/imported
There is no way to move the imported folder out of the vbulletin directory. The only workaround would be a symbolic link (Linux).
If entire folders disappear, you have a system problem and if I was you I would concentrate on that, because it does potentially destroy your forums, too. The only other option which comes to my mind is an old cPanel version which has had a sort of inbuilt "protection", which would purge all folders which weren't built from within FTP or the cPanel. If that is the case, this option has to be disabled at least.
y2ksw
06-04-2011, 10:01 AM
I noticed a very small number of images are saved with some unexpected filenames. For instance: 1.gif?t=1264708348 and so on. What should I do about those, I'm fairly sure they do not work; am I correct?
Yes. I suggest to convert all imported images to JPG, which also would remove eventual tampered images. A sort of inbuilt Antivirus ... ;)
hscorp
06-08-2011, 02:21 AM
any for 3.8.x?
BirdOPrey5
06-08-2011, 12:41 PM
This works fine on 3.8 as is.
Scalemotorcars
07-12-2011, 02:09 AM
Ok I think Im screwed here. Every single post on my site that linked to an image on my photopost is now gone. All I have now is the replacement image.
Site structure is
mysite/forum
mysite/gallery
What do I do now?
y2ksw
07-12-2011, 07:02 AM
Ok I think Im screwed here. Every single post on my site that linked to an image on my photopost is now gone. All I have now is the replacement image.
Site structure is
mysite/forum
mysite/gallery
What do I do now?
I imagine your photopost images weren't readable to visitors and you had not setup the photopost path (mysite/gallery or gallery) into the "whitelist" (Ignore field). So the product tried to download the image but could't read it, and replaced it.
If you have a backup of your post table, you may disable the product and change the INSERT INTO in REPLACE INTO of the queries of your backup (& run a restore of the post table of course), in order to get back what you had, without messing up new posts (since your latest backup).
PS: If you do a restore, make sure not to rebuild the table structure ;)
maznos
07-12-2011, 04:35 PM
I imagine your photopost images weren't readable to visitors and you had not setup the photopost path (mysite/gallery or gallery) into the "whitelist" (Ignore field). So the product tried to download the image but could't read it, and replaced it.
If you have a backup of your post table, you may disable the product and change the INSERT INTO in REPLACE INTO of the queries of your backup (& run a restore of the post table of course), in order to get back what you had, without messing up new posts (since your latest backup).
PS: If you do a restore, make sure not to rebuild the table structure ;)
Hello
your product is so great.
why not add an additional column to the table that include the original images links for in case someone wants to revert automatically through your product or an additional script
i guess it is somehow easy to implement as it will be an "undo" column.
just an idea :)
y2ksw
07-12-2011, 06:52 PM
Hello
your product is so great.
why not add an additional column to the table that include the original images links for in case someone wants to revert automatically through your product or an additional script
i guess it is somehow easy to implement as it will be an "undo" column.
just an idea :)
I thought about it, but is impossible, because an image may be associated with more sources. Since it is unable to tell which is the right one, an undo option may do more harm than good. With a good backup history (I have 6 months) you never get into trouble. REPLACE INTO solves so many problems much better than any other undo procedure may do. :)
maznos
07-12-2011, 07:22 PM
I thought about it, but is impossible, because an image may be associated with more sources. Since it is unable to tell which is the right one, an undo option may do more harm than good. With a good backup history (I have 6 months) you never get into trouble. REPLACE INTO solves so many problems much better than any other undo procedure may do. :)
somehow i see it is possible since you are going to return the original urls and not touching the files.
think of it like this:
thread have the text: blah blah image1.jpg
the undo column is storing this: image1.jpg=http://blah.com/path/to/image.jpg
so when the undo happen your script just replaces the local file urls to the original url
thats it
keep up the good work:up:
y2ksw
07-12-2011, 08:42 PM
somehow i see it is possible since you are going to return the original urls and not touching the files.
think of it like this:
thread have the text: blah blah image1.jpg
the undo column is storing this: image1.jpg=http://blah.com/path/to/image.jpg
so when the undo happen your script just replaces the local file urls to the original url
thats it
keep up the good work:up:
This is what it already stores, but a rollback isn't possible. Imagine you have the replacement image enabled. Then a whole lot of original URL's may be represented by a single image. You would have the trouble to have to use a progressive counter for each image, and in the same time you could not reuse an already stored image. Then it may bloat the disk space wuite a lot, specially if posts with images are quoted a lot.
I'm rather a friend of frequent backups and as a hosting provider I guarantee those work best :)
mybetinfo
07-15-2011, 12:36 PM
I installed this module on 4.1.4, but i have one question, the image path is now on my server on imported folders, yeah, great.
But, i have in settings the thumbnails 150px, i run the script toi rebuiold attachment but this image are not shown as the rest at 150x150px, any ideas how to do that ?
http://dli.ro/f/471-poze-cu-userii-de-pe-forum.html#post2449
Check this and few post bellow taht to see the yhumbnails. thank you.
y2ksw
07-16-2011, 07:54 PM
This plugin imports only images. If you have problems with ImageShack preview images, please add imageshack to the whitelist (ignore) and they are left alone. This plugin is not searching the original images from other sites. ;)
mb2tour
07-18-2011, 12:24 PM
Hi, I'd have one question. This mod is some sort of replacement for external image hosting? Meaning that I will be uploading directly to the FTP and than selecting if I want to post as thumbnail or full view? What about 4.1.4?
Thanks,
~~QS
y2ksw
07-18-2011, 01:12 PM
No, this product imports only images, which are pasted in the editor and left there. Over time more than 90% of the remote images disappear permanently. Thus, having them in local, images continue to exist, even if the source died long time ago ;)
Scalemotorcars
07-19-2011, 10:34 PM
Well Im screwed. I didn't add gallery to the white-list and now all those photos are gone.
My fault for not backing up the db first. You should add a warning (big red letters) about photopost and possible problems.
Once I do get this fixed manually I just want to make sure the info is correct for the hack. All I do is add gallery to the white list right?
y2ksw
07-21-2011, 10:05 AM
Well Im screwed. I didn't add gallery to the white-list and now all those photos are gone.
My fault for not backing up the db first. You should add a warning (big red letters) about photopost and possible problems.
Once I do get this fixed manually I just want to make sure the info is correct for the hack. All I do is add gallery to the white list right?
Yes. In the option description it says:
Images containing these values are ignored and will not be replaced. Normally you will enter here your media server or gallery folder. Images of your forum and the imported folder are always ignored. Please separate each item by a new line.
It means, if you have a gallery folder, you would add in a new line:
/gallery/
If it is a subdomain or domain:
gallery.domain.tld
If it is ImageShack:
imageshack.
And don't forget to backup your post table this time ;)
8thos
07-31-2011, 03:26 AM
What's the point of this mod and can it reduce my First Byte Time in www.webpagetest.org?
y2ksw
07-31-2011, 06:47 AM
What's the point of this mod and can it reduce my First Byte Time in www.webpagetest.org? (http://www.webpagetest.org?)
The point is: it moves external images to your server. But I can't tell if it is useful to you :)
Scalemotorcars
08-01-2011, 12:17 AM
I imagine your photopost images weren't readable to visitors and you had not setup the photopost path (mysite/gallery or gallery) into the "whitelist" (Ignore field). So the product tried to download the image but could't read it, and replaced it.
If you have a backup of your post table, you may disable the product and change the INSERT INTO in REPLACE INTO of the queries of your backup (& run a restore of the post table of course), in order to get back what you had, without messing up new posts (since your latest backup).
PS: If you do a restore, make sure not to rebuild the table structure ;)
I only have a complete backup from about 6 months ago and Ive since upgraded from 3.6 to 4.1.4 Is it possible to only use the one table from the complete backup and since its the older version of VB would that be a problem?
y2ksw
08-01-2011, 07:51 AM
I only have a complete backup from about 6 months ago and Ive since upgraded from 3.6 to 4.1.4 Is it possible to only use the one table from the complete backup and since its the older version of VB would that be a problem?
It is a problem, because the database structure has changed. In order to use the backup you would have to restore the backup in a sandbox, upgrade, backup again and restore as indicated with replace into. However there is no guarantee it works, because I suppose you have (had) also other plugins and probably the database structure isn't exactly the same.
Scalemotorcars
08-01-2011, 10:21 PM
Yep it has changed.
So to be clear since I would like to use the mod.
in the white list, if my site is root/forum and root/gallery all I need to do is add /gallery/ to the list.
tommythejoat
08-02-2011, 10:32 PM
Perhaps I was reckless but I wanted image resizing, so I installed the 1.0.5 version on my test board.
I was not sure from the instructions whether the mod would create the /images/import directory or I would need to do that, so I ran it for a little while without manually creating the directory. The directory did not appear, so I then created the directory with 755 permissions.
I then ran the mod for about an hour and checked the table iei_img to see what was going on. The table shows a number of images have been re-url'd with many going to year based subdirectories and many just being ignored because they were invalid.
However, the /images/import/ directory remains empty.
Here is a translated url from the table
http://mb.nawcc.org/forum/images/imported/2006/11/1.jpg
Are these entries just a "plan of work" and the code actually does the transfers as another background task?
I have turned the mod off by disabling the cron job at the moment
y2ksw
08-03-2011, 07:50 AM
Yep it has changed.
So to be clear since I would like to use the mod.
in the white list, if my site is root/forum and root/gallery all I need to do is add /gallery/ to the list.
Yes, you would add add /gallery/ to the list. This however may also exclude /gallery/ images from anywhere else ... so maybe it's a good idea to include the domain, too, e.g.:
mydomain.com/gallery/
And please don't forget the backup! :)
y2ksw
08-03-2011, 07:57 AM
Perhaps I was reckless but I wanted image resizing, so I installed the 1.0.5 version on my test board.
I was not sure from the instructions whether the mod would create the /images/import directory or I would need to do that, so I ran it for a little while without manually creating the directory. The directory did not appear, so I then created the directory with 755 permissions.
I then ran the mod for about an hour and checked the table iei_img to see what was going on. The table shows a number of images have been re-url'd with many going to year based subdirectories and many just being ignored because they were invalid.
However, the /images/import/ directory remains empty.
Here is a translated url from the table
http://mb.nawcc.org/forum/images/imported/2006/11/1.jpg
Are these entries just a "plan of work" and the code actually does the transfers as another background task?
I have turned the mod off by disabling the cron job at the moment
These subfolders are created from the post date of the one they were taken from. The code parses posts one by one and tries to find pasted image references. If it finds one, it creates a new entry ([forumhome][setting]/year/month/progressive.extension) and imports the image and changes the reference in the post. Then it sets a flag to the post in order to avoid reparsing with value 1. Other values may follow for additional services and new add-ons.
If an image was imported previously, it just sets the new reference.
DaffyDuck
09-05-2011, 02:15 AM
Doesn't seem to be working for me - vB 4.1.5.
Either the cron task is not running (when running it manually, it completes in an instant), or the code is not working. Either way, none of the images are being downloaded, or the URL replaced.
Any ideas?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.