';
// Prevent Chrome from auto completing fields when viewing/editing other members profiles
if (isBrowser('is_chrome') && !$context['user']['is_owner'])
echo '
';
// If an error occurred while trying to save previously, give the user a clue!
if (!empty($context['post_errors']))
echo '
', template_error_message();
// If the profile was update successfully, let the user know this.
if (!empty($context['profile_updated']))
echo '
', $context['profile_updated'], '
';
}
// Template for closing off table started in profile_above.
function template_profile_below()
{
}
// This template displays users details without any option to edit them.
function template_summary()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
// Display the basic information about the user
echo '
';
// What about if we allow email only via the forum??
if ($context['member']['show_email'] === 'yes' || $context['member']['show_email'] === 'no_through_forum' || $context['member']['show_email'] === 'yes_permission_override')
echo '
';
// Don't show an icon if they haven't specified a website.
if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
echo '
';
// Are there any custom profile fields for the summary?
if (!empty($context['custom_fields']))
{
foreach ($context['custom_fields'] as $field)
if (($field['placement'] == 1 || empty($field['output_html'])) && !empty($field['value']))
echo '
';
// ... Or if the one looking at the profile is an admin they can see it anyway.
elseif ($context['member']['show_email'] == 'yes_permission_override')
echo '
';
if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
', $txt['location'], ':
', $context['member']['location'], '
';
echo '
';
// Any custom fields for standard placement?
if (!empty($context['custom_fields']))
{
$shown = false;
foreach ($context['custom_fields'] as $field)
{
if ($field['placement'] != 0 || empty($field['output_html']))
continue;
if (empty($shown))
{
echo '
';
$shown = true;
}
echo '
', $field['name'], ':
', $field['output_html'], '
';
}
if (!empty($shown))
echo '
';
}
echo '
';
// Can they view/issue a warning?
if ($context['can_view_warning'] && $context['member']['warning'])
{
echo '
', $txt['profile_warning_level'], ':
', $context['member']['warning'], '%';
// Can we provide information on what this means?
if (!empty($context['warning_status']))
echo '
(', $context['warning_status'], ')';
echo '
';
}
// Is this member requiring activation and/or banned?
if (!empty($context['activate_message']) || !empty($context['member']['bans']))
{
// 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 '
';
// If the person looking is allowed, they can check the members IP address and hostname.
if ($context['can_see_ip'])
{
if (!empty($context['member']['ip']))
echo '
';
if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
echo '
', $txt['hostname'], ':
', $context['member']['hostname'], '
';
}
echo '
', $txt['local_time'], ':
', $context['member']['local_time'], '
';
if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
echo '
', $txt['language'], ':
', $context['member']['language'], '
';
echo '
', $txt['lastLoggedIn'], ':
', $context['member']['last_login'], '
';
// Are there any custom profile fields for the summary?
if (!empty($context['custom_fields']))
{
$shown = false;
foreach ($context['custom_fields'] as $field)
{
if ($field['placement'] != 2 || empty($field['output_html']))
continue;
if (empty($shown))
{
$shown = true;
echo '
';
}
echo '
', $field['output_html'], '
';
}
if ($shown)
echo '
';
}
// Show the users signature.
if ($context['signature_enabled'] && !empty($context['member']['signature']))
echo '
', $txt['signature'], ':
', $context['member']['signature'], '
';
echo '
';
}
// Template for showing all the posts of the user, in chronological order.
function template_showPosts()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
';
// Button shortcuts
$quote_button = create_button('quote.gif', 'reply_quote', 'quote', 'align="middle"');
$reply_button = create_button('reply_sm.gif', 'reply', 'reply', 'align="middle"');
$remove_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
$notify_button = create_button('notify_sm.gif', 'notify_replies', 'notify', 'align="middle"');
// Are we displaying posts or attachments?
if (!isset($context['attachments']))
{
// For every post to be displayed, give it its own div, and show the important details of the post.
foreach ($context['posts'] as $post)
{
echo '
';
$alternate = !$alternate;
}
// No posts? Just end the table with a informative message.
if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
echo '
';
}
// Template for showing all the buddies of the current user.
function template_editBuddies()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
', $txt['editBuddies'], '
', $txt['name'], '
', $txt['status'], '
', $txt['email'], '
', $txt['icq'], '
', $txt['aim'], '
', $txt['yim'], '
', $txt['msn'], '
';
// If they don't have any buddies don't list them!
if (empty($context['buddies']))
echo '
', $txt['no_buddies'], '
';
// Now loop through each buddy showing info on each.
$alternate = false;
foreach ($context['buddies'] as $buddy)
{
echo '
', $buddy['link'], '
', ($buddy['show_email'] == 'no' ? '' : ''), '
', $buddy['icq']['link'], '
', $buddy['aim']['link'], '
', $buddy['yim']['link'], '
', $buddy['msn']['link'], '
';
$alternate = !$alternate;
}
echo '
';
// Add a new buddy?
echo '
';
}
// Template for showing the ignore list of the current user.
function template_editIgnoreList()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
', $txt['editIgnoreList'], '
', $txt['name'], '
', $txt['status'], '
', $txt['email'], '
', $txt['icq'], '
', $txt['aim'], '
', $txt['yim'], '
', $txt['msn'], '
';
// If they don't have anyone on their ignore list, don't list it!
if (empty($context['ignore_list']))
echo '
', $txt['no_ignore'], '
';
// Now loop through each buddy showing info on each.
$alternate = false;
foreach ($context['ignore_list'] as $member)
{
echo '
', $member['link'], '
', ($member['show_email'] == 'no' ? '' : ''), '
', $member['icq']['link'], '
', $member['aim']['link'], '
', $member['yim']['link'], '
', $member['msn']['link'], '
';
$alternate = !$alternate;
}
echo '
';
// Add a new buddy?
echo '
';
}
// This template shows an admin information on a users IP addresses used and errors attributed to them.
function template_trackActivity()
{
global $context, $settings, $options, $scripturl, $txt;
// The first table shows IP information about the user.
echo '
';
// Show the track user list.
template_show_list('track_user_list');
}
// The template for trackIP, allowing the admin to see where/who a certain IP has been used.
function template_trackIP()
{
global $context, $settings, $options, $scripturl, $txt;
// This function always defaults to the last IP used by a member but can be set to track any IP.
// The first table in the template gives an input box to allow the admin to enter another IP to track.
echo '
', $txt['trackIP'], '
';
// The table inbetween the first and second table shows links to the whois server for every region.
if ($context['single_ip'])
{
echo '
';
}
}
// Template for user statistics, showing graphs and the like.
function template_statPanel()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
// First, show a few text statistics such as post/topic count.
echo '
';
// 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 '
';
// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
{
echo '
';
}
// Template for editing profile options.
function template_edit_options()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
// The main header!
echo '
';
// Some javascript!
echo '
';
// Any final spellchecking stuff?
if (!empty($context['show_spellchecking']))
echo '
';
}
// Personal Message settings.
function template_profile_pm_settings()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
';
}
// Template for showing theme settings. Note: template_options() actually adds the theme specific options.
function template_profile_theme_settings()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
';
if ($context['allow_no_censored'])
echo '
';
echo '
';
if (!empty($modSettings['enable_buddylist']))
echo '
';
echo '
';
// Choose WYSIWYG settings?
if (empty($modSettings['disable_wysiwyg']))
echo '
';
if (empty($modSettings['disableCustomPerPage']))
{
echo '
';
}
if (!empty($modSettings['cal_enabled']))
echo '
';
echo '
';
}
function template_notification()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
// The main containing header.
echo '
', $txt['profile'], '
', $txt['notification_info'], '
';
template_show_list('topic_notification_list');
echo '
';
template_show_list('board_notification_list');
}
// Template for choosing group membership.
function template_groupMembership()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
// The main containing header.
echo '
';
}
function template_ignoreboards()
{
global $context, $txt, $settings, $scripturl;
// The main containing header.
echo '
';
}
// Simple load some theme variables common to several warning templates.
function template_load_warning_variables()
{
global $modSettings, $context;
$context['warningBarWidth'] = 200;
// Setup the colors - this is a little messy for theming.
$context['colors'] = array(
0 => 'green',
$modSettings['warning_watch'] => 'darkgreen',
$modSettings['warning_moderate'] => 'orange',
$modSettings['warning_mute'] => 'red',
);
// Work out the starting color.
$context['current_color'] = $context['colors'][0];
foreach ($context['colors'] as $limit => $color)
if ($context['member']['warning'] >= $limit)
$context['current_color'] = $color;
}
// Show all warnings of a user?
function template_viewWarning()
{
global $context, $txt, $scripturl, $settings;
template_load_warning_variables();
echo '
';
template_show_list('view_warnings');
}
// Show a lovely interface for issuing warnings.
function template_issueWarning()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
template_load_warning_variables();
echo '
';
echo '
';
// Previous warnings?
echo '
', $txt['profile_warning_previous'], '
', $txt['profile_warning_previous_issued'], '
', $txt['profile_warning_previous_time'], '
', $txt['profile_warning_previous_reason'], '
', $txt['profile_warning_previous_level'], '
';
// Print the warnings.
$alternate = 0;
foreach ($context['previous_warnings'] as $warning)
{
$alternate = !$alternate;
echo '
', $warning['issuer']['link'], '
', $warning['time'], '
', $warning['reason'], '
';
if (!empty($warning['id_notice']))
echo '
';
echo '
', $warning['counter'], '
';
}
if (empty($context['previous_warnings']))
echo '
', $txt['profile_warning_previous_none'], '
';
echo '
', $txt['pages'], ': ', $context['page_index'], '
';
// Do our best to get pretty javascript enabled.
echo '
';
}
// Template to show for deleting a users account - now with added delete post capability!
function template_deleteAccount()
{
global $context, $settings, $options, $scripturl, $txt, $scripturl;
// The main containing header.
echo '
';
}
// Template for the password box/save button stuck at the bottom of every profile page.
function template_profile_save()
{
global $context, $settings, $options, $txt;
echo '
';
// Only show the password box if it's actually needed.
if ($context['require_password'])
echo '
';
}
// Small template for showing an error message upon a save problem in the profile.
function template_error_message()
{
global $context, $txt;
echo '
';
}
// Display a load of drop down selectors for allowing the user to change group.
function template_profile_group_manage()
{
global $context, $txt, $scripturl;
echo '
';
// For each membergroup show a checkbox so members can be assigned to more than one group.
foreach ($context['member_groups'] as $member_group)
if ($member_group['can_be_additional'])
echo '
';
echo '
', $txt['additional_membergroups_show'], '
';
}
// Callback function for entering a birthdate!
function template_profile_birthdate()
{
global $txt, $context;
// Just show the pretty box!
echo '
';
}
// Show the signature editing box?
function template_profile_signature_modify()
{
global $txt, $context, $settings;
echo '
', $txt['signature'], ': ', $txt['sig_info'], '
';
if ($context['show_spellchecking'])
echo '
';
echo '
';
// If there is a limit at all!
if (!empty($context['signature_limits']['max_length']))
echo '
', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' ', $context['signature_limits']['max_length'], ' ';
if ($context['signature_warning'])
echo '
', $context['signature_warning'], '';
// Load the spell checker?
if ($context['show_spellchecking'])
echo '
';
// Some javascript used to count how many characters have been used so far in the signature.
echo '
';
}
function template_profile_avatar_select()
{
global $context, $txt, $modSettings;
// Start with the upper menu
echo '
';
// If users are allowed to choose avatars stored on the server show selection boxes to choice them from.
if (!empty($context['member']['avatar']['allow_server_stored']))
{
echo '
';
}
// If the user can link to an off server avatar, show them a box to input the address.
if (!empty($context['member']['avatar']['allow_external']))
{
echo '
', $txt['avatar_by_url'], '
';
}
// If the user is able to upload avatars to the server show them an upload box.
if (!empty($context['member']['avatar']['allow_upload']))
{
echo '
';
}
// Smiley set picker.
function template_profile_smiley_pick()
{
global $txt, $context, $modSettings, $settings;
echo '
', $txt['smileys_current'], ':
';
}
// Change the way you login to the forum.
function template_authentication_method()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
// The main header!
echo '
';
// The password stuff.
echo '
';
}
?>