Template Edit: Tweet Button

Status
Not open for further replies.

Mikey

:mikey:
Staff member
Joined
Jan 26, 2008
Messages
17,836
Attached is the .txt file telling you how to acheive the below affect;

I am talking of course about the button named "Tweet" in the top right hand corner of the threads.

xftweets1.png

xftweet2.png
 

Attachments

  • tweetbuttonforxenforo-mikey-xenfans-com.txt
    1.4 KB · Views: 14

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
Nice one Mikey, thank you for this awesome tweak :D
A lot of people will be using this I suspect.
 

Spartan

OMG Member
Joined
Jul 10, 2008
Messages
337
I will add to my forum for sure.

It's going to be a long time before it's ready for relaunch though.
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
I will add to my forum for sure.

It's going to be a long time before it's ready for relaunch though.

Don't rush it! One of the things Kier and Mike have shown us is that if you care about what you do, and you know what you are doing. That you can take the time to prepare things, finish it and test :)

It is very exciting to see that in a short period a lot of things have already been learned, and shared with the public.
 

Cezz

OMG Member
Joined
Sep 24, 2010
Messages
581
Thanks Mikey, this has been really useful

I did change the code slightly so as to use the official twitter button and counter, but it uses the variables you used so thank you..

PHP:
<a href="http://twitter.com/share" class="twitter-share-button" data-url="{$requestPaths.fullBasePath}{xen:link threads, $thread}" data-text="{$xenOptions.boardTitle} - {$thread.title}" data-count="horizontal">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>

Actually after playing with it for a while I preferred the plain text version you created... Great work :)
 

Spartan

OMG Member
Joined
Jul 10, 2008
Messages
337
Don't rush it! One of the things Kier and Mike have shown us is that if you care about what you do, and you know what you are doing. That you can take the time to prepare things, finish it and test :)

It is very exciting to see that in a short period a lot of things have already been learned, and shared with the public.
Yeah I'm taking it easy this time, I've told my members not to expect anything this side of new year.

There's been a few requests for added functions to the forum and a slight change in what we're about. I didn't bother doing anything as I knew I would be changing to XenForo.
 

Mikey

:mikey:
Staff member
Joined
Jan 26, 2008
Messages
17,836
Thanks Mikey, this has been really useful

I did change the code slightly so as to use the official twitter button and counter, but it uses the variables you used so thank you..

PHP:
<a href="http://twitter.com/share" class="twitter-share-button" data-url="{$requestPaths.fullBasePath}{xen:link threads, $thread}" data-text="{$xenOptions.boardTitle} - {$thread.title}" data-count="horizontal">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>

Actually after playing with it for a while I preferred the plain text version you created... Great work
Thank you for posting the 'official' version, Cezz

If you want this code next to the FaceBook 'like' button, simply follow the info in the .txt and apply it to the template "share_page"

Here is what my share_page template looks like (using Cezz's button code rather than my link)

HTML:
<xen:require css="share_page.css" />

<div class="sharePage">
<div class="facebookLike">
<div class="label faint">{xen:phrase facebook}:</div>
<iframe src="http://www.facebook.com/plugins/like.php?href={xen:urlencode $url}&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=trebuchet+ms&amp;colorscheme=light&amp;height=80" frameborder="0" allowTransparency="true"></iframe>
<a href="http://twitter.com/share" class="twitter-share-button" data-url="{$requestPaths.fullBasePath}{xen:link threads, $thread}" data-text="{$xenOptions.boardTitle} - {$thread.title}" data-count="horizontal">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</div>

</div>

xftweet3.png

Nice one Mikey, thank you for this awesome tweak :D
A lot of people will be using this I suspect.
we may even see it here on xenfans.com? :D
 

Mikey

:mikey:
Staff member
Joined
Jan 26, 2008
Messages
17,836
It's come to my attention that this may not work if youhave not filled out the "Homepage URL" and the "Board URL" in the basic settings of the site. Please fill these out in your XenForo Admin Area if you get any "invalid url" errors from twitter
 
Status
Not open for further replies.
Top