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: Apr 2020 I like it Show Printable Version Email this Page

vB Version: 4.0.x Rating: (17 votes - 4.71 average) Installs: 145
Released: 14 Aug 2010 Last Update: 21 Aug 2010 Downloads: 298
Not Supported Template Edits Re-usable Code Translations External Content  

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)

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

Above this add:

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

Change the X, Y, Z in the first 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:
<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:

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.

If you DO USE the built-in Facebook Like button do the following:

Find:

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

Replace it with:

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.

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.

----

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

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

Screenshots

Click image for larger version

Name:	ss_tweet_vb4-1.jpg
Views:	2775
Size:	91.2 KB
ID:	120803   Click image for larger version

Name:	ss_tweet_vb4-2.jpg
Views:	1678
Size:	64.6 KB
ID:	120804   Click image for larger version

Name:	ss_tweet_vb4-3.jpg
Views:	1572
Size:	71.9 KB
ID:	121142  

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
Show Thread Enhancements Twitter - Tweet Button in SHOWTHREAD BirdOPrey5 vBulletin 3.8 Template Modifications 58 25 Nov 2012 19:04
Mini Mods Facebook - Linkhay - Tweet - Yahoo Buzz Share with Above Button Cool saviola8x vBulletin 4.x Template Modifications 24 26 Aug 2010 03:46

  #31  
Old 21 Aug 2010, 11:34
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
I agree the tweet button would look better a couple pixels higher but haven't figured that put yet,
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #32  
Old 21 Aug 2010, 12:05
zelnik zelnik is offline
 
Join Date: Aug 2008
Originally Posted by xtremecoders View Post
Why for me is Just fine ?



Maybe you don't place it at the right place.
Place the code after the first </div>, NOT the second....
I will give it another try would be be very difficult to get it onto the same line as the fb connect?! as then you would have the 2 social networking sites next to one another?!

Thanks
Reply With Quote
  #33  
Old 21 Aug 2010, 13:14
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
OK, I have figured out the best place to use this if you also use the Facebook Like button which I guess most do. I have updated the first post with new instructions.

Screen Shot of new location below:

__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #34  
Old 21 Aug 2010, 14:51
zelnik zelnik is offline
 
Join Date: Aug 2008
Originally Posted by BirdOPrey5 View Post
OK, I have figured out the best place to use this if you also use the Facebook Like button which I guess most do. I have updated the first post with new instructions.

Screen Shot of new location below:
Works great however the Twitter box with the number of tweets is cut off on the right so if you change the entry from 90px width to 92px it fixes it.

Is there an easy way of flipping them around to the Twitter button is on the left of the FB button!?

Last edited by zelnik; 21 Aug 2010 at 15:00.
Reply With Quote
  #35  
Old 21 Aug 2010, 16:07
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by zelnik View Post
Works great however the Twitter box with the number of tweets is cut off on the right so if you change the entry from 90px width to 92px it fixes it.

Is there an easy way of flipping them around to the Twitter button is on the left of the FB button!?
Thanks I will update the instructions...

I haven't tested this but I'd imagine putting the {vb:raw fblikebutton} code before the twitter code instead of after it, it may work... such as:

EDIT- I did test it and it does work, however the width should be even longer, 95px works nicely.


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

__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.

Last edited by BirdOPrey5; 21 Aug 2010 at 16:12.
Reply With Quote
  #36  
Old 21 Aug 2010, 17:15
vivamexico55 vivamexico55 is offline
 
Join Date: Apr 2005
Doesn't work with 4.06 and FB Connect enabled, gives me this error:

URL required

'url' parameter does not contain a valid URL.
Reply With Quote
  #37  
Old 21 Aug 2010, 17:31
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Hmmm... it's definitely working for me... where are you getting this error, in the pop-up window? Is there anything else?

Can you give a link to your forum?
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #38  
Old 21 Aug 2010, 19:11
zelnik zelnik is offline
 
Join Date: Aug 2008
Originally Posted by BirdOPrey5 View Post
Thanks I will update the instructions...

I haven't tested this but I'd imagine putting the {vb:raw fblikebutton} code before the twitter code instead of after it, it may work... such as:

EDIT- I did test it and it does work, however the width should be even longer, 95px works nicely.
Thanks works nicely but sods law the icons/buttons are different heights.

Would it be difficult to be able to add the twitter button 1 or 2 pixels lower?

Thanks and marked installed.
Reply With Quote
  #39  
Old 21 Aug 2010, 19:32
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by zelnik View Post
Thanks works nicely but sods law the icons/buttons are different heights.

Would it be difficult to be able to add the twitter button 1 or 2 pixels lower?

Thanks and marked installed.
Yeah good call... if you add the code: padding-top:2px; to the style attribute of the <div> tag it perfectly centers the tweet button with the facebook button. I have updated the code in the top post to reflect this change.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #40  
Old 21 Aug 2010, 20:58
zelnik zelnik is offline
 
Join Date: Aug 2008
thanks works perfectly!
Reply With Quote
  #41  
Old 22 Aug 2010, 06:55
Danoxth Danoxth is offline
 
Join Date: Aug 2006
Originally Posted by baghdad4ever View Post
installed

but there is problem

it send this

http://www.baghdad4ever.netshowthread.php/299978

instead of this url

http://www.baghdad4ever.net/vb/showthread.php/299978

how to fix that?
I'm having the same problem as this, I've checked the contact details in the options and everything is as it should be, any ideas?
Reply With Quote
  #42  
Old 22 Aug 2010, 14:37
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
That's weird but this should fix it...

Edit your headinclude template:

Find:

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

Below it Add:

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

Make sure you change http://www.example.com/forum/ to the URL to your own forums, whatever is before "showthread.php..." when you are viewing a thread. (In the example given it would be: http://www.baghdad4ever.net/vb/)

This will include a canonical link on your threads (and only threads) which over-rides the URL passed to Twitter, with hopefully, the right one now...

If this doesn't work please give me a link to your forums so I can see what is up...
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.

Last edited by BirdOPrey5; 27 Aug 2010 at 22:09.
Reply With Quote
  #43  
Old 22 Aug 2010, 20:01
Danoxth Danoxth is offline
 
Join Date: Aug 2006
That worked, cheers for that - much appreciated
Reply With Quote
  #44  
Old 22 Aug 2010, 20:08
Alucard^'s Avatar
Alucard^ Alucard^ is offline
 
Join Date: Feb 2008
Real name: Laureano
Hi man, nice hack!

I have some little problems... see the image:



I am using this code:


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

What is wrong?

Thanks.
Reply With Quote
  #45  
Old 22 Aug 2010, 20:29
zelnik zelnik is offline
 
Join Date: Aug 2008
Originally Posted by Alucard^ View Post
Hi man, nice hack!

I have some little problems... see the image:
Look at post one and use the code near the bottom and it might work.
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


New To Site? Need Help?

All times are GMT. The time now is 00:25.

Layout Options | Width: Wide Color: