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

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 08:02:10 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 143
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 96
  • Total: 96

How is TP Team page created??

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mandos

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

rebelrose


mandos

thanks :)

quite usefull, now all I have to do is to configure how to add extra text under each person :D

rebelrose

Post in that same thread and someone may help you with that.

and your welome

Xarcell

there is also a topic called "roster" or something like that. You might want to look into it.

G6Cad

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

mandos

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 :)

JPDeni

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.

jacortina

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?

mandos

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)