Buddylist Tab on user profiles

alippai - May 31, 2007 - 17:02
Project:Buddylist
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I think, that a tab on the user profiles would be more useable than the list in their profiles (I've big card's for contacts and an user may have 100+ buddies)

$items[] = array('path' => 'user/'.arg(1).'/buddylist',
'title' => ('Users @buddylist', buddylist_translation()),
'access' => TRUE,
'callback'=> 'buddylist_buddylisting_page',
'callback arguments'=> array(arg(1)),
'type' => MENU_LOCAL_TASK,
);

It's now working for me (as a module :) )

#1

gracearoha - July 20, 2007 - 04:07

I could use this function also. But i am quite a noob and have to ask a very stupid question:

where do i put this code?

Thanks alot for the help.

#2

dldege - July 20, 2007 - 17:02

You'd put that in the hook_menu function of a custom module you'd have to provide.

<?php
function buddylistext_menu($may_cache) {
  if (!
$may_cache) {
   
$items[] = array('path' => 'user/' . arg(1) . '/buddylist',
   
'title' => t('@Buddylist', buddylist_translation()),
   
'access' => user_access('maintain buddy list'),
   
'callback'=> 'buddylist_buddylisting_page',
   
'callback arguments'=> array(arg(1)),
   
'type' => MENU_LOCAL_TASK,
    );
  }
 
  return
$items;
}
?>

See http://drupal.org/node/160386 for details on creating a custom module for holding custom code...

#3

alippai - July 20, 2007 - 18:17

Thx :)

#4

pounard - July 18, 2008 - 14:43

Is this tiny patch will be added and maintained in buddylist future versions ?

It could be configurable via the admin section if buddies must display on a tab or in the profile. I propose my help to make a clean patch for this, but if it will be added and maintained in the future releases.

I have some time, just say yes and I'll do it.

 
 

Drupal is a registered trademark of Dries Buytaert.