Back to vBulletin 3.8 Add-ons

vBTwitter
Mod Version: 1.0.4, by King Kovifor

vB Version: 3.8.x Rating: (32 votes - 4.22 average) Installs: 402
Released: 09 Feb 2009 Last Update: 15 Jul 2009 Downloads: 1925
Not Supported DB Changes Uses Plugins Auto-Template Additional Files Translations  

Description

This modification adds basic Twitter integration to vBulletin. Once a user defines their Twitter username & password within their vB Options (User CP -> Edit Options), the Tweet This X links will appear.

It automatically adds a tweet to their account with the default text of "Check this out! " (which can be edited editing the "twitter_checkout" phrase) and uses your forum URL with either tp or tt.php as the link. These redirect to the thread / post that was tweeted.

Installation
  1. Upload files in the /upload/ folder of the .zip into the directories as is.
  2. Install product file.
  3. Register an OAuth Application https://twitter.com/oauth_clients, using:
    • Application Name: Your Site!
    • Description: Site Integration into Twitter.
    • (I request this one not be changed!) Application Website: vBTwitter
    • Website: Your URL!
    • Application Type: Browser
    • (change url) Callback URL: http://www.yoururl.com/twitter_auth.php
    • Default Access type: Read & Write
  4. Click Install on vB.org
  5. Tell Your users.
  6. Enjoy
Upgrading to v1.0.4
  • Upload all files, overwrite everything.
  • Install product file.
  • Register an OAuth Application https://twitter.com/oauth_clients, using:
    • Application Name: Your Site!
    • Description: Site Integration into Twitter.
    • (I request this one not be changed!) Application Website: vBTwitter
    • Website: Your URL!
    • Application Type: Browser
    • (change url) Callback URL: http://www.yoururl.com/twitter_auth.php
    • Default Access type: Read & Write
  • Gain and copy the Consumer Key & Secret into vBulletin Options.
Upgrading to v1.0.3 or before.
  • Upload all files, overwrite everything.
  • install product file.
  • Remove template edits. For the record, they are here:
    • Open the postbit or postbit_legacy template (depending on what you use). Find:
      HTML Code:
      <if condition="$show['postcount']">#<a href="showpost.php?$session[sessionurl]p=$post[postid]&amp;postcount=$post[postcount]" target="new" rel="nofollow" id="postcount$post[postid]" name="$post[postcount]"><strong>$post[postcount]</strong></a></if>
      Add before that:
      HTML Code:
      <if condition="$post['twitter_username']"><a href="tweet.php?do=post&amp;id=$post[postid]&amp;c=$post[postid]">Tweet this post!</a></if>
    • Open the SHOWTHREAD template.
      Find:
      HTML Code:
      	<if condition="$show['addpoll']">
      	<tr>
      		<td class="vbmenu_option"><img class="inlineimg" src="$stylevar[imgdir_button]/addpoll.gif" alt="$vbphrase[add_a_poll]" /> <a href="poll.php?$session[sessionurl]do=newpoll&amp;t=$threadinfo[threadid]">$vbphrase[add_a_poll_to_this_thread]</a></td>
      	</tr>
      	</if>
      Add After:
      HTML Code:
      	<if condition="$vbulletin->userinfo['twitter_username']">
      	<tr>
      		<td class="vbmenu_option">
      			<a href="tweet.php?do=thread&ampid=$threadinfo[threadid]">Tweet This  Thread!</a>
      		</td>
      	</tr>
      	</if>
      Find:
      HTML Code:
      		<if condition="!$show['search_engine']">
      			<div><img class="inlineimg" src="$stylevar[imgdir_button]/printer.gif" alt="$vbphrase[show_printable_version]" vspace="1" /> <a href="printthread.php?$session[sessionurl]t=$threadid" rel="nofollow">$vbphrase[show_printable_version]</a></div>
      			<div><img class="inlineimg" src="$stylevar[imgdir_button]/sendtofriend.gif" alt="$vbphrase[email_this_page]" vspace="1" /> <a href="sendmessage.php?$session[sessionurl]do=sendtofriend&amp;t=$threadid" rel="nofollow">$vbphrase[email_this_page]</a></div>
      		</if>
      Add After:
      HTML Code:
      		<if condition="$vbulletin->userinfo['twitter_username']"><a href="tweet.php?do=thread&amp;id=$threadinfo[threadid]">Tweet This  Thread!</a></if>
Requirements

THIS MODIFICATION REQUIRES PHP 5 DUE TO THE CLASS THAT IS USED!

PHP'S CURL EXTENSION IS ALSO USED! THE API CALLS ARE COMPLETELY DEPENDENT ON THEM!


This modification should work on vBulletin v3.5+, but was only tested on a vB 3.8 install.

Using the "tp.php" switch added in v1.0.2

With the release of v1.0.2, a switch between showpost.php?p=ID&postcount=COUNT and showthread.php?p=ID#postID has been added. Using it is simple, but requires a code edit (Note: This is a SUPPORTED code edit!). Open up tp.php and find this line:

PHP Code:
define('SHOWPOST'true); 
Change that line to this:

PHP Code:
define('SHOWPOST'false); 

This will automatically trigger the change any time it is loaded. This works retroactively and any links will automatically use the new settings once changed!

Download

File Type: %1$s vBTwitter v1.0.4.zip (13.2 KB, 1235 downloads)

Supporters / CoAuthors

  • ragtek

Screenshots

Click image for larger version
Name:	tweet1.jpg.jpeg
Views:	7850
Size:	81.8 KB
ID:	95497   Click image for larger version
Name:	tweet2.jpg.jpeg
Views:	10186
Size:	89.5 KB
ID:	95498  


vblts.ru supports vBulletin®, 2022-2024