[TIP] Twitter Button RC4

Started by Mick., December 07, 2010, 12:12:11 AM

Previous topic - Next topic

Mick.

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!  ;)



TheListener

Hey don't spoil BDs fun.

He gets grouchy ya know.

;D

Masterd

Sorry. I think everyone should know that there is a mod that can do this.

Mick.

I didn't know there was a mod for that.  ;)

Masterd

This topic should be moved to the this board. 

Pяηѕѕ LF

hello,

it's the same technique for smf 1.1.13 ?
1.1.21 Default

Mick.


Masterd

But, it's very easy to add it on SMF 1.1.13. I will show you when I will have more time. 

fatburdy

Quote from: Masterd on March 14, 2011, 12:44:19 PM
But, it's very easy to add it on SMF 1.1.13. I will show you when I will have more time.

heh, not trying to be a pain,  but  bump - 

I wanna know this to.  ;)

Masterd

Code is almost the same. :)

Index.template.php

Find this.

<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>

Add this after.

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

Display.template.php

Find this.

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

Add this after.

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

kosher nostra

Is there any way I can just click click to ad this to my forum?  I'm afraid I don't understand codes and html and all that stuff.

pearpandas

Thanks, I'm gonna use this on my new site.

Masterd

Quote from: kosher nostra on March 27, 2011, 03:28:36 PM
Is there any way I can just click click to ad this to my forum?  I'm afraid I don't understand codes and html and all that stuff.

Take a look at what I posted.

Quote from: Masterd on December 07, 2010, 03:58:07 PM
Or you can use this:

http://custom.simplemachines.org/mods/index.php?mod=2111

pearpandas

My site is pretty much a twitter based site, so this is super helpful.  Thanks!

Mick.

Quote from: pearpandas on March 31, 2011, 01:32:57 PM
My site is pretty much a twitter based site, so this is super helpful.  Thanks!
You're most welcome.

I have a twitter update mod in the cue being reviewed at the moment.

When ever you post on twitter, it will show below the SMF menu. Very simple. I use it for announcement, web findings etc.  Click my signature and you can see the demo.

Advertisement: