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

Recent

Welcome to TinyPortal. Please login or sign up.

May 01, 2024, 09:17:15 PM

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

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.

JPDeni

If you're wanting to add one custom profile field, go to http://www.tinyportal.net/index.php?topic=5423.msg182603#msg182603 and start reading there. The explanation of how to do it is in the next several posts.

If you're wanting to add more than once custom profile field, the whole script would have to be rewritten because of the way custom profile fields are stored in the database.

megaspeek

how could i password lock some groups? so that anyone can just enter and show up on the list for that rank?

Deadfire

#322
I have  a question about the roster I'm making How can I make this script select none primary groups as well?


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

echo '
<table border="0" cellspacing="1" cellpadding="5" align="center" class="bordercolor">
<tr>
<td><a href="http://www.site.net/index.php?page=5&option=rank">Rank</a></td>
<td><a href="http://www.site.net/index.php?page=5&option=position">Position</a></td>
<td><a href="http://www.site.net/index.php?page=5&option=section">Section</a></td>
</tr>
</table>
<br />
';
/* this will decide what to do, if you have stuff common to all three put it above this
   then handle the special stuff in here or call functions to do it. */
if (isset($_REQUEST['option'])) {
switch($_REQUEST['option']) {

case 'rank':
default:

// These must be in the order
$rankorder = array(
'Corporal',
  'Specialist',
  'Private First Class',
  'Private E-2',
'Private E-1',
);

break;

case 'position':


// These must be in the order
$rankorder = array(
'Headquarters',
  'Alpha Squad',
  'Bravo Squad',
  'Charlie Squad',
  'Delta Squad',
);

break;

case 'section':


// These must be in the order
$rankorder = array(
'MP',
  'Recruiters',
  'Drill Instructors',
);

break;
}
}

//The meat

$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="25%"><b>GAMING ALIAS</b></td>';
      echo '<td class="catinfo" width="30%"><b>LAST ONLINE</b></td>';
      echo '<td class="catinfo" width="25%"><b>LOCATION</b></td>';
      echo '<td class="catinfo" width="20%"><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 '<td class="windowbg">' . timeformat($row2['lastLogin']) . '</td>';
        echo '<td class="windowbg2" >';
        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>';
        echo '</td>';
        echo '</tr>';
}
    echo '</table><br>';
  }
}

raxavier69

anyone have a working version with current smf/tp?

ZarPrime

raxavier69,

Not likely. :( If you really want something like this, start a new topic in the Block Code Requests Board and reference this topic.

ZarPrime

Bloodlvst

Quote from: raxavier69 on June 06, 2010, 01:38:33 AM
anyone have a working version with current smf/tp?

It doesn't work with 2.0?

IchBin

Assuming you're talking about the code in the first page. There is an image that you'll need to change with your own. Search the cdoe for rank_21.png and you'll see the image code you need to change. See if this works:
global $db_prefix, $scripturl, $txt, $user_info, $settings, $modSettings;

$groups = '';
//Does all the real work here for showing groups.
$query = tpdb_query("SELECT id_group, group_name, min_posts, online_color
FROM {$db_prefix}membergroups WHERE group_name = 'General'
ORDER BY group_name", __FILE__, __LINE__);
while ($row = tpdb_fetch_assoc($query))
{

$groups[$row['id_group']]  = array(
'id' => $row['id_group'],
'name' => $row['group_name'],
'color' => empty($row['online_color']) ? '' : $row['online_color'],
);
}
tpdb_free_result($query);

foreach ($groups as $id => $data)
{
//Now get all the user's
$query2 = tpdb_query("SELECT id_group, id_member, real_name, 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 = " . $data['id'] . " ", __FILE__, __LINE__);

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

while ($row2 = tpdb_fetch_assoc($query2))
{
echo '
                <td class="windowbg" height="40">
                    <a href="' . $scripturl . '?action=profile;u=' . $row2[''] . '">~RoTa~ <b>
                    <font color="' . $data['color'] . '" size="3" face="verdana">' . $row2['real_name'] . '</b>[GeN]</font></a><br />
                    <font size="1"> ' . $row2['personal_text'] . '</font></a>
                </td>
                <td class="windowbg">' . $row2['usertitle'] . '</td>
                <td class="windowbg">' . $row2['location'] . '</td>
                <td class="windowbg">' . timeformat($row2['last_login']) . '</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>
                </td>
            </tr>';
}
echo '
        </table>';
}
}

echo'<br />';