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

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 05:51:22 AM

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

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.

Olive

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.

IchBin


Lum-chan

#122
Sorry, got it fixed already. Was in the wrong thread for this snippet. My bad...

jarska

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

ZarPrime

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

jarska

Yes that is correct, I believed that was Nicetooltips mod, thanks ZarPrime, I get it. ;)