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,972
  • Latest: Lineo
Stats
  • Total Posts: 196,166
  • Total Topics: 21,347
  • Online today: 626
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

Meet the team page.. Awesome

Started by londonhogfan, April 04, 2006, 08:25:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ontap

#60
This could be used as a Team Page Script, code was takin with the "Team Page" Mod over at SMF,
it will show all Groups, will try and add the avaters and website urls to it.

global $db_prefix, $scripturl, $txt, $user_info,$settings, $modSettings;

                 $groups = '';
//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, minPosts, onlineColor
FROM {$db_prefix}membergroups WHERE minPosts = -1
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, emailAddress, hideEmail, lastLogin, 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="0" cellpadding="2" width="100%">';
echo '<tr>';
echo '<td class="catbg2" width="30%">' . $data['name'] . '</td>';
echo '<td class="catbg2" width="30%">Last Active:</td>';
echo '<td class="catbg2" width="30%">Contact:</td>';
echo '</tr>';

while ($row2 = mysql_fetch_assoc($query2))
{
echo '<tr>';
echo '<td class="windowbg"><a href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '"><font color="' . $data['color'] . '">' . $row2['realName'] . '</font></a></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> ';

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

londonhogfan

This is awesome.

anyone know what would I need to change to hardcode only 1 membergroup? This shows all non post based groups.

global $db_prefix, $scripturl, $txt, $user_info,$settings, $modSettings;

                 $groups = '';
//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, minPosts, onlineColor
FROM {$db_prefix}membergroups WHERE minPosts = -1
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, emailAddress, hideEmail, lastLogin, 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="0" cellpadding="2" width="100%">';
echo '<tr>';
echo '<td class="catbg2" width="30%">' . $data['name'] . '</td>';
echo '<td class="catbg2" width="30%">Last Active:</td>';
echo '<td class="catbg2" width="30%">Contact:</td>';
echo '</tr>';

while ($row2 = mysql_fetch_assoc($query2))
{
echo '<tr>';
echo '<td class="windowbg"><a href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '"><font color="' . $data['color'] . '">' . $row2['realName'] . '</font></a></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> ';

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


I know the mod has the option to let you turn certain groups off, but I want it hardcoded to only allow a certain one so I can use it for other stuff.

londonhogfan

the mod author replied telling me this...

edit this...
//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, minPosts, onlineColor
FROM {$db_prefix}membergroups WHERE minPosts = -1
ORDER BY groupName", __FILE__, __LINE__);


to this...
//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, minPosts, onlineColor
FROM {$db_prefix}membergroups WHERE groupName = 'The exact name of your group here'
ORDER BY groupName", __FILE__, __LINE__);


just in case anyone else wanted to know.

stigmartyr

FYI: I noticed that when I use the current MEET THE TEAM PAGE (code pasted by bloc) that it will only show the members of a GROUP ID if that is the member's PRIMARY member group.

On my TP site I have members with many secondary member groups, and when I modify the code in the Meet the Team page to call GROUP ID's it will not render those members in that group unless it is their PRIMARY ID. 

Is there a way to fix this so that it will recognize even secondary member groups?

IchBin

Yes, Xarcell posted somewhere around here that he would like the same thing I think. Will have to wait until Bloc gets back, or if Feline just happens to come here. They are the only ones I know that hang around here that could give a definitive answer.

stigmartyr

sweetness - until then, Ill tweak my .css !


bloc

The teampage module will fetch secondary groups....the sql call should really just fetch all the membergroups desired and single out which is which afterwards. You can simply re-use the code i used here, but each new copy will increase the query number and since it being a fairly complex call, the load on the server as well.

G6Cad

Got mine working to now :)
Had a bit of struggle with getting the custom membergroup in, but I finaly got it to work  :D

oliver

Quote from: G6 on June 25, 2006, 07:47:10 PM
Got mine working to now :)
Had a bit of struggle with getting the custom membergroup in, but I finaly got it to work  :D

I hpe you share the secret G6 because me I can only hoe right now.

The only thing that i did was to put number 2 to the $membergrup and it shows admin and global moderators but all my team has an aditiona grupname and if I can put that grup on this script than all the team will show up.

I just cant do it :( because I dont know but the my idea is very simple. All the team ( admins, moderators etc ) they have a aditional grup that is called Team :)

So is there any way I can add the team grup on this.

Thanks.

PS: Bloc this Team Page was a grate idea. Thanks for sharing :)

This website is proudly hosted on Crocweb Cloud Website Hosting.