Template Edit: Tweet Button

Status
Not open for further replies.

Mikey

:mikey:
Staff member
Jan 26, 2008
17,836
692
510
33
Disunited Queendom
mikeylicio.us
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
  • Like
Reactions: 4,480 people

Floris

I'm just me :) Hi.
Staff member
Jan 1, 2001
60,101
1,425
930
47
Netherlands
mrfloris.com
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.
 
  • Like
Reactions: 1,120 people

Cezz

OMG Member
Sep 24, 2010
581
48
255
36
United Kingdom
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 :)
 
  • Like
Reactions: 1,120 people

Spartan

OMG Member
Jul 10, 2008
337
8
225
40
www.deadlystream.com
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
Jan 26, 2008
17,836
692
510
33
Disunited Queendom
mikeylicio.us
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
Jan 26, 2008
17,836
692
510
33
Disunited Queendom
mikeylicio.us
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.