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

Recent

Welcome to TinyPortal. Please login or sign up.

May 02, 2024, 02:47:42 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,176
  • Total Topics: 21,220
  • Online today: 127
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 100
  • Total: 100

Roster Page

Started by londonhogfan, May 31, 2006, 06:56:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stigmartyr


stigmartyr

Hey LONDONHOGFAN: I was curious if you could show me just how you got the roster done like the one on: http://www.the-rota.com/index.php?page=5

I want to be able to display a table break-down of all our ranks from Operative on up to our highest ranks.

londonhogfan

#12
well that was just normal HTML

the code posted here is how I got my new roster done...


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

                 $groups = '';
//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, minPosts, onlineColor
FROM {$db_prefix}membergroups WHERE groupName = 'General'
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)
{

//Now get all the user's
$query2 = db_query("SELECT ID_GROUP, ID_MEMBER, realName, avatar, usertitle, emailAddress, hideEmail, lastLogin, location, personalText, totalTimeLoggedIn, dateRegistered, ICQ, AIM, YIM, MSN, hideEmail, emailAddress
FROM {$db_prefix}members WHERE ID_GROUP = " . $data['id'] . " ", __FILE__, __LINE__);

if(db_affected_rows() != 0)
{
echo '<table border="0" cellspacing="1" cellpadding="4" align="center" class="bordercolor">
<tr><td colspan="6" class="titlebg">
<font size="4" face="verdana"><b>[GeN] : ' . $data['name'] . '</b></font></td></tr><tr><td rowspan="70" width="70" class="windowbg" valign="top"><center><img src="http://www.the-rota.com/Themes/Sullen_Madness/images/medium/rank_21.png"></center></td>';
echo '<td class="catbg2" width="230">Alias</td>';
echo '<td class="catbg2" width="80">Name</td>';
echo '<td class="catbg2" width="145">Location</td>';
echo '<td class="catbg2" width="180">Last Active</td>';
echo '<td class="catbg2" width="100">Contact</td>';
echo '</tr><tr>';

while ($row2 = mysql_fetch_assoc($query2))
{

echo '<td class="windowbg" height="40"><a href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '">~RoTa~ <b><font color="' . $data['color'] . '" size="3" face="verdana">' . $row2['realName'] . '</b></font> [GeN]</font></a><br><font size="1"> ' . $row2['personalText'] . '</font></a><td class="windowbg">' . $row2['usertitle'] . '</td>';
echo '</td><td class="windowbg">' . $row2['location'] . '</td>';
                                        echo '<td class="windowbg">' . timeformat($row2['lastLogin']) . '</td>';
//echo '<td class="windowbg">' .  timeformat($row2['dateRegistered']) . '</td>';
echo '<td class="windowbg">';

//Send email row
if($row2['hideEmail'] == 0)
echo '<a href="mailto:', $row2['emailAddress'], '"><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> ';
                                        if (!empty($message['member']['options']['Xfire']))
                                                echo '<a href="http://www.xfire.com/xf/modules.php?name=XFire&file=profile&uname=', $message['member']['options']['Xfire'], '" target="_blank"><img border="0" src="' . $settings['images_url'] . '/Xfire.gif"></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>';
}
}

echo'<br>';


http://www.the-rota.com/?page=30

you need to find the word " General " near the top and change to the exact name of the member group you want to show.  then just look through the code...  I added a rank image for each membergroup, and the tag "~RoTa~" before and position "[GeN]" after each name. so just change or delete that part.

just put the code into an article and test it.  Get everything working how you want and just copy / paste the exact same code below that one (just change the member group...)  Keep going until your done.

Hope that helps.

IchBin

#13
Since I can't get this to work in an article for me (somethings wrong with my TP install) I'll post my additions here and you can test them. :)

It appears after looking more closely at this code that the avatar is already called but it is not displayed. To me it looks like you can just add another column and then in the column that you want the avatar to display you can put this code and it should show the avatar.

' . $row2['avatar'] . '

G6Cad

IchBin, if you need to test something you can use my testsite if you want ....

I PM the info you need if you want  8)

IchBin

Ok, I'll hunt you down if I need to. I can't get it to work on my working site or my test site. So something strange is going on.

stigmartyr

Nothing shows for me in the table when I add PHP Article.  Im not sure what I need to edit to make it work londonhogfan :( Anything I need to change?  No infoz are populating into the table.  Just a single blank row.

londonhogfan

did you change the membergroup name?

Are you sure there are members in that group?

IchBin

Did you get the avatar to work with this yet Hog?

londonhogfan