MyBB Community Forums

Full Version: Twitter widget on user profile
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

Is there any plugin available that allow user from usercp to add twitter profile link and this will be display it on user profile?

Please give me the link of plugin that you think closely matches this requirement, I will make modifications in it.

Thanks in advance.
This link is not working.

(2012-02-06, 07:57 AM)Nathan Malcolm Wrote: [ -> ]http://www.mybbcentral.com/thread-3954.html

That is really helpful most of the requirements are covered by this plugin, now I have to show user twitter widget in place of showing twitter link on user profile.

(2012-02-06, 08:02 AM)ranjani Wrote: [ -> ]see profile twitter plugin

^ may be you can add required widget code in member_profile template ...
I have modified the plugin and now using twitter api to show user's twitter profile on user profile section.
^ fine Smile would you like to share the trick (i.e. required editing) here ..
(2012-02-06, 12:41 PM)ranjani Wrote: [ -> ]^ fine Smile would you like to share the trick (i.e. required editing) here ..

Please...

Whenever I try to hook a plugin into a different location, I manage to wipe the template completely...
Here is what I have modified with profile twitter plugin:

1. On plugin activation, in member_profile template I have added {$twitter_widget}

 find_replace_templatesets('member_profile','#{\$memprofile\[\'msn\'\]\}</a></td>#',
        '{$memprofile[\'msn\']}</a></td>
</tr>
<tr>
<td class="trow2"><strong>Twitter:</strong></td>
<td class="trow2">{$twitter_widget}</td>
</tr>');

2. On member_profile_start hook I set {$twitter_widget} with twitter api script (to show user twitter profile).

$plugins->add_hook("member_profile_start", "profiletwitter_check");

function profiletwitter_check(){
	global $mybb, $db, $twitter_widget;

	$query  = $db->query('SELECT twitter FROM ' . TABLE_PREFIX . 'users WHERE uid='.$mybb->input['uid']);
	$row	=	$db->fetch_array($query);
	if(!empty($row['twitter'])){
		$twitter_widget	=	"<script charset=\"utf-8\" src=\"http://widgets.twimg.com/j/2/widget.js\"></script>
		<script>
		new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 30000,
  width: 320,
  height: 150,
  theme: {
    shell: {
      background: '#696b8a',
      color: '#ffffff'
    },
    tweets: {
      background: '#ffffff',
      color: '#474247',
      links: '#2207eb'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    behavior: 'all'
  }
}).render().setUser('".$row['twitter']."').start();</script>";
	}
	else{
		$twitter_widget	=	"N/A";
	}

See twitter.png for the final results. Hope this will be helpful for you Smile
Pages: 1 2