Nik, I've been looking into it further.. it seems like it would be easier just to modify the "most active bloggers" module. If you could provide an adapted version of the below function, so that it just returns the member user ID's given the currently loaded teamblog ID, that would be awesome.
class modEasyBlogMostActiveBloggerHelper
{
function getBloggers(&$params)
{
if(file_exists(JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'helper.php'))
require_once (JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'helper.php');
$mainframe = JFactory::getApplication();
$db = EasyBlogHelper::db();
$count = (INT)trim($params->get('count', 0));
$excludeemptypost = $params->get('excludeemptypost', 0);
$onlyFeatured = $params->get('onlyfeatured', 0);
$catids = $params->get('catid', '');
$catids = ( empty( $catids ) ) ? '' : explode(',' , $catids );
$query = 'SELECT x.*, count(p.`id`) as `post_count` FROM (';
$query .= ' (SELECT a.`id`, a.`registerDate`';
$query .= ' FROM `#__users` AS `a`';
$query .= ' INNER JOIN `#__easyblog_users` AS `b` ON a.`id` = b.`id`';
if( $onlyFeatured )
$query .= ' INNER JOIN `#__easyblog_featured` AS `fb` ON a.`id` = fb.`content_id` and fb.`type` = ' . $db->Quote('blogger');
if(EasyBlogHelper::getJoomlaVersion() >= '1.6'){
$query .= ' INNER JOIN `#__user_usergroup_map` AS `d` ON a.`id` = d.`user_id`';
} else {
$query .= ' INNER JOIN `#__core_acl_aro` AS `c` ON a.`id` = c.`value`';
$query .= ' AND c.`section_value` = ' . $db->Quote('users');
$query .= ' INNER JOIN `#__core_acl_groups_aro_map` AS `d` ON c.`id` = d.`aro_id`';
}
$query .= ' INNER JOIN `#__easyblog_acl_group` AS `e` ON d.`group_id` = e.`content_id`';
$query .= ' AND e.`type` = ' . $db->Quote('group') . ' AND e.`status` = 1';
$query .= ' INNER JOIN `#__easyblog_acl` as `f` ON e.`acl_id` = f.`id`';
$query .= ' AND f.`action` = ' . $db->Quote('add_entry') . ')';
$query .= ' UNION ';
$query .= ' (SELECT a1.`id`, a1.`registerDate`';
$query .= ' FROM `#__users` AS `a1`';
$query .= ' INNER JOIN `#__easyblog_users` AS `b1` ON a1.`id` = b1.`id`';
if( $onlyFeatured )
$query .= ' INNER JOIN `#__easyblog_featured` AS `fb1` ON a1.`id` = fb1.`content_id` and fb1.`type` = ' . $db->Quote('blogger');
$query .= ' INNER JOIN `#__easyblog_acl_group` AS `c1` ON a1.`id` = c1.`content_id`';
$query .= ' AND c1.`type` = ' . $db->Quote('assigned') . ' AND c1.`status` = 1';
$query .= ' INNER JOIN `#__easyblog_acl` as `d1` ON c1.`acl_id` = d1.`id`';
$query .= ' AND d1.`action` = ' . $db->Quote('add_entry') . ')';
$query .= ' ) as x LEFT JOIN `#__easyblog_post` AS p ON x.`id` = p.`created_by`';
if( !empty($catids) )
{
$query .= ' and p.`category_id` IN (' . implode(',', $catids) . ')';
}
if($excludeemptypost)
{
$query .= ' GROUP BY x.`id` HAVING (count(p.`id`) > 0)';
}
else
{
$query .= ' GROUP BY x.`id`';
}
$query .= ' ORDER BY count(p.`id`) DESC';
if($count > 0)
$query .= ' LIMIT ' . $count;
$db->setQuery($query);
$bloggers = $db->loadObjectList();
return $bloggers;
}