TinyPortal

Development => Block Codes => Topic started by: mandos on October 02, 2006, 07:01:20 PM

Title: How is TP Team page created??
Post by: mandos on October 02, 2006, 07:01:20 PM
Hello there!

I know that the Team Page module will be enabled in v1.0 of TinyPortal
but when I see the "TP Team" here: http://www.tinyportal.net/smf/index.php?page=29
i'm wondering how it is done!

Are there some commands that I can add in an article to show the posts of each member, his avatar etc etc?
Or is this a beta of the module that will be introduced in v1.0

in the second case, i'll just wait
but if TP Team page is generated through article commands I would like to improve my teampage (http://www.tio.gr/index.php?page=24)

thnx in advance
Title: Re: How is TP Team page created??
Post by: rebelrose on October 02, 2006, 07:06:24 PM
You can create a article like that here:


http://www.tinyportal.net/smf/index.php?topic=8555.0;all

or close to it.
Title: Re: How is TP Team page created??
Post by: mandos on October 02, 2006, 07:26:42 PM
thanks :)

quite usefull, now all I have to do is to configure how to add extra text under each person :D
Title: Re: How is TP Team page created??
Post by: rebelrose on October 02, 2006, 07:29:01 PM
Post in that same thread and someone may help you with that.

and your welome
Title: Re: How is TP Team page created??
Post by: Xarcell on October 02, 2006, 09:13:44 PM
there is also a topic called "roster" or something like that. You might want to look into it.
Title: Re: How is TP Team page created??
Post by: G6Cad on October 02, 2006, 09:44:34 PM
Here is the code you need to put in an PHP article

Then the changes you need to do is

Set the values for the group you want to show, in this case it's group 9, if you want more groups added there, just enter more values like this (9, 12, 15, 3, or what ever)  The group numbers you find in the DB tables (member group through PhpMyadmin


Next change is just the headline for the article you want to show, you see that in the top of the code.
Enjoy :)

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


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 = 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);
$groupname=$row[0];
mysql_free_result($request);
}


$select_columns = "
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";
$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 = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
                        ORDER BY mem.memberName 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' => $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>
<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>';
}
Title: Re: How is TP Team page created??
Post by: mandos on October 03, 2006, 12:15:10 AM
thanks for replying
but this is the same with the one mentioned in this post:
http://www.tinyportal.net/smf/index.php?topic=8555.0;all

i'm trying to figure out how to put some text and more fields under each user
(position, and more fields that are created through Custom Profile Field Mod for SMF)

i'm looking for the roster topic now :)
Title: Re: How is TP Team page created??
Post by: JPDeni on October 03, 2006, 12:32:00 AM
You're probably going to want to use this one and not the roster. Adding the text from the Custom Profile Field isn't difficult, but you'll have to see how the fields are stored in the database. It's usually easier to just get the data from the database than to try to go through the functions that someone else created.
Title: Re: How is TP Team page created??
Post by: jacortina on October 03, 2006, 12:33:30 AM
Custom Profile Field values are stored in the {db_prefix}themes table.

SELECT value from {db_prefix}
WHERE ID_MEMBER = <ID>
AND ID_THEME = 1
AND variable = <custom-profile-field-variable - e.g. CP1, CP2>

And isn't Position the same as Group Name?
Title: Re: How is TP Team page created??
Post by: mandos on October 03, 2006, 11:50:39 AM
yeap, position and group name should be the same

thanks for the info on custom fields
once I complete it I'll give the code (it will take some time though)
Title: Re: How is TP Team page created??
Post by: OzButcher on October 12, 2006, 03:47:34 PM
I've made a team page but I prefer not to show the positions of the team in a big header seperating members...  (eg, not displaying grouped by Admin, Moderator, Regular Member etc.). Instead everyone shows up on a single page like in the TP Team link on this forum in one category.

Doesnt anyone know what to remove from this code so my members don't have their group shows? This is what I've got now:

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(1,2,9,10);
/////////////////////////////////////////////////////////////////

        echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-bottom: 2px solid #C7A276; padding-bottom: 4px; "><h2>Meet the =UnT= Team</h2>
<span class="smalltext">These are the people you will bump into on these Forums!</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 = 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);
$groupname=$row[0];
mysql_free_result($request);
}


$select_columns = "
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";
$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 = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
                        ORDER BY mem.memberName 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' => $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>
<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>';
}
Title: Re: How is TP Team page created??
Post by: jacortina on October 12, 2006, 09:07:34 PM
OK. Here you go.

But, first ... a couple of notes. The code below will select any memebers whose PRIMARY membergroup is in the $groups_list array and present them two across, sorted by name. If you want to select any members whose primary OR additional membergroups include at least one of those given in the $groups_list array, uncomment the line which begins:
//   $groups_query2 = ' OR FIND_IN_SET ...

(but I take no responsibility if you try to analyze that line). ;)

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

/////////////////////////////////////////////////////////////////  Enter the desired groups
$groups_list = array(1,2,9,10);
/////////////////////////////////////////////////////////////////
$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>Meet the =UnT= Team</h2>
<span class="smalltext">These are the people you will bump into on these Forums!</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>';



[EDIT: Fixed code as noted a couple of messages down.]
Title: Re: How is TP Team page created??
Post by: OzButcher on October 13, 2006, 12:25:52 AM
thanks... I gave it a go but only the admin group showed up on in the article. I uncommented that other line but its still the same, only admin group shows  :-\

Title: Re: How is TP Team page created??
Post by: jacortina on October 13, 2006, 12:40:47 AM
OK. Change:
$groups_query1 = 'FIND_IN_SET(mem.ID_GROUP, \'' . implode(', ', $groups_list) . '\')';
To:
$groups_query1 = 'mem.ID_GROUP IN (' . implode(', ', $groups_list) . ')';
Title: Re: How is TP Team page created??
Post by: OzButcher on October 13, 2006, 06:46:49 AM
thanks works great now!  :up:  :laugh:
Title: Re: How is TP Team page created??
Post by: mandos on October 13, 2006, 12:17:53 PM
yeap!

just the way I wanted it:
http://www.tio.gr/index.php?page=25
thanks  :up:

now that my exams are over I'll consider finding a way to add some custom text under each member
Title: Re: How is TP Team page created??
Post by: deniz on October 13, 2006, 02:13:11 PM
how can i add moderators and users group which has most posts.. ??

i add their id but there is nothing ?.
Title: Re: How is TP Team page created??
Post by: mandos on October 13, 2006, 02:36:18 PM
the code given here:
http://www.tinyportal.net/smf/index.php?topic=9207.msg79480#msg79480
places all users together, doesn't seperate them in groups

here:
http://www.tinyportal.net/smf/index.php?topic=9207.msg75983#msg75983
and here:
http://www.tinyportal.net/smf/index.php?topic=8555.0;all
you can find the code that seperates the groups :)

all you have to do is to add each groups ID to show it in the article :)

/////////////////////////////////////////////////////////////////  Enter the desired groups
$groups_list = array(1,2,9,10);
/////////////////////////////////////////////////////////////////
Title: Re: How is TP Team page created??
Post by: jacortina on October 13, 2006, 02:44:11 PM
This code only looks at the ID_GROUP and additionalGroups columns from the members table. Moderator status isn't kept there (that's why when you go to the Profile, you can't add Moderator to a user's groups and there's even a link explaining why Moderator isn't there).

Post-count group is a separate column, ID_POST_GROUP, in the members table. This code doesn't check it, but it would be easier to add than the inclusion of Moderators.
Title: Re: How is TP Team page created??
Post by: Tommy on October 13, 2006, 06:54:58 PM
Hey :)

nice team page - thx!  :) Is it possible to edit the profile links (team member name) - maybe to articles where we insert a team member info ?
If I had found an option to write an article with a specific ID (index.php?page=X), I could have edit the link here:

'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER']


I'm a php "noob" :)
Title: Re: How is TP Team page created??
Post by: jacortina on October 13, 2006, 06:59:16 PM
See the OTHER team page thread. Starting at this post:
http://www.tinyportal.net/smf/index.php?topic=8555.msg73540#msg73540

Adapting it/modifying it to go to page # rather than board shouldn't be hard.
Title: Re: How is TP Team page created??
Post by: Tommy on October 13, 2006, 07:49:24 PM
Mh okay - now i have links for the team members to their articles. But how can i displace the nick link to their profile with my article links?  :(

Name: [url=....index.php?page=1]Admin[/url]
Title: Re: How is TP Team page created??
Post by: jacortina on October 13, 2006, 09:08:31 PM
Do you really want to change something that is pretty much a basic constant element of the forum interface (name links to profile)?

Title: Re: How is TP Team page created??
Post by: Kiwitje on October 14, 2006, 02:08:12 AM
Why is the code of OzButcher WORKING but the code of Jacortina NOT working?!

Parse error: syntax error, unexpected T_STRING in /home/nzb/public_html/forum/Sources/Load.php(1711) : eval()'d code(229) : eval()'d code on line 8

Getting that error... Do I have to change anything in the code first?!
Title: Re: How is TP Team page created??
Post by: OzButcher on October 14, 2006, 02:31:19 AM
Quote from: Kiwitje on October 14, 2006, 02:08:12 AM
Why is the code of OzButcher WORKING but the code of Jacortina NOT working?!

I'm using the code from Jacortina, works a treat. You probably didn't read all the posts... did you change the code on line 8 to what Jacortina suggested? Check Jacortina's post again and then 2 posts after there's a fix for line 8.
Title: Re: How is TP Team page created??
Post by: jacortina on October 14, 2006, 02:33:32 AM
No. It was fumble-fingers on the edit. An extra single-quote snuck in.

Fixed now.
Title: Re: How is TP Team page created??
Post by: Kiwitje on October 14, 2006, 02:34:45 AM
Haha, thanks! Working now.. What was wrong?!
Title: Re: How is TP Team page created??
Post by: OzButcher on October 14, 2006, 02:35:11 AM
ahh hehe. I've done that plenty before too :uglystupid2:
Title: Re: How is TP Team page created??
Post by: jacortina on October 14, 2006, 05:44:03 AM
For a reworked block which includes numerous options (including some of those brought up in this thread) see:

http://www.tinyportal.net/smf/index.php?topic=8555.msg79951#msg79951
Title: Re: How is TP Team page created??
Post by: Raven on October 15, 2006, 12:41:10 PM
Please forgive my stupidity if this is obviouse...

http://www.bzfiend.com/raven/forum/index.php?page=5

This is all I get, the 4 primary membergroupd are selected (I think)
////////////////////////////////////////  Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(1, 4, 2, 3);
////////////////////////////////////////


Admin, Global, Moderator and BETA Tester. I hope...

So yeah, what on earth is going on with this? Nothing is showing ???
Title: Re: How is TP Team page created??
Post by: Tommy on October 15, 2006, 01:04:49 PM
Okay now all team member nicks are linked to their article. But what is wrong?:
$context['TPortal']['team'][] = array(
                'member_page' => empty($member_boards[$row['ID_MEMBER']]) ? '' : '<a href="' . $scripturl . '?page=' . $member_boards[$row['ID_MEMBER']] . '"><u> ' . $row['realName'],
'name' => $row['realName'],
'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['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']. '</u></a>',






<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['member_page'].'</h2>
<b>Zuletzt online</b>: '.$team['last_login'].'<br />
<b>BeitrÃÆ'Ã,¤ge</b>: '.$team['posts'].'<br />
' , !empty($team['location']) ? '<b>Wohnort</b>: '.$team['location'].'<br />' : '' , '
' , !empty($team['website']['title']) ? '<b>Webseite</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 />' : '' , '


Not only the nick is a link - all Text (Location, website, ...) is a link to their article  :-\
Title: Re: How is TP Team page created??
Post by: jacortina on October 15, 2006, 02:15:36 PM
Quote from: Raven on October 15, 2006, 12:41:10 PM
Please forgive my stupidity if this is obviouse...

http://www.bzfiend.com/raven/forum/index.php?page=5

This is all I get, the 4 primary membergroupd are selected (I think)
////////////////////////////////////////  Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(1, 4, 2, 3);
////////////////////////////////////////


Admin, Global, Moderator and BETA Tester. I hope...

So yeah, what on earth is going on with this? Nothing is showing ???

Group 4 'should' be your Newbie post count group (that's defined by SMF out-of-the-box).

Group 3 should be moderators, but you still have to enable them by the program 'switch' (set $include_moderators = true).

More importantly. just put in fix for what appears to be a MySQL versioning issue.

Code working fine on my site mirror on my PC wasn't even working on my own live site. ;)

Changing from the implied JOIN type to explicit for the moderator's table appears to have fixed it. Have changed the code in the message:

http://www.tinyportal.net/smf/index.php?topic=8555.msg79951#msg79951

Try it and see if that straightens it out.
Title: Re: How is TP Team page created??
Post by: jacortina on October 15, 2006, 02:19:16 PM
Quote from: Dubidu on October 15, 2006, 01:04:49 PM
$context['TPortal']['team'][] = array(
                'member_page' => empty($member_boards[$row['ID_MEMBER']]) ? '' : '<a href="' . $scripturl . '?page=' . $member_boards[$row['ID_MEMBER']] . '"><u> ' . $row['realName'],
...
'teamtext' => $row['teamtext']. '</u></a>',

You don't close the link tag until the end (until teamtext is displayed and because it will now never be empty, you'll always display it.
Title: Re: How is TP Team page created??
Post by: Raven on October 15, 2006, 07:43:32 PM
Hmm, how can I see what number the membergroups are?

Still blank even with that code and moderators enabled.
I just suck with this stuff :P
Title: Re: How is TP Team page created??
Post by: Kiwitje on October 15, 2006, 07:44:24 PM
If you have cPanel, you can see it in PHPmyadmin
Title: Re: How is TP Team page created??
Post by: jacortina on October 15, 2006, 07:51:51 PM
Quote from: Raven on October 15, 2006, 07:43:32 PM
Hmm, how can I see what number the membergroups are?

Still blank even with that code and moderators enabled.
I just suck with this stuff :P
Admin -> Membergroups

clicking on the Modify link to the far right for the group you want will open up a the edit with a link in your browser address area ending:
index.php?action=membergroups;sa=edit;group=##

Premade groups (SMF out-of-the-box):
1 - Admin
2 - Global Moderator
3 - Moderator
4-8 Post Count Groups Newbie through Hero Member.

Hate to ask, but do you have any members actually assigned as board moderators?
Title: Re: How is TP Team page created??
Post by: Raven on October 15, 2006, 07:54:34 PM
Perhaps not, it is a small board. There are groups that are primary and assigned, I did that method before but wasn;t sure if it was right, it was so hopefully it will work this time...

I am using a friends site for the forum as I need to upgrade mine, I bought the lowest of low, doesn't have a database or nothing :P What can I expect for ÂÃ,£30 for two years :P Then again, I have access to the cPanel so most likely PHPmyadmin too.

EDIT:

SCORE! *Ahem* it worked.
Title: Re: How is TP Team page created??
Post by: Tommy on October 15, 2006, 09:29:41 PM
Quote from: jacortina on October 15, 2006, 02:19:16 PM
Quote from: Dubidu on October 15, 2006, 01:04:49 PM
$context['TPortal']['team'][] = array(
                'member_page' => empty($member_boards[$row['ID_MEMBER']]) ? '' : '<a href="' . $scripturl . '?page=' . $member_boards[$row['ID_MEMBER']] . '"><u> ' . $row['realName'],
...
'teamtext' => $row['teamtext']. '</u></a>',

You don't close the link tag until the end (until teamtext is displayed and because it will now never be empty, you'll always display it.


Aah okay - thx. I copied this link tag from another position.. :) Thx :)
Title: Re: How is TP Team page created??
Post by: OzButcher on December 19, 2006, 02:31:03 AM
Is there a way to display users from additional member groups? Example:

Person1 = Admin (Primary Member Group)
           = Tactical Group (Additional Member Group)

Currently: Only primary group users are displayed. in this case Person1 only shows up in the admin group but not the tactical group.

cheers
Title: Re: How is TP Team page created??
Post by: jacortina on December 19, 2006, 03:44:15 PM
What code are you using?

If you are using the code I posted in:
http://www.tinyportal.net/index.php?topic=8555.msg79951#msg79951

then you first need to make sure that both the admin group and the
tactical group are included in the $groups_list = array(##,##)

You also need to set:
$include_nonprimary_groups = true;
$repeats_allowed = true;

(the last one there is what allows a person to show up more than
once on the page).
Title: Re: How is TP Team page created??
Post by: OzButcher on December 19, 2006, 10:04:55 PM
Ah thats great!!! I had a older version of the script :) Thats perfect!!  ;D
Title: Re: How is TP Team page created??
Post by: alan s on February 14, 2007, 09:29:02 PM
Hmm , Just wondering now would anyone happen to know how to pull the membergroup colours into the article so the names are displayed in the groups colours?
Title: Re: How is TP Team page created??
Post by: Tommy on February 15, 2007, 01:49:15 AM
Hi

could someone tell me what wrong is in the following code team page code:


    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['790'] = '39';
$member_boards['1'] = '41';
$member_boards['311'] = '38';
$member_boards['4334'] = '37';
$member_boards['1151'] = '36';
$member_boards['2158'] = '35';
$member_boards['3517'] = '34';
$member_boards['2665'] = '33';
$member_boards['2402'] = '32';
$member_boards['5435'] = '31';
$member_boards['1014'] = '30';
$member_boards['4619'] = '29';
$member_boards['2284'] = '28';
$member_boards['2642'] = '27';





/////////////////////////////////////////////////////////////////  Enter the desired groups in order of Appearance
$groups_list = array(1, 2, 72);
/////////////////////////////////////////////////////////////////

        echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">Die Gesichter hinter </span>
</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 = 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);
$groupname=$row[0];
mysql_free_result($request);
}


$select_columns = "
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";
$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 = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
                        ORDER BY mem.memberName ASC", __FILE__, __LINE__);
$new_loaded_ids = array();
while ($row = mysql_fetch_assoc($request))
{

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

$context['TPortal']['team'][] = array(
                'member_page' => empty($member_boards[$row['ID_MEMBER']]) ? '' : '<a href="' . $scripturl . '?page=' . $member_boards[$row['ID_MEMBER']] . '"><u> ' . $row['realName'] . '</u></a>',
'name' => $row['realName'],
'groupname' => $groupname,
'posts' => $row['posts'],
'location' => $row['location'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['realName'] . '">[PM schreiben]</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']. '</u></a>',
);


}
mysql_free_result($request);





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> ' . $groupname . '</b></font></td></tr>
<tr>
<td width="130"  class="catbg2">Avatar</td>';
echo '<td class="catbg2" width="145">Nick</td>';
echo '<td class="catbg2" width="280">Alias</td>';
echo '<td class="catbg2" width="100">Name</td>';
echo '<td class="catbg2" width="145">Location</td>';
echo '<td class="catbg2" width="255">Last Active</td>';
echo '<td class="catbg2" width="155">Contact</td>';
echo '</tr><tr>';


        $newrow=1;
foreach($context['TPortal']['team'] as $team)
        {
            echo '
<td class="windowbg" height="40">
<td class="windowbg">'.$team['member_page'].'</td>
<td class="windowbg">'.$team['last_login'].'</td>';


                                        echo '<td class="windowbg">'.$team['posts'].'</td>';
                                        echo '<td class="windowbg">Test</td>';
echo '<td class="windowbg">Test</td>';
echo '<td class="windowbg">Test'</td></tr>';


           $newrow++;
            if($newrow>1){
               $newrow=1;
              echo '</tr></table>';
            }
        }
echo '<br />';
}


I'm a php newbie...  :(
Title: Re: How is TP Team page created??
Post by: Tommy on February 15, 2007, 11:05:50 PM
*meep* can someone help me?  :-X
Title: Re: How is TP Team page created??
Post by: jacortina on February 16, 2007, 02:08:34 PM
It may help if you say what's happening when you try to use it.

And if you'd like us to check on it, tell us how to access it.

Because the code uses information specific to your forum, we can't simply paste it into our own and expect to troubleshoot it.
Title: Re: How is TP Team page created??
Post by: alan s on February 16, 2007, 04:08:29 PM
Quote from: J.A.Cortina on February 16, 2007, 02:08:34 PM
It may help if you say what's happening when you try to use it.

And if you'd like us to check on it, tell us how to access it.

Because the code uses information specific to your forum, we can't simply paste it into our own and expect to troubleshoot it.

Any ideas about my quirey on how to include the membergroup colours J.A.Cortina?
Title: Re: How is TP Team page created??
Post by: jacortina on February 16, 2007, 04:40:26 PM
There are a couple of versions of 'Team Page' code floating around (and even in this thread). So it's a bit difficult to determine EXACT edits to give.

This code will load an array with membergroup colors:
$groupcolors = array();
$request = db_query("SELECT ID_GROUP, onlineColor FROM {$db_prefix}membergroups", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
$groupcolors[$row['ID_GROUP']] = $row['onlineColor'];
mysql_free_result($request);


You'd then have to make sure that the member's primary group is being read from the members tables along with the rest of the info (mem.ID_GROUP in the columns to select where you see other mem.XXX column names).

Then find the line in the array construction which makes the link to the user's profile from the name, like:
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['realName'] . '">' . $row['realName'] . '</a>',

Change to:
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['realName'] . '">' . (!empty($groupcolors[$row['ID_GROUP']]) ? '<font color="' . $groupcolors[$row['ID_GROUP']] . '">' . $row['realName'] . '</font>' : $row['realName'] ) . '</a>',


[Note: may need tweaking as I haven't tested this exact code; but this is generally how you can get colors and apply them to the display name in a link to profile.]
Title: Re: How is TP Team page created??
Post by: Tommy on February 16, 2007, 04:57:29 PM
Quote from: J.A.Cortina on February 16, 2007, 02:08:34 PM
It may help if you say what's happening when you try to use it.

And if you'd like us to check on it, tell us how to access it.

Because the code uses information specific to your forum, we can't simply paste it into our own and expect to troubleshoot it.

Mh what infos do you need? This code only needs the group ids
"$groups_list = array(1, 2, 72);"

and maybe the team page article of the your team members:


"$member_boards['USER_ID'] = 'TEAMPAGE_ID_OF_THE_MEMBER';"

Hope this is okay for you? :)

Ah the error:

Parse error: parse error, unexpected '/' in /XXX/yabbse/Sources/Load.php(1702) : eval()'d code(225) : eval()'d code on line 147


This is the original code with a nice table:


   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 = 'Unsägliche/r'
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" align="center" width="100%" class="bordercolor">
<tr><td colspan="12" class="titlebg">
<font size="4" face="verdana"><b> ' . $data['name'] . '</b></font></td></tr><tr><td rowspan="70" width="75" class="windowbg" valign="top"><br><center><img src="http://maennerseiten.de/harry_potter/yabbse/Themes/classic/images/members.gif"></center></td>';
echo '<td class="catbg2" width="145">Nick</td>';
echo '<td class="catbg2" width="280">Alias</td>';
echo '<td class="catbg2" width="100">Name</td>';
echo '<td class="catbg2" width="145">Location</td>';
echo '<td class="catbg2" width="255">Last Active</td>';
echo '<td class="catbg2" width="155">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'] . '">~hpF~ <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><td class="windowbg"';
// Show avatars, images, etc.?
                        if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
                                echo '
                                                                <div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';
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>';



And this one is a modified (so you can link to TP articles of your team members and not to the profile) version of Blocs code someone posted here


    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['790'] = '39';
$member_boards['1'] = '41';
$member_boards['311'] = '38';
$member_boards['4334'] = '37';
$member_boards['1151'] = '36';
$member_boards['2158'] = '35';
$member_boards['3517'] = '34';
$member_boards['2665'] = '33';
$member_boards['2402'] = '32';
$member_boards['5435'] = '31';
$member_boards['1014'] = '30';
$member_boards['4619'] = '29';
$member_boards['2284'] = '28';
$member_boards['2642'] = '27';





/////////////////////////////////////////////////////////////////  Enter the desired groups in order of Appearance
$groups_list = array(1, 2, 72);
/////////////////////////////////////////////////////////////////

        echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">Die Gesichter hinter hpfreunde.de</span>
</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 = 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);
$groupname=$row[0];
mysql_free_result($request);
}


$select_columns = "
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";
$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 = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
                        ORDER BY mem.memberName ASC", __FILE__, __LINE__);
$new_loaded_ids = array();
while ($row = mysql_fetch_assoc($request))
{

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

$context['TPortal']['team'][] = array(
                'member_page' => empty($member_boards[$row['ID_MEMBER']]) ? '' : '<a href="' . $scripturl . '?page=' . $member_boards[$row['ID_MEMBER']] . '"><u> ' . $row['realName'] . '</u></a>',
'name' => $row['realName'],
'groupname' => $groupname,
'posts' => $row['posts'],
'location' => $row['location'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['realName'] . '">[PM schreiben]</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']. '</u></a>',
);


}
mysql_free_result($request);





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


        $newrow=1;
foreach($context['TPortal']['team'] as $team)
        {
            echo '
<td valign="top">'.$team['avatar']['image'].'</td>
<td valign="top" width="95%" class="middletext" style="padding: 5px;">
<h2 style="margin-top: 0; margin-bottom: 6px;">  '.$team['member_page'].'</h2>
<b>Zuletzt online</b>: '.$team['last_login'].'<br />
<b>Beiträge</b>: '.$team['posts'].'<br />
' , !empty($team['location']) ? '<b>Wohnort</b>: '.$team['location'].'<br />' : '' , '
' , !empty($team['website']['title']) ? '<b>Webseite</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'].'' : '' , '
<b>Kontakt:</b> '.$team['link'].'<br />


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


I just want the second code with the table of the first. (Blocs code is better - for example you can read out more than just one group.

Thank you!!
Title: Re: How is TP Team page created??
Post by: jacortina on February 16, 2007, 05:24:44 PM
Well, it helps a lot when you say what error you're getting. Especially when the error includes a line number. This line:
echo '<td class="windowbg">Test'</td></tr>';

Should be:
echo '<td class="windowbg">Test</td></tr>';

After that, well, you have stuff all over.

First, you say the table will allow for 12 columns:
<tr><td colspan="12" class="titlebg">

Then you put in 7 columns/column headings (meaning overflow space on the right):
<tr>
<td width="130"  class="catbg2">Avatar</td>';
echo '<td class="catbg2" width="145">Nick</td>';
echo '<td class="catbg2" width="280">Alias</td>';
echo '<td class="catbg2" width="100">Name</td>';
echo '<td class="catbg2" width="145">Location</td>';
echo '<td class="catbg2" width="255">Last Active</td>';
echo '<td class="catbg2" width="155">Contact</td>';
echo '</tr><tr>';


Then you fill rows under those headings with dummy test strings or data which doesn't go with the column headings it's under:
echo '
<td class="windowbg" height="40">
<td class="windowbg">'.$team['member_page'].'</td>
<td class="windowbg">'.$team['last_login'].'</td>';
echo '<td class="windowbg">'.$team['posts'].'</td>';
echo '<td class="windowbg">Test</td>';
echo '<td class="windowbg">Test</td>';
echo '<td class="windowbg">Test</td></tr>';
Title: Re: How is TP Team page created??
Post by: jacortina on February 16, 2007, 05:29:44 PM
Quote from: Dubidu on February 16, 2007, 04:57:29 PM
I just want the second code with the table of the first. (Blocs code is better - for example you can read out more than just one group.

Thank you!!

I don't understand. Both of the above have group lists and will output more than one group.


Also note that the last post was based on the code you posted earlier in the thread.
Title: Re: How is TP Team page created??
Post by: alan s on February 16, 2007, 05:54:59 PM
Nope , that code doesnt work , I placed


          $groupcolors = array();
$request = db_query("SELECT ID_GROUP, onlineColor FROM {$db_prefix}membergroups", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
$groupcolors[$row['ID_GROUP']] = $row['onlineColor'];
mysql_free_result($request);
$new_loaded_ids = array();
while ($row = mysql_fetch_assoc($request))
{


Just below

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


On line 63 , I then replaced the code like you said and now none of the member groups show up?

http://beboskinzone.com/forum/index.php?page=9
Title: Re: How is TP Team page created??
Post by: jacortina on February 16, 2007, 06:15:59 PM


That looks like you're 'interrupting' the fetch from one query with the query to get colors. That colors query should go near the top of the code as it's more of an initialization, loading an array which will be referenced later.

Could you post the code you're using? With the variations of code around, it's easier to try to analyze the full code than to try to figure out which you were trying to modify.
Title: Re: How is TP Team page created??
Post by: Tommy on February 16, 2007, 06:41:24 PM
Quote from: J.A.Cortina on February 16, 2007, 05:29:44 PM
I don't understand. Both of the above have group lists and will output more than one group.


Also note that the last post was based on the code you posted earlier in the thread.

Hi,

uhm how can i show more than one group with the first code ?

"FROM {$db_prefix}membergroups WHERE groupName = 'GROUP_NAME"

I want to mix these two codes because the one is based on Blocs is much better. For example the code with the nice tables (which i want use) doesn't show any avatars.

2.) Yeah the last code i posted is the one i posted before but without the table i want to use.
My problem: I need the table of the first code in the second code.
Title: Re: How is TP Team page created??
Post by: brianjw on February 16, 2007, 06:43:54 PM
This is how:

$groups_list = array(8,9,10,11);

the numbers are the group ids which you can find in PHPmyadmin ;)
Title: Re: How is TP Team page created??
Post by: jacortina on February 16, 2007, 07:03:38 PM
No, first code says:
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__);


It's set up to loop through an array.

You would need to change the "$groups = '';" up top to "$groups = array(1,2,72);"

That first query block is pretty useless in that code block.

And I definitely see code in that first 'nice' table to display avatars (though it may not be working correctly).

Give me a little bit and I'll see what I can do.
Title: Re: How is TP Team page created??
Post by: jacortina on February 16, 2007, 07:40:07 PM
The more I look at the first code, the stranger it gets. The avatar code IS included in there, but it's referencing $message array members which have no meaning in this code block (that gets filled in Display and PersonalMessages and refers to posts and PMs.

But I cleaned it up a touch and added the member_page stuff:
   global $db_prefix, $scripturl, $txt, $user_info, $settings, $modSettings, $options;

   $group_list = array(1, 2, 72);

$member_boards = array();
$member_boards['790'] = '39';
$member_boards['1'] = '41';
$member_boards['311'] = '38';
$member_boards['4334'] = '37';
$member_boards['1151'] = '36';
$member_boards['2158'] = '35';
$member_boards['3517'] = '34';
$member_boards['2665'] = '33';
$member_boards['2402'] = '32';
$member_boards['5435'] = '31';
$member_boards['1014'] = '30';
$member_boards['4619'] = '29';
$member_boards['2284'] = '28';
$member_boards['2642'] = '27';

//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, minPosts, onlineColor
FROM {$db_prefix}membergroups WHERE ID_GROUP IN (" . implode(', ', $group_list) . ")", __FILE__, __LINE__);
        $groups = array();
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" align="center" width="100%" class="bordercolor">
<tr><td colspan="12" class="titlebg">
<font size="4" face="verdana"><b> ' . $data['name'] . '</b></font></td></tr><tr><td rowspan="70" width="75" class="windowbg" valign="top"><br><center><img src="http://maennerseiten.de/harry_potter/yabbse/Themes/classic/images/members.gif"></center></td>';
echo '<td class="catbg2" width="145">Nick</td>';
echo '<td class="catbg2" width="280">Alias</td>';
echo '<td class="catbg2" width="100">Name</td>';
echo '<td class="catbg2" width="145">Location</td>';
echo '<td class="catbg2" width="255">Last Active</td>';
echo '<td class="catbg2" width="155">Contact</td>';
echo '</tr><tr>';

while ($row2 = mysql_fetch_assoc($query2))
{

echo '<td class="windowbg" height="40"><a href="' . $scripturl . (!empty($member_boards[$row2['ID_MEMBER']]) ? '?page=' . $member_boards[$row2['ID_MEMBER']] : '?action=profile;u=' . $row2['ID_MEMBER']) . '">~hpF~ <b><font color="' . $data['color'] . '" size="3" face="verdana">' . $row2['realName'] . '</b></font></font></a><br /><font size="1"> ' . $row2['personalText'] . '</font></td>';
echo '<td class="windowbg">' . $row2['usertitle'] . '</td>';
echo '<td class="windowbg">';

echo '</td><td class="windowbg">' . $row2['location'] . '</td>';
                                        echo '<td class="windowbg">' . timeformat($row2['lastLogin']) . '</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>';


Note that this includes an added string of text - '~hpF~' - that was already in the code, preceding the name.

Also already there was a left side graphic - yabbse/Themes/classic/images/members.gif .

Note that this code will link name to member page if a member page is defined. If no member page is defined, it will link to profile page.
Title: Re: How is TP Team page created??
Post by: alan s on February 16, 2007, 10:01:42 PM
Right , I chaned the place of the db quirey to the top of the code and now the names just dont appear but everything else does , The code im using is

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

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

$groupcolors = array();
$request = db_query("SELECT ID_GROUP, onlineColor FROM {$db_prefix}membergroups", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
$groupcolors[$row['ID_GROUP']] = $row['onlineColor'];
mysql_free_result($request);

echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-bottom: 2px solid #C7A276; padding-bottom: 4px; "><h2>BeboSkinZone.Com Team</h2>
<span class="smalltext">Meet the people who make the skins 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 = 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);
$groupname=$row[0];
mysql_free_result($request);
}


$select_columns = "
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";
$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 = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
                        ORDER BY mem.memberName 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' => $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'] . '">' . (!empty($groupcolors[$row['ID_GROUP']]) ? '<font color="' . $groupcolors[$row['ID_GROUP']] . '">' . $row['RealName'] . '</font>' : $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>
<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>';
}
Title: Re: How is TP Team page created??
Post by: jacortina on February 17, 2007, 01:09:16 AM
Arrrgggghhh!!!

Try changing:
               'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['RealName'] . '">' . (!empty($groupcolors[$row['ID_GROUP']]) ? '<font color="' . $groupcolors[$row['ID_GROUP']] . '">' . $row['RealName'] . '</font>' : $row['RealName'] ) . '</a>',

To:
               'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['realName'] . '">' . (!empty($groupcolors[$row['ID_GROUP']]) ? '<font color="' . $groupcolors[$row['ID_GROUP']] . '">' . $row['realName'] . '</font>' : $row['realName'] ) . '</a>',

Case sensitivity of array index (not 'RealName', but 'realName').
Title: Re: How is TP Team page created??
Post by: Tommy on February 17, 2007, 01:16:00 AM
Quote from: J.A.Cortina on February 16, 2007, 07:40:07 PM
The more I look at the first code, the stranger it gets. The avatar code IS included in there, but it's referencing $message array members which have no meaning in this code block (that gets filled in Display and PersonalMessages and refers to posts and PMs.

But I cleaned it up a touch and added the member_page stuff:

Note that this includes an added string of text - '~hpF~' - that was already in the code, preceding the name.

Also already there was a left side graphic - yabbse/Themes/classic/images/members.gif .

Note that this code will link name to member page if a member page is defined. If no member page is defined, it will link to profile page.

Yuuuuuuh ;D You are my hero...! Thank you so much!!!
Title: Re: How is TP Team page created??
Post by: alan s on February 17, 2007, 05:36:43 PM
Quote from: J.A.Cortina on February 17, 2007, 01:09:16 AM
Arrrgggghhh!!!

Try changing:
               'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['RealName'] . '">' . (!empty($groupcolors[$row['ID_GROUP']]) ? '<font color="' . $groupcolors[$row['ID_GROUP']] . '">' . $row['RealName'] . '</font>' : $row['RealName'] ) . '</a>',

To:
               'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['realName'] . '">' . (!empty($groupcolors[$row['ID_GROUP']]) ? '<font color="' . $groupcolors[$row['ID_GROUP']] . '">' . $row['realName'] . '</font>' : $row['realName'] ) . '</a>',

Case sensitivity of array index (not 'RealName', but 'realName').


That made the names show up again but the membergroup colours dont appear at all?
Title: Re: How is TP Team page created??
Post by: jacortina on February 17, 2007, 05:51:17 PM
Quote from: Alan S on February 17, 2007, 05:36:43 PM
That made the names show up again but the membergroup colours dont appear at all?

That's because we both missed this requirement which I named in that initial post:
Quote from: J.A.Cortina on February 16, 2007, 04:40:26 PM
You'd then have to make sure that the member's primary group is being read from the members tables along with the rest of the info (mem.ID_GROUP in the columns to select where you see other mem.XXX column names).

The code you posted wasn't reading the member's primary Goup ID (and I didn't catch that).

Find:
mem.personalText, mem.avatar, mem.ID_MEMBER, mem.memberName,

Change to:
mem.personalText, mem.avatar, mem.ID_MEMBER, mem.memberName, mem.ID_GROUP,
Title: Re: How is TP Team page created??
Post by: alan s on February 17, 2007, 06:11:49 PM
Yep thanks! That did the job!
Title: Re: How is TP Team page created??
Post by: Tommy on February 18, 2007, 02:21:26 AM
Hi,

thanks again with my code problem :) It's all working (with avatars!)...

just one question: is it possible to show whether a team member is online? Like in Blocs code

'online' => array(
'is_online' => $row['isOnline'],
'text' => &$txt[$row['isOnline'] ? 'online2' : 'online3'],
'image_href' => $settings['images_url'] . '/' . ($row['isOnline'] ? 'useron' : 'useroff') . '.gif',
),


When i add "isOnline" to "$query2" i get an error...:
Unknown column 'isOnline' in 'field list'


:up: Tommy
Title: Re: How is TP Team page created??
Post by: jacortina on February 18, 2007, 03:07:00 AM
That value is computed (not a column) and it's computed off of a value coming from another table. The other code does a JOIN to the log_online table. You'd need to change the $query2 to:
$query2 = db_query("SELECT mem.ID_GROUP, mem.ID_MEMBER, mem.realName, mem.avatar, mem.usertitle, mem.emailAddress, mem.hideEmail, mem.lastLogin, mem.location, mem.personalText, mem.totalTimeLoggedIn, mem.dateRegistered, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.hideEmail, mem.emailAddress, IFNULL(lo.logTime, 0) AS isOnline
FROM ({$db_prefix}members as mem)
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
WHERE ID_GROUP = " . $data['id'] . " ", __FILE__, __LINE__);

Title: Re: How is TP Team page created??
Post by: Tommy on February 18, 2007, 01:59:09 PM
Thanks for your answer. Okay i changed "$query2". But how can i get it in the table?


I think this is wrong :) :


//Now get all the user's
$query2 = db_query("SELECT mem.ID_GROUP, mem.ID_MEMBER, mem.realName, mem.avatar, mem.usertitle, mem.emailAddress, mem.hideEmail, mem.lastLogin, mem.location, mem.personalText, mem.totalTimeLoggedIn, mem.dateRegistered, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.hideEmail, mem.emailAddress, IFNULL(lo.logTime, 0) AS isOnline
FROM ({$db_prefix}members as mem)
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
WHERE ID_GROUP = " . $data['id'] . " ", __FILE__, __LINE__);

        $test = array();
while ($row2 = mysql_fetch_assoc($query2))
{
$test[$row2['isOnline']]  = array(
       
'is_online' => $row2['isOnline'],
'text' => &$txt[$row2['isOnline'] ? 'online2' : 'online3'],
'image_href' => $settings['images_url'] . '/' . ($row2['isOnline'] ? 'useron' : 'useroff') . '.gif',
);
}


if(db_affected_rows() != 0)
{
echo '
Title: Re: How is TP Team page created??
Post by: jacortina on February 18, 2007, 02:46:55 PM
Get rid of that $test array construction.

Find:
while ($row2 = mysql_fetch_assoc($query2))
{


Make it:
while ($row2 = mysql_fetch_assoc($query2))
{
$Online  = array(
'is_online' => $row2['isOnline'],
'text' => &$txt[$row2['isOnline'] ? 'online2' : 'online3'],
'image_href' => $settings['images_url'] . '/' . ($row2['isOnline'] ? 'useron' : 'useroff') . '.gif');


Then use:
echo '<img src="'.$Online['image_href'].'" alt="" /> '.$Online['text'];

where you want to put the green/blank graphic + "Online"/"Offline" text
Title: Re: How is TP Team page created??
Post by: alan s on March 07, 2007, 10:25:44 PM
Hmm any ideas on how to pull a field from Winrules custom profile field mod into the team page? I search the threads about the Tp Team Page but i couldnt seem to find anything.
Title: Re: How is TP Team page created??
Post by: jacortina on March 07, 2007, 10:33:45 PM
That info is stored in the {db_prefix}themes table (has columns: ID_MEMBER, ID_THEME, variable, value):

SELECT value FROM {db_prefix}themes
WHERE ID_THEME = 1
AND variable = <field_name; eg CP5>
AND ID_MEMBER = <member_number>
Title: Re: How is TP Team page created??
Post by: BCB on March 08, 2007, 03:51:07 PM
Could we possibly get a condensed code of this that is working instead of trying to piece together all?  Great work guy btw.
Title: Re: How is TP Team page created??
Post by: Tommy on March 12, 2007, 11:15:31 PM
 :( It always tells me that I'm offline. (offline image) Here's the code:



<?php
   
global $db_prefix$scripturl$txt$user_info$settings$modSettings$options;

   
$group_list = array(1272);

$member_boards = array();
$member_boards['790'] = '39';
$member_boards['1'] = '41';
$member_boards['311'] = '38';
$member_boards['4334'] = '37';
$member_boards['1151'] = '36';
$member_boards['2158'] = '35';
$member_boards['3517'] = '34';
$member_boards['2665'] = '33';
$member_boards['2402'] = '32';
$member_boards['5435'] = '31';
$member_boards['1014'] = '30';
$member_boards['4619'] = '29';
$member_boards['2284'] = '28';
$member_boards['2642'] = '27';

//Does all the real work here for showing groups.
$query db_query("SELECT ID_GROUP, groupName, minPosts, onlineColor
FROM 
{$db_prefix}membergroups WHERE ID_GROUP IN (" implode(', '$group_list) . ")"__FILE____LINE__);
        
$groups = array();
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 '<br>
<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> ' 
$data['name'] . '</b></font></td></tr><tr>';
echo '<td class="catbg2" width="300">Nick</td>';
echo '<td class="catbg2" width="120">Online?</td>';
echo '<td class="catbg2" width="100">Wohnort</td>';
echo '<td class="catbg2" width="120">Online:</td>';
echo '<td class="catbg2" width="150">Kontakt:</td>';
echo '</tr><tr>';

while ($row2 mysql_fetch_assoc($query2))
{
$Online  = array(
'is_online' => $row2['isOnline'],
'text' => &$txt[$row2['isOnline'] ? 'online2' 'online3'],
'image_href' => $settings['images_url'] . '/' . ($row2['isOnline'] ? 'useron' 'useroff') . '.gif');

echo '<td class="windowbg" height="40"><a href="' . $scripturl . (!empty($member_boards[$row2['ID_MEMBER']]) ? '?page=' $member_boards[$row2['ID_MEMBER']] : '?action=profile;u=' $row2['ID_MEMBER']) . '"><b><font color="' $data['color'] . '" size="3" face="verdana">' $row2['realName'] . '</b></font></font></a><br /></td>';
echo '<td class="windowbg"><img src="'.$Online['image_href'].'" alt="" /> '.$Online['text'].'</td>';

echo '</td><td class="windowbg">' $row2['location'] . '</td>';
                                        echo 
'<td class="windowbg">' timeformat($row2['lastLogin']) . '</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>';
?>


Title: Re: How is TP Team page created??
Post by: jacortina on March 12, 2007, 11:26:35 PM
You didn't change $query2 as noted in:
http://www.tinyportal.net/index.php?topic=9207.msg111326#msg111326

(even though in the message after, you gave code which WAS changed).
Title: Re: How is TP Team page created??
Post by: Tommy on March 13, 2007, 12:00:43 AM
 O0 That's because of Copy&Past  ::) (mhpf...my english...what can I say when i "destroyed" a code?  :uglystupid2: ). So I used your old code...  :)
Title: Re: How is TP Team page created??
Post by: Zetan on March 24, 2007, 08:46:55 AM
Hi, I'm using this script for our simple Team Page:


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(1,9,14);
/////////////////////////////////////////////////////////////////

$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 = 'board'; // 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>Schedules</h2>
<span class="smalltext">LAB Radio DJ Slots.</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>';



I'd like to add DJ Schedules and some Biography in a new page called Schedules.
Schedules are currently being worked on, I would like to have a table at the top containing a time table and add time Slots next to each DJ name.


I think I'm going to take a course and learn some HTML and Java Script... I'd rather know what was going on with my site.


Thanks for any help offered.
Title: Re: How is TP Team page created??
Post by: brianjw on April 10, 2007, 01:30:06 AM
Do you have a link...Zetan, I would like to see this in action but looked on your site and couldn't find a link to a team page. ???
Title: Re: How is TP Team page created??
Post by: Brian on April 12, 2007, 11:52:12 PM
Can someone point me to the code that will create a Team Page like the one setup up here on Tiny Portal? Displaying the same info as it does with the same layout or format.  Either I can't find it or it doesn't exist?
Title: Re: How is TP Team page created??
Post by: Porky on April 13, 2007, 12:06:32 AM
Yeah look up 2 posts and look at zetans code
Title: Re: How is TP Team page created??
Post by: brianjw on April 13, 2007, 12:23:59 AM
I think Zetans is different because looking at my code and his... my code works like TP team page but Zetans code just looks different to me. :) idk.
Title: Re: How is TP Team page created??
Post by: Brian on April 13, 2007, 12:38:08 AM
I like Zetans and it works right out of the box but it is different than the TP team page.  I like the looks of the TP team page if I could find that code.
Title: Re: How is TP Team page created??
Post by: brianjw on April 13, 2007, 02:56:06 AM
Quote from: Brian on April 13, 2007, 12:38:08 AM
I like Zetans and it works right out of the box but it is different than the TP team page.  I like the looks of the TP team page if I could find that code.
You can find it somewhere on this forum. But you can ask your friend -"The Search"- lol :P
Title: Re: How is TP Team page created??
Post by: khoking on April 13, 2007, 09:29:09 AM
This is the team page of my site:

http://pentaxworld.com/forum/index.php?page=9

This is the codes that I use:

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(1,2,3);
/////////////////////////////////////////////////////////////////

        echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>PentaxWorld Staffs!</h2>
<span>PentaxWorld team that helps safeguarding the site!</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 = 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);
$groupname=$row[0];
mysql_free_result($request);
}


$select_columns = "
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";
$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 = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
                        ORDER BY mem.memberName 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' => $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>
<td colspan="4" style="border-bottom: 2px solid #d0d0d0; 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>';
}


Title: Re: How is TP Team page created??
Post by: geekincsupport on April 17, 2007, 02:12:43 PM
Ok This is the code I am using I dont have a title or a query tittle i created a php article what am i doing wrong
I am not getting any errors or anything I am just not getting the about me page 
[code]Enter the desired groups in order of Appearance
$groups_list = array(9);
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 = 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);
$groupname=$row[0];
mysql_free_result($request);
}


$select_columns = "
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";
$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 = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
                        ORDER BY mem.memberName 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' => $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>
<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>';
}
[/code]
Title: Re: How is TP Team page created??
Post by: JPDeni on April 17, 2007, 02:31:22 PM
First, please go back to your post and delete the code. Click the button that has the # on it. That will put

[ code ]
[ /code ]

into your post. (I've added spaces so that you can see the tags.)

Copy your code again and paste it between those two tags. That will make your code readable.

Second, tell us what is happening when you access the page. Do you get an error message? Do you not get any text? Is the text wrong? If we know what the problem is, we can more likely find the reason for it.
Title: Re: How is TP Team page created??
Post by: G6Cad on April 17, 2007, 02:31:54 PM
Please edit your post and copy/paste the code again, but this time with in the code tags, otherwise it will have a lot of errors as the bbc code change parts of it.

The code tag is this little button. (https://www.tinyportal.net/Themes/newdef/images/bbc/code.gif)
Title: Re: How is TP Team page created??
Post by: geekincsupport on April 17, 2007, 02:38:30 PM
There, I am sorry about that
Title: Re: How is TP Team page created??
Post by: JPDeni on April 17, 2007, 04:24:51 PM
QuoteI am just not getting the about me page
Is it blank? Can we get a link to it?
Title: Re: How is TP Team page created??
Post by: geekincsupport on April 18, 2007, 02:46:34 AM
I put the following code in a php article block and just get a white line on the home page www.geekinc.info
Title: Re: How is TP Team page created??
Post by: JPDeni on April 18, 2007, 03:25:05 AM
I copied your code into a php article. I don't have a membership group 9, so nothing shows (and I'm the only person registered on the site anyway), but the code works.

http://www.jpdeni.com/fresh/index.php?page=6 (as a php article)

http://www.jpdeni.com/fresh/index.php (as a php center block)

I'm not sure what you mean by "a php article block." I'm not sure if it's an article block that accesses a php article, a php block, or a php article that is showing on the front page. Whatever it is, here is what I would do.

Delete whatever you have. Create either a new php article or php block and paste your code into it.
Title: Re: How is TP Team page created??
Post by: geekincsupport on April 18, 2007, 03:28:45 AM
hmm, that isnt what I want though I am sorry I am being so much trouble I want the about me section that looks like tinyportals but when I go to make an article its not working
Title: Re: How is TP Team page created??
Post by: IchBin on April 18, 2007, 04:16:56 AM
Did you put in the proper groupID number geekin?
Title: Re: How is TP Team page created??
Post by: khoking on April 24, 2007, 01:43:40 PM
I have a problem with the codes. Moderators are not showing up in the Staff page. Only Administrator, Supermoderators are shown.

Any idea?

This is my codes:

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(1,2,3);
/////////////////////////////////////////////////////////////////

        echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>PentaxWorld Staffs!</h2>
<span>PentaxWorld team that helps safeguarding the site!</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 = 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);
$groupname=$row[0];
mysql_free_result($request);
}


$select_columns = "
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";
$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 = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
                        ORDER BY mem.memberName 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' => $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>
<td colspan="4" style="border-bottom: 2px solid #d0d0d0; 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>';
}
Title: Re: How is TP Team page created??
Post by: jacortina on April 24, 2007, 02:08:00 PM
Quote from: khoking on April 24, 2007, 01:43:40 PM
I have a problem with the codes. Moderators are not showing up in the Staff page. Only Administrator, Supermoderators are shown.

Any idea?

Moderators aren't really a regular group. That's why when you go in through a user's profile and assign them to groups, it says "Primary Membergroup: (why isn't moderator here?)". Moderator status is an attribute of the board a user moderates and not an attribute of the user.

But a later version of the code was developed to include moderators (and allow a few other parameterized options):
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(12, 11, 9, 10, 25, 28);
////////////////////////////////////////

$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 = 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 = 'YOUR PAGE TITLE HERE';
$page_subtitle = '--- A Subtitle Here --- ';

$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[intval($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>';
Title: Re: How is TP Team page created??
Post by: shomazta on May 04, 2007, 07:42:27 PM
Quote from: Brianjw on February 16, 2007, 06:43:54 PM
This is how:

$groups_list = array(8,9,10,11);

the numbers are the group ids which you can find in PHPmyadmin ;)

no! =P phpMyAdmin mwahaha...

okay for real, how would I go about disabling setting that's making "team" display alphabetically.
Title: Re: How is TP Team page created??
Post by: shomazta on May 04, 2007, 07:45:51 PM
Quote from: Miles on April 17, 2007, 02:38:30 PM
There, I am sorry about that

haha fool. how you doin? we gonna make that site hot....

________________
oh, in reference to my post above this one... im using the cortina code
Title: Re: How is TP Team page created??
Post by: jacortina on May 07, 2007, 02:00:59 PM
If you are using the code provided a few posts back in the thread ( http://www.tinyportal.net/index.php?topic=9207.msg127849#msg127849 )

Then find and change this line:
$sort_by = 'name'; // choices - 'id' ascending(default), 'posts' descending, 'name' ascending
Title: Re: How is TP Team page created??
Post by: shomazta on May 07, 2007, 08:12:37 PM
global $txt, $scripturl, $user_info;
global $context, $modSettings, $ID_MEMBER;
global $board_info, $settings, $db_prefix;

/////////////////////////////////////////////////////////////////  Enter the desired groups
$groups_list = array(1,2,3,19,23,24,25,26);
/////////////////////////////////////////////////////////////////
$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>SM Staff : Meet the Fam</h2>
<span class="smalltext">These are some people you will bump into throughout this site! Interested in helping out? <a href="http://www.shomazta.com/smf/index.php?topic=115.0">Join Today</a>!</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>';


http://www.tinyportal.net/index.php?topic=9207.msg79480#msg79480 : Second Page

If it'd make more sense is there a way to modify your newest coding to work similar to the one linked above. As in there would be no separators stating member group other then in their little bio ?
Title: Re: How is TP Team page created??
Post by: shomazta on May 07, 2007, 08:17:05 PM
also how does one do this

"- I just saved a ton of $$ on portal/forum software" /personal text
"Resistance is Futile! Install TinyPortal NOW! I Love Star Trek, (all varieties) And play my xbox 360 alot. You can find me playing the latest version on Ghost Recon most any day. I write parody songs, and help out here when I can." /little bio

http://www.tinyportal.net/index.php?page=29 <<<
Title: Re: How is TP Team page created??
Post by: jacortina on May 07, 2007, 08:32:52 PM
In that code, the sorting/ordering is done by this line:
ORDER BY mem.realName ASC", __FILE__, __LINE__);
which is the last line of the large query.

You could change that to:
ORDER BY mem.ID_MEMBER ASC", __FILE__, __LINE__);
to sort by User ID# - ascending.

You could change that to:
ORDER BY mem.posts DESC", __FILE__, __LINE__);
to sort by post count - descending.

--------------------------------

Personal Text is entered by the user in their profile and if they specify any, the code you have should write it out.

I'm not sure how the teamtext portion is set up and maintained.
Title: Re: How is TP Team page created??
Post by: shomazta on May 07, 2007, 08:58:43 PM
thanks
Title: Re: How is TP Team page created??
Post by: clarkkent93 on July 13, 2007, 05:00:15 PM
How do you stop a banned user from showing up?

BTW, how does my crew manifest look?  I'm specifically trying to find out how to fix  the delineation between membergroups.  I have no idea what it's exactly called but look for any help.

http://www.ussriverside.us/index.php?page=14

Am I missing anything important?
Title: Re: How is TP Team page created??
Post by: TimUSA on September 21, 2007, 02:42:33 AM
This is my current code:

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(1,11,12,9,13,6);
/////////////////////////////////////////////////////////////////

        echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-bottom: 2px solid #C7A276; padding-bottom: 4px; "><h2></h2>
</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 = 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);
$groupname=$row[0];
mysql_free_result($request);
}


$select_columns = "
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";
$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 = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
                        ORDER BY mem.memberName 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' => $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>
<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>';
}


I would like to add a few thing here but I am a complete idiot when it comes to this.

1. I have the country flag mod installed and would like to show the country and flag under "location"

2. I have the custom profile mod installed  and would like to add those as well.

I hate to ask for free help but i dont know what else to do, because I cook food for a living, not write code!
Title: Re: How is TP Team page created??
Post by: IchBin on September 21, 2007, 02:53:13 AM
Being that you are asking for help with other mods TimUSA, I would advise you to seek help from the mod authors. They can tell you what code would go where.


Clark, if you don't want a banned user showing up in the list remove them from the group. As for your other part of your question I don't understand.
Title: Re: How is TP Team page created??
Post by: alving on October 02, 2007, 12:09:22 PM
im using the code here and my question is how do i resize the avatar? 

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

i tried putting 65px in between '' and other combination like "65px" and it is not resizing the avatar.  well, i dont have any php knowledge..  any help out there..

thanks in advance!
Title: Re: How is TP Team page created??
Post by: jacortina on October 02, 2007, 02:24:12 PM
Quote from: alving on October 02, 2007, 12:09:22 PM
im using the code here and my question is how do i resize the avatar? 

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

i tried putting 65px in between '' and other combination like "65px" and it is not resizing the avatar.  well, i dont have any php knowledge..  any help out there..

thanks in advance!

Try:
$avatar_width = '';
$avatar_height = ' height="65px"';


Without putting anything for width, the resizing should stay proportional. The way he code uses those variables further down, it simply concatenates in the entire clause and should be empty (no unfinished 'height=') if not used.

(of course, you could choose to specify only a width parameter, instead, while keeping the height variable empty: $avatar_width = ' width="65px"'; )
Title: Re: How is TP Team page created??
Post by: alving on October 02, 2007, 08:28:55 PM
perfect!  thanks!  :)
Title: Re: How is TP Team page created??
Post by: HecKel on January 24, 2008, 02:06:23 PM
Hi!

I tried this code, but somethings doesn't work well...

I am Global Moderator (id group = 2), but as secondary group, I removed the // but this still doesn't work. The weird thing is that for other groups (with more than 1 digit, >9) this works fine.

Can you help me?
Quote from: J.A.Cortina on October 12, 2006, 09:07:34 PM
OK. Here you go.

But, first ... a couple of notes. The code below will select any memebers whose PRIMARY membergroup is in the $groups_list array and present them two across, sorted by name. If you want to select any members whose primary OR additional membergroups include at least one of those given in the $groups_list array, uncomment the line which begins:
//   $groups_query2 = ' OR FIND_IN_SET ...

(but I take no responsibility if you try to analyze that line). ;)

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

/////////////////////////////////////////////////////////////////  Enter the desired groups
$groups_list = array(1,2,9,10);
/////////////////////////////////////////////////////////////////
$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>Meet the =UnT= Team</h2>
<span class="smalltext">These are the people you will bump into on these Forums!</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>';



[EDIT: Fixed code as noted a couple of messages down.]

Another thing, can you put on a new thread the different variations of this snippet? Is hard to find what is correct in this thread..., maybe one new thread, locked, only to list all the variations...
Title: Re: How is TP Team page created??
Post by: IchBin on January 24, 2008, 11:52:15 PM
Yeah, thats a little out of reach at this point. We have sooooo many snippets. We are looking to change that in the near future by adding some sort of package deal for block code snippets. So you can keep them in the downloads and organized in which changes are made to the files. Then the topics will just be for support.
Title: Re: How is TP Team page created??
Post by: lOOmis on March 27, 2008, 06:51:33 PM
OK, the code worked great I have it set up linked off the home page. BUt even though i have set the groups to show in a certain order in this line,
$groups_list = array(1,2,10,9);
My members show up on the Roster page in Alphebetical order. Is there something I should add to this line to correct it.

Thanks
lOOmis
Title: Re: How is TP Team page created??
Post by: IchBin on March 27, 2008, 06:54:15 PM
I'm guessing you should just change the query.
ORDER BY mem.memberName ASC", __FILE__, __LINE__);

ORDER BY mem.ID_GROUP ASC", __FILE__, __LINE__);
Title: Re: How is TP Team page created??
Post by: tolisgr on April 01, 2008, 04:01:54 PM
Hello,

Sorry if i am off-topic but i want to ask a question. How do i have to modify the code of first page (in this topic) so that it adds one or two Custom Fields of profile (i use Custom Profile Field Mod for SMF 1.1.4). I couldn't understand if this was answered before so i made this question. I found the entry in database (i use perfix smf_) it is in smf_themes and it is variable CP1

Thank you
Title: Re: How is TP Team page created??
Post by: JPDeni on April 01, 2008, 04:57:12 PM
There's a problem with that, as far as I can see. Possibly someone who knows more about MySQL can figure out how to do this, but the fact that the Custom Profile fields are held in the smf_themes directory and that the way they're held is difficult to deal with.

As it stands, the code uses a variable from the smf_themes directory called "teamtext." I'm not sure where that comes from, but it could be another custom profile field. I don't know how to call another value from that same table.

If you don't have anything called "teamtext" then you can do a global search-and-replace in the code (using a text editor), changing teamtext to CP1.

I remember typing this before, although it could have been in a different topic. IIRC, the person I suggested it to said it worked just fine.

However, I still don't know how you would be able to display a second custom profile field, which concerns me, since you said
Quoteso that it adds one or two Custom Fields of profile

One, yes. Two, it may be possible, but I don't know how.
Title: Re: How is TP Team page created??
Post by: tolisgr on April 01, 2008, 06:38:16 PM

Well, that actualy works  ;D . Thank you a lot!
Title: Re: How is TP Team page created??
Post by: FireSlash on June 18, 2008, 05:40:11 PM
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>';
Title: Re: How is TP Team page created??
Post by: G6Cad on June 18, 2008, 05:47:28 PM
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 ;)
Title: Re: How is TP Team page created??
Post by: 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?
Title: Re: How is TP Team page created??
Post by: FireSlash on June 18, 2008, 11:12:39 PM
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.
Title: Re: How is TP Team page created??
Post by: Kethra on August 10, 2008, 04:33:25 AM
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>';
Title: Re: How is TP Team page created??
Post by: IchBin on April 13, 2010, 03:50:55 PM
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>';
}
Title: Re: How is TP Team page created??
Post by: Blue Steel on April 14, 2010, 12:38:11 AM
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.

Title: Re: How is TP Team page created??
Post by: IchBin on April 14, 2010, 12:46:07 AM
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;
Title: Re: How is TP Team page created??
Post by: Blue Steel on April 14, 2010, 01:11:09 AM
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..
Title: Re: How is TP Team page created??
Post by: Olive on April 20, 2010, 05:51:21 PM
Quote from: IchBinâ„¢ on April 13, 2010, 03:50:55 PM
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>';
}


Hi Ichbin, sorry for my late reply but the above code did not work. It just gives me an empty page, no errors. I tried using it in a php-article.
Title: Re: How is TP Team page created??
Post by: IchBin on April 20, 2010, 09:12:36 PM
Did you remove the <?php tag?
Title: Re: How is TP Team page created??
Post by: Lum-chan on January 18, 2012, 10:14:00 AM
Sorry, got it fixed already. Was in the wrong thread for this snippet. My bad...
Title: Re: How is TP Team page created??
Post by: jarska on January 23, 2012, 02:40:44 PM
Sorry my many...many questions but if I understand right, here is mod called Nicetooltips in use?

Here it shows avatar and last post, that looks great, how to do that? ::)
Title: Re: How is TP Team page created??
Post by: ZarPrime on January 23, 2012, 08:05:29 PM
jarska,

If I am understanding you correctly, when you are looking at an index of one of the boards and, and when you hover your mouse over a topic subject, you see the avatar to the left of the last message.  Is that correct?  If so, that has nothing to do with the NiceToolTips Mod.  You are probably using the default theme for the site which is currently Proteus.  The ToolTips used in that theme are a built-in feature of that theme.

We are currently working on a newer version of that theme designed specifically for SMF 2.02.  The tooltips in that one and the index page itself will look different than the one you are looking at now.

If you want to get an idea of what the new theme will look like, you can click this link and look around --> http://www.tinyportal.net/index.php?board=46.0;theme=12

When you are finished looking at the new one that we are working on, you can return to the theme you were using by cllicking this link --> http://www.tinyportal.net/index.php?board=46.0;theme=11

ZarPrime
Title: Re: How is TP Team page created??
Post by: jarska on January 24, 2012, 08:13:12 AM
Yes that is correct, I believed that was Nicetooltips mod, thanks ZarPrime, I get it. ;)