Contribute to the development of SMF. Follow the coding discussions taking place on >> Github.

Twitter Button fro SMF 2.0

Mick in Tutorials on Dec 07, 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!  ;)

Tagged with: tip twitter button script code 


Mick

Mick G

idesignsmf.com

    

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 and has a weakness for Tacos and Pizza.


0 Comments




Latest Discussions

Join the conversation

Our Most Popular Features