Template's Social API interface doesn't really work

25 April, 2016
GK User
Mon May 16, 2016 3:09 pm
Hello there, the site and page in discussion is http://peterdaniels.ru/bio2
Below the article I see the Social API interface that when I click, they do not work. For instance Facebook opens and immediately shuts down. Twitter doesn't relay the link, so I have to enter it manually, same thing about G+, Pinterest gives javascript error, LinkedIn doesn't work, the only one worked was VK. Of course I was the one telling you I want it's support. What happened to the rest of 'em? )))
User avatar
Platinum Boarder

teitbite
Thu May 19, 2016 11:34 am
Hi

Please edit file: gk_news_refreshed/html/com_k2/templates/default/item.php and add those 2 lines:

Code: Select all
$cur_url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$cur_url = preg_replace('@%[0-9A-Fa-f]{1,2}@mi', '', htmlspecialchars($cur_url, ENT_QUOTES, 'UTF-8'));


above line:

Code: Select all
$app        = JFactory::getApplication();
User avatar
Moderator

GK User
Fri May 20, 2016 6:56 am
Hello,
just reading this thread and the question was about the template called Box and the code patch was for News.
can you confirm this is the patch for Box please?
kind regards
Drew
User avatar
Gold Boarder

teitbite
Sat May 21, 2016 1:26 pm
Hi

Yes it can be used in any template. All those 2 lines does is to grab an url it's used on and pass it as a parameter for social sharing.
User avatar
Moderator

GK User
Tue May 24, 2016 5:42 am
teitbite wrote:above line:
Code: Select all
$app        = JFactory::getApplication();

Sorry I didn't respond sooner, I was traveling. I can't find any line with $app in the item.php file under /templates/gk_box/html/com_k2/templates/default

What am I reading wrong? Thanks.
User avatar
Platinum Boarder

teitbite
Thu May 26, 2016 10:40 am
Hi

Sorry, I thought You were using gk_news template. In gk_box item.php got divided into multiple files the one it should be in is: item_social.php

I can see it's been added already, so You may just replace this file with the one from latest package.
User avatar
Moderator

GK User
Thu May 26, 2016 3:14 pm
teitbite wrote:In gk_box item.php got divided into multiple files the one it should be in is: item_social.php
I can see it's been added already, so You may just replace this file with the one from latest package.

I've cracked my head trying to figure out why it's still doesn't work. Later found out, we've applied the patch for k2, whereas I needed for simple Joomla content. )))
I've tried to renew files from new QS's folder templates/gk_box/html/com_content/article - didn't help.
User avatar
Platinum Boarder

teitbite
Mon May 30, 2016 12:40 pm
Hi

Please send me an access to ftp. I'll try to do it myself.
User avatar
Moderator

GK User
Mon May 30, 2016 1:13 pm
teitbite wrote:Hi

Please send me an access to ftp. I'll try to do it myself.

Sent PM. Thank you!
User avatar
Platinum Boarder

teitbite
Thu Jun 02, 2016 12:28 pm
Hi

Are You sure those are the correct credentials ? I'm adding changes to file /html/com_content/article/default.php but there are no changes visible on article page at all. Do You have some server cache active maybe ? I've commented the code out for now, but please check if maybe it will work for You when uncommented.
User avatar
Moderator


cron