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:24:14 AM

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

How is TP Team page created??

Started by mandos, October 02, 2006, 07:01:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tolisgr


Well, that actualy works  ;D . Thank you a lot!

FireSlash

Sorry to bring this from the dead, but it seems to not work with the new TP.  Perhaps someone knows what changes need made? I can fixx0r it myself but I'm not familiar at all with TP's DB structure, and there's only so much coding you can do in one day before your head implodes :uglystupid2:
global $txt, $scripturl, $user_info;
global $context, $modSettings, $ID_MEMBER;
global $board_info, $settings, $db_prefix;

/////////////////////////////////////////////////////////////////  Enter the desired groups
$groups_list = array(9);
/////////////////////////////////////////////////////////////////
$groups_query1 = 'mem.ID_GROUP IN (' . implode(', ', $groups_list) . ')';
$groups_query2 = '';
$groups_query2 = ' OR FIND_IN_SET(' . implode(', mem.additionalGroups) OR FIND_IN_SET(', $groups_list) . ', mem.additionalGroups)';


        echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-bottom: 2px solid #C7A276; padding-bottom: 4px; "><h2>Idle Minds members</h2>
<span class="smalltext">We develop stuff. Sometimes.</span><br /><br />
</td></tr></table>';


$loaded_ids = array();
    $user_profile=array();
    $memberContext=array();
    $profile=array();
    $context['TPortal']['team']=array();

// 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.ID_MEMBER, mem.memberName, mem.realName , mem.lastLogin, mem.websiteTitle,
mem.websiteUrl, mem.location, mem.posts, them.value AS teamtext, g.groupName
FROM ({$db_prefix}members AS mem, {$db_prefix}membergroups AS g)
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 mem.ID_GROUP = g.ID_GROUP
AND ($groups_query1 $groups_query2)
ORDER BY mem.realName ASC", __FILE__, __LINE__);
$new_loaded_ids = array();
while ($row = mysql_fetch_assoc($request))
{

$avatar_width = '';
$avatar_height = '';

$context['TPortal']['team'][] = array(
'username' => $row['memberName'],
'name' => $row['realName'],
'groupname' => $row['groupName'],
'posts' => $row['posts'],
'location' => $row['location'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" 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="" class="avatar2" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar2" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar2" 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);

echo '<table align="center" width="95%" cellpadding="5" cellspacing="5"><tr>';

    $newrow=0;
foreach($context['TPortal']['team'] as $team)
        {
            echo '
<td valign="top">'.$team['avatar']['image'].'</td>
<td valign="top" width="50%" class="middletext" style="padding: 5px;">
<h2 style="margin-top: 0; margin-bottom: 6px;">'.$team['link'].'</h2>
<b>'.$team['groupname'].'</b><br />
<b>Last seen</b>: '.$team['last_login'].'<br />
<b>Posts</b>: '.$team['posts'].'<br />
' , !empty($team['location']) ? '<b>Location</b>: '.$team['location'].'<br />' : '' , '
' , !empty($team['website']['title']) ? '<b>Website</b>: <a href="'.$team['website']['url'].'" target="_blank">'.$team['website']['title'].'</a><br />' : '' , '
' ,  $team['online']['is_online'] ? '<img src="'.$team['online']['image_href'].'" alt="" /> '.$team['online']['text'].'<br />' : $team['online']['text'].'<br />' , '

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

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

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

G6Cad

#112
The group and member details are not a TP function, it's SMF

And just post a code up and say it's not working is not so good.

Whats not working ? Any errors, if so, what errors ?, whats your setup, whats your theme, and if you read the posting guide, i would not have to ask you this ;)

IchBin

The code you posted worked fine on my site with the latest TP and SMF. Did you change the mebergroup ID in the code to get your group?

FireSlash

Quote from: IchBinâ,,¢ on June 18, 2008, 09:00:33 PM
The code you posted worked fine on my site with the latest TP and SMF. Did you change the mebergroup ID in the code to get your group?
Hmm. It worked fine before upgrading, and now it just shows a blank page. I assumed the problem lied with TP. I'll double check my config and see if anything got mucked up in the conversion, then work from there.

Kethra

I've searched through the thread fully (I think), and I don't think this question has been asked/answered yet.

I'm trying to add the ability to list additional membergroups into the code, but am not very proficient at it.  I was able to get the group numbers listed, but I'd like to list the text.  To clarify, I'd like it the additional groups to be listed as part of the member information, not to have the list sorted by additional membergroup.

My current code is below.  I appreciate any and all help.

Thank you.

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




///////////////////
//
// Format - $member_boards['<member userid #>'] = '<forum board #>';
//
//$member_boards = array();
//$member_boards['1'] = '34';
//$member_boards['9'] = '57';
//$member_boards['12'] = '35';
//$member_boards['4'] = '37';
//$member_boards['52'] = '56';
//$member_boards['3'] = '36';
//$member_boards['65'] = '61';
//$member_boards['5'] = '60';


/////////////////////////////////////////////////////////////////  Enter the desired groups in order of Appearance
$groups_list = array(15,16,9,10,12);
/////////////////////////////////////////////////////////////////

$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[1] = '34';
$extra_links[9] = '57';
$extra_links[12] = '35';
$extra_links[4] = '37';
$extra_links[52] = '56';
$extra_links[3] = '36';
$extra_links[65] = '61';
$extra_links[5] = '60';

$extra_label_prefix = 'Board 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

echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-bottom: 2px solid orange; padding-bottom: 4px; "><h2>Member Roster</h2>
<span class="smalltext">Current Order Members</span><br /><br />
</td></tr></table>';

$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'],
'member_page' => ($extra_type == 'none') ? '' : (!isset($extra_links[intval($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>';

IchBin

See if this works:
<?php
global 
$txt$scripturl$user_info;
global $context$modSettings$ID_MEMBER;
global $board_info$settings$db_prefix;

/////////////////////////////////////////////////////////////////  Enter the desired groups in order of Appearance
$groups_list = array(9);
/////////////////////////////////////////////////////////////////

       
echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-bottom: 2px solid #C7A276; padding-bottom: 4px; "><h2>YOUR HEADLINE HERE</h2>
<span class="smalltext">PUT YOUR DESCRIPTION HERE</span><br /><br />
</td></tr></table>'
;



foreach($groups_list as $groupnumber)
{

$loaded_ids = array();
    
$user_profile=array();
    
$memberContext=array();
    
$profile=array();
    
$context['TPortal']['team']=array();

// get the name of the group
$request tp_query("
                        SELECT group_name FROM 
{$db_prefix}membergroups WHERE id_group=$groupnumber"__FILE____LINE__);
if(tpdb_num_rows($request)>0){
$row tpdb_fetch_row($request);
$groupname=$row[0];
tpdb_free_result($request);
}


$select_columns "
IFNULL(lo.log_time, 0) AS is_online, IFNULL(a.id_attach, 0) AS id_attach, a.filename, a.attachment_type,
mem.personal_text, mem.avatar, mem.id_member, mem.member_name,
mem.real_name,mem.last_login, mem.website_title, mem.website_url, mem.location,   
                        mem.posts,
                        them.value AS teamtext"
;
$select_tables "
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)";

// Load the member's data.
$request tp_query("
SELECT
$select_columns
FROM 
{$db_prefix}members AS mem$select_tables
WHERE mem.id_group = 
$groupnumber
                        ORDER BY mem.member_name ASC"
__FILE____LINE__);
$new_loaded_ids = array();
while ($row tpdb_fetch_assoc($request))
{

$avatar_width '';
$avatar_height '';

$context['TPortal']['team'][] = array(
'username' => $row['member_name'],
'name' => $row['real_name'],
'groupname' => $groupname,
'posts' => $row['posts'],
'location' => $row['location'],
'href' => $scripturl '?action=profile;u=' $row['id_member'],
'link' => '<a href="' $scripturl '?action=profile;u=' $row['id_member'] . '" title="' $txt[92] . ' ' $row['real_name'] . '">' $row['real_name'] . '</a>',
'blurb' => $row['personal_text'],
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > '<img  src="' . (empty($row['attachment_type']) ? $scripturl '?action=dlattach;attach=' $row['id_attach'] . ';type=avatar' $modSettings['custom_avatar_url'] . '/' $row['filename']) . '" alt="" class="avatar2" border="0" />' '') : (stristr($row['avatar'], 'http://') ? '<img src="' $row['avatar'] . '"' $avatar_width $avatar_height ' alt="" class="avatar2" border="0" />' '<img src="' $modSettings['avatar_url'] . '/' htmlspecialchars($row['avatar']) . '" alt="" class="avatar2" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > ? (empty($row['attachment_type']) ? $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['last_login']) ? $txt['never'] : timeformat($row['last_login']),
'last_login_timestamp' => empty($row['last_login']) ? forum_time(0$row['last_login']),
'website' => array(
'title' => $row['website_title'],
'url' => $row['website_url']),
'online' => array(
'is_online' => $row['is_online'],
'text' => &$txt[$row['is_online'] ? 'online2' 'online3'],
'image_href' => $settings['images_url'] . '/' . ($row['is_online'] ? 'useron' 'useroff') . '.gif',
),
'teamtext' => $row['teamtext'],
);


}
tpdb_free_result($request);





echo '<table align="center" width="95%" cellpadding="5" cellspacing="5"><tr>
<td colspan="4" style="border-bottom: 2px solid #C7A276; padding-bottom: 4px; "><h2>' 
$groupname '</h2>
</td></tr><tr><td colspan="4"><br /> </td></tr><tr>'
;


        
$newrow=0;
foreach($context['TPortal']['team'] as $team)
        {
            echo 
'
<td valign="top">'
.$team['avatar']['image'].'</td>
<td valign="top" width="50%" class="middletext" style="padding: 5px;">
<h2 style="margin-top: 0; margin-bottom: 6px;">'
.$team['link'].'</h2>
<b>Last seen</b>: '
.$team['last_login'].'<br />
<b>Posts</b>: '
.$team['posts'].'<br />
, !empty($team['location']) ? '<b>Location</b>: '.$team['location'].'<br />' '' '
, !empty($team['website']['title']) ? '<b>Website</b>: <a href="'.$team['website']['url'].'" target="_blank">'.$team['website']['title'].'</a><br />' '' '
,  $team['online']['is_online'] ? '<img src="'.$team['online']['image_href'].'" alt="" /> '.$team['online']['text'].'<br />' $team['online']['text'].'<br />' '

, !empty($team['blurb']) ? '<i>- '.$team['blurb'].'</i><br />' '' '

,  !empty($team['teamtext']) ? $team['teamtext'].'<br />' '' '

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

Blue Steel

just thought i'd ask.. how did you get the syntax highlighted in that code block.? as i run a coding web site and am looking for something to do that.


IchBin

If you add the <?php tags in a code block in your post, you can put code in them automatically in SMF. You can also use [php][/php] tags to highlight code like this:

$myvar 
"string";
echo 
$myvar;

Blue Steel

ahh ok thanks .. so it only works for php... drats :( .. still looking for an intigrated syntax highlighter for customisable languages that will work in code block and elsewhere..