vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Integration with vBulletin - vBTwitter (https://vborg.vbsupport.ru/showthread.php?t=204694)

King Kovifor 02-08-2009 10:00 PM

vBTwitter
 
1 Attachment(s)
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 here, using:
  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 here, using:
  • 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!

King Kovifor 02-08-2009 11:52 PM

Change Log
  • v1.0.0 - February 8, 2009
    • Initial Release
  • v1.0.1 - February 16, 2009
    • Bug Fixes
      • Ability to uninstall (I fixed the SQL query)
      • Added missing ; in the Tweet this Thread!
      • Fixed bug within the Twitter class that blocked authentication.
    • Completely phrased.
    • New vBTwitter source parameter, any tweets show as coming from this mod (instead of web).
    • Removed extra query on updating options.
    • mcrypt integration (encrypted password)
    • Automatic Template Edits!
    • Image in Tweet this Thread!
  • v1.0.2 - February 21, 2009
    • Bug Fixes
      • Multiple "Tweet this Post" links.
      • Mcrypt decryption errors.
    • Switch for tp.php to redirect to showthread.php or showpost.php.
  • v1.0.3 - March 4, 2009
    • Crucial Bug Fix: New Verification Method!
  • v1.0.4 - July 14, 2009
    • OAuth integration!
    • Shows links to all (including guests for now).
    • Requires setup.

Floris 02-08-2009 11:58 PM

Thanks @KingKovifor, via @Floris

LOL

Dream 02-09-2009 12:04 AM

Nice, just worried about storing twitter passwords... I take it they are not md5ed so to use them on twitter.

I think I'd rather use a popup asking username and password.

King Kovifor 02-09-2009 12:16 AM

Quote:

Originally Posted by Floris (Post 1738174)
Thanks @KingKovifor, via @Floris

LOL

LOL. You got to hear about my development woes!

Quote:

Originally Posted by Dream (Post 1738181)
Nice, just worried about storing twitter passwords... I take it they are not md5ed so to use them on twitter.

I think I'd rather use a popup asking username and password.

I was worried about that too but I need to authenticate and don't know where or how to authenticate without storing it. Pop up would work, but I am thinking of ease of use. Any suggestions?

Dream 02-09-2009 12:34 AM

I'd guess another version of this mod could be made, where anyone can twit anything clicking on "Twit This" that opens a popup window that asks username, password and text to append before URL. I could do it but *yawn* not sure how integration with twitter works. It would be just one php file and one template edit. Also not sure if you can twit posts, or just threads would make more sense. But your idea of twitting not the post text, but a link to the forum is nice.

dirtycrow 02-09-2009 12:35 AM

awesome!

King Kovifor 02-09-2009 12:43 AM

Quote:

Originally Posted by Dream (Post 1738211)
I'd guess another version of this mod could be made, where anyone can twit anything clicking on "Twit This" that opens a popup window that asks username, password and text to append before URL. I could do it but *yawn* not sure how integration with twitter works. It would be just one php file and one template edit. Also not sure if you can twit posts, or just threads would make more sense. But your idea of twitting not the post text, but a link to the forum is nice.

I can add that as a product tomorrow. Admin set option for on / off?

This allows you to tweet posts and threads. My next major feature release plans on adding things that would require edits like it.

KevinL 02-09-2009 12:51 AM

You guys are too much I love it.

After that thread I knew this was coming! Great work!

King Kovifor 02-09-2009 01:06 AM

Quote:

Originally Posted by KevinL (Post 1738231)
You guys are too much I love it.

After that thread I knew this was coming! Great work!

What thread?


All times are GMT. The time now is 11:07 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02912 seconds
  • Memory Usage 1,770KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_html_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete