vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Profile Enhancements - Twitter Updates in Members Profile (https://vborg.vbsupport.ru/showthread.php?t=166382)

winduff 12-28-2007 10:00 PM

Twitter Updates in Members Profile
 
Compatible with vBulletin 3.6.x and 3.7.0b3

Okay guys, this is my first 'mod'. It's pretty simple, and a more a workaround than mod... Anyway, here goes:

What this does
This adds a profile field wich is then turned into a twitter output. This means, all twitter updates of your users will be displayed in the users profile.
Preview:

https://vborg.vbsupport.ru/attachmen...1&d=1198945279

How to install

Basicly, we add a simple profile field, and then catch it in the output and replace the code. Here goes:

1. Add a Single-Line Text Box via the User Profile Field Manager and name it (for example) Twitter. Leave the rest blank if you like.
2. Go to Style & Templates -> Style Manager -> Choose your style -> Member Info Templates -> memberinfo_customfields
3. Replace the entire content with this:

Code:

<if condition="$profilefield[title]=='Twitter'">
<dt class="smallfont"><strong>$profilefield[title]</strong>:</dt>
<div id="twitter_div">
<ul id="twitter_update_list"></ul></div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script text="text/javascript" src="http://twitter.com/statuses/user_timeline/$profilefield[value].json?callback=twitterCallback2&count=3"></script>
<br><dt class="smallfont">You can add me to your friendslist, my username is <strong>$profilefield[value]</strong></dt>
<else />
<dt class="smallfont"><strong>$profilefield[title]</strong>:</dt>
<dd class="smallfont">$profilefield[value]</dd>
</if>

Note the highlights:
1. 'Twitter' must be the same as the name you gave your new profile field
2. count=3 <-- here you can set how many updates to show. Three is a good value.

And finally, click Install if you use this please :)

Hope you like it, it's simple :)

Btw.: check out www.twitter.com if you don't know what this is all about ;)

ran_iu_Conan 12-29-2007 10:22 PM

do you know ? :-??

Alfa1 12-30-2007 12:37 AM

Interesting.

Is it possible to make this available on profiles of members in certain member groups only? So this can be a supporters feature?

winduff 12-30-2007 01:02 PM

you could add the following condition:


Code:

<if condition="$bbuserinfo[usergroupid] == x">
wich would mean, the twitter function would only be shown if the usergroup is x

for example:

Code:

<if condition="$profilefield[title]=='Twitter'">
<if condition="$bbuserinfo[usergroupid] == 1 OR $bbuserinfo[usergroupid] == 2">
<dt class="smallfont"><strong>$profilefield[title]</strong>:</dt>
<div id="twitter_div">
<ul id="twitter_update_list"></ul></div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script text="text/javascript" src="http://twitter.com/statuses/user_timeline/$profilefield[value].json?callback=twitterCallback2&count=3"></script>
<br><dt class="smallfont">You can add me to your friendslist, my username is <strong>$profilefield[value]</strong></dt>
</if>
<else />
<dt class="smallfont"><strong>$profilefield[title]</strong>:</dt>
<dd class="smallfont">$profilefield[value]</dd>
</if>

you can add as many OR's as you like, wich would mean ( in this example) usergroups 1 and 2 can use this function. Any other usergroup who set a twitter account would just not show up

Alfa1 12-30-2007 01:55 PM

Doesn't that only SHOW the function to members within a certain member group, instead of allowing the function only on profiles of members within a certain member group?

winduff 12-30-2007 02:06 PM

oh yeah true, my bad wrong thinking... will come up with sth later for you okay?

Alfa1 12-30-2007 02:25 PM

Super.

Big Daddy Payne 12-30-2007 02:58 PM

Fantastic! Thank you So Much for this!

gforce75 12-30-2007 04:29 PM

Nice hack

Hornstar 12-31-2007 06:48 AM

I have not got myself involved in Twitter yet, but I may see if my members have ^^ THanks for sharing this.


All times are GMT. The time now is 10:42 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.03785 seconds
  • Memory Usage 1,736KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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