Customizing SMF > Tips and Tricks

[TIP] Facebook Share Button

<< < (7/12) > >>

metalmaragato:
it work for SMF 1.1.14 and work fine with the Google +1 Topics MOD

Google +1 Topics code

--- Code: --- // Start Google +1 Mod smfhacks.com
if ($message['id'] == $context['topic_first_message'] )
{
echo '<div style="float: left"><g:plusone href="' . $scripturl . '?topic=' . $context['current_topic'] . '" size="small"></g:plusone>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script></div>';
}
// End Google Plus +1 Mod smfhacks.com

--- End code ---

This tip with some changes change the button for button_count

--- Code: --- // Start Facebook share
if ($message['id'] == $context['topic_first_message'] )
{
        echo '<div style="float: left"><a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div>';
                            }
// End Facebook share

--- End code ---



PLAYBOY:
It think it would be a helpful mod for ones who dont like to do manual changes.

~Dragon~:
it is easy tutorial trick! code!

Thank you so much information!

marci_n:

--- Quote from: metalmaragato on July 15, 2011, 01:38:21 AM ---
This tip with some changes change the button for button_count

--- Code: --- // Start Facebook share
if ($message['id'] == $context['topic_first_message'] )
{
        echo '<div style="float: left"><a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div>';
                            }
// End Facebook share

--- End code ---





--- End quote ---


It's working but... when I click on share button facebook doesn't have the forum default thumbnails. Ive got "Choose a thumbnail" on the windows popup and there is forum logo but also avatars from users profile discussing in that shared topics. Any idea?

8hoursale:
I know this is an old topic, but hopefully someone can help me. I just tired to copy this this code:


--- Code: ---if ($message['id'] == $context['topic_first_message'])
                            echo '<br /><br /><a name="fb_share" type="box_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script><br /><br />';};
--- End code ---


and put it right before:


--- Code: ---// Maybe they want to report this post to the moderator(s)?
--- End code ---


received an error that said.


--- Code: ---The file you tried to save generated the following error:
Parse error: syntax error, unexpected '}' in Display.template.php on line 676
--- End code ---

I'm using SMF 1.1

I'd appreciate any help.

Thanks!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version