Problem with the button "like" the facebook.

GK User
Tue Feb 12, 2013 10:03 pm
hello

I'm having a problem with the button "like" the facebook.

When I click "Like" the Facebook receives information that "Like" the article, but the link appears as error.

Usually example photo of the article with error. This is the domain of the website http://www.ventanabr.com

Link image http://www.ventanabr.com/like.png

I think the problem is that the link is appearing with the "s" in the http "s" :/ / http://www.ventanabr.com / index.php and this link does not open the page.
User avatar
Junior Boarder

teitbite
Thu Feb 14, 2013 6:40 pm
Hi

Plese show me an exact page You have this problem.
User avatar
Moderator

GK User
Thu Feb 14, 2013 9:30 pm
User avatar
Junior Boarder

teitbite
Fri Feb 15, 2013 5:22 pm
Hi

Please send me an access to FTP and I'll try to generate button code one more time.
User avatar
Moderator

GK User
Fri Feb 15, 2013 9:23 pm
Hi Teitbite,

I sent the password for this email
[email protected]
User avatar
Junior Boarder

teitbite
Sat Feb 16, 2013 6:56 pm
Hi

I've edited /html/com_content/article/default.php and replaced this:

Code: Select all
          <gavern:social><fb:like href="<?php echo $cur_url; ?>" GK_FB_LIKE_SETTINGS></fb:like></gavern:social>


to

Code: Select all
   <div id="fb-root"></div>
   <script>(function(d, s, id) {
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) return;
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/pl_PL/all.js#xfbml=1";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));</script>
   <div class="fb-like" data-send="true" data-layout="button_count" data-width="450" data-show-faces="false"></div>



Please try it now.
User avatar
Moderator

GK User
Sun Feb 17, 2013 5:16 pm
Hi,

Thanks for the help but the problem continues

The facebook not find the page that the link is https:// rather than http:// as

I performed the tests on these pages and sending the image that appears on facebook

http://www.ventanabr.com/index.php?opti ... Itemid=311
http://www.ventanabr.com/index.php?opti ... Itemid=311
User avatar
Junior Boarder

teitbite
Tue Feb 19, 2013 4:48 am
Hi

Than I'm affraid You need to ask facebook developers for help. I've already used a clean facebook like button code. This is the code generated by facebook page, so problem must be somewhere else. I hope they know the issue already and will be able to tell You what to do.
User avatar
Moderator

GK User
Wed Feb 20, 2013 1:12 pm
hi
thanks for the help so far
I believe the problem is not directly with the facebook link but with the configuration of Open Graph
I removed the information from the File Open Graph / html / com_content / article / default.php and installed the plugin "Phoca Open Graph Plugin".
The problem was partially solved. The photos, the link and the page title is correct but in many cases the information that are shown are not the article but the "home" site.

You know how corrir programming without using the Open Graph plugin from "Phoca"? I found the same problem in another template from Gavick I'm using.

I'm putting the piece of programming that removed the file. Do not know if removed properly.

// OpenGraph support
$template_config = new JConfig();
$uri = JURI::getInstance();
$article_attribs = json_decode($this->item->attribs, true);

$og_title = $this->escape($this->item->title);
$og_type = 'article';
$og_url = $cur_url;
if (version_compare( JVERSION, '1.8', 'ge' ) && isset($images->image_fulltext) and !empty($images->image_fulltext)) {
$og_image = $uri->root() . htmlspecialchars($images->image_fulltext);
$pin_image = $uri->root() . htmlspecialchars($images->image_fulltext);
} else {
$og_image = '';
preg_match('/src="([^"]*)"/', $this->item->text, $matches);
if(isset($matches[0])) {
$pin_image = $uri->root() . substr($matches[0], 5,-1);
}
}
$og_site_name = $template_config->sitename;
$og_desc = '';


if(isset($article_attribs['og:title'])) {
$og_title = ($article_attribs['og:title'] == '') ? $this->escape($this->item->title) : $this->escape($article_attribs['og:title']);
$og_type = $this->escape($article_attribs['og:type']);
$og_url = $cur_url;
$og_image = ($article_attribs['og:image'] == '') ? $og_image : $uri->root() . $article_attribs['og:image'];
$og_site_name = ($article_attribs['og:site_name'] == '') ? $template_config->sitename : $this->escape($article_attribs['og:site_name']);
$og_desc = $this->escape($article_attribs['og:description']);
}

$doc = JFactory::getDocument();
$doc->setMetaData( 'og:title', $og_title );
$doc->setMetaData( 'og:type', $og_type );
$doc->setMetaData( 'og:url', $og_url );
$doc->setMetaData( 'og:image', $og_image );
$doc->setMetaData( 'og:site_name', $og_site_name );
$doc->setMetaData( 'og:description', $og_desc );
User avatar
Junior Boarder

teitbite
Wed Feb 20, 2013 8:15 pm
Hi

Good thinking. This may be it. But I would propose the simpliest solution I can think of. If old system is working almost ok and the problem is "https" than maybe changing this one small thing is everything we need :)

Please search for this line:

Code: Select all
$doc->setMetaData( 'og:image', $og_image );


and replace it with

Code: Select all
$doc->setMetaData( 'og:image', str_replace( 'https', 'http', $og_image ) );
User avatar
Moderator


cron