OpenGraph with external images

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
drmenzelit
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 24 Jan 2018, 11:45

OpenGraph with external images

Post 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
christine
Phoca Hero
Phoca Hero
Posts: 2818
Joined: 28 Nov 2010, 17:20

Re: OpenGraph with external images

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: OpenGraph with external images

Post 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
If you find Phoca extensions useful, please support the project
drmenzelit
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 24 Jan 2018, 11:45

Re: OpenGraph with external images

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: OpenGraph with external images

Post 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
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: OpenGraph with external images

Post 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
If you find Phoca extensions useful, please support the project
Post Reply