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: Jul 2019 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: 297
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:	2772
Size:	91.2 KB
ID:	120803   Click image for larger version

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

Name:	ss_tweet_vb4-3.jpg
Views:	1571
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

Comments
  #2  
Old 14 Aug 2010, 13:15
CMSTemplateZ CMSTemplateZ is offline
 
Join Date: Jun 2010
Cheers for this.... i saw this on DP today.. looks like a handy little addon, i just want to use on the main page so i guess i just need to add the divs without the conditionals ?

Thanks

Last edited by CMSTemplateZ; 14 Aug 2010 at 13:43.
Reply With Quote
  #3  
Old 14 Aug 2010, 13:46
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
If you want to add it to only your main forum page you'd edit the FORUMHOME template instead. I'd recommend finding the code:


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

And Below this adding:

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

So you would not need the conditionals, correct.

Note- if you have the VB4 Suite and want to add it to your main page of the suite you'd have to edit some other template- I don't have the Suite so I can't help you with that.
__________________
-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
  #4  
Old 14 Aug 2010, 14:43
CMSTemplateZ CMSTemplateZ is offline
 
Join Date: Jun 2010
Note- if you have the VB4 Suite and want to add it to your main page of the suite you'd have to edit some other template- I don't have the Suite so I can't help you with that.
Thanks bud for a quick reply... i worked it out.... See Here: http://battlefield3forums.com/content/

I added it to the start of the breadcrumb div and wrapped it in my own custom div to style it a little better... because the facebook like text color can not be changed it's kinda hard to see i will keep playing around with it.

Thanks for this, just hope people still click these buttons, now that every site seems to have them numbers have dropped alot, hopefully the tweet button gets people clicking it.

Cheers again for posting this
Reply With Quote
  #5  
Old 14 Aug 2010, 14:58
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Looks Good.
__________________
-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
  #6  
Old 14 Aug 2010, 18:23
baghdad4ever baghdad4ever is offline
 
Join Date: May 2007
Real name: husam
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?
Reply With Quote
  #7  
Old 14 Aug 2010, 18:27
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
If you go to vbulletin options -> Site Name / URL / Contact Details
are your forum URL and Homepage URL correct?
It looks like your forum url should be: http://www.baghdad4ever.net/vb/
__________________
-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 14 Aug 2010, 18:30
baghdad4ever baghdad4ever is offline
 
Join Date: May 2007
Real name: husam
hi

yes my friend i used http://www.baghdad4ever.net/vb

but i dont know why this problem occur

is there any modification to the code in order to enforce the button to take the forum url?
Reply With Quote
  #9  
Old 14 Aug 2010, 18:45
baghdad4ever baghdad4ever is offline
 
Join Date: May 2007
Real name: husam
i used this code


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


is that ok?
Reply With Quote
  #10  
Old 14 Aug 2010, 19:02
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
It's OK if it works!

Another option is I see you have a facebook tag in the header/header include...
<meta property="og:url" content="YOUR CODE HERE" />
You could add the following line under that:
<link rel="canonical" href="YOUR CODE HERE" />

Use the same code you use for your facebook og:url tag in the canonical tag and that will override the URL the tweet button sends.
__________________
-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
  #11  
Old 14 Aug 2010, 19:12
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
I went to your page, it looks like whatever you're doing is working.
__________________
-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 14 Aug 2010, 20:17
baghdad4ever baghdad4ever is offline
 
Join Date: May 2007
Real name: husam
Originally Posted by BirdOPrey5 View Post
I went to your page, it looks like whatever you're doing is working.

thank u very much
Reply With Quote
  #13  
Old 14 Aug 2010, 20:19
zurrie zurrie is offline
 
Join Date: Apr 2008
Originally Posted by BirdOPrey5 View Post
Another option is I see you have a facebook tag in the header/header include...
<meta property="og:url" content="YOUR CODE HERE" />
You could add the following line under that:
<link rel="canonical" href="YOUR CODE HERE" />

Use the same code you use for your facebook og:url tag in the canonical tag and that will override the URL the tweet button sends.
Hi,

1. Could you explain what is "header/header include" ?

2. is there anyway to put automativ trailing slash on your mod?

nice mode btw, thanks for sharing.

Zurrie
Reply With Quote
  #14  
Old 14 Aug 2010, 20:23
zelnik zelnik is offline
 
Join Date: Aug 2008
I guess Showthread has changed in 4.0.6 as your edits do not work.

I've tried it above and below where you have said to enter it and do not get the desired affect.

Also on your site if you click on the number next to the tweet it finds nothing on Twitter, however I checked on DP and theirs works ok?

See attachment for location problems.
Attached Images
File Type: png tweet.png (5.8 KB, 70 views)
Reply With Quote
  #15  
Old 14 Aug 2010, 20:35
zurrie zurrie is offline
 
Join Date: Apr 2008
This is looks in 4.0.5.
Attached Images
File Type: jpg a.jpg (3.4 KB, 73 views)
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 22:03.

Layout Options | Width: Wide Color: