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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 282
  • Total: 282

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.

jacortina

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,

alan s


Tommy

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

jacortina

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__);


Tommy

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 '

jacortina

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

alan s

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.

jacortina

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>

BCB

Could we possibly get a condensed code of this that is working instead of trying to piece together all?  Great work guy btw.

Tommy

 :( 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>';
?>



This website is proudly hosted on Crocweb Cloud Website Hosting.