The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
![]() |
|||||||||||||||||||||||||||||||||||
Twitter - Tweet Button in SHOWTHREAD
![]() Developer Last Online: Aug 2023 ![]() ![]()
This mod is now outdated and as a result support for new installs will be limited, if any.
-July 7, 2011- Please instead use my new mod which offers Twitter and many more share options for VB 4.x without template edits. WARNING - It appears vBulletin has changed the location of the Facebook Like button in version 4.1.2. As a result it is likely the code changes below will be different in 4.1.2 and beyond, I will not be able to support installs beginning with version 4.1.2 since my license stops at 4.0.8. Twitter released their new TWEET button. Live Demo: http://www.juot.net/forums/showthread.php?t=41185 (Note my Live Board is VB 3.8, but I have tested this on 4.0.4 and 4.0.6) (Update I have for the time being replaced the Tweet button with the Add This share button on my live forum. See the screen shots instead.) I have tested this in latest versions of IE / Firefox / Chrome / Safari / Opera and it should work in all. This will show you how to add this simple code to your SHOWTHREAD template above the page navigation bar, if visible. If you DO NOT use the built-in Facebook Like button do the following: Go to the Admin CP -> Styles & Templates -> Style Manager Edit your SHOWTHREAD Template Find: (The first instance of) Code:
<vb:if condition="$pagenav"> {vb:raw pagenav} </vb:if> Code:
<vb:if condition="!in_array($GLOBALS[forumid], array(X, Y, Z))"> <div id="mytweetbutton" align="right" style="height:27px;"> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="YOUR_TWITTER_USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> </div> </vb:if> Valid Examples: <vb:if condition="!in_array($GLOBALS[forumid], array(2, 5, 9))"> <vb:if condition="!in_array($GLOBALS[forumid], array(7))"> <vb:if condition="!in_array($GLOBALS[forumid], array(2, 3, 4, 5, 6, 7, 8))"> If none of your forums are private or you want to enable this in every forum you can remove the lines: Code:
<vb:if condition="!in_array($GLOBALS[forumid], array(X, Y, Z))"> and </vb:if> If you DO USE the built-in Facebook Like button do the following: Find: Code:
{vb:raw fblikebutton} Code:
<div id="fb_likeframe" style="border: none; overflow: hidden; height: 27px; width: 95px; vertical-align: text-bottom; padding-top:1px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="YOUR_TWITTER_USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>{vb:raw fblikebutton} The Tweet button will now show up next to the Facebook Like button in anytime the Facebook Like button is displayed in a thread. ---- When you hit the Tweet button you will be given a box to type a message if you're logged in. If you're not logged in you will be asked to login or join, all within the pop-up window. This button code will count the number of tweets people have made using it. For other options including the button with no counter visit: http://twitter.com/goodies/tweetbutton The screen shots show the Tweet button both with and without the page navigation bar, and with the Facebook Like button. Please click Install if you use this. ![]() Download the .txt file for a copy of the install instructions. :up: ---- Known Issues- a few people have reported a 'slash' is missing in the URL submitted to Twitter on some boards. Other people have said URL's with non-english characters cause a URL error. The solution for both of these issues is in post #143 in this thread. Also Twitter appears to be having widespread issues with the counter not working. Some sites it works, some it don't, sometimes it stops working, sometimes it starts working for no reason. If you find your count isn't working try the solution in post #147. If that doesn't work than disable your counter completely if you want by changing the word "horizontal" to "none" in the twitter code. Download Now
Screenshots
Show Your Support
|
Comments |
#152
|
|||
|
|||
![]()
Is there a way to have it show the follow-up screen that suggests to follow a user after they click tweet.... namely the user that I'm already inserting for the "via" part of the tweet? Thanks.
|
#153
|
||||
|
||||
![]()
They should already see the 'via' user as a suugested follower- if it's not YOU tweeting since you can't follow yourself... you can add an additional suggested follow by adding:
Code:
data-related="2ndUSERNAME" Code:
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="YOUR_TWITTER_USERNAME" data-related="2ndUSERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> |
#154
|
|||
|
|||
![]()
Installed and I believe its working (not planning on setting up a 2nd tweet account to test from a 3rd party view). But I was able to tweet myself using the original code.
4.1 PL2 |
#155
|
|||
|
|||
![]()
I don't think it's working for me. It installed correctly, but when I click the Tweet button, it says that Twitter is over capacity. But in another window I am logged into Twitter and it's working fine/not at capacity...
Also, I am using the mod that works WITH the Facebook one built-in to vB 4.x. EDIT: This is the url from the Twitter pop-up window: "http://twitter.com/share?_=1294397124377&count=horizontal&original_re ferer=http%3A%2F%2Fslayalive.c om%2Fshowthread.php%2F758-New-Feature-Tweet-This!%3Fp%3D12354&text=New%20Feature%3A%20Tweet%20 This!&url=http%3A%2F%2Fslayali ve.comshowthread.php%2F758-New-Feature-Tweet-This!&via=SlayAliveForum" Doesn't seem right. I hope this can be fixed because I really want to use this! |
#156
|
||||
|
||||
![]()
Your info appears correct- Twitter could use different severs for the "Tweet This" button then they do their regular site so it's possible one is over capacity while the other still works- in fact I'm fairly sure different sites tweet buttons get handled by different servers- I would give it a few hours and try again before worrying too much.
If you want me to take a look you can post your exact twitter code used in the template here and I'll double check it for anything suspicious. |
#157
|
|||
|
|||
![]()
Looks like this only happens when there are special characters in the thread title, i.e - !?.,@ and so on. Threads that do not include special characters in the title work fine. Otherwise I get that "at capacity" message. Weird.
|
#158
|
||||
|
||||
![]()
See post #143 in this thread to fix the non-English character issue.
|
#159
|
|||
|
|||
![]() Quote:
But I also have vBet which translates my community in a wide range other then English. Should I use the code also or did you update the 1st post to include the fix in post #143? |
#160
|
||||
|
||||
![]()
Post 143 isn't necessary for most people do I didn't include it in post # 1...
The combined code from post 1 and 143 you should use is: Code:
<div id="fb_likeframe" style="border: none; overflow: hidden; height: 27px; width: 95px; vertical-align: text-bottom; padding-top:1px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="YOUR_TWITTER_USERNAME" data-url="{vb:raw vboptions.bburl}/showthread.php?t={vb:raw threadid}">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>{vb:raw fblikebutton} |
#161
|
|||
|
|||
![]() Quote:
![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|