Page 1 of 1

OpenGraph with external images

Posted: 24 Jan 2018, 11:49
by drmenzelit
Hi,
I'm using Phoca OpenGraph for a client website where the most images are from external urls, in this case OpenGraph doesn't work, because it create a wrong url for the image (the website url + the url of the image itself).
Can this be changed?
It would be really great!
Thanks

Viviana

Re: OpenGraph with external images

Posted: 24 Jan 2018, 15:24
by christine
Hi Viviana,

Found this older thread: viewtopic.php?t=38952

The modified lines were from previous version 3.0.5. Downloaded & checked the latest one now: 3.1.2 and it's implemented starting line: 230. Sorry, I don't know, if above info will help you.

Kind regards
Christine

Re: OpenGraph with external images

Posted: 30 Mar 2018, 10:43
by Jan
Hi, which version of the extension do you use? System or Content plugin?

The plugin tries to find the images with full url:

Code: Select all

$absU = 0;
					// Test if this link is absolute http:// then do not change it
					$pos1 			= strpos($src[1], 'http://');
					if ($pos1 === false) {
					} else {
						$absU = 1;
					}
					
					// Test if this link is absolute https:// then do not change it
					$pos2 			= strpos($src[1], 'https://');
					if ($pos2 === false) {
					} else {
						$absU = 1;
					}
So there should not be any problem with external images :idea:

Jan

Re: OpenGraph with external images

Posted: 30 Mar 2018, 11:39
by drmenzelit
Hi Jan,
I have the content plugin version 3.1.2
That is how it shows on the page:
<meta name="og:image" content="http://clienturl.eu/https://gdb.rferl.o ... 3_r1_s.jpg">
The code you posted above search for a url in images inside the article, right. But my client has intro images...

Regards
Viviana

Re: OpenGraph with external images

Posted: 01 Apr 2018, 23:16
by Jan
Hi, Ok, so this explains it all. For now there is no support for external urls in intro image, so I will implement it in next version.

Thank you for the info.

Jan

Re: OpenGraph with external images

Posted: 13 Apr 2019, 22:39
by Jan
Hi, should be Ok now in version 3.1.3 (Content plugin), 3.0.5 (System plugin):

https://www.phoca.cz/news/1027-phoca-op ... 5-released

Jan