MyBB Community Forums

Full Version: Social Share Thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
I only kept twitter and facebook but also added Google Plus. The code below can be seen here

<div style="margin-top: 6px; padding-right: 10px;" class="float_left">

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

<a title="Facebook" href="http://www.facebook.com/share.php?u={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}" target="_blank"><img src="http://mnlakeparty.com/forum/images/FaceBook-24x24.png" alt="Facebook" /></a>

<a title="Twitter" href="http://twitter.com/home?status={$thread['subject']} - {$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}" target="_blank"><img src="http://mnlakeparty.com/forum/images/twitter-24x24.png" alt="Twitter" /></a>

<!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="none"></g:plusone>

<!-- Place this render call where appropriate -->
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

</div>
nice share bro... works perfect...
Sorry to bump the thread, the code works great except for the facebook button. When I click it it opens a Facebook window to share the post but the URL posted goes with an invalid something like

http://invalid.invalid/showthread.php?tid=%7B$thread%5B'tid'%5D%7D

I think this has to do with the use of the Google SEO plugin because when I share the URL despite it saying invalid, then the post on my Facebook wall shows the right URL name.

Anybody know how to make the URL appear with the right name when I share it? Otherwise people will be putt off from sharing it thinking the URL is truly invalid.
Pages: 1 2 3 4 5 6