I want a block to list members of a group. For instance I have a block that I type in on the right hand side of my clan site for members of the clan. http://www.digitalserialkillers.com
I want to list all members from a member group called clan. Any ideas?
This may work to show a certian group in a block.
WHERE groupName = 'Enter The Group Name Here!'
(This must be the exact name of the group in your Membergroups.)
global $db_prefix, $scripturl, $txt, $user_info,$settings, $modSettings;
$groups = '';
// Show Group
$query = db_query("SELECT ID_GROUP, groupName, minPosts, onlineColor
FROM {$db_prefix}membergroups WHERE groupName = 'Enter The Group Name Here'
ORDER BY groupName", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($query))
{
$groups[$row['ID_GROUP']] = array(
'id' => $row['ID_GROUP'],
'name' => $row['groupName'],
'color' => empty($row['onlineColor']) ? '' : $row['onlineColor'],
);
}
mysql_free_result($query);
foreach ($groups as $id => $data)
{
$query2 = db_query("SELECT ID_GROUP, ID_MEMBER, realName, emailAddress
FROM {$db_prefix}members WHERE ID_GROUP = " . $data['id'] . " ", __FILE__, __LINE__);
if(db_affected_rows() != 0)
{
echo '<table border="0" cellspacing="0" cellpadding="2" width="100%">';
echo '<tr>';
//echo '<td class="catbg2">' . $data['name'] . '</td>';
echo '</tr>';
while ($row2 = mysql_fetch_assoc($query2))
{
echo '<tr>';
echo '<td class="windowbg"><a href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '"><font color="' . $data['color'] . '">' . $row2['realName'] . '</font></a></td>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
}
}
DIdn't give a list of users, did give one of the users, but unable to resolve why it choose that specific person.
it will only list the users in that membergroup, is that not what your lookin for?
yes, it only listed ONE person in that group. IT's not even the latest person, so I have no idea why this person was even listed.
Look for a post in TP support called "The Team Page.....Awesome!" or something like that. On page two Bloc posted the code for it. You could modify it to suite your needs.
http://www.tinyportal.net/smf/index.php?topic=5423.new#new