This simple patch allows you to implement two hooks in a custom module to extend the buddylist table header and row data. With it you can add more items into the table.

For example, http://dstaging.imedstudios.com/files/share/buddy_table.png, was created with

function sandbox_buddylist_buddypage_headers() {
  $headers = array(t('favorite color'), t('action'));
  return $headers;
}

function sandbox_buddylist_buddypage_rowvalues($bid) {
  global $user;
  $profile = (object)array('uid' => $bid);
  profile_load_profile($profile);
  return array($profile->profile_fav_color, '');
}
CommentFileSizeAuthor
#4 buddy_table.png26.96 KBdldege
#1 extend_tables_2.txt1.99 KBdldege
extend_tables.txt1.97 KBdldege
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dldege’s picture

FileSize
1.99 KB

Here's a better version - I didn't realize I was already loading the user in theme('username'...

This version passes the loaded user object to the hook function for the row data instead of the uid.

So, to get, http://dstaging.imedstudios.com/files/share/buddy_table.png

do something like

function sandbox_buddylist_buddypage_headers() {
  $headers = array(t('favorite color'), t('action'));
  return $headers;
}

function sandbox_buddylist_buddypage_rowvalues($buddy) {
  profile_load_profile($buddy);
  return array($buddy->profile_fav_color, l('email', 'mailto:' . $buddy->mail));
}
dldege’s picture

The patch also adds a buddylist_table class to themed buddylist tables to make it simple to style these tables in your theme's CSS.

robertDouglass’s picture

the pngs are no longer available, and I'm sure they are helpful in understanding the patch. Could you please make them available again? Thanks.

dldege’s picture

FileSize
26.96 KB

This is example output using this patch.