Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Twitter Friends or Followers Updates Details »»
Twitter Friends or Followers Updates
Version: 1.00, by Gemma Gemma is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 4.x.x Rating:
Released: 06-29-2011 Last Update: Never Installs: 10
Template Edits
Re-useable Code Additional Files  
No support by the author.

This is a follow-on from this - https://vborg.vbsupport.ru/showthread.php?t=265541 mod and one from my old community.

I've restricted it for use on ForumHome but you can have it display anywhere or site-wide if you wish

Tested on vB 4.1.x upwards.

What is it?
This will display pictures of your Twitter followers or friends (whom you follow) and their latest tweets in a box below your navbar. (it could quite easily be made into a widget by editing the css file while a few alterations)

How To
1. You need a twitter account profile field (you can skip this step if you already have one) if not:

Add a Single-Line Text Box via the User Profile Field Manager and give it a title and a description so users know what it is for.
Set the Maximum length and Field length to your liking
Field Required: NO
Field Editable by User: YES
Private Field: NO
Field Searchable on Members List: NO
Show on Members List: NO
Regular Expression: Leave Blank

Take note of the profile field number.

2. Download the twitterfields.zip file and extract the contents. Keeping the same file structure upload the css and js folders to your server.

3. In your footer template add the following lines at the end.
Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.twitter-friends-1.0.min.js"></script>
<link rel="stylesheet" href="css/twitterfriends.css"/>
4. In your navbar template add the following lines at the end.
Code:
<vb:if condition="THIS_SCRIPT == 'index'">
<vb:if condition="$bbuserinfo[fieldXX]">
<!-- what's going on box -->
    <div id="wgo" class="collapse wgo_block block">
        <h2 class="blockhead">My Twitter Friends Updates</h2>
        <div class="blockbody formcontrols floatcontainer">
<div class="blockbody subsection userprof_content userprof_content_border" style="width:100%">
<div class="twitter-friends" options="{
   username:'{vb:raw bbuserinfo.fieldXX}',
   friends:1,
   tweet:1,
   header:'<a href=\'_tp_\' title=\'follow me\'><img src=\'_ti_\'/></a><h2>_fr_ Friends / _fo_ Followers</h2>',
   loop:1,
   users:50,
   user_animate:'width'
   }"></div></div></div></div></vb:if></vb:if>
Changing the XX to the profile field number from step 1.

Settings that can be changed

friends:1, ---> change to 0 to show followers
tweet:1, ---> Set this to 1 to display friends' tweets at widget footer. Tweets will also appear as a tool tip when hovering on a friend picture.
loop:1, ---> loop friends pictures animation or not. Set it to 1 to loop or 0 to disable.
users:50, ---> Number of visible friends' pictures on each swap. Note that Twitter will return your latest 100 Followers/Friends. you can choose to show a smaller number of pictures at a time.
user_animate:'width', ---> Customize picture entry animation type. available values are 'width', 'height', 'opacity'

Settings that can be added

tweet_source:1, ---> Show tweet source or not (ex: web, twhirl). set it to 0 to hide.
tweet_image:48, ---> by default tweet avatar image is 48x48. You may scale it down by setting it to something like 32
tweet_stay:5000, ---> Time in milliseconds for a tweet to be shown.

Edit this line <vb:if condition="THIS_SCRIPT == 'index'"> replacing the "index" to display elsewhere or delete that line plus the last </vb:if> to display everywhere.

I've added an example of using a popular tweet account so you can see how it looks.

If anyone wants to further develop any of my addons, you are free to do so.

Download Now

File Type: zip twitterfriends.zip (591.5 KB, 50 views)

Screenshots

File Type: jpg friendstweet.jpg (86.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
BCP Hung

Comments
  #2  
Old 06-30-2011, 01:15 PM
BCP Hung BCP Hung is offline
 
Join Date: May 2011
Location: Vietnam
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good job men !
It will be known as a plugin for mine !
Reply With Quote
  #3  
Old 07-01-2011, 07:30 AM
Gemma's Avatar
Gemma Gemma is offline
 
Join Date: Apr 2004
Location: Scotland
Posts: 1,229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alternatively, if you have a twitter account associated with your site you could show friends/followers updates from that to everyone and remove the need for the profile fields.

Code:
<vb:if condition="THIS_SCRIPT == 'index'">
<!-- what's going on box -->
    <div id="wgo" class="collapse wgo_block block">
        <h2 class="blockhead">My Twitter Friends Updates</h2>
        <div class="blockbody formcontrols floatcontainer">
<div class="blockbody subsection userprof_content userprof_content_border" style="width:100%">
<div class="twitter-friends" options="{
   username:'twitteraccount',
   friends:1,
   tweet:1,
   header:'<a href=\'_tp_\' title=\'follow me\'><img src=\'_ti_\'/></a><h2>_fr_ Friends / _fo_ Followers</h2>',
   loop:1,
   users:50,
   user_animate:'width'
   }"></div></div></div></div></vb:if>
Replacing twitteraccount with the account name ie www.twitter.com/twitteraccount
Reply With Quote
Благодарность от:
djilou
  #4  
Old 08-07-2011, 12:29 AM
webgroup webgroup is offline
 
Join Date: May 2006
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice! Can I show updates from more than 1 twitter account at the same time?
Reply With Quote
  #5  
Old 08-07-2011, 09:14 AM
Gemma's Avatar
Gemma Gemma is offline
 
Join Date: Apr 2004
Location: Scotland
Posts: 1,229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by webgroup View Post
Nice! Can I show updates from more than 1 twitter account at the same time?
I'm not sure. You would need to make separate profile fields for each account and you would need to add the template code a second time. I'm don't know if it would work though or if the script would cause a conflict.
Reply With Quote
  #6  
Old 08-08-2011, 01:49 AM
webgroup webgroup is offline
 
Join Date: May 2006
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed, not working. No images or updates are showing.
Reply With Quote
  #7  
Old 08-08-2011, 04:46 AM
Hanany95 Hanany95 is offline
 
Join Date: May 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks good man! Just one question. Do the users see my follower's tweets or can they import their own account?
Reply With Quote
  #8  
Old 08-08-2011, 07:01 AM
Cybertims Cybertims is offline
 
Join Date: Nov 2005
Location: Bedfordshire
Posts: 203
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by webgroup View Post
Installed, not working. No images or updates are showing.
Same here
Reply With Quote
  #9  
Old 08-08-2011, 09:44 AM
Gemma's Avatar
Gemma Gemma is offline
 
Join Date: Apr 2004
Location: Scotland
Posts: 1,229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by webgroup View Post
Installed, not working. No images or updates are showing.
Quote:
Originally Posted by Cybertims View Post
Same here
In your footer template, find

Code:
<script type="text/javascript" src="js/jquery.twitter-friends-1.0.min.js?T=1"></script>
<link rel="stylesheet" href="css/twitterfriends.css"/>
Replace with:
Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.twitter-friends-1.0.min.js"></script>
<link rel="stylesheet" href="css/twitterfriends.css"/>
Quote:
Originally Posted by Hanany95 View Post
Looks good man! Just one question. Do the users see my follower's tweets or can they import their own account?
If you create the profilefield and your users add their twitter account name then it will show their followers, if they don't fill it in then nothing will show. If you want to display your website's twitter account to everyone use the code in post #3
Reply With Quote
  #10  
Old 08-08-2011, 05:43 PM
webgroup webgroup is offline
 
Join Date: May 2006
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I did not realized that this is an add-on for another plugin.
I installed the other plugin and now its working.

Why it always shows the same 50 friends?
Reply With Quote
Reply

Thread Tools

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

Forum Jump


All times are GMT. The time now is 11:35 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.07581 seconds
  • Memory Usage 2,332KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete