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)

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

Quote:

Originally Posted by BirdOPrey5 (Post 2149672)
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:
PHP Code:

$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

Quote:

Originally Posted by newmomsforum (Post 2149752)
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:
Code:

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

Quote:

Originally Posted by vietfancy (Post 2150719)
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

Quote:

Originally Posted by vortodox (Post 2150720)
Is it possible to enable this hack only on articles and blogs?

It is only for forum posts yet.


All times are GMT. The time now is 08:12 PM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01691 seconds
  • Memory Usage 1,758KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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