Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Twitter - Tweet Button in SHOWTHREAD Details »
Twitter - Tweet Button in SHOWTHREAD
Mod Version: 1.00, by BirdOPrey5 (IB Staff) BirdOPrey5 is offline
Developer Last Online: Sep 2018 I like it Show Printable Version Email this Page

vB Version: 3.8.x Rating: (5 votes - 4.80 average) Installs: 55
Released: 14 Aug 2010 Last Update: 21 Aug 2010 Downloads: 142
Not Supported Template Edits Re-usable Code Translations External Content  

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace With:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change the X, Y, Z in the second line to the forumid's of any private forums you may have. If a guest can't view a forum there is no reason to link a tweet to it. You can add as many or as few forumid's here as you need, just separate each with a comma.
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace "YOUR_TWITTER_USERNAME" with your twitter username, it will be referenced in the tweet- but the tweet will not be from YOU, it will be from whoever hits the tweet button.

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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Be sure to replace "YOUR_TWITTER_USERNAME" and "X, Y, Z" as described above.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	ss_twitter.jpg
Views:	1143
Size:	180.2 KB
ID:	120800   Click image for larger version

Name:	ss_twitter_badic.jpg
Views:	891
Size:	82.3 KB
ID:	120801  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Mini Mods Facebook - Linkhay - Tweet - Yahoo Buzz Share with Above Button Cool saviola8x vBulletin 4.x Template Modifications 24 26 Aug 2010 03:46

Comments
  #2  
Old 14 Aug 2010, 02:03
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
To have just a Tweet button and no count use the following code instead:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

For more options check out: http://twitter.com/goodies/tweetbutton
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #3  
Old 15 Aug 2010, 11:05
busybeeburns busybeeburns is offline
 
Join Date: Feb 2006
thanks! I'm trying also to get the Like button next to it, what code are you using overall?
Reply With Quote
  #4  
Old 15 Aug 2010, 14:42
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
My exact code is:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But I also followed most of the instructions in this facebook mod as well to get facebook to work right... in general facebook is a major PITA compared to twitter. I basically followed all instructions on the facebook mod but used the iframe instead of the built in like button because it worked for me and after days of messing with it I didn't want to risk it not working... but I think things have been straightened out now and you'd be OK in following the instructions exactly.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #5  
Old 15 Aug 2010, 15:33
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Real name: Brandon
thanks for this, I've been using the tweetmeme button, but want to switch it over to the official button soon.
this reminded me
__________________
Reply With Quote
  #6  
Old 15 Aug 2010, 20:25
Carlos X's Avatar
Carlos X Carlos X is offline
 
Join Date: Jun 2007
I'll wait a while before implementing this. I would love to install it, but I'm concerned about security.
Reply With Quote
  #7  
Old 15 Aug 2010, 20:39
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by Carlos X View Post
I'll wait a while before implementing this. I would love to install it, but I'm concerned about security.
Security is always a valid concern although I don't see any possible way this mod could jeopardize your forum's security, it is a fairly basic JavaScript released by some of the most talented developers in the industry- probably better then vBulletin's, not meant in any way to insult vB who themselves are quite good. This mod is just Twitter's own instructions for installing their own Tweet button- I just found what I feel was the best place to put it on a vB forum... anyone is free to put this on any web page, forum or not... If, and I stress IF, there was ever any security issue with this mod it would:
1) Be corrected by Twitter ASAP with no work necessary on your part since this links to twitter's server to download the script.
and
2) Would be limited to, perhaps, security of your twitter account- not the forum in general.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #8  
Old 15 Aug 2010, 21:12
Carlos X's Avatar
Carlos X Carlos X is offline
 
Join Date: Jun 2007
Okie dokie.

So now I'm going to be geared towards SEO because I've got vbSEO installed.

And this includes your version of the facebook "like."
Reply With Quote
  #9  
Old 15 Aug 2010, 21:41
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
This does not include facebook 'like' - I only posted that code in response to a specific question. Copying it won't help you unless you follow the instructions in the facebook mod I linked to.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #10  
Old 17 Aug 2010, 23:47
MylesM MylesM is offline
 
Join Date: Aug 2009
For some reason the counter keeps getting reset to 0...

When ever I click on the counter to search Twitter, it says "No results found" - but when I go to my twitter profile page I can see what I've tweeted.

I'm running 3.8.6 with C-Logic SEO if that helps.
__________________
http://trucksim.org
Reply With Quote
  #11  
Old 18 Aug 2010, 00:48
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
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.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #12  
Old 18 Aug 2010, 09:28
MylesM MylesM is offline
 
Join Date: Aug 2009
Originally Posted by BirdOPrey5 View Post
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.
Thanks for the reply.

For now, I've removed the counter from the Tweet button. It's still a great modification none the less.
__________________
http://trucksim.org
Reply With Quote
  #13  
Old 18 Aug 2010, 09:38
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Real name: Shawn
this is great thanks
__________________
Sorry Guys, just a little busy lately.
Reply With Quote
  #14  
Old 21 Aug 2010, 19:46
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
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-

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #15  
Old 29 Aug 2010, 22:32
Eryeal Eryeal is offline
 
Join Date: May 2006
Odd problem

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?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 06:02.

Layout Options | Width: Wide Color: