Creating Simple Social Share Buttons MyBB
poeja .

Social Network has grown rapidly, now on average everyone has a social account in cyberspace, facebook, twitter and google plus are some examples of fast-growing social network.

This time I want to share about how to add share post to social network without plugin.

ok first thing is edit file Global.css contained in [b] your theme> global.css> advanced mode [/ b]

Then add the following code at the bottom on global.css

Code:
.share {
padding: 5px;
border-radius: 2px;
margin-top: -11px;
}

.share-twitter {
background: # 51CDF6;
border: 1px solid # 4DB9D5;
padding: 5px;
text-align: center;
vertical-align: top;
-webkit-border-radius: 2px;
-khtml-border-radius: 2px;
border-radius: 2px;
float: left;
margin-right: 5px;
}

.share-google {
background: # D4503F;
border: 1px solid # CE0E0E;
padding: 5px;
text-align: center;
vertical-align: top;
-webkit-border-radius: 2px;
-khtml-border-radius: 2px;
border-radius: 2px;
float: left;
margin-right: 5px;
}

.share-facebook {
background: # 4A65A1;
border: 1px solid # 1D59A5;
padding: 5px;
text-align: center;
vertical-align: top;
-webkit-border-radius: 2px;
-khtml-border-radius: 2px;
border-radius: 2px;
float: left;
margin-right: 5px;
}

then save.
the next thing is to open [b] theme templates> Showthread templates> showthread template [/ b] and find the following code

Code:
{$pollbox}

and place it just below the following code

PHP Code:
<div style="float: left" class="share">
<
span class="share-twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-lang="en" >Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></span>
<span class="share-google"><script type="text/javascript" src="https://apis.google.com/js/plusone.js">
  {lang: 'en'}
</script>
<g:plusone size="medium" href="{$mybb->settings['bburl']}/showthread.php?tid={$tid}"></g:plusone></span>
<span class="ssf"><iframe src="//www.facebook.com/plugins/like.php?href={$mybb->settings['bburl']}/showthread.php?tid={$tid}&amp;send=false&amp;layout=button_count&amp;width=130&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:130px; height:20px;" allowTransparency="true"></iframe></span>
<span class="share-facebook"><a title="Share On Facebook" href="http://www.facebook.com/share.php?u={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}" target="_blank" style="color: #FFF;"><img src="images/fb.png" alt="Facebook" style="padding-right: 5px;padding-bottom: 2px;vertical-align: middle;"/> <b>Share</b></a></span>
</div>
<br /> 

ok then save and see the result

Settings

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
0 Vote(s) - 0 Average