TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,815
  • Total Topics: 21,284
  • Online today: 85
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 73
  • Total: 74
  • @rjen

Member Group List

Started by scope, June 14, 2006, 06:28:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

scope

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?

ontap

#1
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>';
}
}

scope

DIdn't give a list of users, did give one of the users, but unable to resolve why it choose that specific person.

ontap


it will only list the users in that membergroup, is that not what your lookin for?

scope

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.

IchBin

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.


This website is proudly hosted on Crocweb Cloud Website Hosting.