';
// Loop through every area, displaying its name as a header.
foreach ($context['profile_areas'] as $section)
{
echo '
', $section['title'], ' |
';
// For every section of the area display it, and bold it if it's the current area.
foreach ($section['areas'] as $i => $area)
if ($i == $context['menu_item_selected'])
echo '
', $area, ' ';
else
echo '
', $area, ' ';
echo '
|
';
}
echo '
|
';
}
// If no areas exist just open up a containing table.
else
{
echo '
';
}
// If an error occurred whilst trying to save previously, give the user a clue!
if (!empty($context['post_errors']))
{
echo '
', template_error_message(), ' |
';
}
}
// Template for closing off table started in profile_above.
function template_profile_below()
{
global $context, $settings, $options;
echo '
|
';
}
// This template displays users details without any option to edit them.
function template_summary()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
// First do the containing table and table header.
echo '
', $txt['summary'], ' - ', $context['member']['name'], '
|
', $txt[232], ' |
';
// Do the left hand column - where all the important user info is displayed.
echo '
', $txt[68], ': |
', $context['member']['name'], ' |
';
if (!empty($modSettings['titlesEnable']) && $context['member']['title'] != '')
{
echo '
', $txt['title1'], ': |
', $context['member']['title'], ' |
';
}
echo '
', $txt[86], ': |
', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ') |
', $txt[87], ': |
', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), ' |
';
// If the person looking is allowed, they can check the members IP address and hostname.
if ($context['can_see_ip'])
{
echo '
', $txt[512], ':
|
', $context['member']['ip'], '
|
', $txt['hostname'], ':
|
', $context['member']['hostname'], '
|
';
}
// If karma enabled show the members karma.
if ($modSettings['karmaMode'] == '1')
echo '
', $modSettings['karmaLabel'], '
|
', ($context['member']['karma']['good'] - $context['member']['karma']['bad']), '
|
';
elseif ($modSettings['karmaMode'] == '2')
echo '
', $modSettings['karmaLabel'], '
|
+', $context['member']['karma']['good'], '/-', $context['member']['karma']['bad'], '
|
';
echo '
', $txt[233], ': |
', $context['member']['registered'], ' |
', $txt['lastLoggedIn'], ': |
', $context['member']['last_login'], ' |
';
// Is this member requiring activation and/or banned?
if (!empty($context['activate_message']) || !empty($context['member']['bans']))
{
echo '
|
';
// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
if (!empty($context['activate_message']))
echo '
', $context['activate_message'], ' (', $context['activate_link_text'], ')
|
';
// If the current member is banned, show a message and possibly a link to the ban.
if (!empty($context['member']['bans']))
{
echo '
', $txt['user_is_banned'], ' [' . $txt['view_ban'] . ']
|
', $txt['user_banned_by_following'], ':';
foreach ($context['member']['bans'] as $ban)
echo '
', $ban['explanation'], '';
echo '
|
';
}
}
// Messenger type information.
echo '
|
', $txt[513], ': |
', $context['member']['icq']['link_text'], ' |
', $txt[603], ': |
', $context['member']['aim']['link_text'], ' |
', $txt['MSN'], ': |
', $context['member']['msn']['link_text'], ' |
', $txt[604], ': |
', $context['member']['yim']['link_text'], ' |
', $txt[69], ': |
';
// Only show the email address if it's not hidden.
if ($context['member']['email_public'])
echo '
', $context['member']['email'], '';
// ... Or if the one looking at the profile is an admin they can see it anyway.
elseif (!$context['member']['hide_email'])
echo '
', $context['member']['email'], '';
else
echo '
', $txt[722], '';
// Some more information.
echo '
|
', $txt[96], ': |
', $context['member']['website']['title'], ' |
', $txt[113], ' |
', $context['can_send_pm'] ? '' : '', $settings['use_image_buttons'] ? '' : $context['member']['online']['text'], $context['can_send_pm'] ? '' : '', $settings['use_image_buttons'] ? ' ' . $context['member']['online']['text'] . '' : '', '';
// Can they add this member as a buddy?
if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
echo '
[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']';
echo '
|
|
', $txt[231], ': |
', $context['member']['gender']['name'], ' |
', $txt[420], ': |
', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' ' : ''), ' |
', $txt[227], ': |
', $context['member']['location'], ' |
', $txt['local_time'], ': |
', $context['member']['local_time'], ' |
';
if (!empty($modSettings['userLanguage']))
echo '
', $txt['smf225'], ': |
', $context['member']['language'], ' |
';
echo '
|
';
// Show the users signature.
echo '
', $txt[85], ': |
', $context['member']['signature'], ' |
|
| ';
// Now print the second column where the members avatar/text is shown.
echo '
', $context['member']['avatar']['image'], '
', $context['member']['blurb'], '
|
';
// Finally, if applicable, span the bottom of the table with links to other useful member functions.
echo '
', $txt[597], ': |
';
if (!$context['user']['is_owner'] && $context['can_send_pm'])
echo '
', $txt[688], '.
';
echo '
', $txt[460], ' ', $txt[461], '.
', $txt['statPanel_show'], '.
|
';
}
// Template for showing all the posts of the user, in chronological order.
function template_showPosts()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
', $txt['showPosts'], '
|
';
// Only show posts if they have made some!
if (!empty($context['posts']))
{
// Page numbers.
echo '
', $txt[139], ': ', $context['page_index'], '
|
';
// Button shortcuts
$quote_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');
$reply_button = create_button('reply_sm.gif', 146, 146, 'align="middle"');
$remove_button = create_button('delete.gif', 121, 31, 'align="middle"');
$notify_button = create_button('notify_sm.gif', 131, 125, 'align="middle"');
// For every post to be displayed, give it its own subtable, and show the important details of the post.
foreach ($context['posts'] as $post)
{
echo '
', $post['counter'], '
|
', $post['category']['name'], ' / ', $post['board']['name'], ' / ', $post['subject'], '
|
', $txt[30], ': ', $post['time'], '
|
', $post['body'], '
|
';
if ($post['can_delete'])
echo '
', $remove_button, '';
if ($post['can_delete'] && ($post['can_mark_notify'] || $post['can_reply']))
echo '
', $context['menu_separator'];
if ($post['can_reply'])
echo '
', $reply_button, '', $context['menu_separator'], '
', $quote_button, '';
if ($post['can_reply'] && $post['can_mark_notify'])
echo '
', $context['menu_separator'];
if ($post['can_mark_notify'])
echo '
' . $notify_button . '';
echo '
|
|
';
}
// Show more page numbers.
echo '
', $txt[139], ': ', $context['page_index'], '
|
';
}
// No posts? Just end the table with a informative message.
else
echo '
|
', $txt['showPermissions'], '
|
';
if ($context['member']['has_all_permissions'])
{
echo '
', $txt['showPermissions_all'], ' |
';
}
else
{
if (!empty($context['no_access_boards']))
{
echo '
', $txt['showPermissions_restricted_boards'], ' |
', $txt['showPermissions_restricted_boards_desc'], ': ';
foreach ($context['no_access_boards'] as $no_access_board)
echo '
', $no_access_board['name'], '', $no_access_board['is_last'] ? '' : ', ';
echo '
|
';
}
// General Permissions section.
echo '
', $txt['showPermissions_general'], ' |
';
if (!empty($context['member']['permissions']['general']))
{
echo '
', $txt['showPermissions_permission'], ' |
|
';
foreach ($context['member']['permissions']['general'] as $permission)
{
echo '
', $permission['is_denied'] ? '' . $permission['id'] . '' : $permission['id'], '
', $permission['name'], '
|
';
if ($permission['is_denied'])
echo '
', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']);
else
echo '
', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']);
echo '
|
';
}
}
else
echo '
', $txt['showPermissions_none_general'], ' |
';
// Board permission section.
echo '
|
';
if (!empty($context['member']['permissions']['board']))
{
echo '
', $txt['showPermissions_permission'], ' |
|
';
foreach ($context['member']['permissions']['board'] as $permission)
{
echo '
', $permission['is_denied'] ? '' . $permission['id'] . '' : $permission['id'], '
', $permission['name'], '
|
';
if ($permission['is_denied'])
{
echo '
', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), ' ';
}
else
{
echo '
', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']), ' ';
}
echo '
|
';
}
}
else
echo '
', $txt['showPermissions_none_board'], ' |
';
}
echo '
', $txt['statPanel_generalStats'], ' - ', $context['member']['name'], ' |
';
// First, show a few text statistics such as post/topic count.
echo '
|
', $txt['statPanel_total_time_online'], ': |
', $context['time_logged_in'], ' |
', $txt['statPanel_total_posts'], ': |
', $context['num_posts'], ' ', $txt['statPanel_posts'], ' |
', $txt['statPanel_total_topics'], ': |
', $context['num_topics'], ' ', $txt['statPanel_topics'], ' |
', $txt['statPanel_users_polls'], ': |
', $context['num_polls'], ' ', $txt['statPanel_polls'], ' |
', $txt['statPanel_users_votes'], ': |
', $context['num_votes'], ' ', $txt['statPanel_votes'], ' |
|
';
// This next section draws a graph showing what times of day they post the most.
echo '
', $txt['statPanel_activityTime'], ' |
|
';
// If they haven't post at all, don't draw the graph.
if (empty($context['posts_by_time']))
echo '
', $txt['statPanel_noPosts'], ' |
';
// Otherwise do!
else
{
echo '
| ';
// Loops through each hour drawing the bar to the correct height.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
| ';
echo '
|
| ';
// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
', $time_of_day['hour'], ' | ';
echo '
|
', $txt['statPanel_timeOfDay'], ' |
';
}
echo '
|
';
// The final section is two columns with the most popular boards by posts and activity (activity = users posts / total posts).
echo '
', $txt['statPanel_topBoards'], ' |
', $txt['statPanel_topBoardsActivity'], ' |
|
';
if (empty($context['popular_boards']))
echo '
', $txt['statPanel_noPosts'], ' |
';
else
{
// Draw a bar for every board.
foreach ($context['popular_boards'] as $board)
{
echo '
', $board['link'], ' |
', $board['posts'] > 0 ? '' : ' ', ' |
', empty($context['hide_num_posts']) ? $board['posts'] : '', ' |
';
}
}
echo '
|
|
';
if (empty($context['board_activity']))
echo '
', $txt['statPanel_noPosts'], ' |
';
else
{
// Draw a bar for every board.
foreach ($context['board_activity'] as $activity)
{
echo '
', $activity['link'], ' |
', $activity['percent'] > 0 ? '' : ' ', ' |
', $activity['percent'], '% |
';
}
}
echo '
|
';
}
// Template for changing user account information.
function template_account()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
// Javascript for checking if password has been entered / taking admin powers away from themselves.
echo '
';
// The main containing header.
echo '