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,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 588
  • Total: 589
  • @rjen

Add a group to this code

Started by RebelRose, September 13, 2006, 11:55:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joachim

Now it works like charm :up:

Thank you!

Lesmond

I am getting a Database Error with this now, dont know why though I have not changed anything :o anyone know whats going on?
QuoteThe SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
File: /home/sites/xxxxxxxx/public_html/smf/Sources/Load.php(1733) : eval()'d code(9) : eval()'d code
Line: 106

Lesmond

here is the code I am using, if it helps :) this is for the meet the team page

global $txt, $scripturl, $user_info, $context, $modSettings, $ID_MEMBER, $board_info, $settings, $db_prefix;

////////////////////////////////////////  Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(1, 2, 11);
////////////////////////////////////////

$list_by_group = true; // \'true\' for separate sections by group; \'false\' for consolidated list
$include_nonprimary_groups = true; // \'true\' to check for group membership in additional groups; \'false\' for primary only
$include_post_groups = false; // \'true\' to include post-count based group in membership search
$include_moderators = true; // \'true\' to include board moderators on page
$repeats_allowed = false; // \'true\' to allow multiple appearances by member on page (for $list_by_group = true only)

$sort_by = \'name\'; // choices - \'id\' ascending(default), \'posts\' descending, \'name\' ascending

$extra_type = \'none\'; // choices - \'none\'(default), \'board\' links, \'page\' (article) links
///////////////////
// Format - $extra_links[\'<member userid #>\'] = \'<forum board #>\';
//       or $extra_links[\'<member userid #>\'] = \'<TP article #>\';
$extra_links = array();
$extra_links[\'3\'] = \'5\';
$extra_links[\'2\'] = \'11\';

$extra_label_prefix = \'Page of \'; // text to precede member\'s name in link label for extra link
$extra_label_suffix = \'\'; // text to append to member\'s name in link label for extra link

$page_title = \'Meet the team at Lesmonds Place!\';
$page_subtitle = \'The people you will run into while visiting\';

$moderator_group = 3;
///////////////////////////////////////////////////////////////////////////////////////

$sort_ord = \'mem.ID_MEMBER ASC\';
if ($sort_by == \'posts\') $sort_ord = \'mem.posts DESC\';
if ($sort_by == \'name\') $sort_ord = \'mem.realName ASC\';

if (($extra_type != \'board\') && ($extra_type != \'page\')) $extra_type = \'none\';

if ($include_moderators)
{if (!in_array($moderator_group, $groups_list)) $groups_list[] = $moderator_group;}

$groups_to_use = array();
if ($list_by_group)
{$groups_to_use = $groups_list;}
else
{$groups_to_use[] = 0;}

$users_already_listed = array();
$users_already_listed[] = 0;

loadLanguage(\'Profile\');

echo \'<table align=\"center\" width=\"96%\" cellpadding=\"3\" cellspacing=\"2\"><tr>
<td colspan=\"4\"><h2>\', $page_title, \'</h2>
<span class=\"smalltext\">\', $page_subtitle, \'</span><br /></td></tr>\';

if (!$list_by_group)
echo \'<tr><td colspan=\"4\"><br /></td></tr><tr width=\"95%\" style=\"margin-top: 4px;\">
<td class=\"windowbg3\" colspan=\"4\" style=\"border-top: 2px solid #d0d0d0; padding-top: 4px; \"><h2> </h2>
</td></tr>\';

foreach($groups_to_use as $groupnumber)
{
$loaded_ids = array();
$user_profile=array();
$memberContext=array();
$profile=array();
$context[\'TPortal\'][\'team\']=array();

// get the name of the group
$request = db_query(\"
SELECT groupName FROM {$db_prefix}membergroups WHERE ID_GROUP=$groupnumber\", __FILE__, __LINE__);
if(mysql_num_rows($request)>0){
$row = mysql_fetch_row($request);
$groupNameX=$row[0];
mysql_free_result($request);
}

if ($list_by_group) {
$select_where = \'mem.ID_GROUP = \'.$groupnumber;
if ($include_nonprimary_groups) $select_where .= \' OR FIND_IN_SET(\'.$groupnumber.\', mem.additionalGroups)\';
if ($include_post_groups) $select_where .= \' OR mem.ID_POST_GROUP = \'.$groupnumber;
if ($include_moderators && ($groupnumber == $moderator_group)) $select_where = \'mem.ID_MEMBER = m.ID_MEMBER\';
}
else {
$select_where = \'mem.ID_GROUP IN (\' . implode(\', \', $groups_list) . \')\';
if ($include_nonprimary_groups) $select_where .= \' OR FIND_IN_SET(\' . implode(\', mem.additionalGroups) OR FIND_IN_SET(\', $groups_list) . \', mem.additionalGroups)\';
if ($include_post_groups) $select_where .= \' OR mem.ID_POST_GROUP IN (\' . implode(\', \', $groups_list) . \')\';
if ($include_moderators) $select_where .= \'OR mem.ID_MEMBER = m.ID_MEMBER\';
}

$select_where = \'(\' . $select_where . \') AND mem.ID_MEMBER NOT IN (\' . implode(\', \', $users_already_listed) . \')\';

// Load the member\'s data.
$request = db_query(\"
SELECT IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType,
mem.personalText, mem.avatar, mem.additionalGroups, mem.ID_MEMBER as memnum, mem.memberName, mem.ID_GROUP,
mem.usertitle, mem.karmaBad, mem.karmaGood, mem.realName, mem.lastLogin, mem.websiteTitle,
mem.websiteUrl, mem.location, mem.posts, them.value AS teamtext, m.ID_MEMBER as modmem, g.groupName
FROM ({$db_prefix}members AS mem, {$db_prefix}moderators AS m)
LEFT JOIN {$db_prefix}membergroups AS g ON (g.ID_GROUP = mem.ID_GROUP)
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}attachments AS a ON (a.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}themes AS them ON (mem.ID_MEMBER = them.ID_MEMBER AND them.variable = \'teamtext\' AND them.ID_THEME=1)
WHERE $select_where
GROUP BY mem.ID_MEMBER
ORDER BY $sort_ord\", __FILE__, __LINE__);
$new_loaded_ids = array();
$member_count = 0;

while ($row = mysql_fetch_assoc($request))
{
if (!$repeats_allowed) $users_already_listed[$row[\'memnum\']] = $row[\'memnum\'];

$member_count += 1;

$avatar_width = \'\';
$avatar_height = \'\';
if($context[\'browser\'][\'is_ie6\']) $avatar_width = \'width=\"\' . $modSettings[\'avatar_max_width_external\'] . \'\"\';

$context[\'TPortal\'][\'team\'][] = array(
\'username\' => $row[\'memberName\'],
\'usertitle\' => $row[\'usertitle\'],
\'name\' => $row[\'realName\'],
\'groupname\' => ($groupnum == 0) ? $row[\'groupName\'] : $groupNameX ,
\'posts\' => $row[\'posts\'],
\'karmabad\' => $row[\'karmaBad\'],
\'karmagood\' => $row[\'karmaGood\'],
\'location\' => $row[\'location\'],
\'href\' => $scripturl . \'?action=profile;u=\' . $row[\'memnum\'],
\'link\' => \'<a href=\"\' . $scripturl . \'?action=profile;u=\' . $row[\'memnum\'] . \'\" title=\"\' . $txt[92] . \' \' . $row[\'realName\'] . \'\">\' . $row[\'realName\'] . \'</a>\',
\'blurb\' => $row[\'personalText\'],
\'avatar\' => array(
\'name\' => $row[\'avatar\'],
\'image\' => $row[\'avatar\'] == \'\' ? ($row[\'ID_ATTACH\'] > 0 ? \'<img  src=\"\' . (empty($row[\'attachmentType\']) ? $scripturl . \'?action=dlattach;attach=\' . $row[\'ID_ATTACH\'] . \';type=avatar\' : $modSettings[\'custom_avatar_url\'] . \'/\' . $row[\'filename\']) . \'\" alt=\"\" style=\"max-height:280px;max-width:180px;\" border=\"0\" />\' : \'\') : (stristr($row[\'avatar\'], \'http://\') ? \'<img src=\"\' . $row[\'avatar\'] . \'\"\' . $avatar_width . $avatar_height . \' alt=\"\" style=\"max-height:280px;max-width:180px;\" border=\"0\" />\' : \'<img src=\"\' . $modSettings[\'avatar_url\'] . \'/\' . htmlspecialchars($row[\'avatar\']) . \'\" alt=\"\" style=\"max-height:280px;max-width:180px;\" border=\"0\" />\'),
\'href\' => $row[\'avatar\'] == \'\' ? ($row[\'ID_ATTACH\'] > 0 ? (empty($row[\'attachmentType\']) ? $scripturl . \'?action=dlattach;attach=\' . $row[\'ID_ATTACH\'] . \';type=avatar\' : $modSettings[\'custom_avatar_url\'] . \'/\' . $row[\'filename\']) : \'\') : (stristr($row[\'avatar\'], \'http://\') ? $row[\'avatar\'] : $modSettings[\'avatar_url\'] . \'/\' . $row[\'avatar\']),
\'url\' => $row[\'avatar\'] == \'\' ? \'\' : (stristr($row[\'avatar\'], \'http://\') ? $row[\'avatar\'] : $modSettings[\'avatar_url\'] . \'/\' . $row[\'avatar\'])
),
\'last_login\' => empty($row[\'lastLogin\']) ? $txt[\'never\'] : timeformat($row[\'lastLogin\']),
\'last_login_timestamp\' => empty($row[\'lastLogin\']) ? 0 : forum_time(0, $row[\'lastLogin\']),
\'website\' => array(
\'title\' => $row[\'websiteTitle\'],
\'url\' => $row[\'websiteUrl\']
),
\'online\' => array(
\'is_online\' => $row[\'isOnline\'],
\'text\' => &$txt[$row[\'isOnline\'] ? \'online2\' : \'online3\'],
\'image_href\' => $settings[\'images_url\'] . \'/\' . ($row[\'isOnline\'] ? \'useron\' : \'useroff\') . \'.gif\',
),
\'teamtext\' => $row[\'teamtext\'],
\'member_page\' => ($extra_type == \'none\') ? \'\' : empty($extra_links[$row[\'memnum\']]) ? \'\' : $extra_links[$row[\'memnum\']],
);

}
mysql_free_result($request);

if ($member_count > 0)
{
if ($list_by_group)
echo \'<tr><td colspan=\"4\"><br /></td></tr><tr width=\"95%\" style=\"margin-top: 4px;\">
<td class=\"windowbg3\" colspan=\"4\" style=\"border-top: 2px solid #d0d0d0; padding-top: 4px; \"><h2>\' . $groupNameX . \'</h2>
</td></tr>\';

echo \'<tr>\';
        $newrow=0;

foreach($context[\'TPortal\'][\'team\'] as $team)
        {
echo \'
<td valign=\"top\" width=\"18%\">\'.$team[\'avatar\'][\'image\'].\'</td>\';

echo \' <td valign=\"top\" class=\"middletext\" style=\"padding: 2px;\">\';

echo \'<h2 style=\"margin-top: 0; margin-bottom: 4px;\"><b>\'.$team[\'link\'].\'</b></h2>\';

echo \'<b>\'. $team[\'usertitle\'].\'</b><br />\';

if (!$list_by_group)
echo \'<b>\'.$txt[87].\'</b>: \'.$team[\'groupname\'].\'<br />\';

if ($modSettings[\'karmaMode\'] == \'1\')
echo \'<b>\', $modSettings[\'karmaLabel\'], \'</b> \', $team[\'karmagood\'] - $team[\'karmabad\'], \'<br />\';
elseif ($modSettings[\'karmaMode\'] == \'2\')
echo \'<b>\', $modSettings[\'karmaLabel\'], \'</b> +\', $team[\'karmagood\'], \' | -\', $team[\'karmabad\'], \'<br />\';

echo \'<b>\'.$txt[\'lastLoggedIn\'].\'</b>: \'.$team[\'last_login\'].\'<br />\';

echo !empty($team[\'location\']) ? \'<b>\'.$txt[227].\'</b>: \'.$team[\'location\'].\'<br />\' : \'\';

echo !empty($team[\'website\'][\'title\']) ? \'<b>\'.$txt[96].\'</b>: <a href=\"\'.$team[\'website\'][\'url\'].\'\" target=\"_blank\"><u>\'.$team[\'website\'][\'title\'].\'</u></a><br />\' : \'\';

echo $team[\'online\'][\'is_online\'] ? \'<img src=\"\'.$team[\'online\'][\'image_href\'].\'\" alt=\"\" /> \'.$team[\'online\'][\'text\'].\'<br />\' : $team[\'online\'][\'text\'].\'<br />\';

echo \'<b>\'.$txt[86].\'</b>: \'.$team[\'posts\'].\'<br />\';

echo !empty($team[\'blurb\']) ? \'<i>- \'.$team[\'blurb\'].\'</i><br />\' : \'\';

echo !empty($team[\'teamtext\']) ? $team[\'teamtext\'].\'<br />\' : \'\';

if (($extra_type == \'board\') && !empty($team[\'member_page\']))
echo \'<a href=\"\' . $scripturl . \'?board=\' . $team[\'member_page\'] . \'\"><u>\'. $extra_label_prefix . $team[\'name\'] . $extra_label_suffix . \'</u></a><br />\';
if (($extra_type == \'page\') && !empty($team[\'member_page\']))
echo \'<a href=\"\' . $scripturl . \'?page=\' . $team[\'member_page\'] . \'\"><u>\'. $extra_label_prefix . $team[\'name\'] . $extra_label_suffix . \'</u></a><br />\';

echo \'
</td>\';

$newrow++;
if($newrow>1){
$newrow=0;
echo \'</tr><tr><td colspan=\"4\"></td></tr><tr>\';
}
        }
if($newrow=1) echo \'<td colspan=\"2\"></td>\';
echo \'</tr>\';
}

}
echo \'</table>\';

jacortina

Well, I'm lost.  ???

The main query there does a lot of table joins, but it's not really any more extensive than some of the queries used in the SMF scripts.

Also, looking into this, SQL_BIG_SELECTS is supposedly ON (1) by default at connection time.

Lesmond

Thanks J.A, I just don't know what happened it was working fine, then this pops up from nowhere, I haven't added any mods since or changed anything, so I to am lost :(

Brian

Using your code everything is working great.  I have it so it displays the way I want but when a user clicks the link to go to the team page one time I get all the following errors.  Anyone send me in the right direction to get this fixed?
Thank you in advance
Brian

George   Today at 03:13:26 AM 
xx.xx.xxx.xxx     c25303645927c373bb529ec3a8942c5f 
http://mysite/forum2/index.php?page=17 
8: Undefined index: 1
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 151

   George   Today at 03:13:26 AM 
xx.xx.xxx.xxx     c25303645927c373bb529ec3a8942c5f 
http://mysite/forum2/index.php?page=17 
8: Undefined variable: groupnum
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 125

   George   Today at 03:13:26 AM 
xx.xx.xxx.xxx     c25303645927c373bb529ec3a8942c5f 
http://mysite/forum2/index.php?page=17 
8: Undefined index: 5
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 151

   George   Today at 03:13:26 AM 
xx.xx.xxx.xxx     c25303645927c373bb529ec3a8942c5f 
http://mysite/forum2/index.php?page=17 
8: Undefined variable: groupnum
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 125

   George   Today at 03:13:26 AM 
xx.xx.xxx.xxx     c25303645927c373bb529ec3a8942c5f 
http://mysite/forum2/index.php?page=17 
8: Undefined variable: groupnum
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 125

   George   Today at 03:13:26 AM 
xx.xx.xxx.xxx     c25303645927c373bb529ec3a8942c5f 
http://mysite/forum2/index.php?page=17 
8: Undefined variable: groupnum
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 125

   George   Today at 03:13:26 AM 
xx.xx.xxx.xxx     c25303645927c373bb529ec3a8942c5f 
http://mysite/forum2/index.php?page=17 
8: Undefined index: 4
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 151

   George   Today at 03:13:26 AM 
xx.xx.xxx.xxx     c25303645927c373bb529ec3a8942c5f 
http://mysite/forum2/index.php?page=17 
8: Undefined variable: groupnum
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 125


G6Cad

Look for the language files from the snippets and add it to the language files you get the errors from.

JPDeni

The problem with the undefined variable is due to this line:


\'groupname\' => ($groupnum == 0) ? $row[\'groupName\'] : $groupNameX ,


From a cursory glance over your code, I think that if you change it to


\'groupname\' => ($groupnumber == 0) ? $row[\'groupName\'] : $groupNameX ,


you should be all right.

I'm not sure where your undefined index error is coming from, but you should look for some place that uses a conditional statement and a numerical array.

Brian

That fixed the Undefined variable: groupnum
error on line 125. 
Thank You very much
The only errors left are the three Undefined index errors on line 151.
Here is the code I am using on line 151
'member_page' => ($extra_type == 'none') ? '' : empty($extra_links[$row['memnum']]) ? '' : $extra_links[$row['memnum']],

Brian

Ok I have deleted that line and everything seems to be working fine now with no errors.  But since I do not understand php at all even though I have spent countless hours working with it I probably have some pretty messed up code.  This is what I have ended up with.
global $txt, $scripturl, $user_info, $context, $modSettings, $ID_MEMBER, $board_info, $settings, $db_prefix;

////////////////////////////////////////  Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(10, 9, 1);
////////////////////////////////////////

$list_by_group = true; // 'true' for separate sections by group; 'false' for consolidated list
$include_nonprimary_groups = false; // 'true' to check for group membership in additional groups; 'false' for primary only
$include_post_groups = false; // 'true' to include post-count based group in membership search
$include_moderators = false; // 'true' to include board moderators on page
$repeats_allowed = false; // 'true' to allow multiple appearances by member on page (for $list_by_group = true only)

$sort_by = 'name'; // choices - 'id' ascending(default), 'posts' descending, 'name' ascending

$extra_type = 'none'; // choices - 'none'(default), 'board' links, 'page' (article) links
///////////////////
// Format - $extra_links['<member userid #>'] = '<forum board #>';
//       or $extra_links['<member userid #>'] = '<TP article #>';
$extra_links = array();
$extra_links['3'] = '5';
$extra_links['2'] = '11';

$extra_label_prefix = 'Page of '; // text to precede member's name in link label for extra link
$extra_label_suffix = ''; // text to append to member's name in link label for extra link

$page_title = 'Meet the Team!';
$page_subtitle = 'The people you will meet when you come to camp';

$moderator_group = 3;
///////////////////////////////////////////////////////////////////////////////////////

$sort_ord = 'mem.ID_MEMBER ASC';
if ($sort_by == 'posts') $sort_ord = 'mem.posts DESC';
if ($sort_by == 'name') $sort_ord = 'mem.realName ASC';

if (($extra_type != 'board') && ($extra_type != 'page')) $extra_type = 'none';

if ($include_moderators)
{if (!in_array($moderator_group, $groups_list)) $groups_list[] = $moderator_group;}

$groups_to_use = array();
if ($list_by_group)
{$groups_to_use = $groups_list;}
else
{$groups_to_use[] = 0;}

$users_already_listed = array();
$users_already_listed[] = 0;

loadLanguage('Profile');

echo '<table align="center" width="96%" cellpadding="3" cellspacing="2"><tr>
<td colspan="4"><h2>', $page_title, '</h2>
<span class="smalltext">', $page_subtitle, '</span><br /></td></tr>';

if (!$list_by_group)
echo '<tr><td colspan="4"><br /></td></tr><tr width="95%" style="margin-top: 4px;">
<td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2> </h2>
</td></tr>';

foreach($groups_to_use as $groupnumber)
{
$loaded_ids = array();
$user_profile=array();
$memberContext=array();
$profile=array();
$context['TPortal']['team']=array();

// get the name of the group
$request = db_query("
SELECT groupName FROM {$db_prefix}membergroups WHERE ID_GROUP=$groupnumber", __FILE__, __LINE__);
if(mysql_num_rows($request)>0){
$row = mysql_fetch_row($request);
$groupNameX=$row[0];
mysql_free_result($request);
}

if ($list_by_group) {
$select_where = 'mem.ID_GROUP = '.$groupnumber;
if ($include_nonprimary_groups) $select_where .= ' OR FIND_IN_SET('.$groupnumber.', mem.additionalGroups)';
if ($include_post_groups) $select_where .= ' OR mem.ID_POST_GROUP = '.$groupnumber;
if ($include_moderators && ($groupnumber == $moderator_group)) $select_where = 'mem.ID_MEMBER = m.ID_MEMBER';
}
else {
$select_where = 'mem.ID_GROUP IN (' . implode(', ', $groups_list) . ')';
if ($include_nonprimary_groups) $select_where .= ' OR FIND_IN_SET(' . implode(', mem.additionalGroups) OR FIND_IN_SET(', $groups_list) . ', mem.additionalGroups)';
if ($include_post_groups) $select_where .= ' OR mem.ID_POST_GROUP IN (' . implode(', ', $groups_list) . ')';
if ($include_moderators) $select_where .= 'OR mem.ID_MEMBER = m.ID_MEMBER';
}

$select_where = '(' . $select_where . ') AND mem.ID_MEMBER NOT IN (' . implode(', ', $users_already_listed) . ')';

// Load the member's data.
$request = db_query("
SELECT IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType,
mem.personalText, mem.avatar, mem.additionalGroups, mem.ID_MEMBER as memnum, mem.memberName, mem.ID_GROUP,
mem.usertitle, mem.karmaBad, mem.karmaGood, mem.realName, mem.lastLogin, mem.websiteTitle,
mem.websiteUrl, mem.location, mem.posts, them.value AS teamtext, m.ID_MEMBER as modmem, g.groupName
FROM ({$db_prefix}members AS mem)
LEFT JOIN {$db_prefix}moderators AS m ON (m.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS g ON (g.ID_GROUP = mem.ID_GROUP)
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}attachments AS a ON (a.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}themes AS them ON (mem.ID_MEMBER = them.ID_MEMBER AND them.variable = 'teamtext' AND them.ID_THEME=1)
WHERE $select_where
GROUP BY mem.ID_MEMBER
ORDER BY $sort_ord", __FILE__, __LINE__);
$new_loaded_ids = array();
$member_count = 0;

while ($row = mysql_fetch_assoc($request))
{
if (!$repeats_allowed) $users_already_listed[$row['memnum']] = $row['memnum'];

$member_count += 1;

$avatar_width = '';
$avatar_height = '';
if($context['browser']['is_ie6']) $avatar_width = 'width="' . $modSettings['avatar_max_width_external'] . '"';

$context['TPortal']['team'][] = array(
'username' => $row['memberName'],
'usertitle' => $row['usertitle'],
'name' => $row['realName'],
'groupname' => ($groupnumber == 0) ? $row['groupName'] : $groupNameX ,
'posts' => $row['posts'],
'karmabad' => $row['karmaBad'],
'karmagood' => $row['karmaGood'],
'location' => $row['location'],
'href' => $scripturl . '?action=profile;u=' . $row['memnum'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['memnum'] . '" title="' . $txt[92] . ' ' . $row['realName'] . '">' . $row['realName'] . '</a>',
'blurb' => $row['personalText'],
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? '<img  src="' . (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" style="max-height:280px;max-width:180px;" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" style="max-height:280px;max-width:180px;" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" style="max-height:280px;max-width:180px;" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
'last_login' => empty($row['lastLogin']) ? $txt['never'] : timeformat($row['lastLogin']),
'last_login_timestamp' => empty($row['lastLogin']) ? 0 : forum_time(0, $row['lastLogin']),
'website' => array(
'title' => $row['websiteTitle'],
'url' => $row['websiteUrl']
),
'online' => array(
'is_online' => $row['isOnline'],
'text' => &$txt[$row['isOnline'] ? 'online2' : 'online3'],
'image_href' => $settings['images_url'] . '/' . ($row['isOnline'] ? 'useron' : 'useroff') . '.gif',
),
'teamtext' => $row['teamtext'],

);

}
mysql_free_result($request);

if ($member_count > 0)
{
if ($list_by_group)
echo '<tr><td colspan="4"><br /></td></tr><tr width="95%" style="margin-top: 4px;">
<td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2>' . $groupNameX . '</h2>
</td></tr>';

echo '<tr>';
        $newrow=0;

foreach($context['TPortal']['team'] as $team)
        {
echo '
<td valign="top" width="18%">'.$team['avatar']['image'].'</td>';

echo ' <td valign="top" class="middletext" style="padding: 2px;">';

echo '<h2 style="margin-top: 0; margin-bottom: 4px;"><b>'.$team['link'].'</b></h2>';

echo '<b>'. $team['usertitle'].'</b><br />';

if (!$list_by_group)
echo '<b>'.$txt[87].'</b>: '.$team['groupname'].'<br />';


echo !empty($team['location']) ? '<b>'.$txt[227].'</b>: '.$team['location'].'<br />' : '';

echo !empty($team['website']['title']) ? '<b>'.$txt[96].'</b>: <a href="'.$team['website']['url'].'" target="_blank"><u>'.$team['website']['title'].'</u></a><br />' : '';

echo $team['online']['is_online'] ? '<img src="'.$team['online']['image_href'].'" alt="" /> '.$team['online']['text'].'<br />' : $team['online']['text'].'<br />';



echo '
</td>';

$newrow++;
if($newrow>1){
$newrow=0;
echo '</tr><tr><td colspan="4"></td></tr><tr>';
}
        }
if($newrow=1) echo '<td colspan="2"></td>';
echo '</tr>';
}

}
echo '</table>';

This website is proudly hosted on Crocweb Cloud Website Hosting.