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)

Sonik_elf 02-22-2017 05:40 AM

Quote:

1. Go to AdminCP >> Options >> Settings >>vB4 Import External Images and input your settings and enable the addon

2. Go to AdminCP >> Scheduled Tasks >> Scheduled Task Manager >> vB4 Import External Images

3. Edit your settings there and then enable the cron job /scheduled task.
It performs the task, but do not appear in the image folder. What is the problem? Folder have 777 permissions.

Can somewhere view logs or something?

djbaxter 02-22-2017 02:24 PM

Only missing images appear in the image folder.

djbaxter 02-22-2017 02:30 PM

Update:

It appears that the error messages I received and posted above were misleading (at least they misled me). It is not the case that this add-on is finding the same missing image in a number of posts; I thought that initially made sense because the image pointed to a no longer available smiley.

Rather it seems that once the add-on encounters a no longer available image, it gets "stuck" on that image each time it tries to process another run, and keeps generating the same error.

A work-around which appears to be working for me is to add the URL (or part of the URL) pointing to the problem image to the add-on's Ignore list:

AdminCP >> Settings >> Options >> vB4 Import External Images >> Ignore

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

My ignore list now looks like this:

Code:

imgcache/
websmileys.com/
/shea0017/
allposters.com/

Now that I'm posting this, I'm not sure what "imgcache/" is - that was prepopulated by the add-on.

y2ksw 02-23-2017 02:29 PM

Quote:

Originally Posted by djbaxter (Post 2582627)
MySQL server has gone away

Nothing we can do about. Server issues are server issues.

Quote:

Originally Posted by djbaxter (Post 2582747)
Now that I'm posting this, I'm not sure what "imgcache/" is - that was prepopulated by the add-on.

It's the folder where imported images are stored. Values in this field avoid to import images which were already imported or stored elsewhere by other means.

djbaxter 02-23-2017 02:55 PM

I think you've missed the point. See my latest post above. The add-on gets stuck on a missing image and keeps trying to retrieve it even after it moves on to other posts.

https://vborg.vbsupport.ru/showpost....&postcount=723

y2ksw 02-24-2017 01:16 PM

Quote:

Originally Posted by djbaxter (Post 2582786)
I think you've missed the point. See my latest post above. The add-on gets stuck on a missing image and keeps trying to retrieve it even after it moves on to other posts.

https://vborg.vbsupport.ru/showpost....&postcount=723

We have had stuck image problems in the past, namely out of memory problems with huge images and PHP silently crashing, but then, MySQL would not complain. None of the stuck image problems were solvable by more clever PHP code. And trust me, we have tried hard (a customer paid all the effort but no avail).

All I can say is, when you cannot solve the timeout problems, the plugin does not work for you.

xyd 02-25-2017 02:53 AM

I'm actually strongly considering developing a service for forum owners, as I am one myself, to do what this plugin did (or does, I don't know if it still works) along with a few extra features... all things I've been doing on my forum for a few years but utilizing custom code and not vB plugins...

There's almost nothing I hate more than coming to a forum and reading quality posts from a while back but the images not working in them.

What I've been doing, and the service that I'm considering starting up, would do these things:

1.) Any external images in the past that have been posted to your forum, which are still available, would be imported into my server cluster.

2.) After being imported, the image will be optimized (using lossless - or lossy - the site owner would be able to choose which they would want) using the latest image optimization routines (OptiPNG, etc etc etc).

3.) After being optimized, the old external images inserted into posts on your forums would be updated to no longer route to the external image, but the one on my server.

4.) Files would be distributed to your viewers over our CDN to allow for a better (by not having to wait for things to load) browsing experience.

5.) Any future posts made with external images inserted into them would have them automatically imported, optimized, posts updated and distributed through our service automatically.

The setup would be extremely painless, it'd pretty much be a set it and forget it type thing - everything would be done in the background.

I have a lot of resources at my disposal, but I'd charge around $10/month for access to this service (you can enable it for all of your forums - if you run multiple forums) because there are infrastructure costs if I were to provide this as a service.

Also you'd have the option to have all your normal image uploads (i.e. when someone attaches a jpg to a thread they are making) served through our service as well - the idea here would be to reduce strain on your server, reduce your bandwidth costs and improve browsing experience by faster page loading thanks to the files being served via CDN.

Another thing, and this is still experimental (but I'm implementing it on my forum as we speak), you would have the option to allow us to optimize your images even further, by making it so images that are way too big for the viewer's screen would be resized automatically during the import->optimization phase, into 4 different files (based on the most popular browser screen resolutions), which would not only increase their page loading speed, but decrease their bandwidth used and decrease your bandwidth used. They would, of course, be able to see the image in all it's glory by clicking on it, but the initial view would be sized intelligently (responsive web design). Images would never be upscaled - QUALITY and performance is something I require when it comes to processing images, so you would never see crappy quality images due to our service.

LASTLY, lol, this is still experimental as well (another thing I'm implementing on my forum as we speak), but images could be served as BPGs instead of JPGs/PNGs - more or less this would decrease the file size of images by about 30-40%, saving you and your viewers bandwidth, and making pages load even faster. Should this option be offered, and the forum owner want it enabled, you'd have to stick a piece of javascript into your forum (would all be done via the vB plugin) since BPGs aren't natively supported by browsers yet, but it's well worth doing. I'll post some before and after screenshots once I'm done implementing everything on my own forum.

As I said before, this would be an extremely powerful tool for any forum, there would be hardly any work required to implement it on your own forum. And of course since it would be provided as a service, I'd help anyone who needs it when it comes to installation/configuration.

I'm curious to see what kind of interest a service like this would conjure up - I know if it was around when I created my forum I would have definitely jumped on it for $10/month.

y2ksw 02-25-2017 04:48 AM

Quote:

Originally Posted by xyd (Post 2582861)
I'm actually strongly considering developing a service for forum owners, as I am one myself, to do what this plugin did (or does, I don't know if it still works) along with a few extra features... all things I've been doing on my forum for a few years but utilizing custom code and not vB plugins...
(...)

Sounds challenging :)

BadgerDog 02-25-2017 09:09 AM

Quote:

Originally Posted by xyd (Post 2582861)

I'm curious to see what kind of interest a service like this would conjure up - I know if it was around when I created my forum I would have definitely jumped on it for $10/month.

Nice initiative, but at $120/year, it sounds expensive when this mod does a similar job for the single one time price of a PayPal donation?

If you went ahead, it would also have to be an SSL site..

Regards,
Doug

y2ksw 02-25-2017 12:25 PM

Quote:

Originally Posted by BadgerDog (Post 2582871)
Nice initiative, but at $120/year, it sounds expensive when this mod does a similar job for the single one time price of a PayPal donation?

If you went ahead, it would also have to be an SSL site..

Regards,
Doug

It surely depends on the service such an add-on may give. Say it is perfect and never crashes, nor has any kind of problems, ever, then $100/yr is not cheap, but in relation to the effort.

The point is that high end servers have a cost which never is paid unless some tricks apply. For example, I was playing with the idea of using flickr and instagram for storing images, taking advantage of a paid account. Then, the service would handle the downloading and redirecting only. But still, a professional service is very costly both in time and hardware.

Personally I prefer a low-end solution and no or little costs, at the expense of sometimes not getting exactly what I want.

xyd 02-26-2017 07:00 AM

I'll add a little more in response later today as I only have a few seconds at this very moment, but I wanted to mention something right now at least, regarding this:

Quote:

Originally Posted by BadgerDog (Post 2582871)
Nice initiative, but at $120/year, it sounds expensive when this mod does a similar job for the single one time price of a PayPal donation?

If you went ahead, it would also have to be an SSL site..

Regards,
Doug

I agree, the service wouldn't be for everyone - a lot of people like self hosting (I myself am one of those people) - and perhaps there would be a self-hosted version I'd make available, but to provide the level of service I want to with such a mod/plugin/whatever you want to call it, being able to fully administrate the infrastructure is something that I see, personally, as being important to me as the developer.

In regards to it being ran on HTTPS, I entirely agree. In fact, it's something I strongly believe in so much that I wouldn't even give the option to disable SSL for the service. Some could argue that having images behind SSL could cause extra round trip time due to SSL negotiation, but these images being served from a CDN would clear that up for most forum operators - and in a lot of situations, even being behind SSL but served with a CDN images would still load faster due to not a lot of places using CDNs for forum images/attachments.

That, along with all of the other newer technologies that increase loading time (HTTP/2 etc), would all be enabled, and again, such extreme performance optimizations aren't as common on forums as we'd all prefer. I am extremely... paranoid, or obsessive... when it comes to optimization when it comes to delivery of web objects.

SSL is becoming a very important aspect to the web these days, and I'd sweeten the pot for those who would use this service if I do end up creating it (I'm looking to create a few services for forum owners actually, this one included)... by allowing the site owner to choose the subdomain they wish to have their images served from, and thus creating, utilizing and issuing (yes, giving you the actual cert to utilize on your site however you want) a wildcard SSL certificate (signed by GlobalSign's AlphaSSL CA) for your domain for free.

Will add a little bit more later when I get back.

BadgerDog 02-26-2017 10:14 AM

Quote:

Originally Posted by xyd (Post 2582916)
I agree, the service wouldn't be for everyone - a lot of people like self hosting (I myself am one of those people) - and perhaps there would be a self-hosted version I'd make available, but to provide the level of service I want to with such a mod/plugin/whatever you want to call it, being able to fully administrate the infrastructure is something that I see, personally, as being important to me as the developer.

Paying one time for a functional commercial product that would enable self hosting would be something we'd be interested in .. :up:

Thanks .. :)

Regards,
Doug

RichieBoy67 02-27-2017 08:54 PM

Ok, well this thread is for this mod..

Can anyone tell me why Tapatalk images do not import. I believe they used to but I am not sure. It could have to do with their https:// url change or ours but I really want those images on our server..

djbaxter 03-03-2017 11:33 AM

Why would the cron job for this task suddenly stop logging events?

y2ksw 03-05-2017 12:57 PM

Quote:

Originally Posted by djbaxter (Post 2583192)
Why would the cron job for this task suddenly stop logging events?

If PHP silently crashes, for example.

y2ksw 03-05-2017 12:59 PM

Quote:

Originally Posted by RichieBoy67 (Post 2582974)
Ok, well this thread is for this mod..

Can anyone tell me why Tapatalk images do not import. I believe they used to but I am not sure. It could have to do with their https:// url change or ours but I really want those images on our server..

Maybe ... you have no CURL? fopen() is somewhat limited with https.

djbaxter 03-05-2017 04:21 PM

Quote:

Originally Posted by djbaxter (Post 2583192)
Why would the cron job for this task suddenly stop logging events?

Quote:

Originally Posted by y2ksw (Post 2583249)
If PHP silently crashes, for example.

I'm not sure what you mean by "silently crashes". I haven't seen anything to suggest anything crashed in server alerts. But assuming this might happen, what is the resolution? Server reboot?

y2ksw 03-06-2017 07:59 AM

Quote:

Originally Posted by djbaxter (Post 2583263)
I'm not sure what you mean by "silently crashes". I haven't seen anything to suggest anything crashed in server alerts. But assuming this might happen, what is the resolution? Server reboot?

If PHP crashes silently then there is no notification anywhere and the causes are unknown. We have had silent crashes with huge images (such as 60.000x80.000 pixel). The solution is to mark that post as "scanned ok" and eventually exclude the specific image in the options, if it appears in more than one post.

djbaxter 03-08-2017 04:36 PM

Quote:

Originally Posted by y2ksw (Post 2583297)
If PHP crashes silently then there is no notification anywhere and the causes are unknown. We have had silent crashes with huge images (such as 60.000x80.000 pixel). The solution is to mark that post as "scanned ok" and eventually exclude the specific image in the options, if it appears in more than one post.

How do you mark it as "scanned ok"? How do you even know which image to do that for if there's no notification and if the add-on is no longer logging its activity?

RichieBoy67 03-09-2017 12:06 AM

I just checked and this does not appear to be working at all any more.. no changes to the settings or plug in but updated Vbulletin, changed php version..things like that. Vbulletin 4.2.4 beta 1..also changed site to https://

Cron tasks says done but nothing happens..

RichieBoy67 03-09-2017 12:28 AM

Just found this in my log:

Database error in vBulletin 4.2.5 Beta 1:

Invalid SQL:
INSERT INTO oasl_session SET userid='85961', session_token='JEOGPb3rGt1nfI7PfB2LXGTq8B6xJazzQGD v', date_created='1488993068';

MySQL Error : Duplicate entry '85961' for key 'userid'
Error Number : 1062
Request Date : Wednesday, March 8th 2017 @ 12:11:07 PM
Error Date : Wednesday, March 8th 2017 @ 12:11:08 PM
Script : http://##############
Referrer : http://#######
IP Address : 173.245.50.139
Username : #######
Classname : vB_Database_MySQLi
MySQL Version :
Server : ########

It is supposed to be https://// also not sure about the duplicate session..

djbaxter 03-09-2017 06:50 AM

@RichieBoy67: That's essentially what is / was happening for me.

I recently updated to vBulletin 4.2.4 but I was getting all that with 4.2.3 PL2.

y2ksw 03-09-2017 08:03 AM

Quote:

Originally Posted by djbaxter (Post 2583462)
How do you mark it as "scanned ok"? How do you even know which image to do that for if there's no notification and if the add-on is no longer logging its activity?

The posts are scanned top-down (from postid=1 to latest).

The plugin adds a field to post, called iei_parsed.

If you issue the query:

Code:

SELECT postid
FROM post
WHERE iei_parsed>0
ORDER BY postid DESC
LIMIT 1

you get the last post ID which was successfully parsed. If this value stays put, then something is not working.

As for the concerns with https and SSL (I've been looking into it now), requesting data from such sites requires you to use CURL. You can choose the mode from the options. CURL is installed anyway since required by 4.x vBulletin versions.

Marking a post "OK" can be done this way:

Code:

UPDATE post SET
iei_parsed=1
WHERE postid=N

where N is the postid.

y2ksw 03-09-2017 08:05 AM

Quote:

Originally Posted by RichieBoy67 (Post 2583502)
Just found this in my log:

Database error in vBulletin 4.2.5 Beta 1:

Invalid SQL:
INSERT INTO oasl_session SET userid='85961', session_token='JEOGPb3rGt1nfI7PfB2LXGTq8B6xJazzQGD v', date_created='1488993068';

MySQL Error : Duplicate entry '85961' for key 'userid'
Error Number : 1062
Request Date : Wednesday, March 8th 2017 @ 12:11:07 PM
Error Date : Wednesday, March 8th 2017 @ 12:11:08 PM
Script : http://##############
Referrer : http://#######
IP Address : 173.245.50.139
Username : #######
Classname : vB_Database_MySQLi
MySQL Version :
Server : ########

It is supposed to be https://// also not sure about the duplicate session..

These are crashed database issues and require a table repair.

y2ksw 03-09-2017 08:07 AM

Quote:

Originally Posted by RichieBoy67 (Post 2583499)
I just checked and this does not appear to be working at all any more.. no changes to the settings or plug in but updated Vbulletin, changed php version..things like that. Vbulletin 4.2.4 beta 1..also changed site to https://

Cron tasks says done but nothing happens..

Please disregard my PM and see here:

https://vborg.vbsupport.ru/showpost....&postcount=743

djbaxter 03-09-2017 08:36 AM

Quote:

Originally Posted by y2ksw (Post 2583517)
The posts are scanned top-down (from postid=1 to latest).

The plugin adds a field to post, called iei_parsed.

If you issue the query:

Code:

SELECT postid
FROM post
WHERE iei_parsed>0
ORDER BY postid DESC
LIMIT 1

you get the last post ID which was successfully parsed. If this value stays put, then something is not working.

As for the concerns with https and SSL (I've been looking into it now), requesting data from such sites requires you to use CURL. You can choose the mode from the options. CURL is installed anyway since required by 4.x vBulletin versions.

Marking a post "OK" can be done this way:

Code:

UPDATE post SET
iei_parsed=1
WHERE postid=N

where N is the postid.

Thank you.

Running the first query shows 242442 as the last post ID.

Manually running the cron job leaves that number unchanged.

Running the second query yields

Code:

Affected Rows: 0 (0.0015s)
Repeating the whole sequence gives the same result.

Does that mean the add-on has stopped working?

Note my statement above that I recently updated to 4.2.4 but the issues were happening prior to that update.

RichieBoy67 03-09-2017 10:52 AM

1 Attachment(s)
Quote:

Originally Posted by y2ksw (Post 2583517)
The posts are scanned top-down (from postid=1 to latest).

The plugin adds a field to post, called iei_parsed.

If you issue the query:

Code:

SELECT postid
FROM post
WHERE iei_parsed>0
ORDER BY postid DESC
LIMIT 1

you get the last post ID which was successfully parsed. If this value stays put, then something is not working.

As for the concerns with https and SSL (I've been looking into it now), requesting data from such sites requires you to use CURL. You can choose the mode from the options. CURL is installed anyway since required by 4.x vBulletin versions.

Marking a post "OK" can be done this way:

Code:

UPDATE post SET
iei_parsed=1
WHERE postid=N

where N is the postid.

When I run this I get nothing..

##I get an id now after running a table repair. :) I will run the other one ..

RichieBoy67 03-09-2017 11:17 AM

I think it's working now because I do see the id moving after I run the 1st query. I do not see any new images yet in my import folder but I assume that just means it has not found any to import yet?

Thanks for your help!

djbaxter 03-09-2017 03:46 PM

Still not working for me. I did a repair and optimize on the database. No errors found.

RichieBoy67 03-09-2017 10:54 PM

Nope, not working.. looks like it went through the posts and is caught up with the last post but it has not imported any of the images..

Dave 03-10-2017 01:56 PM

@y2ksw I think I know the cause, I've made the following changes for someone and now it's working again:

In the cURL part in the iei_get_contents function, I made it so that any SSL errors are ignored (for HTTPS sites). This can be done by setting CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER to 0. I also added a check there so that it returns false when the status code is bigger than 400.

Finally, the iei_normalize_path function adds a slash in front of the path which does not seem to work on all servers. I removed the first slash in the path that's created by that function and that fixed the whole thing.

BadgerDog 03-10-2017 02:00 PM

Quote:

Originally Posted by Dave (Post 2583601)
@y2ksw I think I know the cause, I've made the following changes for someone and now it's working again:

In the cURL part in the iei_get_contents function, I made it so that any SSL errors are ignored (for HTTPS sites). This can be done by setting CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER to 0. I also added a check there so that it returns false when the status code is bigger than 400.

Finally, the iei_normalize_path function adds a slash in front of the path which does not seem to work on all servers. I removed the first slash of the path that's created and that fixed the whole thing.


Interesting Dave .... thanks .. :)

We import pics from all kinds of SSL sites and have so for years with this mod, but I don't recall us ever having to modify CURL options to do so.. and y2ksw's mod hasn't crashed, or failed to import a pic in years.

Are we missing something, or are we just lucky?

Regards,
Doug

Dave 03-10-2017 02:01 PM

Quote:

Originally Posted by BadgerDog (Post 2583602)
Interesting Dave .... thanks .. :)

We import pics from all kinds of SSL sites and have so for years with this mod, but I don't recall us ever having to modify CURL options to do so.. and y2ksw's mod hasn't crashed, or failed to import a pic in years.

Are we missing something, or are we just lucky?

Regards,
Doug

I assume you're just lucky. :)

Rideharder 06-13-2017 03:30 AM

Hello guys will this work on Version 4.2.5 or would you guys recommend something else for that 4.2.5? Thanks!!!

y2ksw 06-13-2017 06:27 AM

Quote:

Originally Posted by Rideharder (Post 2587480)
Hello guys will this work on Version 4.2.5 or would you guys recommend something else for that 4.2.5? Thanks!!!

It should work, but I can't promise ... please try and let us know :)

Kane@airrifle 06-13-2017 07:01 AM

Works in 4.2.5 PHP 7.1 for me.

Paul M 06-13-2017 10:33 AM

Quote:

Originally Posted by Rideharder (Post 2587480)
Hello guys will this work on Version 4.2.5 or would you guys recommend something else for that 4.2.5? Thanks!!!

I dont see why not, I have it (or at least a modified version of it) working on 3.8.11 & PHP 7.1, which is basically the same as far as this code is concerned.

(** The modifications relate to the information stored, I like to save the postid and a timestamp).

Rideharder 06-14-2017 08:29 PM

Awesome, thank you so much. I remember I stop doing the Vbulletin because it was a pain in the ass to keep up with all the version updates on the modules. You guys are pretty awesome to have around for the community and thanks!

andy626 07-03-2017 04:03 AM

Hi folks,

Some members pointed me to this thread, great mod!

Now that Photobucket has stopped 3rd party hosting, years of threads on my forum now have the below redirected image.

Has anyone tried this mod since PB have done this?

Any luck?

I'm concerned it will try and pull all of the PB photos but will pull the redirected image code instead or just blanks, any ideas/help greatly appreciated!

https://vborg.vbsupport.ru/

Kane@airrifle 07-03-2017 07:26 AM

Quote:

Originally Posted by andy626 (Post 2588076)
Hi folks,

Some members pointed me to this thread, great mod!

Now that Photobucket has stopped 3rd party hosting, years of threads on my forum now have the below redirected image.

Has anyone tried this mod since PB have done this?

Any luck?

I'm concerned it will try and pull all of the PB photos but will pull the redirected image code instead or just blanks, any ideas/help greatly appreciated!

https://vborg.vbsupport.ru/

Bad news, in testing I have found that the image is replace with the PB shakedown thumbnail


All times are GMT. The time now is 12:47 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.02293 seconds
  • Memory Usage 1,900KB
  • 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
  • (8)bbcode_code_printable
  • (25)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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