Twitter Button fro SMF 2.0

by Mick in Tutorials on 07 Dec 2010



Twitter Button fro SMF 2.0

Add Twitter button with tweet count into your topics.

Open:
Themes/default/Index.template.php

Find:
// Here comes the JavaScript bits!
echo '


Add after:
        <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>



Open:
Themes/default/Display.template.php

Find:
// Maybe they want to report this post to the moderator(s)?

Add after:
        if ($message['id'] == $context['topic_first_message'])
echo'           
<br/>
       <span style="float:left;">
<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical">Tweet</a></span>';


That's it!  Have fun!  ;)
Mick is an American theme designer for Simple Machines Forum software currently living in South Florida, USA. He runs idesignSMF and started tinkering with SMF in 2006 where he created several SMF forums of his own before he founded idesignSMF in 2009 to which he is dedicated full time.
    
0 Comments

Get more stuff like this

Subscribe to our mailing list and get interesting content and updates.