OpenGraph with external images

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

OpenGraph with external images

Post by drmenzelit » 24 Jan 2018, 11:49

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: 1636
Joined: 28 Nov 2010, 17:20

Re: OpenGraph with external images

Post by christine » 24 Jan 2018, 15:24

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: 41299
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: OpenGraph with external images

Post by Jan » 30 Mar 2018, 10:43

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: 2
Joined: 24 Jan 2018, 11:45

Re: OpenGraph with external images

Post by drmenzelit » 30 Mar 2018, 11:39

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: 41299
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: OpenGraph with external images

Post by Jan » 01 Apr 2018, 23:16

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: 41299
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: OpenGraph with external images

Post by Jan » 13 Apr 2019, 22:39

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