This object is in archive! 

Tweet button not displayed

Archived Helge K. 12 years ago

The "Tweet" button that is normally displayed next to the Facebook "Like" button on the start page is not displayed (I use HTTPS). This can be seen on the attached screen shot or at https://helgeklein.com/forum/.

Best Answer
photo

Weird, we should have fixed it in 2.0.2 release. As of now you can go to application/templates/share.phtml and replace this code in 2 places with https

  1. <?php echo $protocol ?>

Replies (10)

photo
1

This might be related to SSL and the browser used. The screen shot is from Chrome. Firefox displays both buttons (Twitter and Facebook), IE9 by default only shows "secure" content where neither two buttons are visible (see screen shot attached to this post).

photo
1

Weird, we should have fixed it in 2.0.2 release. As of now you can go to application/templates/share.phtml and replace this code in 2 places with https

  1. <?php echo $protocol ?>

photo
1

Thanks for the prompt answer, Stas. I replaced all three instances of "<?php echo $protocol ?>" with "https" in share.phtml and now the sharing buttons are displayed correctly in Chrome, Firefox and IE.

photo
1

Great to hear that, but we'll check one more time on the issue why https is not identified correctly in your case in protocol variable

photo
1

Stas Kuzma wrote:

Great to hear that, but we'll check one more time on the issue why https is not identified correctly in your case in protocol variable
Please do that! If you need more information just let me know, I am happy to help.

photo
1

It would be better to detect https by either the setting oif the application or schema used in the product URL or by checking _SERVER["HTTPS"] environment variable. As for example Apache on CentOS 6.3, _SERVER['SERVER_PROTOCOL'] is 'HTTP/1.1' even over https.

photo
1

Petr Chocholous wrote:

It would be better to detect https by either the setting oif the application or schema used in the product URL or by checking _SERVER["HTTPS"] environment variable. As for example Apache on CentOS 6.3, _SERVER['SERVER_PROTOCOL'] is 'HTTP/1.1' even over https.
Exact code I use in share.phtml instead of the $protocol... line is:

  1. $protocol = (false === stripos($_SERVER['HTTPS'], 'on')) ? 'http' : 'https';

photo
1

Petr,

Thanks for sharing the code. We'll implement the fix in the next release.

photo
1

Petr Chocholous wrote:

Exact code I use in share.phtml instead of the $protocol... line is:


  1. $protocol = (false === stripos($_SERVER['HTTPS'], 'on')) ? 'http' : 'https';

To make it compatible with both nginx and Apache replace line 3:

  1. $protocol = (false === stripos($_SERVER['SERVER_PROTOCOL'], 'HTTPS')) ? 'http' : 'https';

with:


  1. $protocol = Singular_Core::_('Environment')->getRequestProtocol();

This fix will be covered in the next release.

photo
1

Fixed in 2.2 Beta release

Replies have been locked on this page!