MyBB Community Forums

Full Version: 2016 Share Links
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here I am with another tutorial the other one I created for sharing posts is a your own image and opening in a new tab. Well this one is a 2016 version of adding social sharing buttons to your posts.

Go to your ACP -> Templates & Styles -> Templates -> the them you want to add this to -> Show Thread Templates -> showthread

Now find:
<div style="padding-top: 4px;" class="float_right">
		{$newreply}
	</div>

And add this below it:
<div style="margin-top: 6px; padding-right: 10px; padding-top: 4px;" class="float_left">

<strong style="float: left; padding-right: 10px;">Share Post:</strong>
<br />		

<a href="https://twitter.com/share" class="twitter-share-button" data-via="YoutTwitterName" data-hashtags="YourHashTag">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

<a class='fbLike'><div class="fb-like" data-href="{$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}" data-send="false" data-layout="button_count" data-width="150" data-show-faces="false" data-action="like"></div><div id="fb-root"></div></a>
<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/en_US/sdk.js#xfbml=1";
	  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>		
	
<script src="https://apis.google.com/js/platform.js" async defer></script>
<div class="g-plus" data-action="share" data-annotation="none"></div>
		
<script src="https://apis.google.com/js/platform.js" async defer></script>
<div class="g-follow" data-annotation="none" data-height="20" data-href="//plus.google.com/+YourGoogle+Name" data-rel="author"></div>		

<a title="Digg" href="http://digg.com/submit?url={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}" target="_blank"><img src="images/digg.png" alt="Digg" /></a>

<a title="Delicious" href="http://del.icio.us/post?url={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}&title={$thread['subject']}" target="_blank"><img src="images/delicious.png" alt="Delicious" /></a>

<a href="//www.reddit.com/submit" onclick="window.location = '//www.reddit.com/submit?url=' + encodeURIComponent(window.location); return false"> <img src="//www.redditstatic.com/spreddit1.gif" alt="submit to reddit" border="0" /> </a>

<su:badge layout="2"></su:badge>
<script type="text/javascript">
  (function() {
    var li = document.createElement('script'); li.type = 'text/javascript'; li.async = true;
    li.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//platform.stumbleupon.com/1/widgets.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(li, s);
  })();</script>
	
<script
    type="text/javascript"
    async defer
    src="//assets.pinterest.com/js/pinit.js"
></script>
<a href="https://www.pinterest.com/pin/create/button/">
    <img src="//assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png" />
</a>	
	
<a href="mailto:?subject={$thread['subject']}&amp;body=Your email message {$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}&title={$thread['subject']}"
   title="Share by Email">
  <img src="images/email.png">
</a>
	
<a href="javascript:window.print()">
	<img src="images/print.png" alt="Print Me!"  />
	</a>

</div>

[Image: Screen%20Shot%202016-04-27%20at%208.33.5...hbtpp7.png]

Social Icons
Hey.
Can u post a print screen of the final result? Smile
Screenshot sure