Advertisement:

Author Topic: [TIP] Facebook Share Button  (Read 60948 times)

Offline searchgr

  • Sophist Member
  • *****
  • Posts: 1,247
Re: [TIP] Facebook Share Button
« Reply #20 on: September 25, 2010, 02:01:52 PM »
Can i add this code to smf 2.0 ?

Offline lucas-ruroken

  • SMF Hero
  • ******
  • Posts: 4,906
  • Gender: Male
  • Adk Developer
    • lucas.ruroken on Facebook
    • lucasruroken on GitHub
Re: [TIP] Facebook Share Button
« Reply #21 on: September 25, 2010, 06:45:47 PM »
this code is for smf2 ;)
Adk Portal 3.1 is coming....

Design your universe!

Offline searchgr

  • Sophist Member
  • *****
  • Posts: 1,247
Re: [TIP] Facebook Share Button
« Reply #22 on: September 26, 2010, 01:34:41 AM »
sorry, i meant the smf 2 RC2.

Offline lucas-ruroken

  • SMF Hero
  • ******
  • Posts: 4,906
  • Gender: Male
  • Adk Developer
    • lucas.ruroken on Facebook
    • lucasruroken on GitHub
Re: [TIP] Facebook Share Button
« Reply #23 on: September 26, 2010, 01:53:34 AM »
sorry, i meant the smf 2 RC2.

Yeah! It works! ;D
Adk Portal 3.1 is coming....

Design your universe!

Offline searchgr

  • Sophist Member
  • *****
  • Posts: 1,247
Re: [TIP] Facebook Share Button
« Reply #24 on: September 27, 2010, 01:45:53 AM »
If you can, try to split up the thing in two parts:

Themes/default/Display.template.php
Code: [Select]
                      if ($message['id'] == $context['first_message']) {
                            echo '<br /><br /><a name="fb_share" type="box_count" href="http://www.facebook.com/sharer.php">Share</a><br /><br />';
                            };

And put this in the footer
Code: [Select]
              echo '<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>';

It will increase page loading speed time (a little bit).

See http://developer.yahoo.com/performance/rules.html#js_bottom for more info.

Where in the footer? Can you specify please?

Offline searchgr

  • Sophist Member
  • *****
  • Posts: 1,247
Re: [TIP] Facebook Share Button
« Reply #25 on: September 27, 2010, 01:55:16 AM »
I have added the code and the facebook shows as a title: An Error Has Occurred!

Offline Diomet

  • Semi-Newbie
  • *
  • Posts: 19
  • Gender: Male
  • SMF 2.0 RC3
    • FIATFan.ro
Re: [TIP] Facebook Share Button
« Reply #26 on: October 10, 2010, 05:58:59 AM »
What is the code for "Share" button to appear on every message?
SMF 2.0 RC3
My SMF Forum [nofollow]

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,926
  • Gender: Male
Re: [TIP] Facebook Share Button
« Reply #27 on: November 26, 2010, 01:55:23 PM »
Code: [Select]
                            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 />';

Offline kavasa

  • Newbie
  • *
  • Posts: 2
Re: [TIP] Facebook Share Button
« Reply #28 on: May 09, 2011, 07:03:58 PM »
what about smf1.1.13? :-[

Offline sunehrigal

  • Newbie
  • *
  • Posts: 5
Re: [TIP] Facebook Share Button
« Reply #29 on: May 09, 2011, 08:43:06 PM »
Thanks it will really help me to track some traffic from facebook.. Keep sharing such informative and productive stuff.

Offline metalmaragato

  • Newbie
  • *
  • Posts: 7
Re: [TIP] Facebook Share Button
« Reply #30 on: July 15, 2011, 01:38:21 AM »
it work for SMF 1.1.14 and work fine with the Google +1 Topics MOD

Google +1 Topics code
Code: [Select]
// 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

This tip with some changes change the button for button_count
Code: [Select]
// 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



« Last Edit: July 15, 2011, 01:48:41 AM by metalmaragato »

Offline PLAYBOY

  • SMF Hero
  • ******
  • Posts: 2,074
  • Livephotoshop.com & Lullabyabc.com
    • Lullabies and Us
Re: [TIP] Facebook Share Button
« Reply #31 on: July 15, 2011, 01:43:39 AM »
It think it would be a helpful mod for ones who dont like to do manual changes.

Offline ~Dragon~

  • Jr. Member
  • **
  • Posts: 301
  • Gender: Male
Re: [TIP] Facebook Share Button
« Reply #32 on: July 15, 2011, 07:00:05 AM »
it is easy tutorial trick! code!

Thank you so much information!
Please do not PM or email, Thank respond please post fast to SMF!

Offline marci_n

  • Newbie
  • *
  • Posts: 5
Re: [TIP] Facebook Share Button
« Reply #33 on: July 22, 2011, 05:43:45 PM »

This tip with some changes change the button for button_count
Code: [Select]
// 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






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?

Offline 8hoursale

  • Newbie
  • *
  • Posts: 3
Re: [TIP] Facebook Share Button
« Reply #34 on: July 23, 2011, 06:15:49 PM »
I know this is an old topic, but hopefully someone can help me. I just tired to copy this this code:

Code: [Select]
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 />';};


and put it right before:

Code: [Select]
// Maybe they want to report this post to the moderator(s)?

received an error that said.

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

I'm using SMF 1.1

I'd appreciate any help.

Thanks!

Offline juliegreen

  • Semi-Newbie
  • *
  • Posts: 62
    • job seekers
Re: [TIP] Facebook Share Button
« Reply #35 on: June 30, 2012, 09:00:11 AM »
is that code working for current smf version? SMF 2.0.2.

Offline Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,440
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: [TIP] Facebook Share Button
« Reply #36 on: June 30, 2012, 09:28:37 AM »
is that code working for current smf version? SMF 2.0.2.
Yes.

Offline gerzok

  • Semi-Newbie
  • *
  • Posts: 27
  • Gender: Male
    • @gerzok on Twitter
    • Grupo ClickMedia
Re: [TIP] Facebook Share Button
« Reply #37 on: July 27, 2012, 07:49:54 PM »
this is like the facebook "like" button?  :-\

Offline goldysaini

  • Newbie
  • *
  • Posts: 1
Re: [TIP] Facebook Share Button
« Reply #38 on: August 29, 2012, 01:08:01 AM »
 this is really a cool Facebook share this it will help me a lot. Keep sharing! Thanks!

Offline PLAYBOY

  • SMF Hero
  • ******
  • Posts: 2,074
  • Livephotoshop.com & Lullabyabc.com
    • Lullabies and Us
Re: [TIP] Facebook Share Button
« Reply #39 on: August 29, 2012, 01:24:59 AM »
It think it would be a helpful mod for ones who dont like to do manual changes.

There is still not a mod to do this right?