vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Import External Images (https://vborg.vbsupport.ru/showthread.php?t=253309)

y2ksw 11-06-2010 10:00 PM

Import External Images
 
1 Attachment(s)
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., 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

M@rc 11-08-2010 12:02 AM

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

Quote:

Originally Posted by Wajdan (Post 2119339)
I snap shot would be highly appreciated....!

check this 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

Quote:

Originally Posted by LuisManson (Post 2119114)
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.
Quote:

Originally Posted by BadgerDog (Post 2119128)
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

Quote:

Originally Posted by sticky (Post 2119294)
So will it go through all past posts and replace those images?

Yes, it parses all posts from the beginning.
Quote:

Originally Posted by Wajdan (Post 2119339)
I snap shot would be highly appreciated....!

It has not much to show off - maybe the options window? :)

Veer 11-08-2010 09:50 AM

Quote:

Originally Posted by YankForum (Post 2119361)
check this 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

Quote:

Originally Posted by y2ksw (Post 2119401)
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 [HSURL]http://www.pic.jog[/HSURL]. 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

Quote:

Originally Posted by BadgerDog (Post 2119416)
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 [HSURL]http://www.pic.jog[/HSURL]. 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

Quote:

Originally Posted by y2ksw (Post 2119451)
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.

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?

[hsurl=http://photos.imageevent.com/badgerdog/canadianservicerifles/1915rossmkiiisniper223/DSC01967.JPG][IMG]http://photos.imageevent.com/badgerdog/canadianservicerifles/1915rossmkiiisniper223/icons/DSC01967.JPG[/IMG][/hsurl]

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

Quote:

Originally Posted by BadgerDog (Post 2119453)
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?

[hsurl=http://photos.imageevent.com/badgerdog/canadianservicerifles/1915rossmkiiisniper223/DSC01967.JPG][img]https://vborg.vbsupport.ru/external/2010/11/33.jpg[/img][/hsurl]

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 [img] 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.

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

Quote:

Originally Posted by y2ksw (Post 2119464)
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 [img] 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[/IMG][/hsurl]

Quote:

Originally Posted by y2ksw (Post 2119465)
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

Quote:

Originally Posted by BadgerDog (Post 2119483)
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]https://vborg.vbsupport.ru/external/2010/11/33.jpg[/img][/hsurl]



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,

[hsurl=http://photos.imageevent.com/badgerdog/canadianservicerifles/1915rossmkiiisniper223/DSC01967.JPG][img]https://vborg.vbsupport.ru/external/2010/11/33.jpg[/img][/hsurl]

is not touched at all. If it isn't, it is touched this way:

[hsurl=http://photos.imageevent.com/badgerdog/canadianservicerifles/1915rossmkiiisniper223/DSC01967.JPG][IMG]http://www.forum.tld/images/imported/2010/11/1234.jpg[/IMG][/hsurl]

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

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

Quote:

Originally Posted by sticky (Post 2119782)
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

Quote:

Originally Posted by Dr.osamA (Post 2119720)
thanxx

installed but not working at all

you can try it here alra7ba.info

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

Quote:

Originally Posted by sticky (Post 2119784)
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

Quote:

Originally Posted by doopz (Post 2119791)
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

Quote:

Originally Posted by y2ksw (Post 2119805)
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

Quote:

Originally Posted by sticky (Post 2120047)
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

Quote:

Originally Posted by sticky (Post 2120048)
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

Quote:

Originally Posted by sticky (Post 2120137)
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

Quote:

Originally Posted by Dr.osamA (Post 2120189)
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:

Code:

UPDATE post SET iei_parsed=1
This way, only new and edited posts are parsed.

If you decide later to reparse all old posts, too, just run

Code:

UPDATE post SET iei_parsed=0
which 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

Quote:

Originally Posted by abunaji (Post 2125321)
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

Quote:

Originally Posted by y2ksw (Post 2120252)
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

Quote:

Originally Posted by sticky (Post 2127799)
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 :)


All times are GMT. The time now is 04:57 AM.

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

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

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete