The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Twitter - Tweet Button in SHOWTHREAD Details »» | |||||||||||||||||||||||||||||||||
Twitter - Tweet Button in SHOWTHREAD
Developer Last Online: Aug 2023
Twitter released their new TWEET button.
Live Demo: http://www.juot.net/forums/showthread.php?t=41185 (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 / Opera / Safari. This will show you how to add this simple code to your SHOWTHREAD template below the page navigation bar, if visible. Go to the Admin CP -> Styles & Templates -> Style Manager Edit your SHOWTHREAD Template Find: Code:
<if condition="$show['pagenav']"><td align="$stylevar[right]">$pagenav</td></if> Code:
<td align="$stylevar[right]"><if condition="$show['pagenav']">$pagenav</if> <if condition="!in_array($GLOBALS[forumid], array(X, Y, Z))"> <table border="0"> <tr><td> <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> </td></tr></table> </if> </td> Valid Examples: <if condition="!in_array($GLOBALS[forumid], array(2, 5, 9))"> <if condition="!in_array($GLOBALS[forumid], array(7))"> <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:
<if condition="!in_array($GLOBALS[forumid], array(X, Y, Z))"> and </if> (The second one) 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. I will add more options in later posts. Note- My Screenshot also has the Facebook Like button available as a separate mod here by someone else. If you don't have the facebook like button your Tweet button will be on the right of the page. There is also a basic skin screen shot. Please click Install if you use this. NEW UPDATE!!! Use this code instead it will force the correct URL to Twitter and solve the issue with a different URL being tweeted if thread is tweeted as soon as it's posted. Code:
<td align="$stylevar[right]"><if condition="$show['pagenav']">$pagenav</if> <if condition="!in_array($GLOBALS[forumid], array(X, Y, Z))"> <table border="0"> <tr><td> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="YOUR_TWITTER_USERNAME" data-url="$vboptions[bburl]/showthread.php?t=$thread[threadid]">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> </td></tr></table> </if> </td> Download Now
Screenshots
Show Your Support
|
Благодарность от: | ||
mary_rose082198 |
Comments |
#12
|
||||
|
||||
I'd bet the SEO is the problem... the link being submitted to twitter is the non SEO link, but when you visit the thread you are visiting from a different URL so the counter is zero and always will be.
I noticed the same issue if you tweet a post immediately after you submit it... when you submit a post the URL has the post number appended to the end of the URL, when you browse the thread from a forum though there is no post number just thread id so it's a different URL so the counter is different. The way around this I believe would be to use a canonical link tag in the header but that would be very bad for your SEO purposes because you want the 'seo optimized' url not the vb default one. |
#13
|
|||
|
|||
Quote:
For now, I've removed the counter from the Tweet button. It's still a great modification none the less. |
#14
|
||||
|
||||
this is great thanks
|
#15
|
||||
|
||||
If anyone is using this like I do with the Facebook Like button I added the following code so that the tweet button is centered vertically with the facebook button...
put a <div> around the tweet button code- Code:
<div style="padding-bottom:8px;"> Original Tweet Button Code Here </div> |
#16
|
|||
|
|||
I have a very odd problem .. The twitter icon doesn't show up in 2 of my forums on any threads .. there is absolutely no difference in these forums in the Forum Manager, or Forum Permissions. They are set up the exact same way - the only difference is the name of the forum that I can tell. The icon just doesn't show up at all. Any ideas?
|
#17
|
||||
|
||||
Quote:
Code:
<if condition="!in_array($GLOBALS[forumid], array(X, Y, Z))"> Code:
<if condition="!in_array($GLOBALS[forumid], array(11, 12, 20, 58))"> Code:
<if condition="!in_array($GLOBALS[forumid], array(6))"> If you don't have any forums in which you don't want to display the tweet button I give yo the two lines to remove in the instructions. |
#18
|
|||
|
|||
Thanks this is cool. I instantly got traffic when I tweeted my threads. not sure if they are bots or real people but at least the links are getting out there
|
#19
|
|||
|
|||
I added this and the Facebook button at the same time and people freaked out at seeing their Facebook (Real) name on the forum. Even though only their friends can see that, it made them uncomfortable.
I may add the Tweet button back on. |
#20
|
||||
|
||||
Some people will complain about anything- if they really understood that only people who ALREADY knew their name would see their name they'd have nothing to complain about... but that said the Twitter button doesn't show any personal info to anyone besides the twitter account of the forum admin which you want people to know.
|
#21
|
|||
|
|||
I know and I tried to explain it, but I know that if they aren't comfortable with it, they won't use it.
On my forum, there are a lot of local teachers and city workers who post about their jobs and they are just paranoid that their bosses and co-workers will be able to identify them. If the Facebook note showed that their Username liked it, they would probably be ok with it. I was hoping to use it to generate traffic to the site. Adding the Tweet link back now. Thanks |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|