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,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 348
  • Total: 348

Roster Page

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

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Xarcell

I can fix the html part as soon as I get the script to work.

Xarcell

lol, you also didn't close your link tag. Because you posted it here and not within the bbc code tags, SMF added the close url tags.

Xarcell

I can't test it because I can't get it to work. However try this, it should fix your table errors:

//Recruits Group
          $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 = 'Recruit'
         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, MSN
         FROM {$db_prefix}members WHERE ID_GROUP = " . $data['id'] . " ", __FILE__, __LINE__);

         if(db_affected_rows() != 0)
         {
            echo '<table width="200" border="0" cellspacing="1" cellpadding="4" align="center" class="bordercolor">
<tr>
    <td colspan="1" class="titlebg" style="font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif;">' . $data['name'] . '</td></tr>';
           
            while ($row2 = mysql_fetch_assoc($query2))
            {

               echo '<tr><td class="windowbg" height="40"><a title="' . $row2['MSN'] . '"  href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '">::[DsK]:: <span style="' . $data['color'] . '" size="1" face="verdana">' . $row2['realName'] . '</span></a></td><td class="windowbg">' . $row2['usertitle'] . '</td></tr>';
             }
                             echo '</table>';
          }
       }

stigmartyr

Im using an array borrowed from Londonhogfan. Ã, If you are using that code Xar, then this is where you enter Member Group name:

Ã, 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 = 'PRECEPTOR'
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" class="bordercolor">
<tr><td colspan="6" class="titlebg">
<font size="4" face="verdana"><b>=[B|C]= : ' . $data['name'] . '</b></font></td></tr><tr><td rowspan="70" width="70" class="windowbg" valign="top"><center><img src="http://black-chapter.com/images/roster/4starGEN.png"></center></td>';
echo '<td class="catbg2" width="230">Alias</td>';
echo '<td class="catbg2" width="80">Title</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'] . '">=[B|C]= <b><font color="' . $data['color'] . '" size="3" face="verdana">' . $row2['realName'] . '</b></font></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>';



^ Whereas the membergroup above is 'PRECEPTOR'


Working Link: http://black-chapter.com/forums/index.php?page=9

Xarcell

I tried, this is the error I get:

Table 'gamemod.membergroups' doesn't exist

stigmartyr

Do you think the server ur on might be running php5?

Xarcell

#36
I compared the 2 scripts and found the error. I also got it to work. Too bad it doesn't work with secondary membergroups.

Here is the fixed script. Shows membergroup, then below tag + name | user title.

* Replace CLAN TAG with your clan tag or remove.
* Replace YOUR MEMBERGROUP with the name of the membergroup you want to use.

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

//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, minPosts, onlineColor
FROM {$db_prefix}membergroups WHERE groupName = 'YOUR MEMBERGROUP'
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 width="100%" border="0" cellspacing="1" cellpadding="4" align="center" class="bordercolor">
<tr>
    <td colspan="2" class="titlebg"><span class="normaltext">' . $data['name'] . '</span></td></tr>';
           
            while ($row2 = mysql_fetch_assoc($query2))
            {

               echo '<tr><td class="windowbg" height="40"><a title="' . $row2['MSN'] . '" class="smalltext" href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '">CLAN TAG ' . $row2['realName'] . '</span></a></td><td class="windowbg"><span class="smalltext">' . $row2['usertitle'] . '</span></td></tr>';
             }
                             echo '</table>';
          }
       }


Here it is without the user title.

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

//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, minPosts, onlineColor
FROM {$db_prefix}membergroups WHERE groupName = 'YOUR MEMBERGROUP'
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 width="100%" border="0" cellspacing="1" cellpadding="4" align="center" class="bordercolor">
<tr>
    <td class="titlebg"><span class="normaltext">' . $data['name'] . '</span></td></tr>';
           
            while ($row2 = mysql_fetch_assoc($query2))
            {

               echo '<tr><td class="windowbg" style="padding: 5px;"><a title="' . $row2['MSN'] . '" class="normaltext" href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '">CLAN TAG ' . $row2['realName'] . '</span></a></td></tr>';
             }
                             echo '</table>';
          }
       }


Maybe I should also add a cell that shows a icon for everyone in that group. A "clan shield" or "medal" so to speak.


Xarcell

#37
Here is the code if you want to add a clan shield/medal before your names.

* Replace CLAN TAG with your clan tag or remove.
* Replace YOUR MEMBERGROUP with the name of the membergroup you want to use.
* Replace CLANSHIELD.jpg with a small image you want to use.

  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 = 'YOUR MEMBERGROUP'
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 width="100%" border="0" cellspacing="1" cellpadding="4" align="center" class="bordercolor">
<tr>
    <td colspan="2" class="titlebg"><span class="normaltext">' . $data['name'] . '</span></td></tr>';
           
            while ($row2 = mysql_fetch_assoc($query2))
            {

               echo '<tr><td class="windowbg2" align="center" valign="middle"><img src="' . $settings['images_url'] . '/CLANSHIELD.jpg" /></td><td class="windowbg" style="padding: 5px;"><a title="' . $row2['MSN'] . '" class="smalltext" href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '">CLAN TAG ' . $row2['realName'] . '</span></a></td></tr>';
             }
                             echo '</table>';
          }
       }

Xarcell

BTW, I also fixed the script so that it doesn't show sessionID in link.

Anyone know how to get it to show secondary membergroups?

stigmartyr

I copied your code on the most bottom post, and I get this error:


Parse error: parse error, unexpected T_STRING in /home/blacsto1/public_html/forums/Sources/Load.php(1607) : eval()'d code(45) : eval()'d code on line 11



This website is proudly hosted on Crocweb Cloud Website Hosting.