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: 365
  • Total: 365

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.

IchBin

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.

alving

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!

jacortina

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"'; )

alving

#103
perfect!  thanks!  :)

HecKel

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...

IchBin

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.

lOOmis

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

IchBin

I'm guessing you should just change the query.
ORDER BY mem.memberName ASC", __FILE__, __LINE__);

ORDER BY mem.ID_GROUP ASC", __FILE__, __LINE__);

tolisgr

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

JPDeni

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.

This website is proudly hosted on Crocweb Cloud Website Hosting.