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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,911
  • Total Topics: 21,307
  • Online today: 871
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 511
  • Total: 511

LF code: member list/roster

Started by raxavier69, June 06, 2010, 01:47:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Freddy

#10
I wish you had done that before I spent an hour working on the other script - I did ask.  :o

Nevermind I will take a look.

Freddy

Try this out.  I couldn't test it properly because my forum is not set up for it.  I think it should work :

global $db_prefix, $scripturl, $txt, $settings, $options;

// These must be in the order you wish them to print out on your roster.
// VERY IMPORTANT!!!! -- they must be exactly the same as the group names in the database, including
// capitalization and spaces.
$rankorder = array(
'Council Elder',
'Council Member',
'Dragox Coder',
'Dragoon',
'Xuardian',
'DraX',
'Hatchling'
);

$groups = '';

//Does all the real work here for showing groups.
$query = tp_query("
SELECT id_group, group_name, online_color, stars
FROM {$db_prefix}membergroups", __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($query))
{
$groups[$row['group_name']] = array(
'id' => $row['id_group'],
'color' => empty($row['online_color']) ? '' : $row['online_color'],
'stars' => empty($row['stars']) ? '' : substr($row['stars'],2),
);
}
tpdb_free_result($query);


foreach ($rankorder as $rank)
{
//Now get all the users
$query2 = tp_query("
SELECT id_group, id_member, real_name, avatar, usertitle,
email_address, hide_email, last_login, location, personal_text,
total_time_logged_in, date_registered, icq, aim, yim, msn
FROM {$db_prefix}members
WHERE id_group = '" . $groups[$rank]['id'] . "' ", __FILE__, __LINE__);

if(mysql_affected_rows() != 0)
{
echo '<table border="0" cellspacing="1" cellpadding="5" align="center" class="bordercolor">
<tr><td colspan="7" class="catbg"><font size="3" color="' . $groups[$rank]['color'] . '""><b>' . $rank . '</b></font></td></tr>
<tr><td rowspan="70" width="85" class="profilebg" valign="top">
<center><img src="' . $settings['images_url'] . '/' . $groups[$rank]['stars'] . '">
<br>
<img src="/images/custom/r2/' . $rank . '.png">
</center></td>';

echo '<td class="catinfo" width="270"><b><center>User Name</center></b></td>';
echo '<td class="catinfo" width="170"><b><center>Last Online</center></b></td>';
echo '<td class="catinfo" width="100"><b><center>Awards</center></b></td>';
echo '<td class="catinfo" width="175"><b><center>Contact</center></b></td></tr><tr>';
while ($row2 = mysql_fetch_assoc($query2))
{
echo '<td class="windowbg2"><center><font size="2"> '  . '<a href="' . $scripturl . '?action=profile;u=' . $row2['id_member'] . '"><font color="' . $groups[$rank]['color'] . '"">' . $row2['real_name'] . '</b></center></font></a></td></td>';
echo '<td class="windowbg">' . timeformat($row2['last_login']) . '</td>';
echo '<td class="windowbg2" align="center">';
echo '<div style="overflow: auto; width: 100%;"><a href="', $scripturl, '?action=profile;sa=awards;u=', $row2['id_member'], '"> Members Awards</a> ',  '</div><br />';
echo '</td><td class="windowbg">';
//Send email row
if($row2['hide_email'] == 0)
echo '<a href="mailto:', $row2['email_address'], '"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="email" /></a> ';

if($row2['icq'] != '')
echo '<a href="http://www.icq.com/whitepages/about_me.php?uin=' . $row2['icq'] . '" target="_blank"><img src="http://status.icq.com/online.gif?img=5&icq=' . $row2['icq'] . '" alt="' . $row2['icq'] . '" width="18" height="18" border="0" /></a> ';
if($row2['aim'] != '')
echo '<a href="aim:goim?screenname=' . urlencode(strtr($row2['aim'], array(' ' => '%20'))) . '&message=' . $txt['aim_default_message'] . '"><img src="' . $settings['images_url'] . '/aim.gif" alt="' . $row2['aim'] . '" border="0" /></a> ';
if($row2['yim'] != '')
echo '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($row2['yim']) . '"><img src="http://opi.yahoo.com/online?u=' . urlencode($row2['yim']) . '&m=g&t=0" alt="' . $row2['yim'] . '" border="0" /></a> ';
if($row2['msn'] != '')
echo '<a href="http://members.msn.com/' . $row2['msn'] . '" target="_blank"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $row2['msn'] . '" border="0" /></a> ';

//Send PM row
echo '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $row2['id_member'] . '"><img src="' . $settings['images_url'] . '/im_on.gif" alt="email" /></a></a>';
echo '</td>';
echo '</tr>';
}
echo '</table><br>';
}
}

raxavier69

thanks and sorry. a co-admin saved it and i didnt know until i started testing yours :/

raxavier69


Freddy


This website is proudly hosted on Crocweb Cloud Website Hosting.