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: 202
  • Total: 202

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.

jacortina

The code you're using first gets the group ID from the group name and then queries to find members using that group ID. If that group ID is blank or null because the name doesn't correspond to any groups, then that could indeed be giving you the problems.

Bloodlvst

Alright, works! Thank you so much for your support and patience!

If you don't feel like helping with this issue it's fine, just something I can't help but ask if it can be done!

Since we have different teams, they all use the same type of ranks, but their rank in one group may be different from the main roster. Would there be a way that if I had ranks CS Joint Chief, BW Joint Chief, that the CS  or WoW  part could be removed from the roster display. Is it even possible?

jacortina

Frankly, if I had to try this, I'd say that you might simply consider making extra member groups and add all the "Joint Chief" members, no matter their team, to a "Joint Chief" membergroup and then key on that.

Other than that, you may have to highly customize the page and make it really problematic to show more than one of these "consolidated rank lists" on any one page.

Bloodlvst

Hmmm I get where you're going. Well I'll try some stuff and see where it takes me.

Thanks for getting me to this point though, I really appreciate it!

Hairy

OK the best one for me I have found here so far is the following:

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

if (isset($_GET['rteam']))
  $rteam = ' AND FIND_IN_SET('. $_GET['rteam'] . ',additionalGroups)';
else
  $rteam = '';

// 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(
  'Administrator',
  'Global Moderator',
  'Server Admin',
  'Server Deputy',
  'Recruiter',
  'Battle Manager',
  'Article Manager',
  '2.8.1 Squad Leader',
//  '2.8.1 Clan Member',
  '2.6 Squad Leader',
  '2.6 Clan Member',
//  'Clan Member',
);

$team[10] = '';
$team[11] = '';
$groups = '';
//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, onlineColor, stars
  FROM {$db_prefix}membergroups", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($query))
{
  $groups[$row['groupName']]  = array(
    'id' => $row['ID_GROUP'],
    'color' => empty($row['onlineColor']) ? '' : $row['onlineColor'],
'stars' => empty($row['stars']) ? '' : substr($row['stars'],2),
  );
}
mysql_free_result($query);

foreach ($rankorder as $rank)
{
//Now get all the users
  $query2 = db_query("
    SELECT ID_GROUP, ID_MEMBER, realName, avatar, memberName, usertitle,
           emailAddress, hideEmail, lastLogin, location, personalText,
           totalTimeLoggedIn, dateRegistered, ICQ, AIM, YIM, MSN,   
           hideEmail, emailAddress, additionalGroups
    FROM {$db_prefix}members
    WHERE ID_GROUP = '" . $groups[$rank]['id'] . "'" .
       " OR FIND_IN_SET(" . $groups[$rank]['id'] . ", additionalGroups)", $rteam, __FILE__, __LINE__);

  if(db_affected_rows() != 0)
  {
    echo '<table border="0" cellspacing="1" cellpadding="5" align="center" class="bordercolor">
      <tr><td colspan="7" class="catbg"><font size="4" face="verdana"><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'] . '"></center></td>';
      echo '<td class="catinfo" width="245"><b>GAMING ALIAS</b></td>';
      echo '<td class="catinfo" width="130"><b>NAME</b></td>';
      echo '<td class="catinfo" width="170"><b>LAST ONLINE</b></td>';
      echo '<td class="catinfo" width="175"><b>CONTACT</b></td></tr><tr>';
      while ($row2 = mysql_fetch_assoc($query2))
      {
        echo '<td class="windowbg" height="40"><a href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '"><b><font size="3" face="verdana">' . $row2['realName'] . '</b>';   
          if ($row2['additionalGroups'] <> '' )
            {
            $addl = explode(',',$row2['additionalGroups']);
            foreach ($team as $key => $value)
              {
              if (in_array($key,$addl))
              echo ' '. $value . ' ';
              }
            }
        echo ' '. $team[$row2['additionalGroups']] . ' ';
        echo '</font></font></a><br><font size="1"> ' . $row2['personalText'] . '</font></a></td><td class="windowbg2">' . $row2['memberName'] . '</td>';
        echo '<td class="windowbg">' . timeformat($row2['lastLogin']) . '</td>';
        echo '<td class="windowbg2" align="left">';

//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> ';

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


But what I want to do is change the "Last Online" part to show the "local time" of the member it is displaying, it would be awesome if anyone knows what to do.

I'm very new to this stuff and had a fiddle but only ended up making it display the local time of the person who is viewing the roster (displayed the same time for everyone) I deleted that so can't remember what I used now  :uglystupid2:

JOSHSKORN

Can someone help me customize this thing?  Let me explain overall what I want, and maybe someone can help put the pieces together.

Member Name, Online, Location, Favorite Game, Xfire

More Info:

Online: Show the member online or member offline image
Location: country flag mod

Favorite Games: A selection from a drop-down list.  I have Custom Profile Fields mod installed where I made a list.  This particular field is called CPGameList.  I'd like this column to check for the selection, and then display the appropriate image (i.e. halo.jpg, halo2.jpg, bf2142.jpg, etc.).  Choices in this list are: Halo, Halo 2, Battlefield 2142.  I'd expand the list myself eventually but I'd need a way to get started.  Let me know where exactly to place the images, too.

XFire: there's an xfire mod I know of, I just haven't installed it. It will only place the small xfire image next to your name in forum posts if you specify your username.  What I'm looking to do, is take this field and generate an xfire image that will display the player's game stats.

Here's sample code generated from xfire.com

<a href="http://profile.xfire.com/myusername"><img src="http://miniprofile.xfire.com/bg/co/type/0/myusername.png" width="440" height="111" /></a>

myusername would have to be replaced with the entry in the xfire profile field.  If no xfire exists, maybe a message saying "Player does not have xfire".

I would have no idea how to code this thing.

Attached is my current Roster, showing: Member Name (display name), and three columns that I don't want: Last Online, Location (city state and country I think), and Contact Info.

If someone could help that would be great!

iGate

is there a way i can add a contrained sized avatar to my roster?.

http://test.ihf.lp.pl/forums/index.php?page=11
i want to use this script:


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(
  '=IHF=Administrator',
  '=IHF= Server Admin',
  '=IHF= Forum G. Mod',
  '=IHF= Forum Moderator',
  '=IHF= Member',
  );

$groups = '';
//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, onlineColor, stars
  FROM {$db_prefix}membergroups", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($query))
{
  $groups[$row['groupName']]  = array(
    'id' => $row['ID_GROUP'],
    'color' => empty($row['onlineColor']) ? '' : $row['onlineColor'],
    'stars' => empty($row['stars']) ? '' : substr($row['stars'],2),
  );
}
mysql_free_result($query);

foreach ($rankorder as $rank)
{
//Now get all the users
  $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 = '" . $groups[$rank]['id'] . "' ", __FILE__, __LINE__);

  if(db_affected_rows() != 0)
  {
    echo '<table border="0" cellspacing="1" cellpadding="5" align="center" class="bordercolor">
      <tr><td colspan="7" class="catbg"><font size="4" face="verdana"><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'] . '"></center></td>';
      echo '<td class="catinfo" width="270"><b>Name</b></td>';
      echo '<td class="catinfo" width="130"><b>N1AME</b></td>';
      echo '<td class="catinfo" width="170"><b>Last Online</b></td>';
      echo '<td class="catinfo" width="100"><b>Location</b></td>';
      echo '<td class="catinfo" width="175"><b>Contact</b></td></tr><tr>';
      while ($row2 = mysql_fetch_assoc($query2))
      {
echo '<td class="windowbg" height="40"><a href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '"><b><font color="' . $groups[$rank]['color'] . '" size="3" face="verdana">' . $row2['realName'] . '</b>';

echo '</font></font></a><br><font size="1"> ' . $row2['personalText'] . '</font></a></td><td class="windowbg2">' . $row2['usertitle'] . '</td>';
        echo '<td class="windowbg">' . timeformat($row2['lastLogin']) . '</td>';
        echo '<td class="windowbg2" align="center">';
        echo '<i>' . $row2['location'] . '</i>';
        echo '</td><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> ';

//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>';
  }
}

Mike-

I got the code to work fine. Just one little problem, I am using the Mirage - Revised theme, and there is a function under 'Portal' that says Team Page. How would I get the roster to show up when someone clicks that button?

Hairy

#218
I'm not sure if this applies to what you are talking about:

Tiny Portal Team page is a feature that is not yet implemented, it might be used in the future.

But you can still do something else, in the TP block manager "add menu item" and point the new menu item to the roster article you created and name as you wish.

Then use "menu manager" to turn on the new menu item and tick the box "sitemap"

Now you should a link for it on your front page

TimUSA

#219
When using the code four here: http://www.tinyportal.net/index.php?topic=5423.msg63479#msg63479

I get this. Anyone know why it is creating the end of this table offset?

Solved this was happening in this line:
<tr><td rowspan="70" width="10" class="profilebg" valign="top">

and I changed to this:
<tr><td rowspan="100" width="10" class="profilebg" valign="top">

This website is proudly hosted on Crocweb Cloud Website Hosting.