So I've installed the buddylist module, and I don't think that the View Groups tab is working correctly. I have set up 2 buddy groups, called Friends and Friends1. But when I go to View Groups, all I see is the buddy that is in Friends (and not the buddies in Friends1). What exactly is the deal with this View Groups window?

Comments

mshaver’s picture

I'm having the same problem. Using the latest 4.7 version: v 1.48.2.24

jbhan’s picture

same issue. can this be repaired? or can we have an option to disable groups?

j

jasonxxx’s picture

I'm very bad speak to english (knew only russian and albanish) - sorry.
So, file buddilist.module , old function buddylist_buddiesgroups_page - fuck off ,
new function buddylist_buddiesgroups_page

function buddylist_buddiesgroups_page($uid) {
  global $user;
  $thisuser = user_load(array('uid' => $uid));
  drupal_set_title(t('%username\'s %buddy groups', array('%username' => $thisuser->name) + buddylist_translation()));

  $headers = array(t('%buddy', buddylist_translation()), t('online'), t('# of %buddies', buddylist_translation()), t("%buddy's posts", buddylist_translation()));

  $result = db_query('SELECT DISTINCT(label), label_id FROM {buddylist_groups} WHERE uid = %d ORDER BY label ASC', $thisuser->uid);
  $groups = array();
  while ($row = db_fetch_object($result)) {
    $groups[$row->label_id] = $row->label;
  }

  if (count($groups) == 0) {
    if ($thisuser->uid == $user->uid) {
      drupal_set_message(t("To organize your %buddies into groups, visit the %edit_groups page", array('%edit_groups' => l(t('edit groups'), "buddylist/$uid/buddies/groups/edit")) + buddylist_translation()));
    }
    return theme('placeholder',t("No groups found."));
  }

  $online_interval = time() - variable_get('user_block_seconds_online', 180);
  $buddies = buddylist_get_buddies($thisuser->uid);
  $headers_group=array(t('Buddies-group name'), t('Buddies'));
  $rows = array();
  foreach ($groups as $label_id => $label) {
    $result = pager_query('SELECT bg.buddy, u.access FROM {buddylist_buddy_group} bg INNER JOIN {users} u ON bg.buddy = u.uid WHERE bg.uid = %d and bg.label_id = %d', 10, 0, NULL, $thisuser->uid, $label_id);
  $user_group=array();
    while ($row = db_fetch_object($result)) {
      $online = $row->access > $online_interval;
      $user_group[] = array(
        l($buddies[$row->buddy]['name'], 'user/'.$row->buddy),
        theme('buddylist_online', $online),
        buddylist_count_buddies($row->buddy),
        l(t('view posts'), 'user/'. $row->buddy. '/track')
      );

    }
   $rows[$label][]=$label;
   $rows[$label][]=theme('table', $headers, $user_group);
  }
  return theme('table', $headers_group, $rows);
}
fago’s picture

please post any corrections as patch!
thanks!

fago’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)