How would I make this show more than one group?
global $txt, $scripturl, $user_info;
global $context, $modSettings, $ID_MEMBER;
global $board_info, $settings, $db_prefix;
$groupnumber = 1;
$loaded_ids = array();
$user_profile=array();
$memberContext=array();
$profile=array();
$context['TPortal']['team']=array();
$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
OR mem.ID_GROUP = 1 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'],
'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="0" cellspacing="0"><tr>
<td colspan="4" style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">The people you will run into while visiting rebelrosenetworks.com</span><br /><br />
</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>';
im just hazzarding a guess here
but have u tried $groupnumber = 1,2,3,etc;
like that?
yes it does not work like that
A little more info?
More than one group at the same time or one group followed by another group?
Are you interested in checking only the primary group?
One group followed by another,
admin,
Global
and so on
4 groups
Try:
global $txt, $scripturl, $user_info;
global $context, $modSettings, $ID_MEMBER;
global $board_info, $settings, $db_prefix;
//////////////////////////////////////////////////////////////// List of group numbers here
$groups_list = array(12, 11, 9, 10, 25);
////////////////////////////////////////////////////////////////
foreach($groups_list as $groupnumber)
{
$loaded_ids = array();
$user_profile=array();
$memberContext=array();
$profile=array();
$context['TPortal']['team']=array();
$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
OR mem.ID_GROUP = 1 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'],
'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="0" cellspacing="0"><tr>
<td colspan="4" style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">The people you will run into while visiting rebelrosenetworks.com</span><br /><br />
</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>'
}
Main code is the same as yours, so only based on Primary Group.
Parse error: syntax error, unexpected $end, expecting ',' or ';' in xxxxxxxxxx/Sources/Load.php(1708) : eval()'d code(225) : eval()'d code on line 104
Yeah, sorry.
I dropped the ';' from the last echo line:
echo '</tr></table>'
should be
echo '</tr></table>';
Oh that is so close, but it list the admins a few times in each group
Yeah, the Admin check is hard-coded. has to be taken out.
Change:
// Load the member's data.
$request = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
OR mem.ID_GROUP = 1 ORDER BY mem.memberName ASC", __FILE__, __LINE__);
To:
// 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__);
That is almost perfect, I have to take out the wording and work it out, it shows more than once.
is there a way to show the position of the member as well, I do so much appreciate your help
Right. You have the heading embedded in the table so it
repeats for each group at the top of the group's table.
And, again, this won't pick up members of groups where
the membership is one of their secondary groups.
Position? You mean Group name or...?
Yes Group Name
OK. Another shot (moved the page title up and added 'subtitles' for group names). Remember to put your group number in:
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(12, 11, 9, 10, 25);
/////////////////////////////////////////////////////////////////
echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
<td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">The people you will run into while visiting rebelrosenetworks.com</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 #d0d0d0; 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>';
}
Perfect, thank you so much for your help.
OK this worked perfectly, now another question maybe someone knows the answer and code for - I want something just like this with a link to a board that will be done on each team member in the member info lines. Any ideas?? :uglystupid2:
Just to make sure I know what you're seeking, each team member is going to have a full board to which you want a link included in their entry.
i.e. URL ending with index.php?board=##.0
Quote from: jacortina on September 25, 2006, 08:45:07 PM
Just to make sure I know what you're seeking, each team member is going to have a full board to which you want a link included in their entry.
i.e. URL ending with index.php?board=##.0
Yes that is what I am saying!! YEA!! :)
Well, 'enhancing' the code listed earlier, you could try this:
global $txt, $scripturl, $user_info;
global $context, $modSettings, $ID_MEMBER;
global $board_info, $settings, $db_prefix;
///////////////////
//
// Format - $member_boards['<member userid #>'] = '<forum board #>';
//
$member_boards = array();
$member_boards['101'] = '27';
$member_boards['152'] = '29';
///////////////////////////////////////////////////////////////// Enter the desired groups in order of Appearance
$groups_list = array(12, 11, 9, 10, 25);
/////////////////////////////////////////////////////////////////
echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
<td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">The people you will run into while visiting rebelrosenetworks.com</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'],
'member_page' => empty($member_boards[$row['ID_MEMBER']]) ? '' : '<a href="' . $scripturl . '?board=' . $member_boards[$row['ID_MEMBER']] . '"><u>Board for ' . $row['realName'] . '</u></a>',
);
}
mysql_free_result($request);
echo '<table align="center" width="95%" cellpadding="5" cellspacing="5"><tr>
<td colspan="4" style="border-bottom: 2px solid #d0d0d0; 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 />' : '' , '
' , !empty($team['member_page']) ? $team['member_page'].'<br />' : '' , '
</div></td>';
$newrow++;
if($newrow>1){
$newrow=0;
echo '</tr><tr><td colspan="4"><br /><br /> </td></tr><tr>';
}
}
echo '</tr></table>';
}
Remember to change your group list and whatever other changes (reference to rebelrosenetworks). Or insert the following in the appropriate places in your article.
There at the top, you'll see:
///////////////////
//
// Format - $member_boards['<member userid #>'] = '<forum board #>';
//
$member_boards = array();
$member_boards['101'] = '27';
$member_boards['152'] = '29';
For each of the members that have a board assigned, include a line where the member id # is the index of the array and the value is the board #.
The actual link format (including the text 'Board for ') is specified in the line:
'member_page' => empty($member_boards[$row['ID_MEMBER']]) ? '' : '<a href="' . $scripturl . '?board=' . $member_boards[$row['ID_MEMBER']] . '"><u>Board for ' . $row['realName'] . '</u></a>',
Then toward the end, this actual outputs it:
' , !empty($team['member_page']) ? $team['member_page'].'<br />' : '' , '
That's it. User<->Board specifications and two single lines.
And if a given member doesn't yet have a board set up, simply don't include a line for them. Nothing should show up.
Thanks for this Jacortina :up:
Jacortina, I appreciate all the help you give. Thank you so much
well... since my php knowledge is 'null' i'm going to ask the question
hope it is not too lame :P
Here:
http://www.tinyportal.net/smf/index.php?page=29
in each member there is a "Position:" entry
in my site the position is listed on top of each category
(http://www.tio.gr/index.php?page=25)
I can't figure out how to change it and make it like Blocs... any ideas?
and the other thing that i can't figure is how to add some custom text after each member and some custom profile fields that I have added in my forum (using Custom Profile Field Mod for SMF)
I'll try to find a solution again later, it might help seeing it with a clear mind, but I don't think i'll manage to do it :P
Great work all of you :)
Please dont hijack the threads, start a new thread with your questions so we can keep the topic clean as it is ;)
eeeerr... it is already here:
http://www.tinyportal.net/smf/index.php?topic=9207.new;topicseen#new
but I thought it would be better to have it all gathered
after all we are talking about enchancing the very same thing that is described in the previous pages ???
Deleted by PhilH
Hijacking is allowed
Brianjw, please for the love of all things holy, READ AND SEARCH THIS SITE! ALL of the answers have been posted to everything that you have a question for I guarantee it!!! We have a hundred+ posts everyday with legitimate questions. We can't waste our time answering the same questions that have already been answered.
hey are "board moderators" a secondary group?
Quote from: akulion on October 13, 2006, 01:34:02 AM
hey are "board moderators" a secondary group?
I don't believe so. Moderator status for a member is really a property of the BOARD they're a moderator for and not so much a property of the member. Actually, that info is in its very own table (independent of both boards and members - called {$db_prefix}moderators which has only two columns: ID_BOARD and ID_MEMBER).
thanks for the info :up:
oh that sucks! my board moderators will kill me :2funny: if their names dont show up
ill just stick to my old fashioned manual html coded page for now :D
Well, appending what would basically be a second 'copy' of the groups based code above, modified to work off of the moderators table instead, would get them listed.
too complicated for me to be honest
and i dont wana trouble u either since ur already over loaded with code requests everyday
thanks anyways :up: :D
A quick question here.... the code is great btw...
How can you control the avatar size? I've got a few members where the forums have scaled down their avatar automatically, but the images with the code are full size...
Any help would be appreciated.
Thanks.
You want primary group only? You got it.
You want to include additional membergroups? You got it.
You want to include board moderators? You got it.
You want to include post-count groups? You got it.
You want choice of groups broken out or single consolidated list? You got it.
Sort by id # (which is generally seniority), display name, or post count.
Include teamtext (if present).
Include links to board or article page by member.
Uses $txt values from standard language file.
Output entries in separate 'echo' statements to make shuffling and/or exclusion by commenting out easier.
(And it 'should' limit avatar width to that set in admin.)
global $txt, $scripturl, $user_info, $context, $modSettings, $ID_MEMBER, $board_info, $settings, $db_prefix;
//////////////////////////////////////// Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(12, 11, 9, 10, 25);
////////////////////////////////////////
$list_by_group = true; // 'true' for separate sections by group; 'false' for consolidated list
$include_nonprimary_groups = true; // 'true' to check for group membership in additional groups; 'false' for primary only
$include_post_groups = false; // 'true' to include post-count based group in membership search
$include_moderators = false; // 'true' to include board moderators on page
$repeats_allowed = false; // 'true' to allow multiple appearances by member on page (for $list_by_group = true only)
$sort_by = 'name'; // choices - 'id' ascending(default), 'posts' descending, 'name' ascending
$extra_type = 'none'; // choices - 'none'(default), 'board' links, 'page' (article) links
///////////////////
// Format - $extra_links['<member userid #>'] = '<forum board #>';
// or $extra_links['<member userid #>'] = '<TP article #>';
$extra_links = array();
$extra_links['3'] = '5';
$extra_links['2'] = '11';
$extra_label_prefix = 'Page of '; // text to precede member's name in link label for extra link
$extra_label_suffix = ''; // text to append to member's name in link label for extra link
$page_title = 'Meet the Team!';
$page_subtitle = 'The people around the place';
$moderator_group = 3;
///////////////////////////////////////////////////////////////////////////////////////
$sort_ord = 'mem.ID_MEMBER ASC';
if ($sort_by == 'posts') $sort_ord = 'mem.posts DESC';
if ($sort_by == 'name') $sort_ord = 'mem.realName ASC';
if (($extra_type != 'board') && ($extra_type != 'page')) $extra_type = 'none';
if ($include_moderators)
{if (!in_array($moderator_group, $groups_list)) $groups_list[] = $moderator_group;}
$groups_to_use = array();
if ($list_by_group)
{$groups_to_use = $groups_list;}
else
{$groups_to_use[] = 0;}
$users_already_listed = array();
$users_already_listed[] = 0;
loadLanguage('Profile');
echo '<table align="center" width="96%" cellpadding="3" cellspacing="2"><tr>
<td colspan="4"><h2>', $page_title, '</h2>
<span class="smalltext">', $page_subtitle, '</span><br /></td></tr>';
if (!$list_by_group)
echo '<tr><td colspan="4"><br /></td></tr><tr width="95%" style="margin-top: 4px;">
<td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2> </h2>
</td></tr>';
foreach($groups_to_use 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);
$groupNameX=$row[0];
mysql_free_result($request);
}
if ($list_by_group) {
$select_where = 'mem.ID_GROUP = '.$groupnumber;
if ($include_nonprimary_groups) $select_where .= ' OR FIND_IN_SET('.$groupnumber.', mem.additionalGroups)';
if ($include_post_groups) $select_where .= ' OR mem.ID_POST_GROUP = '.$groupnumber;
if ($include_moderators && ($groupnumber == $moderator_group)) $select_where = 'mem.ID_MEMBER = m.ID_MEMBER';
}
else {
$select_where = 'mem.ID_GROUP IN (' . implode(', ', $groups_list) . ')';
if ($include_nonprimary_groups) $select_where .= ' OR FIND_IN_SET(' . implode(', mem.additionalGroups) OR FIND_IN_SET(', $groups_list) . ', mem.additionalGroups)';
if ($include_post_groups) $select_where .= ' OR mem.ID_POST_GROUP IN (' . implode(', ', $groups_list) . ')';
if ($include_moderators) $select_where .= 'OR mem.ID_MEMBER = m.ID_MEMBER';
}
$select_where = '(' . $select_where . ') AND mem.ID_MEMBER NOT IN (' . implode(', ', $users_already_listed) . ')';
// 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.additionalGroups, mem.ID_MEMBER as memnum, mem.memberName, mem.ID_GROUP,
mem.usertitle, mem.karmaBad, mem.karmaGood, mem.realName, mem.lastLogin, mem.websiteTitle,
mem.websiteUrl, mem.location, mem.posts, them.value AS teamtext, m.ID_MEMBER as modmem, g.groupName
FROM ({$db_prefix}members AS mem)
LEFT JOIN {$db_prefix}moderators AS m ON (m.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS g ON (g.ID_GROUP = mem.ID_GROUP)
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 $select_where
GROUP BY mem.ID_MEMBER
ORDER BY $sort_ord", __FILE__, __LINE__);
$new_loaded_ids = array();
$member_count = 0;
while ($row = mysql_fetch_assoc($request))
{
if (!$repeats_allowed) $users_already_listed[$row['memnum']] = $row['memnum'];
$member_count += 1;
$avatar_width = '';
$avatar_height = '';
if($context['browser']['is_ie6']) $avatar_width = 'width="' . $modSettings['avatar_max_width_external'] . '"';
$context['TPortal']['team'][] = array(
'username' => $row['memberName'],
'usertitle' => $row['usertitle'],
'name' => $row['realName'],
'groupname' => ($groupnum == 0) ? $row['groupName'] : $groupNameX ,
'posts' => $row['posts'],
'karmabad' => $row['karmaBad'],
'karmagood' => $row['karmaGood'],
'location' => $row['location'],
'href' => $scripturl . '?action=profile;u=' . $row['memnum'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['memnum'] . '" 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="" style="max-height:280px;max-width:180px;" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" style="max-height:280px;max-width:180px;" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" style="max-height:280px;max-width:180px;" 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'],
'member_page' => ($extra_type == 'none') ? '' : empty($extra_links[$row['memnum']]) ? '' : $extra_links[$row['memnum']],
);
}
mysql_free_result($request);
if ($member_count > 0)
{
if ($list_by_group)
echo '<tr><td colspan="4"><br /></td></tr><tr width="95%" style="margin-top: 4px;">
<td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2>' . $groupNameX . '</h2>
</td></tr>';
echo '<tr>';
$newrow=0;
foreach($context['TPortal']['team'] as $team)
{
echo '
<td valign="top" width="18%">'.$team['avatar']['image'].'</td>';
echo ' <td valign="top" class="middletext" style="padding: 2px;">';
echo '<h2 style="margin-top: 0; margin-bottom: 4px;"><b>'.$team['link'].'</b></h2>';
echo '<b>'. $team['usertitle'].'</b><br />';
if (!$list_by_group)
echo '<b>'.$txt[87].'</b>: '.$team['groupname'].'<br />';
if ($modSettings['karmaMode'] == '1')
echo '<b>', $modSettings['karmaLabel'], '</b> ', $team['karmagood'] - $team['karmabad'], '<br />';
elseif ($modSettings['karmaMode'] == '2')
echo '<b>', $modSettings['karmaLabel'], '</b> +', $team['karmagood'], ' | -', $team['karmabad'], '<br />';
echo '<b>'.$txt['lastLoggedIn'].'</b>: '.$team['last_login'].'<br />';
echo !empty($team['location']) ? '<b>'.$txt[227].'</b>: '.$team['location'].'<br />' : '';
echo !empty($team['website']['title']) ? '<b>'.$txt[96].'</b>: <a href="'.$team['website']['url'].'" target="_blank"><u>'.$team['website']['title'].'</u></a><br />' : '';
echo $team['online']['is_online'] ? '<img src="'.$team['online']['image_href'].'" alt="" /> '.$team['online']['text'].'<br />' : $team['online']['text'].'<br />';
echo '<b>'.$txt[86].'</b>: '.$team['posts'].'<br />';
echo !empty($team['blurb']) ? '<i>- '.$team['blurb'].'</i><br />' : '';
echo !empty($team['teamtext']) ? $team['teamtext'].'<br />' : '';
if (($extra_type == 'board') && !empty($team['member_page']))
echo '<a href="' . $scripturl . '?board=' . $team['member_page'] . '"><u>'. $extra_label_prefix . $team['name'] . $extra_label_suffix . '</u></a><br />';
if (($extra_type == 'page') && !empty($team['member_page']))
echo '<a href="' . $scripturl . '?page=' . $team['member_page'] . '"><u>'. $extra_label_prefix . $team['name'] . $extra_label_suffix . '</u></a><br />';
echo '
</td>';
$newrow++;
if($newrow>1){
$newrow=0;
echo '</tr><tr><td colspan="4"></td></tr><tr>';
}
}
if($newrow=1) echo '<td colspan="2"></td>';
echo '</tr>';
}
}
echo '</table>';
Edit 1: Fix for moderators repeating.
Edit 2: Fix for MySQL versioning (?) issue.
Great work dont here jacortina :)
Whats really a drawback in this routine, is that the more groups you add, the more resource intensive db calls you make. Rather it should just one call that fetch the info from all the groups added.
Gotta save that poor server lol. :)
Quote from: Bloc on October 14, 2006, 09:56:33 AM
Whats really a drawback in this routine, is that the more groups you add, the more resource intensive db calls you make. Rather it should just one call that fetch the info from all the groups added.
Gotta save that poor server lol. :)
True (though the consolidated list only does one call, no matter the number of groups).
What makes a sinlge query for the broken-out list more than a little problematic is that there's no easily defined way for the ordering by groups the current method provides. As you see in my example, the 12-11-9-10-25 ordering (along with the fact that the 'qualifying' group matching can be from any of a number of columns - including the additionalGroups column which itself is an array of possible values to match - or even due to the existence of a record in a separate table) makes attempts to sort/break the the fetched results something I can't readily envision. :-\
thanks for this, but I am getting multiple instances of the moderator, but none of admin, what do I change to fix this?
Thanks Les
How have you set the 'switches' at the top of script?
EDIT: And what is the group list?
$groups_list = array(1, 12, 11, 9, 10, 25);
Is this the switches? then I have the Mod to True, just one thing I only have one moderator on my board.
$list_by_group = true;
$include_nonprimary_groups = true;
$include_post_groups = false;
$include_moderators = true;
$repeats_allowed = false;
Thanks Les
The 'switches' seem fine for a grouped list (separate sections) which includes checks for matching on both primary and additional membergroups.
I see the groups that I left in the script. Not sure right now why those extra groups would cause a repeat on the moderator, though.
Are you looking to list Admin(s) and Moderator(s)?
Each in their own section, right?
$groups_list = array(1);
How about Global Moderators?
$groups_list = array(1, 2);
(In both cases, board moderators are pulled in by the: $include_moderators = true;)
if I set $include_moderators = true; this (http://www.lesmonds.co.uk/smf/index.php?action=team) is what it looks like for moderators, all the rest are ok
Arrrrghhh!
Does this member, by any chance, moderate 13 boards?
Let me look into it.
yes I see what it is now, not that I could fix it :)
Thanks Les
I know now how you look like Lesmond :)
Just saw your gallery on your site, love the enviroment there, great pictures, and very nice to see how you look like, it's fun to have a face to put with all the words :)
OK. Fixed (hopefully) code put in place in original message:
http://www.tinyportal.net/smf/index.php?topic=8555.msg79951#msg79951
(remember to check/fix the group list for your needs)
Thank you very much jacortina that done the trick :) sorry to have put you to all this trouble.
Quote from: G6 on October 14, 2006, 10:15:56 PM
I know now how you look like Lesmond :)
Just saw your gallery on your site, love the enviroment there, great pictures, and very nice to see how you look like, it's fun to have a face to put with all the words :)
Hope I didn't scare you too much G6 :) you are more than welcome any time
Quote from: Lesmond on October 14, 2006, 10:43:26 PM
Thank you very much jacortina that done the trick :) sorry to have put you to all this trouble.
Not at all. The original code was incorrect. If you hadn't caught it, someone else would.
@ jacortina - one notice
In my case i have only admin and one global mod. Your changed code works only if minimum 1 moderator is defined, otherwise it shows only the "intro text".
Joachim
Quote from: Joachim on October 15, 2006, 08:17:12 AM
@ jacortina - one notice
In my case i have only admin and one global mod. Your changed code works only if minimum 1 moderator is defined, otherwise it shows only the "intro text".
Joachim
Just put in fix for what appears to be a MySQL versioning issue.
Code working fine on my site mirror on my PC wasn't even working on my own live site. ;)
Changing from the implied JOIN type to explicit for the moderator's table appears to have fixed it. Have changed the code in the message:
http://www.tinyportal.net/smf/index.php?topic=8555.msg79951#msg79951
Try it (change groups/switches/title) and see if that straightens it out.
Now it works like charm :up:
Thank you!
I am getting a Database Error with this now, dont know why though I have not changed anything :o anyone know whats going on?
QuoteThe SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
File: /home/sites/xxxxxxxx/public_html/smf/Sources/Load.php(1733) : eval()'d code(9) : eval()'d code
Line: 106
here is the code I am using, if it helps :) this is for the meet the team page
global $txt, $scripturl, $user_info, $context, $modSettings, $ID_MEMBER, $board_info, $settings, $db_prefix;
//////////////////////////////////////// Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(1, 2, 11);
////////////////////////////////////////
$list_by_group = true; // \'true\' for separate sections by group; \'false\' for consolidated list
$include_nonprimary_groups = true; // \'true\' to check for group membership in additional groups; \'false\' for primary only
$include_post_groups = false; // \'true\' to include post-count based group in membership search
$include_moderators = true; // \'true\' to include board moderators on page
$repeats_allowed = false; // \'true\' to allow multiple appearances by member on page (for $list_by_group = true only)
$sort_by = \'name\'; // choices - \'id\' ascending(default), \'posts\' descending, \'name\' ascending
$extra_type = \'none\'; // choices - \'none\'(default), \'board\' links, \'page\' (article) links
///////////////////
// Format - $extra_links[\'<member userid #>\'] = \'<forum board #>\';
// or $extra_links[\'<member userid #>\'] = \'<TP article #>\';
$extra_links = array();
$extra_links[\'3\'] = \'5\';
$extra_links[\'2\'] = \'11\';
$extra_label_prefix = \'Page of \'; // text to precede member\'s name in link label for extra link
$extra_label_suffix = \'\'; // text to append to member\'s name in link label for extra link
$page_title = \'Meet the team at Lesmonds Place!\';
$page_subtitle = \'The people you will run into while visiting\';
$moderator_group = 3;
///////////////////////////////////////////////////////////////////////////////////////
$sort_ord = \'mem.ID_MEMBER ASC\';
if ($sort_by == \'posts\') $sort_ord = \'mem.posts DESC\';
if ($sort_by == \'name\') $sort_ord = \'mem.realName ASC\';
if (($extra_type != \'board\') && ($extra_type != \'page\')) $extra_type = \'none\';
if ($include_moderators)
{if (!in_array($moderator_group, $groups_list)) $groups_list[] = $moderator_group;}
$groups_to_use = array();
if ($list_by_group)
{$groups_to_use = $groups_list;}
else
{$groups_to_use[] = 0;}
$users_already_listed = array();
$users_already_listed[] = 0;
loadLanguage(\'Profile\');
echo \'<table align=\"center\" width=\"96%\" cellpadding=\"3\" cellspacing=\"2\"><tr>
<td colspan=\"4\"><h2>\', $page_title, \'</h2>
<span class=\"smalltext\">\', $page_subtitle, \'</span><br /></td></tr>\';
if (!$list_by_group)
echo \'<tr><td colspan=\"4\"><br /></td></tr><tr width=\"95%\" style=\"margin-top: 4px;\">
<td class=\"windowbg3\" colspan=\"4\" style=\"border-top: 2px solid #d0d0d0; padding-top: 4px; \"><h2> </h2>
</td></tr>\';
foreach($groups_to_use 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);
$groupNameX=$row[0];
mysql_free_result($request);
}
if ($list_by_group) {
$select_where = \'mem.ID_GROUP = \'.$groupnumber;
if ($include_nonprimary_groups) $select_where .= \' OR FIND_IN_SET(\'.$groupnumber.\', mem.additionalGroups)\';
if ($include_post_groups) $select_where .= \' OR mem.ID_POST_GROUP = \'.$groupnumber;
if ($include_moderators && ($groupnumber == $moderator_group)) $select_where = \'mem.ID_MEMBER = m.ID_MEMBER\';
}
else {
$select_where = \'mem.ID_GROUP IN (\' . implode(\', \', $groups_list) . \')\';
if ($include_nonprimary_groups) $select_where .= \' OR FIND_IN_SET(\' . implode(\', mem.additionalGroups) OR FIND_IN_SET(\', $groups_list) . \', mem.additionalGroups)\';
if ($include_post_groups) $select_where .= \' OR mem.ID_POST_GROUP IN (\' . implode(\', \', $groups_list) . \')\';
if ($include_moderators) $select_where .= \'OR mem.ID_MEMBER = m.ID_MEMBER\';
}
$select_where = \'(\' . $select_where . \') AND mem.ID_MEMBER NOT IN (\' . implode(\', \', $users_already_listed) . \')\';
// 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.additionalGroups, mem.ID_MEMBER as memnum, mem.memberName, mem.ID_GROUP,
mem.usertitle, mem.karmaBad, mem.karmaGood, mem.realName, mem.lastLogin, mem.websiteTitle,
mem.websiteUrl, mem.location, mem.posts, them.value AS teamtext, m.ID_MEMBER as modmem, g.groupName
FROM ({$db_prefix}members AS mem, {$db_prefix}moderators AS m)
LEFT JOIN {$db_prefix}membergroups AS g ON (g.ID_GROUP = mem.ID_GROUP)
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 $select_where
GROUP BY mem.ID_MEMBER
ORDER BY $sort_ord\", __FILE__, __LINE__);
$new_loaded_ids = array();
$member_count = 0;
while ($row = mysql_fetch_assoc($request))
{
if (!$repeats_allowed) $users_already_listed[$row[\'memnum\']] = $row[\'memnum\'];
$member_count += 1;
$avatar_width = \'\';
$avatar_height = \'\';
if($context[\'browser\'][\'is_ie6\']) $avatar_width = \'width=\"\' . $modSettings[\'avatar_max_width_external\'] . \'\"\';
$context[\'TPortal\'][\'team\'][] = array(
\'username\' => $row[\'memberName\'],
\'usertitle\' => $row[\'usertitle\'],
\'name\' => $row[\'realName\'],
\'groupname\' => ($groupnum == 0) ? $row[\'groupName\'] : $groupNameX ,
\'posts\' => $row[\'posts\'],
\'karmabad\' => $row[\'karmaBad\'],
\'karmagood\' => $row[\'karmaGood\'],
\'location\' => $row[\'location\'],
\'href\' => $scripturl . \'?action=profile;u=\' . $row[\'memnum\'],
\'link\' => \'<a href=\"\' . $scripturl . \'?action=profile;u=\' . $row[\'memnum\'] . \'\" 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=\"\" style=\"max-height:280px;max-width:180px;\" border=\"0\" />\' : \'\') : (stristr($row[\'avatar\'], \'http://\') ? \'<img src=\"\' . $row[\'avatar\'] . \'\"\' . $avatar_width . $avatar_height . \' alt=\"\" style=\"max-height:280px;max-width:180px;\" border=\"0\" />\' : \'<img src=\"\' . $modSettings[\'avatar_url\'] . \'/\' . htmlspecialchars($row[\'avatar\']) . \'\" alt=\"\" style=\"max-height:280px;max-width:180px;\" 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\'],
\'member_page\' => ($extra_type == \'none\') ? \'\' : empty($extra_links[$row[\'memnum\']]) ? \'\' : $extra_links[$row[\'memnum\']],
);
}
mysql_free_result($request);
if ($member_count > 0)
{
if ($list_by_group)
echo \'<tr><td colspan=\"4\"><br /></td></tr><tr width=\"95%\" style=\"margin-top: 4px;\">
<td class=\"windowbg3\" colspan=\"4\" style=\"border-top: 2px solid #d0d0d0; padding-top: 4px; \"><h2>\' . $groupNameX . \'</h2>
</td></tr>\';
echo \'<tr>\';
$newrow=0;
foreach($context[\'TPortal\'][\'team\'] as $team)
{
echo \'
<td valign=\"top\" width=\"18%\">\'.$team[\'avatar\'][\'image\'].\'</td>\';
echo \' <td valign=\"top\" class=\"middletext\" style=\"padding: 2px;\">\';
echo \'<h2 style=\"margin-top: 0; margin-bottom: 4px;\"><b>\'.$team[\'link\'].\'</b></h2>\';
echo \'<b>\'. $team[\'usertitle\'].\'</b><br />\';
if (!$list_by_group)
echo \'<b>\'.$txt[87].\'</b>: \'.$team[\'groupname\'].\'<br />\';
if ($modSettings[\'karmaMode\'] == \'1\')
echo \'<b>\', $modSettings[\'karmaLabel\'], \'</b> \', $team[\'karmagood\'] - $team[\'karmabad\'], \'<br />\';
elseif ($modSettings[\'karmaMode\'] == \'2\')
echo \'<b>\', $modSettings[\'karmaLabel\'], \'</b> +\', $team[\'karmagood\'], \' | -\', $team[\'karmabad\'], \'<br />\';
echo \'<b>\'.$txt[\'lastLoggedIn\'].\'</b>: \'.$team[\'last_login\'].\'<br />\';
echo !empty($team[\'location\']) ? \'<b>\'.$txt[227].\'</b>: \'.$team[\'location\'].\'<br />\' : \'\';
echo !empty($team[\'website\'][\'title\']) ? \'<b>\'.$txt[96].\'</b>: <a href=\"\'.$team[\'website\'][\'url\'].\'\" target=\"_blank\"><u>\'.$team[\'website\'][\'title\'].\'</u></a><br />\' : \'\';
echo $team[\'online\'][\'is_online\'] ? \'<img src=\"\'.$team[\'online\'][\'image_href\'].\'\" alt=\"\" /> \'.$team[\'online\'][\'text\'].\'<br />\' : $team[\'online\'][\'text\'].\'<br />\';
echo \'<b>\'.$txt[86].\'</b>: \'.$team[\'posts\'].\'<br />\';
echo !empty($team[\'blurb\']) ? \'<i>- \'.$team[\'blurb\'].\'</i><br />\' : \'\';
echo !empty($team[\'teamtext\']) ? $team[\'teamtext\'].\'<br />\' : \'\';
if (($extra_type == \'board\') && !empty($team[\'member_page\']))
echo \'<a href=\"\' . $scripturl . \'?board=\' . $team[\'member_page\'] . \'\"><u>\'. $extra_label_prefix . $team[\'name\'] . $extra_label_suffix . \'</u></a><br />\';
if (($extra_type == \'page\') && !empty($team[\'member_page\']))
echo \'<a href=\"\' . $scripturl . \'?page=\' . $team[\'member_page\'] . \'\"><u>\'. $extra_label_prefix . $team[\'name\'] . $extra_label_suffix . \'</u></a><br />\';
echo \'
</td>\';
$newrow++;
if($newrow>1){
$newrow=0;
echo \'</tr><tr><td colspan=\"4\"></td></tr><tr>\';
}
}
if($newrow=1) echo \'<td colspan=\"2\"></td>\';
echo \'</tr>\';
}
}
echo \'</table>\';
Well, I'm lost. ???
The main query there does a lot of table joins, but it's not really any more extensive than some of the queries used in the SMF scripts.
Also, looking into this, SQL_BIG_SELECTS is supposedly ON (1) by default at connection time.
Thanks J.A, I just don't know what happened it was working fine, then this pops up from nowhere, I haven't added any mods since or changed anything, so I to am lost :(
Using your code everything is working great. I have it so it displays the way I want but when a user clicks the link to go to the team page one time I get all the following errors. Anyone send me in the right direction to get this fixed?
Thank you in advance
Brian
George Today at 03:13:26 AM
xx.xx.xxx.xxx c25303645927c373bb529ec3a8942c5f
http://mysite/forum2/index.php?page=17
8: Undefined index: 1
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 151
George Today at 03:13:26 AM
xx.xx.xxx.xxx c25303645927c373bb529ec3a8942c5f
http://mysite/forum2/index.php?page=17
8: Undefined variable: groupnum
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 125
George Today at 03:13:26 AM
xx.xx.xxx.xxx c25303645927c373bb529ec3a8942c5f
http://mysite/forum2/index.php?page=17
8: Undefined index: 5
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 151
George Today at 03:13:26 AM
xx.xx.xxx.xxx c25303645927c373bb529ec3a8942c5f
http://mysite/forum2/index.php?page=17
8: Undefined variable: groupnum
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 125
George Today at 03:13:26 AM
xx.xx.xxx.xxx c25303645927c373bb529ec3a8942c5f
http://mysite/forum2/index.php?page=17
8: Undefined variable: groupnum
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 125
George Today at 03:13:26 AM
xx.xx.xxx.xxx c25303645927c373bb529ec3a8942c5f
http://mysite/forum2/index.php?page=17
8: Undefined variable: groupnum
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 125
George Today at 03:13:26 AM
xx.xx.xxx.xxx c25303645927c373bb529ec3a8942c5f
http://mysite/forum2/index.php?page=17
8: Undefined index: 4
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 151
George Today at 03:13:26 AM
xx.xx.xxx.xxx c25303645927c373bb529ec3a8942c5f
http://mysite/forum2/index.php?page=17
8: Undefined variable: groupnum
File: /home/xxxxx/public_html/forum2/Themes/default/languages/Profile.english.php (eval?)
Line: 125
Look for the language files from the snippets and add it to the language files you get the errors from.
The problem with the undefined variable is due to this line:
\'groupname\' => ($groupnum == 0) ? $row[\'groupName\'] : $groupNameX ,
From a cursory glance over your code, I think that if you change it to
\'groupname\' => ($groupnumber == 0) ? $row[\'groupName\'] : $groupNameX ,
you should be all right.
I'm not sure where your undefined index error is coming from, but you should look for some place that uses a conditional statement and a numerical array.
That fixed the Undefined variable: groupnum
error on line 125.
Thank You very much
The only errors left are the three Undefined index errors on line 151.
Here is the code I am using on line 151
'member_page' => ($extra_type == 'none') ? '' : empty($extra_links[$row['memnum']]) ? '' : $extra_links[$row['memnum']],
Ok I have deleted that line and everything seems to be working fine now with no errors. But since I do not understand php at all even though I have spent countless hours working with it I probably have some pretty messed up code. This is what I have ended up with.
global $txt, $scripturl, $user_info, $context, $modSettings, $ID_MEMBER, $board_info, $settings, $db_prefix;
//////////////////////////////////////// Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(10, 9, 1);
////////////////////////////////////////
$list_by_group = true; // 'true' for separate sections by group; 'false' for consolidated list
$include_nonprimary_groups = false; // 'true' to check for group membership in additional groups; 'false' for primary only
$include_post_groups = false; // 'true' to include post-count based group in membership search
$include_moderators = false; // 'true' to include board moderators on page
$repeats_allowed = false; // 'true' to allow multiple appearances by member on page (for $list_by_group = true only)
$sort_by = 'name'; // choices - 'id' ascending(default), 'posts' descending, 'name' ascending
$extra_type = 'none'; // choices - 'none'(default), 'board' links, 'page' (article) links
///////////////////
// Format - $extra_links['<member userid #>'] = '<forum board #>';
// or $extra_links['<member userid #>'] = '<TP article #>';
$extra_links = array();
$extra_links['3'] = '5';
$extra_links['2'] = '11';
$extra_label_prefix = 'Page of '; // text to precede member's name in link label for extra link
$extra_label_suffix = ''; // text to append to member's name in link label for extra link
$page_title = 'Meet the Team!';
$page_subtitle = 'The people you will meet when you come to camp';
$moderator_group = 3;
///////////////////////////////////////////////////////////////////////////////////////
$sort_ord = 'mem.ID_MEMBER ASC';
if ($sort_by == 'posts') $sort_ord = 'mem.posts DESC';
if ($sort_by == 'name') $sort_ord = 'mem.realName ASC';
if (($extra_type != 'board') && ($extra_type != 'page')) $extra_type = 'none';
if ($include_moderators)
{if (!in_array($moderator_group, $groups_list)) $groups_list[] = $moderator_group;}
$groups_to_use = array();
if ($list_by_group)
{$groups_to_use = $groups_list;}
else
{$groups_to_use[] = 0;}
$users_already_listed = array();
$users_already_listed[] = 0;
loadLanguage('Profile');
echo '<table align="center" width="96%" cellpadding="3" cellspacing="2"><tr>
<td colspan="4"><h2>', $page_title, '</h2>
<span class="smalltext">', $page_subtitle, '</span><br /></td></tr>';
if (!$list_by_group)
echo '<tr><td colspan="4"><br /></td></tr><tr width="95%" style="margin-top: 4px;">
<td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2> </h2>
</td></tr>';
foreach($groups_to_use 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);
$groupNameX=$row[0];
mysql_free_result($request);
}
if ($list_by_group) {
$select_where = 'mem.ID_GROUP = '.$groupnumber;
if ($include_nonprimary_groups) $select_where .= ' OR FIND_IN_SET('.$groupnumber.', mem.additionalGroups)';
if ($include_post_groups) $select_where .= ' OR mem.ID_POST_GROUP = '.$groupnumber;
if ($include_moderators && ($groupnumber == $moderator_group)) $select_where = 'mem.ID_MEMBER = m.ID_MEMBER';
}
else {
$select_where = 'mem.ID_GROUP IN (' . implode(', ', $groups_list) . ')';
if ($include_nonprimary_groups) $select_where .= ' OR FIND_IN_SET(' . implode(', mem.additionalGroups) OR FIND_IN_SET(', $groups_list) . ', mem.additionalGroups)';
if ($include_post_groups) $select_where .= ' OR mem.ID_POST_GROUP IN (' . implode(', ', $groups_list) . ')';
if ($include_moderators) $select_where .= 'OR mem.ID_MEMBER = m.ID_MEMBER';
}
$select_where = '(' . $select_where . ') AND mem.ID_MEMBER NOT IN (' . implode(', ', $users_already_listed) . ')';
// 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.additionalGroups, mem.ID_MEMBER as memnum, mem.memberName, mem.ID_GROUP,
mem.usertitle, mem.karmaBad, mem.karmaGood, mem.realName, mem.lastLogin, mem.websiteTitle,
mem.websiteUrl, mem.location, mem.posts, them.value AS teamtext, m.ID_MEMBER as modmem, g.groupName
FROM ({$db_prefix}members AS mem)
LEFT JOIN {$db_prefix}moderators AS m ON (m.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS g ON (g.ID_GROUP = mem.ID_GROUP)
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 $select_where
GROUP BY mem.ID_MEMBER
ORDER BY $sort_ord", __FILE__, __LINE__);
$new_loaded_ids = array();
$member_count = 0;
while ($row = mysql_fetch_assoc($request))
{
if (!$repeats_allowed) $users_already_listed[$row['memnum']] = $row['memnum'];
$member_count += 1;
$avatar_width = '';
$avatar_height = '';
if($context['browser']['is_ie6']) $avatar_width = 'width="' . $modSettings['avatar_max_width_external'] . '"';
$context['TPortal']['team'][] = array(
'username' => $row['memberName'],
'usertitle' => $row['usertitle'],
'name' => $row['realName'],
'groupname' => ($groupnumber == 0) ? $row['groupName'] : $groupNameX ,
'posts' => $row['posts'],
'karmabad' => $row['karmaBad'],
'karmagood' => $row['karmaGood'],
'location' => $row['location'],
'href' => $scripturl . '?action=profile;u=' . $row['memnum'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['memnum'] . '" 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="" style="max-height:280px;max-width:180px;" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" style="max-height:280px;max-width:180px;" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" style="max-height:280px;max-width:180px;" 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);
if ($member_count > 0)
{
if ($list_by_group)
echo '<tr><td colspan="4"><br /></td></tr><tr width="95%" style="margin-top: 4px;">
<td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2>' . $groupNameX . '</h2>
</td></tr>';
echo '<tr>';
$newrow=0;
foreach($context['TPortal']['team'] as $team)
{
echo '
<td valign="top" width="18%">'.$team['avatar']['image'].'</td>';
echo ' <td valign="top" class="middletext" style="padding: 2px;">';
echo '<h2 style="margin-top: 0; margin-bottom: 4px;"><b>'.$team['link'].'</b></h2>';
echo '<b>'. $team['usertitle'].'</b><br />';
if (!$list_by_group)
echo '<b>'.$txt[87].'</b>: '.$team['groupname'].'<br />';
echo !empty($team['location']) ? '<b>'.$txt[227].'</b>: '.$team['location'].'<br />' : '';
echo !empty($team['website']['title']) ? '<b>'.$txt[96].'</b>: <a href="'.$team['website']['url'].'" target="_blank"><u>'.$team['website']['title'].'</u></a><br />' : '';
echo $team['online']['is_online'] ? '<img src="'.$team['online']['image_href'].'" alt="" /> '.$team['online']['text'].'<br />' : $team['online']['text'].'<br />';
echo '
</td>';
$newrow++;
if($newrow>1){
$newrow=0;
echo '</tr><tr><td colspan="4"></td></tr><tr>';
}
}
if($newrow=1) echo '<td colspan="2"></td>';
echo '</tr>';
}
}
echo '</table>';
I think I know what your problem was, but if it's working now, it must not be a problem. Still...
You have
$extra_links = array();
$extra_links['3'] = '5';
$extra_links['2'] = '11';
I think it's looking for $extra_links['1'], $extra_links['5'] and $extra_links['4']. If they're all equal to 0, you should still set them. Also, you don't need to have all of those single quotes.
$extra_links = array();
$extra_links[1] = 0;
$extra_links[2] = 11;
$extra_links[3] = 5;
$extra_links[4] = 0;
$extra_links[5] = 0;
Thank You very much that seemed to work. I put the code I deleted back in and I had to add one more line $extra_links[6] = 0; and I have no errors again. With all the code I deleted to get the appearance I wanted I am sure it is doing a lot of things it doesn't need to but it is working with 0 errors.
Thank You again
Good. :) I'm glad I was able to help.
I have been using this code for my Intranet site roster and it's great. I also have the Custom Fields Mod and added Phone, Pager, Cell, etc. How do I pull the items from the Custom Fields Mod database table to display those fields in this roster?
QuoteHow do I pull the items from the Custom Fields Mod database table to display those fields in this roster?
That will take a little work. In general, as you go through the loop to display the data for each person, you'll have to access the "settings" table that holds the custom fields to pull the info.
I'll look at it tomorrow. I'm a bit tired tonight.
How would I make this display within its own tab?
How does this code work?
ChetUbetcha, there's a lot of code floating around in this topic. It would probably be best if you posted the code you're using, so I can start from there.
Miles, I don't know what you mean. If you want tabbed content in a block, look for the topic about tabbed content for information about how to do it.
Shadow Queen, are you asking what it does? It lists the admins and moderators of a site. Usually the best way to find out what a given piece of code does is to try it out. If you don't want it after you see it, you can just delete it.
Alright, Where at I can found the correct code? And which box I have to use. I like to try it out.
First, almost everything posted on this board with code is php, unless it says it should go in a scriptbox. This is best in a php article.
As for which code to try, read the posts. Experiment. If one doesn't work, try another one, or apply the fixes to the code that follow it. That is the best way to learn.
Alright, You are correct about that one. I am going to try each code out to see which one work.
Ok, My First question is how do I get the code presentable in this format.
Color= Status of group = Milesâ„¢
Last seen: Today at 5:17 PM
Posts: 157
Position: Administrator
Location: Eugene, Oregon
Website: www.geekinc.info
[Online icon]Offline
Bio/quote etc..
The Code I am using
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(12, 11, 9, 10, 25);
/////////////////////////////////////////////////////////////////
echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
<td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">The people you will run into while visiting GeekInc.info</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 #d0d0d0; 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>';
2) Question : I want to have it's own tab within the Navigation Meet The Team page how can I create an individual Block that I can link via the navigation
I don't know what
QuoteColor= Status of group = Milesâ„¢
means. I'll need you to explain.
As for the tabs, someone else will have to help you with that. I don't do javascript. :)
Color of the memergroup I am in on my forum for example The color of my name is red
the developer's color is orange etc..
but there name would appear that color on the team page
as for the block how do I make an individual block that I can link to a tab no center or left or right block just a plain page that I Can link it to the team page
QuoteColor of the memergroup
Oh, okay. I think that's doable.
What about "status of group"?
If you want to make just a plain page, make a php article. If that's not what you need, we'll have to wait for someone else to figure it out.
Status of the group was just refering, to the color of the member group
Miles <==Red because thats whats defined in the membergroup for admins
As for the individual page I just want the team page linked
is there anyone else who can help me with this code?
Please don't hijack this topic and make it your own, Jpdeni had surgery can anyone else help me with the above code?
I use this code which was given earlier in this threas and it works great but with one error:
First the code:
global $txt, $scripturl, $user_info, $context, $modSettings, $ID_MEMBER, $board_info, $settings, $db_prefix;
//////////////////////////////////////// Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(10);
////////////////////////////////////////
$list_by_group = true; // 'true' for separate sections by group; 'false' for consolidated list
$include_nonprimary_groups = true; // 'true' to check for group membership in additional groups; 'false' for primary only
$include_post_groups = false; // 'true' to include post-count based group in membership search
$include_moderators = false; // 'true' to include board moderators on page
$repeats_allowed = false; // 'true' to allow multiple appearances by member on page (for $list_by_group = true only)
$sort_by = 'name'; // choices - 'id' ascending(default), 'posts' descending, 'name' ascending
$extra_type = 'none'; // choices - 'none'(default), 'board' links, 'page' (article) links
///////////////////
// Format - $extra_links['<member userid #>'] = '<forum board #>';
// or $extra_links['<member userid #>'] = '<TP article #>';
$extra_links = array();
$extra_links['3'] = '5';
$extra_links['2'] = '11';
$extra_label_prefix = 'Page of '; // text to precede member's name in link label for extra link
$extra_label_suffix = ''; // text to append to member's name in link label for extra link
$page_title = 'Lista på alla användare som har donerat till ***.com';
$page_subtitle = 'Vi tackar alla som donerat och som hjälper ***.com att finansieras.';
$moderator_group = 3;
///////////////////////////////////////////////////////////////////////////////////////
$sort_ord = 'mem.ID_MEMBER ASC';
if ($sort_by == 'posts') $sort_ord = 'mem.posts DESC';
if ($sort_by == 'name') $sort_ord = 'mem.realName ASC';
if (($extra_type != 'board') && ($extra_type != 'page')) $extra_type = 'none';
if ($include_moderators)
{if (!in_array($moderator_group, $groups_list)) $groups_list[] = $moderator_group;}
$groups_to_use = array();
if ($list_by_group)
{$groups_to_use = $groups_list;}
else
{$groups_to_use[] = 0;}
$users_already_listed = array();
$users_already_listed[] = 0;
loadLanguage('Profile');
echo '<table align="center" width="96%" cellpadding="3" cellspacing="2"><tr>
<td colspan="4"><center><h2>', $page_title, '</h2></center>
<span class="smalltext"><center>', $page_subtitle, '</center></span><br /></td></tr>';
if (!$list_by_group)
echo '<tr><td colspan="4"><br /></td></tr><tr width="95%" style="margin-top: 4px;">
<td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2> </h2>
</td></tr>';
foreach($groups_to_use 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);
$groupNameX=$row[0];
mysql_free_result($request);
}
if ($list_by_group) {
$select_where = 'mem.ID_GROUP = '.$groupnumber;
if ($include_nonprimary_groups) $select_where .= ' OR FIND_IN_SET('.$groupnumber.', mem.additionalGroups)';
if ($include_post_groups) $select_where .= ' OR mem.ID_POST_GROUP = '.$groupnumber;
if ($include_moderators && ($groupnumber == $moderator_group)) $select_where = 'mem.ID_MEMBER = m.ID_MEMBER';
}
else {
$select_where = 'mem.ID_GROUP IN (' . implode(', ', $groups_list) . ')';
if ($include_nonprimary_groups) $select_where .= ' OR FIND_IN_SET(' . implode(', mem.additionalGroups) OR FIND_IN_SET(', $groups_list) . ', mem.additionalGroups)';
if ($include_post_groups) $select_where .= ' OR mem.ID_POST_GROUP IN (' . implode(', ', $groups_list) . ')';
if ($include_moderators) $select_where .= 'OR mem.ID_MEMBER = m.ID_MEMBER';
}
$select_where = '(' . $select_where . ') AND mem.ID_MEMBER NOT IN (' . implode(', ', $users_already_listed) . ')';
// 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.additionalGroups, mem.ID_MEMBER as memnum, mem.memberName, mem.ID_GROUP,
mem.usertitle, mem.karmaBad, mem.karmaGood, mem.realName, mem.lastLogin, mem.websiteTitle,
mem.websiteUrl, mem.location, mem.posts, them.value AS teamtext, m.ID_MEMBER as modmem, g.groupName
FROM ({$db_prefix}members AS mem)
LEFT JOIN {$db_prefix}moderators AS m ON (m.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS g ON (g.ID_GROUP = mem.ID_GROUP)
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 $select_where
GROUP BY mem.ID_MEMBER
ORDER BY $sort_ord", __FILE__, __LINE__);
$new_loaded_ids = array();
$member_count = 0;
while ($row = mysql_fetch_assoc($request))
{
if (!$repeats_allowed) $users_already_listed[$row['memnum']] = $row['memnum'];
$member_count += 1;
$avatar_width = '';
$avatar_height = '';
if($context['browser']['is_ie6']) $avatar_width = 'width="' . $modSettings['avatar_max_width_external'] . '"';
$context['TPortal']['team'][] = array(
'username' => $row['memberName'],
'usertitle' => $row['usertitle'],
'name' => $row['realName'],
'groupname' => ($groupnumber == 0) ? $row['groupName'] : $groupNameX ,
'posts' => $row['posts'],
'karmabad' => $row['karmaBad'],
'karmagood' => $row['karmaGood'],
'location' => $row['location'],
'href' => $scripturl . '?action=profile;u=' . $row['memnum'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['memnum'] . '" 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="" style="max-height:280px;max-width:180px;" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" style="max-height:280px;max-width:180px;" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" style="max-height:280px;max-width:180px;" 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'],
'member_page' => ($extra_type == 'none') ? '' : empty($extra_links[$row['memnum']]) ? '' : $extra_links[$row['memnum']],
);
}
mysql_free_result($request);
if ($member_count > 0)
{
if ($list_by_group)
echo '<tr><td colspan="4"><br /></td></tr><tr width="95%" style="margin-top: 4px;">
<td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2>' . $groupNameX . '</h2>
</td></tr>';
echo '<tr>';
$newrow=0;
foreach($context['TPortal']['team'] as $team)
{
echo '
<td valign="top" width="18%">'.$team['avatar']['image'].'</td>';
echo ' <td valign="top" class="middletext" style="padding: 2px;">';
echo '<h2 style="margin-top: 0; margin-bottom: 4px;"><b>'.$team['link'].'</b></h2>';
echo '<b>'. $team['usertitle'].'</b><br />';
if (!$list_by_group)
echo '<b>'.$txt[87].'</b>: '.$team['groupname'].'<br />';
if ($modSettings['karmaMode'] == '1')
echo '<b>', $modSettings['karmaLabel'], '</b> ', $team['karmagood'] - $team['karmabad'], '<br />';
elseif ($modSettings['karmaMode'] == '2')
echo '<b>', $modSettings['karmaLabel'], '</b> +', $team['karmagood'], ' | -', $team['karmabad'], '<br />';
echo '<b>'.$txt['lastLoggedIn'].'</b>: '.$team['last_login'].'<br />';
echo !empty($team['location']) ? '<b>'.$txt[227].'</b>: '.$team['location'].'<br />' : '';
echo !empty($team['website']['title']) ? '<b>'.$txt[96].'</b>: <a href="'.$team['website']['url'].'" target="_blank"><u>'.$team['website']['title'].'</u></a><br />' : '';
echo $team['online']['is_online'] ? '<img src="'.$team['online']['image_href'].'" alt="" /> '.$team['online']['text'].'<br />' : $team['online']['text'].'<br />';
echo '<b>'.$txt[86].'</b>: '.$team['posts'].'<br />';
echo !empty($team['blurb']) ? '<i>'.$team['blurb'].'</i><br />' : '';
echo !empty($team['teamtext']) ? $team['teamtext'].'<br />' : '';
if (($extra_type == 'board') && !empty($team['member_page']))
echo '<a href="' . $scripturl . '?board=' . $team['member_page'] . '"><u>'. $extra_label_prefix . $team['name'] . $extra_label_suffix . '</u></a><br />';
if (($extra_type == 'page') && !empty($team['member_page']))
echo '<a href="' . $scripturl . '?page=' . $team['member_page'] . '"><u>'. $extra_label_prefix . $team['name'] . $extra_label_suffix . '</u></a><br />';
echo '
</td>';
$newrow++;
if($newrow>1){
$newrow=0;
echo '</tr><tr><td colspan="4"></td></tr><tr>';
}
}
if($newrow=1) echo '<td colspan="2"></td>';
echo '</tr>';
}
}
echo '</table>';
The error in the logs:
http://www.***.com/index.php?dummy=1&page=44
8: Undefined index: 119
File: /var/www/html/Themes/default/languages/Profile.swedish.php (eval?)
Line: 151
Could anyone help me with this?
I don't think that error has any thing to do with the code.
About the only thing I can think of is if there's something about your Preofile.swedish.php file itself which tries to reference something with the "119" index (because I can't find anything in this code which does). This code DOES load that language file, which would expose any problem there.
I would suggest looking around line 151 in that file.
I am using the following code and I would like my page to look like the following format
Color= Status of group = Milesâ„¢
Last seen: Today at 5:17 PM
Posts: 157
Position: Administrator
Location: Eugene, Oregon
Website: www.geekinc.info
[Online icon]Offline
Bio/quote etc..
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(12, 11, 9, 10, 25);
/////////////////////////////////////////////////////////////////
echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
<td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">The people you will run into while visiting GeekInc.info</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 #d0d0d0; 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>';
Any takers?
Does "Color= Status of group =" mean you want the name to have the primary membergroup color?
Does "Position:" indicate membergroup name? This list does come out in membergroup order.
Yes, And yes I want it to turn out like this
I want Admins And Moderators to be Displayed and how would I add other groups in the future?
See www.geekinc.info like that but only with the below format and with admins then moderators
Color= Status of group = Milesâ„¢
Last seen: Today at 5:17 PM
Posts: 157
Position: Administrator
Location: Eugene, Oregon
Website: www.geekinc.info
[Online icon]Offline
Bio/quote etc..
Try this:
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(1, 13, 9, 10, 25);
/////////////////////////////////////////////////////////////////
echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
<td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">The people you will run into while visiting GeekInc.info</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, onlineColor FROM {$db_prefix}membergroups WHERE ID_GROUP=".$groupnumber, __FILE__, __LINE__);
$row = mysql_fetch_assoc($request);
$groupname => $row['groupName'];
$grpcolor=$row['onlineColor'];
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'] . '"><font color="'.$grpcolor.'">' . $row['realName'] . '</font></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 #d0d0d0; 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 />
<b>Position</b>: '.$team['groupname'].'<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>';
uhh now nothings working
www.geekinc.info
Oops
Find: $groupname => $row['groupName'];
Change to: $groupname = $row['groupName'];
Nice, Can you get it to were theres Admins then Moderators
Admins are membergroup 1 and Global Moderators membergroup 2. Moderators of a board or multiple boards isn't actually a membergroup (though you might see code checking for group 3). The forum software treats moderators as an attribute of the given boards (rather than boards moderated being an attribute of members).
There are other team/roster pages here that can do it, but I'm not sure if any have membergroup colored names or an additional line for position.
Ack this is so freaking confusing I just want it to display Admins, Then Moderators , Then any Addional groups I want to add gut like it is now
www.geekinc.info I dont want the stupid mac support in there gosh
and how do i add my small blurb?
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(1, 13, 9, 10, 25);
/////////////////////////////////////////////////////////////////
echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
<td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">The people you will run into while visiting GeekInc.info</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, onlineColor FROM {$db_prefix}membergroups WHERE ID_GROUP=".$groupnumber, __FILE__, __LINE__);
$row = mysql_fetch_assoc($request);
$groupname = $row['groupName'];;
$grpcolor=$row['onlineColor'];
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'] . '"><font color="'.$grpcolor.'">' . $row['realName'] . '</font></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 #d0d0d0; 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 />
<b>Position</b>: '.$team['groupname'].'<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>';
I am using this code, I would like Moderators to show up next then Global Moderators how hard is that grr can someone please help with this I know this has been asked a billion times I tried searching and can't find it
I don't think Moderators has a group ID. They inherit the permissions of the board. Don't quite think its very possible IMO.
Well then Admins , Then Global Moderators?
global mods is group ID #2. Just add that to the $groups_lists array at the top in the same number format.
$groups_list = array(1, 2, 13, 9, 10, 25);
UHH, this doesn't look good I changed $groups_list = array(1, 13, 9, 10, 25); to
$groups_list = array(1, 2, 13, 9, 10, 25); and got a big mess :o :o
http://www.geekinc.info/index.php?action=Team
You must have deleted or changed something else without knowing. Can you post the whole code that you have now?
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(1, 2, 13, 9, 10, 25);
/////////////////////////////////////////////////////////////////
echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
<td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">The people you will run into while visiting GeekInc.info</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, onlineColor FROM {$db_prefix}membergroups WHERE ID_GROUP=".$groupnumber, __FILE__, __LINE__);
$row = mysql_fetch_assoc($request);
$groupname = $row['groupName'];;
$grpcolor=$row['onlineColor'];
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'] . '"><font color="'.$grpcolor.'">' . $row['realName'] . '</font></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 #d0d0d0; 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 />
<b>Position</b>: '.$team['groupname'].'<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>';
is what i am using
Check to see if your article type has changed. Make sure its still a php article. If it is, I may have to take a look at this. PM a temp admin account if you'd like.
Ok, It works I had it selected as html lol my mistake
http://www.geekinc.info/index.php?action=Team
But site archeect and mac support need to go as for adding more groups?
lets say I want 6 mods instead of 5
hmm
6 mods instead of 5? I don't get what you're saying, sorry.
Like were it's displaying how many moderators are showing, Theres only 5 Can I display more
Are you saying you have the global moderators group added and its not showing all of them?
$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";
Because there is no veld white the name teamtext i renamed it to "woonplaats" (Dutch for City) and after that i get in the list the name of the City.
So a new question was born.
Is it posible to get the other colums for the them table, like the "Straatnaam" (Dutch for Streetname), "Huisnummer (Dutch for House number), "Postcode" (Dutch for Postcode), "Mobiel telefoon nummer" (Dutch for Mobile Number), "Vastnet telefoon nummer" (Dutch for Home Phone Number)
What i like is to place all the info from those velds under the rest of the output text. O and is it posible to get the vels discriptions in my own lang style? like in one of the post in thes topic.
here is the rest of my code:
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(21,25,19,23,22,26,20,24);
/////////////////////////////////////////////////////////////////
echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
<td style="border-bottom: 2px solid #d0d0d0; padding-bottom: 4px; "><h2>Meet the team!</h2>
<span class="smalltext">The people you will run into while visiting GeekInc.info</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, onlineColor FROM {$db_prefix}membergroups WHERE ID_GROUP=".$groupnumber, __FILE__, __LINE__);
$row = mysql_fetch_assoc($request);
$groupname = $row['groupName'];
$grpcolor=$row['onlineColor'];
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'] . '"><font color="'.$grpcolor.'">' . $row['realName'] . '</font></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 #d0d0d0; 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 />
<b>Position</b>: '.$team['groupname'].'<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>';
and in this code the feld discription is in my lang style:
global $txt, $scripturl, $user_info, $context, $modSettings, $ID_MEMBER, $board_info, $settings, $db_prefix;
//////////////////////////////////////// Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(21,25,19,23,22,26,20,24);
////////////////////////////////////////
$list_by_group = true; // 'true' for separate sections by group; 'false' for consolidated list
$include_nonprimary_groups = true; // 'true' to check for group membership in additional groups; 'false' for primary only
$include_post_groups = false; // 'true' to include post-count based group in membership search
$include_moderators = false; // 'true' to include board moderators on page
$repeats_allowed = false; // 'true' to allow multiple appearances by member on page (for $list_by_group = true only)
$sort_by = 'name'; // choices - 'id' ascending(default), 'posts' descending, 'name' ascending
$extra_type = 'none'; // choices - 'none'(default), 'board' links, 'page' (article) links
///////////////////
// Format - $extra_links['<member userid #>'] = '<forum board #>';
// or $extra_links['<member userid #>'] = '<TP article #>';
$extra_links = array();
$extra_links['3'] = '5';
$extra_links['2'] = '11';
$extra_label_prefix = 'Page of '; // text to precede member's name in link label for extra link
$extra_label_suffix = ''; // text to append to member's name in link label for extra link
$page_title = 'Meet the Team!';
$page_subtitle = 'The people around the place';
$moderator_group = 3;
///////////////////////////////////////////////////////////////////////////////////////
$sort_ord = 'mem.ID_MEMBER ASC';
if ($sort_by == 'posts') $sort_ord = 'mem.posts DESC';
if ($sort_by == 'name') $sort_ord = 'mem.realName ASC';
if (($extra_type != 'board') && ($extra_type != 'page')) $extra_type = 'none';
if ($include_moderators)
{if (!in_array($moderator_group, $groups_list)) $groups_list[] = $moderator_group;}
$groups_to_use = array();
if ($list_by_group)
{$groups_to_use = $groups_list;}
else
{$groups_to_use[] = 0;}
$users_already_listed = array();
$users_already_listed[] = 0;
loadLanguage('Profile');
echo '<table align="center" width="96%" cellpadding="3" cellspacing="2"><tr>
<td colspan="4"><h2>', $page_title, '</h2>
<span class="smalltext">', $page_subtitle, '</span><br /></td></tr>';
if (!$list_by_group)
echo '<tr><td colspan="4"><br /></td></tr><tr width="95%" style="margin-top: 4px;">
<td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2> </h2>
</td></tr>';
foreach($groups_to_use 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);
$groupNameX=$row[0];
mysql_free_result($request);
}
if ($list_by_group) {
$select_where = 'mem.ID_GROUP = '.$groupnumber;
if ($include_nonprimary_groups) $select_where .= ' OR FIND_IN_SET('.$groupnumber.', mem.additionalGroups)';
if ($include_post_groups) $select_where .= ' OR mem.ID_POST_GROUP = '.$groupnumber;
if ($include_moderators && ($groupnumber == $moderator_group)) $select_where = 'mem.ID_MEMBER = m.ID_MEMBER';
}
else {
$select_where = 'mem.ID_GROUP IN (' . implode(', ', $groups_list) . ')';
if ($include_nonprimary_groups) $select_where .= ' OR FIND_IN_SET(' . implode(', mem.additionalGroups) OR FIND_IN_SET(', $groups_list) . ', mem.additionalGroups)';
if ($include_post_groups) $select_where .= ' OR mem.ID_POST_GROUP IN (' . implode(', ', $groups_list) . ')';
if ($include_moderators) $select_where .= 'OR mem.ID_MEMBER = m.ID_MEMBER';
}
$select_where = '(' . $select_where . ') AND mem.ID_MEMBER NOT IN (' . implode(', ', $users_already_listed) . ')';
// 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.additionalGroups, mem.ID_MEMBER as memnum, mem.memberName, mem.ID_GROUP,
mem.usertitle, mem.karmaBad, mem.karmaGood, mem.realName, mem.lastLogin, mem.websiteTitle,
mem.websiteUrl, mem.location, mem.posts, them.value AS teamtext, m.ID_MEMBER as modmem, g.groupName
FROM ({$db_prefix}members AS mem)
LEFT JOIN {$db_prefix}moderators AS m ON (m.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS g ON (g.ID_GROUP = mem.ID_GROUP)
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 $select_where
GROUP BY mem.ID_MEMBER
ORDER BY $sort_ord", __FILE__, __LINE__);
$new_loaded_ids = array();
$member_count = 0;
while ($row = mysql_fetch_assoc($request))
{
if (!$repeats_allowed) $users_already_listed[$row['memnum']] = $row['memnum'];
$member_count += 1;
$avatar_width = '';
$avatar_height = '';
if($context['browser']['is_ie6']) $avatar_width = 'width="' . $modSettings['avatar_max_width_external'] . '"';
$context['TPortal']['team'][] = array(
'username' => $row['memberName'],
'usertitle' => $row['usertitle'],
'name' => $row['realName'],
'groupname' => ($groupnum == 0) ? $row['groupName'] : $groupNameX ,
'posts' => $row['posts'],
'karmabad' => $row['karmaBad'],
'karmagood' => $row['karmaGood'],
'location' => $row['location'],
'href' => $scripturl . '?action=profile;u=' . $row['memnum'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['memnum'] . '" 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="" style="max-height:280px;max-width:180px;" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" style="max-height:280px;max-width:180px;" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" style="max-height:280px;max-width:180px;" 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'],
'member_page' => ($extra_type == 'none') ? '' : empty($extra_links[$row['memnum']]) ? '' : $extra_links[$row['memnum']],
);
}
mysql_free_result($request);
if ($member_count > 0)
{
if ($list_by_group)
echo '<tr><td colspan="4"><br /></td></tr><tr width="95%" style="margin-top: 4px;">
<td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2>' . $groupNameX . '</h2>
</td></tr>';
echo '<tr>';
$newrow=0;
foreach($context['TPortal']['team'] as $team)
{
echo '
<td valign="top" width="18%">'.$team['avatar']['image'].'</td>';
echo ' <td valign="top" class="middletext" style="padding: 2px;">';
echo '<h2 style="margin-top: 0; margin-bottom: 4px;"><b>'.$team['link'].'</b></h2>';
echo '<b>'. $team['usertitle'].'</b><br />';
if (!$list_by_group)
echo '<b>'.$txt[87].'</b>: '.$team['groupname'].'<br />';
if ($modSettings['karmaMode'] == '1')
echo '<b>', $modSettings['karmaLabel'], '</b> ', $team['karmagood'] - $team['karmabad'], '<br />';
elseif ($modSettings['karmaMode'] == '2')
echo '<b>', $modSettings['karmaLabel'], '</b> +', $team['karmagood'], ' | -', $team['karmabad'], '<br />';
echo '<b>'.$txt['lastLoggedIn'].'</b>: '.$team['last_login'].'<br />';
echo !empty($team['location']) ? '<b>'.$txt[227].'</b>: '.$team['location'].'<br />' : '';
echo !empty($team['website']['title']) ? '<b>'.$txt[96].'</b>: <a href="'.$team['website']['url'].'" target="_blank"><u>'.$team['website']['title'].'</u></a><br />' : '';
echo $team['online']['is_online'] ? '<img src="'.$team['online']['image_href'].'" alt="" /> '.$team['online']['text'].'<br />' : $team['online']['text'].'<br />';
echo '<b>'.$txt[86].'</b>: '.$team['posts'].'<br />';
echo !empty($team['blurb']) ? '<i>- '.$team['blurb'].'</i><br />' : '';
echo !empty($team['teamtext']) ? $team['teamtext'].'<br />' : '';
if (($extra_type == 'board') && !empty($team['member_page']))
echo '<a href="' . $scripturl . '?board=' . $team['member_page'] . '"><u>'. $extra_label_prefix . $team['name'] . $extra_label_suffix . '</u></a><br />';
if (($extra_type == 'page') && !empty($team['member_page']))
echo '<a href="' . $scripturl . '?page=' . $team['member_page'] . '"><u>'. $extra_label_prefix . $team['name'] . $extra_label_suffix . '</u></a><br />';
echo '
</td>';
$newrow++;
if($newrow>1){
$newrow=0;
echo '</tr><tr><td colspan="4"></td></tr><tr>';
}
}
if($newrow=1) echo '<td colspan="2"></td>';
echo '</tr>';
}
}
echo '</table>';
who makes my happy?
I have been using this code for a year now and it works great. I have recently decided I would like to change the background color. I can change everything else and I know it should be an easy change but I cannot find what I need to change. Can the background color be changed? I just want it to be the windowbg background, it is using the windowbg2 background.
You try adding the class to the table?
echo '<table align="center" width="96%" cellpadding="3" cellspacing="2"><tr>
echo '<table class="windowbg" align="center" width="96%" cellpadding="3" cellspacing="2"><tr>
That's real close to what I want it just has a border around the outside edge now that uses the windowbg2 color. Can I change that?
Can I see what you're talking about? If I can look at it I can tell you what it is that needs to change.
I figured it out just had to use my head a little. I had to change the article setting to do not use title/frame.
Thanks for all your help IchBin
I cant get none of this code working on my smf portal install :( .cry .cry
Cool snippet.....
Im using it here: http://www.chevyavalancheclub.com/index.php?action=staff
but what i dont understand is,.... why member "Donnie1" is shown twice?
lol...any ideas?
how would i go about adding this to smf 2.0.4
You have to change all the things that SMF needs.
db_query() changes to use the new $smcFunc functions like $smcFunc['db_query'](). That means adding $smcFunc to the globals.
Database fields are no longer camelcase (websiteTitle would instead be website_title). This goes for all rows in the tables. The only other changes I can think of would be ID_GROUP is now id_group and ID_MEMBER is now id_member. That should be the basics of it.