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?

KevinL 02-09-2009 01:27 AM

The twitter thread...

ArnyVee 02-09-2009 01:47 AM

Okay....so, will this allow us to send a Twitter (or a Tweet or whatever it's called! :) ) message to our vB profile? I'm a little confused (although that's not a big surprise ;) ) about what the dilly yo'. :D

King Kovifor 02-09-2009 02:06 AM

It creates a tweet that includes a URL to the specified Post / thread with the default words "check this out" to your Twitted profile. Each user sets up their own profile for this to work.

Wayne Luke 02-09-2009 02:08 AM

Quote:

Originally Posted by King Kovifor (Post 1738196)
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?

Use mcrypt and have the site owner enter a secret phrase in the config.php file (best place for it)... You can then take the secret phrase and generate a seed value that encrypts the login information. Not foolproof since it will be necessary to decrypt the information but should provide enough basic protection.

King Kovifor 02-09-2009 02:16 AM

Quote:

Originally Posted by Wayne Luke (Post 1738278)
Use mcrypt and have the site owner enter a secret phrase in the config.php file (best place for it)... You can then take the secret phrase and generate a seed value that encrypts the login information. Not foolproof since it will be necessary to decrypt the information but should provide enough basic protection.

Thanks! I'll look into that! And i'm looking at HTTP Basic Auth as the example show it encrypted so if I can figure that out I'll store that.

Brandon Sheley 02-09-2009 02:39 AM

Thank you so much for wanting to make this @KingKovifor :)

I'll be checking back on this as it's developed

[high]* Brandon Sheley clicks install[/high]

Dream 02-09-2009 02:43 AM

Quote:

Originally Posted by King Kovifor (Post 1738221)
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.

Thanks but lets see if other people request it :) this one may be what people want. Personally I'm in doubt whether to add this, as Twitter is in english only right now.

King Kovifor 02-09-2009 02:59 AM

I'm guessing your forum is non-English?

dvsDave 02-09-2009 03:30 AM

this looks very promising! I'll be keeping an eye on it as well. I would suggest trying to automate the template modifications.

/me clicks install

King Kovifor 02-09-2009 03:42 AM

Quote:

Originally Posted by dvsDave (Post 1738335)
this looks very promising! I'll be keeping an eye on it as well. I would suggest trying to automate the template modifications.

[high]* dvsDave clicks install[/high]

Plan on it. :)

AyeCapn 02-09-2009 12:55 PM

I'll install once the template mods are automatic :)

scottct1 02-09-2009 01:37 PM

Quote:

Originally Posted by AyeCapn (Post 1738649)
I'll install once the template mods are automatic :)

Same here. :)

Ricsca 02-09-2009 02:41 PM

Demo?

Brandon Sheley 02-09-2009 05:16 PM

Quote:

Originally Posted by Ricsca (Post 1738732)
Demo?

It just posted a "Tweet" with the phrase "Come check this out" which can be edited, mentioned in the first post, than a link back to the thread that you are checking out. :)

King Kovifor 02-09-2009 06:50 PM

Quote:

Originally Posted by Ricsca (Post 1738732)
Demo?

As Loco.M said, it just posts a Tweet that says something you define and a URL...

Reycer 02-10-2009 01:41 AM

INASTALLED and WORKS like a charm. Thanks for this one! Would love to see you turn something like this into a "Buy Me A Beer Mod" though!

King Kovifor 02-10-2009 06:22 PM

Quote:

Originally Posted by mdelcour (Post 1739283)
INASTALLED and WORKS like a charm. Thanks for this one! Would love to see you turn something like this into a "Buy Me A Beer Mod" though!

Buy me a beer mod?

Wayne Luke 02-10-2009 07:05 PM

Quote:

Originally Posted by King Kovifor (Post 1740090)
Buy me a beer mod?

http://www.blogclout.com/blog/goodie...nation-plugin/

AWS 02-10-2009 07:10 PM

Great addition. I just installed it.

King Kovifor 02-11-2009 12:31 AM

Ah. Thanks Wayne.

Joe Gronlund 02-11-2009 01:08 AM

I really like this mod, but I get many errors when testing it to uninstall, if I ever need too..

Upon uninstalling errors:

Code:

Invalid SQL:
ALTER TABLE `user`  DROP `twitter_password`, `twitter_username`;

MySQL Error  : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`twitter_username`' at line 1
Error Number  : 1064
Request Date  : Tuesday, February 10th 2009 @ 10:00:54 PM
Error Date    : Tuesday, February 10th 2009 @ 10:00:54 PM
Script        : http://www.windows7liveforums.com/admincp/plugin.php?do=productkill

Thanks,,

King Kovifor 02-11-2009 01:12 AM

Your getting errors while testing it? But thanks for the uninstall errors.

Joe Gronlund 02-11-2009 01:21 AM

Quote:

Originally Posted by King Kovifor (Post 1740376)
Your getting errors while testing it? But thanks for the uninstall errors.


No, I was making sure it would uninstall, and it won't.. I was trying to remove it..

King Kovifor 02-11-2009 01:47 AM

Quick fix. Split it up into 2 queries: both same front with a single table name at the end. I'll see about getting a fix out tomorrow.

Joe Gronlund 02-11-2009 01:56 AM

Quote:

Originally Posted by King Kovifor (Post 1740391)
Quick fix. Split it up into 2 queries: both same front with a single table name at the end. I'll see about getting a fix out tomorrow.


Okay,, thank you.....

King Kovifor 02-11-2009 02:24 AM

Anytime.

DotSauce 02-11-2009 03:34 AM

This is cool, I can't wait to try it out cause I have a Twitter vB community (http://TweetSocial.com)

I would love to see an additional feature where users can Tweet *anything* at all directly from the forum. Also Twitter API allows you to define where the tweet is coming from and would give a backlink to the forum for each tweet a user sends out.

Like instead of "from web" or "from twitterific" it would be "from TweetSocial" or "from YourForum"

Thanks for this!

Joe Gronlund 02-11-2009 03:43 AM

Quote:

Originally Posted by DotSauce (Post 1740437)
This is cool, I can't wait to try it out cause I have a Twitter vB community (http://TweetSocial.com)

I would love to see an additional feature where users can Tweet *anything* at all directly from the forum. Also Twitter API allows you to define where the tweet is coming from and would give a backlink to the forum for each tweet a user sends out.

Like instead of "from web" or "from twitterific" it would be "from TweetSocial" or "from YourForum"

Thanks for this!

Great site you have there, being Twitter/Tweet based, and the look/style.. :)

ragtek 02-11-2009 04:58 AM

Quote:

Originally Posted by DotSauce (Post 1740437)
Also Twitter API allows you to define where the tweet is coming from and would give a backlink to the forum for each tweet a user sends out.

realy?

i thought this is not possible for communities, because i also wanted that my add-on have it's own name!

thats from the faq:
Quote:

How do I get ?from [MyApp]? appended to updates sent from my API application?

Just fill out this handy form! Note that you must have a Twitter account and must be signed in to submit the form. We only approve applications and sites that appear legitimate and in the best interest of Twitter, Inc. and our community. We do not approve requests to link to personal sites and weblogs, marketing materials, or anything that rubs us the wrong way.

King Kovifor 02-11-2009 10:12 PM

I'll be posting updates using the @vBTwit account on Twitter. So follow me here:

http://twitter.com/vBTwit


All times are GMT. The time now is 06:32 AM.

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.01911 seconds
  • Memory Usage 1,861KB
  • 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
  • (1)bbcode_code_printable
  • (6)bbcode_html_printable
  • (2)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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