• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Tweet Button

Automatically tweet all threads from the forum to one central Twitter account would be rad~
 
Thanks to Ceri May for the visual button code posted over at xenfans.com

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 :)

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>

ands a screenshot of it next to the facebook 'like'

xftweet3.webp
 
I tried it on your website, with my popup blocker it redirects too

Code:
javascript:window.open('http://twitter.com/share?text=XenForo Development - Testing The Tweet Button :)&url=http://xfdev.com/threads/testing-the-tweet-button.4/', 'Tweet', 'height=480,width=640', false);
[/code]

then outputs

Code:
null
 
Looks great Mikey, short and simple.
I am of course hoping for a few more social features to appear in 1.1.x but until then this is very nice to have.
 
I tried it on your website, with my popup blocker it redirects too

Code:
javascript:window.open('http://twitter.com/share?text=XenForo Development - Testing The Tweet Button :)&url=http://xfdev.com/threads/testing-the-tweet-button.4/', 'Tweet', 'height=480,width=640', false);
[/code]

then outputs

Code:
null
the answer lies within your post - "popup blocker" - this uses javascript to make it popup, even the official tweet button has it pop up, there is a version in the .txt file to use a non popup version, but if you have a popup blocker, of course this edit wont work for you :rolleyes:
 
confused, can you add the bit to add tweet button in the oppisite side of facebook in the main thread? -.-
 
That's very odd, it works fine on my xfdev.com site.

Have you filled out the "Board URL" & "Home Page URL" in the "Basic Board Information"?

Yes I have, just looked over those settings and both are filled in with the right details.
 
I am going to sound really stupid. I know tweet is popular but I never did anything tweet related.

I am sure it is great but what does tweeting actually do?
 
Automatically tweet all threads from the forum to one central Twitter account would be rad~

best solution i can suggest.

use yahoo pipes to combine the rss feeds of all the forums (since XF seems to lack a combined RSS for the entire forum). feed that RSS to a service like twitterfeed or dlvr.it. and it would work fine. i am currently feeding the rss from this forum to a twitter account named @xentweets. :)
 
best solution i can suggest.

use yahoo pipes to combine the rss feeds of all the forums (since XF seems to lack a combined RSS for the entire forum). feed that RSS to a service like twitterfeed or dlvr.it. and it would work fine. i am currently feeding the rss from this forum to a twitter account named @xentweets. :)

=/

xentwee.webp
 
Top Bottom