disableAutoComplete();
';
// If an error occurred while trying to save previously, give the user a clue!
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 any HTML needed below the profile (closing off divs/tables, etc.)
*/
function template_profile_below()
{
}
/**
* Template for showing off the spiffy popup of the menu
*/
function template_profile_popup()
{
global $context, $scripturl;
// Unlike almost every other template, this is designed to be included into the HTML directly via $().load()
echo '
';
}
/**
* The "popup" showing the user's alerts
*/
function template_alerts_popup()
{
global $context, $txt, $scripturl;
// Unlike almost every other template, this is designed to be included into the HTML directly via $().load()
echo '
';
}
/**
* A simple template to say "You don't have any unread alerts".
*/
function template_alerts_all_read()
{
global $txt;
echo '
', $txt['alerts_no_unread'], '
';
}
/**
* This template displays a user's details without any option to edit them.
*/
function template_summary()
{
global $context, $settings, $scripturl, $modSettings, $txt;
// Display the basic information about the user
echo '
';
// Are there any custom profile fields for above the name?
if (!empty($context['print_custom_fields']['above_member']))
{
$fields = '';
foreach ($context['print_custom_fields']['above_member'] as $field)
if (!empty($field['output_html']))
$fields .= '
' . $field['output_html'] . '
';
if (!empty($fields))
echo '
', $fields, '
';
}
echo '
';
if (!empty($context['print_custom_fields']['before_member']))
foreach ($context['print_custom_fields']['before_member'] as $field)
if (!empty($field['output_html']))
echo '
', $field['output_html'], '';
echo '
', $context['member']['name'];
if (!empty($context['print_custom_fields']['after_member']))
foreach ($context['print_custom_fields']['after_member'] as $field)
if (!empty($field['output_html']))
echo '
', $field['output_html'], '';
echo '
', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '
', $context['member']['avatar']['image'];
// Are there any custom profile fields for below the avatar?
if (!empty($context['print_custom_fields']['below_avatar']))
{
$fields = '';
foreach ($context['print_custom_fields']['below_avatar'] as $field)
if (!empty($field['output_html']))
$fields .= '
' . $field['output_html'] . '
';
if (!empty($fields))
echo '
', $fields, '
';
}
echo '
';
// Email is only visible if it's your profile or you have the moderate_forum permission
if ($context['member']['show_email'])
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 as icons?
if (!empty($context['print_custom_fields']['icons']))
{
foreach ($context['print_custom_fields']['icons'] as $field)
if (!empty($field['output_html']))
echo '
', $field['output_html'], '
';
}
echo '
';
// 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 '
';
if (!$context['user']['is_owner'] && $context['can_send_pm'])
echo '
', $txt['profile_sendpm_short'], '';
echo '
', $txt['showPosts'], '';
if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled']))
echo '
', $txt['drafts_show'], '';
echo '
', $txt['statPanel'], '';
// Are there any custom profile fields for bottom?
if (!empty($context['print_custom_fields']['bottom_poster']))
{
$fields = '';
foreach ($context['print_custom_fields']['bottom_poster'] as $field)
if (!empty($field['output_html']))
$fields .= '
' . $field['output_html'] . '
';
if (!empty($fields))
echo '
', $fields, '
';
}
echo '
';
if ($context['user']['is_owner'] || $context['user']['is_admin'])
echo '
', $txt['username'], ':
', $context['member']['username'], '
';
if (!isset($context['disabled_fields']['posts']))
echo '
';
// Any custom fields for standard placement?
if (!empty($context['print_custom_fields']['standard']))
{
$fields = array();
foreach ($context['print_custom_fields']['standard'] as $field)
if (!empty($field['output_html']))
$fields[] = $field;
if (count($fields) > 0)
{
echo '
';
foreach ($fields as $field)
echo '
', $field['name'], ':
', $field['output_html'], '
';
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 '
';
// Are there any custom profile fields for above the signature?
if (!empty($context['print_custom_fields']['above_signature']))
{
$fields = '';
foreach ($context['print_custom_fields']['above_signature'] as $field)
if (!empty($field['output_html']))
$fields .= '
' . $field['output_html'] . '
';
if (!empty($fields))
echo '
', $fields, '
';
}
// Show the users signature.
if ($context['signature_enabled'] && !empty($context['member']['signature']))
echo '
', $txt['signature'], ':
', $context['member']['signature'], '
';
// Are there any custom profile fields for below the signature?
if (!empty($context['print_custom_fields']['below_signature']))
{
$fields = '';
foreach ($context['print_custom_fields']['below_signature'] as $field)
if (!empty($field['output_html']))
$fields .= '
' . $field['output_html'] . '
';
if (!empty($fields))
echo '
', $fields, '
';
}
echo '
';
}
/**
* Template for showing all the posts of the user, in chronological order.
*/
function template_showPosts()
{
global $context, $scripturl, $txt;
echo '
' : '';
// 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. OK ?
foreach ($context['posts'] as $post)
{
echo '
';
// affiche les messages mais uniquement si on passe dessus (collapse)
echo '
', $txt['khbb_collapse_recent_post'], '
', $post['body'], '
';
// Post options
template_quickbuttons($post['quickbuttons'], 'profile_showposts');
echo '
';
}
}
else
template_show_list('attachments');
// No posts? Just end with a informative message.
if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
echo '
';
echo '';
// Show more page numbers.
if (!empty($context['page_index']))
echo '
', $context['page_index'], '
';
}
/**
* Template for showing all alerts
*/
function template_showAlerts()
{
global $context, $txt, $scripturl;
// Do we have an update message?
if (!empty($context['update_message']))
echo '
';
else
{
// Start the form if checkboxes are in use
if ($context['showCheckboxes'])
echo '
';
}
}
/**
* Template for showing all of a user's drafts
*/
function template_showDrafts()
{
global $context, $scripturl, $txt;
echo '
' : '';
// No drafts? Just show an informative message.
if (empty($context['drafts']))
echo '
', $txt['draft_none'], '
';
else
{
// For every draft to be displayed, give it its own div, and show the important details of the draft. OK
foreach ($context['drafts'] as $draft)
{
echo '
#', $draft['counter'], '
', $draft['board']['name'], ' / ', $draft['topic']['link'], ' ';
if (!empty($draft['sticky']))
echo '
';
if (!empty($draft['locked']))
echo '
';
echo '
';
}
/**
* Template for showing and managing the buddy list.
*/
function template_editBuddies()
{
global $context, $scripturl, $txt;
if (!empty($context['saved_successful']))
echo '
';
if (!empty($context['custom_pf']))
foreach ($context['custom_pf'] as $column)
echo '
', $column['label'], '
';
echo '
', $txt['remove'], '
';
// 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.
else
{
foreach ($context['buddies'] as $buddy)
{
echo '
', $buddy['link'], '
';
/*
';*/
if ($buddy['show_email'])
echo '
';
// Show the custom profile fields for this user.
if (!empty($context['custom_pf']))
foreach ($context['custom_pf'] as $key => $column)
echo '
', $buddy['options'][$key], '
';
echo '
';
}
}
echo '
';
// Add a new buddy?
echo '
';
}
/**
* Template for showing the ignore list of the current user.
*/
function template_editIgnoreList()
{
global $context, $scripturl, $txt;
if (!empty($context['saved_successful']))
echo '
';
// 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.
foreach ($context['ignore_list'] as $member)
{
echo '
', $member['link'], '
';
/*
';*/
if ($context['can_moderate_forum'])
echo '
';
echo '
';
}
echo '
';
// Add to the ignore list?
echo '
';
}
/**
* This template shows an admin information on a users IP addresses used and errors attributed to them.
*/
function template_trackActivity()
{
global $context, $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, $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 '
';
}
echo '
';
template_show_list('track_message_list');
echo ' ';
template_show_list('track_user_list');
// 3rd party integrations may have added additional tracking.
if (!empty($context['additional_track_lists']))
{
foreach ($context['additional_track_lists'] as $list)
{
echo ' ';
template_show_list($list);
}
}
}
/**
* This template shows an admin which permissions a user have and which group(s) give them each permission.
*/
function template_showPermissions()
{
global $context, $scripturl, $txt;
echo '
', $txt['showPermissions'], '
';
if ($context['member']['has_all_permissions'])
echo '
', $txt['showPermissions_all'], '
';
else
{
echo '
', $txt['showPermissions_help'], '
';
if (!empty($context['no_access_boards']))
{
echo '
';
}
}
/**
* Template for user statistics, showing graphs and the like.
*/
function template_statPanel()
{
global $context, $txt;
// First, show a few text statistics such as post/topic count.
echo '
';
foreach ($context['text_stats'] as $key => $stat)
{
echo '
';
}
/**
* Template for editing profile options.
*/
function template_edit_options()
{
global $context, $scripturl, $txt, $modSettings;
// The main header!
// because some browsers ignore autocomplete=off and fill username in display name and/ or email field, fake them out.
$url = !empty($context['profile_custom_submit_url']) ? $context['profile_custom_submit_url'] : $scripturl . '?action=profile;area=' . $context['menu_item_selected'] . ';u=' . $context['id_member'];
$url = $context['require_password'] && !empty($modSettings['force_ssl']) ? strtr($url, array('http://' => 'https://')) : $url;
echo '
';
// Any final spellchecking stuff?
if (!empty($context['show_spellchecking']))
echo '
';
}
/**
* Personal Message settings.
*/
function template_profile_pm_settings()
{
global $context, $modSettings, $txt;
echo '
';
}
/**
* Template for showing theme settings. Note: template_options() actually adds the theme specific options.
*/
function template_profile_theme_settings()
{
global $context, $modSettings;
$skeys = array_keys($context['theme_options']);
$first_option_key = array_shift($skeys);
$titled_section = false;
foreach ($context['theme_options'] as $i => $setting)
{
// Just spit out separators and move on
if (empty($setting) || !is_array($setting))
{
// Avoid double separators and empty titled sections
$empty_section = true;
for ($j=$i+1; $j < count($context['theme_options']); $j++)
{
// Found another separator, so we're done
if (!is_array($context['theme_options'][$j]))
break;
// Once we know there's something to show in this section, we can stop
if (!isset($context['theme_options'][$j]['enabled']) || !empty($context['theme_options'][$j]['enabled']))
{
$empty_section = false;
break;
}
}
if ($empty_section)
{
if ($i === $first_option_key)
$first_option_key = array_shift($skeys);
continue;
}
// Insert a separator (unless this is the first item in the list)
if ($i !== $first_option_key)
echo '
';
// Should we give a name to this section?
if (is_string($setting) && !empty($setting))
{
$titled_section = true;
echo '
' . $setting . '
';
}
else
$titled_section = false;
continue;
}
// Is this disabled?
if (isset($setting['enabled']) && $setting['enabled'] === false)
{
if ($i === $first_option_key)
$first_option_key = array_shift($skeys);
continue;
}
// Some of these may not be set... Set to defaults here
$opts = array('calendar_start_day', 'topics_per_page', 'messages_per_page', 'display_quick_mod');
if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']]))
$context['member']['options'][$setting['id']] = 0;
if (!isset($setting['type']) || $setting['type'] == 'bool')
$setting['type'] = 'checkbox';
elseif ($setting['type'] == 'int' || $setting['type'] == 'integer')
$setting['type'] = 'number';
elseif ($setting['type'] == 'string')
$setting['type'] = 'text';
if (isset($setting['options']))
$setting['type'] = 'list';
echo '
';
if (isset($setting['description']))
echo '
', $setting['description'], '';
echo '
';
// Display checkbox options
if ($setting['type'] == 'checkbox')
echo '
';
// How about selection lists, we all love them
elseif ($setting['type'] == 'list')
{
echo '
';
}
// A textbox it is then
else
{
if (isset($setting['type']) && $setting['type'] == 'number')
{
$min = isset($setting['min']) ? ' min="' . $setting['min'] . '"' : ' min="0"';
$max = isset($setting['max']) ? ' max="' . $setting['max'] . '"' : '';
$step = isset($setting['step']) ? ' step="' . $setting['step'] . '"' : '';
echo '
';
}
// end of this defintion
echo '
';
}
}
/**
* The template for configuring alerts
*/
function template_alert_configuration()
{
global $context, $txt, $scripturl, $modSettings;
echo '
';
}
/**
* Template for showing which topics you're subscribed to
*/
function template_alert_notifications_topics()
{
global $txt;
// The main containing header.
echo '
', $txt['watched_topics'], '
', $txt['watched_topics_desc'], '
';
template_show_list('topic_notification_list');
}
/**
* Template for showing which boards you're subscribed to
*/
function template_alert_notifications_boards()
{
global $txt;
echo '
', $txt['watched_boards'], '
', $txt['watched_boards_desc'], '
';
template_show_list('board_notification_list');
}
/**
* Template for choosing group membership.
*/
function template_groupMembership()
{
global $context, $scripturl, $txt;
// The main containing header.
echo '
';
}
/**
* Template for managing ignored boards
*/
function template_ignoreboards()
{
global $context, $txt, $scripturl;
// The main containing header.
echo '
';
}
/**
* Simply loads some theme variables common to several warning templates.
*/
function template_load_warning_variables()
{
global $modSettings, $context;
// Setup the warning mode
$context['warning_mode'] = array(
0 => 'none',
$modSettings['warning_watch'] => 'watched',
$modSettings['warning_moderate'] => 'moderated',
$modSettings['warning_mute'] => 'muted',
);
// Work out the starting warning.
$context['current_warning_mode'] = $context['warning_mode'][0];
foreach ($context['warning_mode'] as $limit => $warning)
if ($context['member']['warning'] >= $limit)
$context['current_warning_mode'] = $warning;
}
/**
* Template for viewing a user's warnings
*/
function template_viewWarning()
{
global $context, $txt;
template_load_warning_variables();
echo '
';
template_show_list('view_warnings');
}
/**
* Template for issuing warnings
*/
function template_issueWarning()
{
global $context, $scripturl, $txt;
template_load_warning_variables();
echo '
';
echo '
';
// Previous warnings?
template_show_list('view_warnings');
echo '
';
}
/**
* Template to show for deleting a user's account - now with added delete post capability!
*/
function template_deleteAccount()
{
global $context, $scripturl, $txt;
// 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, $txt;
echo '
';
// Only show the password box if it's actually needed.
if ($context['require_password'])
echo '
';
if (!empty($context['token_check']))
echo '
';
echo '
';
}
/**
* Small template for showing an error message upon a save problem in the profile.
*/
function template_error_message()
{
global $context, $modSettings, $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 'no birthday';
}
/**
* Show the signature editing box?
*/
function template_profile_signature_modify()
{
global $txt, $context;
echo '
', $txt['current_signature'], '
', $txt['signature_preview'], '
', $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 (!empty($context['show_preview_button']))
echo '
';
if ($context['signature_warning'])
echo '
', $context['signature_warning'], '';
// Some javascript used to count how many characters have been used so far in the signature.
echo '
';
}
/**
* Template for selecting an avatar
*/
function template_profile_avatar_select()
{
global $context, $txt, $modSettings, $scripturl;
// Start with the upper menu
echo '
';
if (empty($modSettings['gravatarEnabled']) || empty($modSettings['gravatarOverride']))
echo '
';
if (!empty($context['member']['avatar']['allow_server_stored']))
echo '
';
if (!empty($context['member']['avatar']['allow_external']))
echo '
';
if (!empty($context['member']['avatar']['allow_upload']))
echo '
';
if (!empty($context['member']['avatar']['allow_gravatar']))
echo '
';
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 '
';
else
{
// Depending on other stuff, the stored value here might have some odd things in it from other areas.
if ($context['member']['avatar']['external'] == $context['member']['email'])
$textbox_value = '';
else
$textbox_value = $context['member']['avatar']['external'];
echo '
', $txt['gravatar_alternateEmail'], '
';
}
echo '
';
}
echo '
';
}
/**
* This is just a really little helper to avoid duplicating code unnecessarily
*
* @param string $type The type of avatar
*/
function template_max_size($type)
{
global $modSettings, $txt;
$w = !empty($modSettings['avatar_max_width_' . $type]) ? comma_format($modSettings['avatar_max_width_' . $type]) : 0;
$h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0;
$suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : '');
if (empty($suffix))
return;
echo '
';
}
/**
* Smiley set picker.
*/
function template_profile_smiley_pick()
{
global $txt, $context, $modSettings, $settings;
echo '
';
}
/**
* Template for setting up and managing Two-Factor Authentication.
*/
function template_tfasetup()
{
global $txt, $context, $scripturl, $modSettings;
echo '
', $txt['tfa_title'], '
';
if (!empty($context['tfa_backup']))
echo '
', $txt['tfa_backup_used_desc'], '
';
elseif ($modSettings['tfa_mode'] == 2)
echo '
', $txt['tfa_forced_desc'], '
';
echo '
', $txt['tfa_desc'], '
';
if (!empty($context['from_ajax']))
echo '
';
echo '
';
}
/**
* Template for disabling two-factor authentication.
*/
function template_tfadisable()
{
global $txt, $context, $scripturl;
echo '
', $txt['tfadisable'], '
';
}
/**
* Template for setting up 2FA backup code
*/
function template_tfasetup_backup()
{
global $context, $txt;
echo '
', $txt['tfa_backup_title'], '
', $txt['tfa_backup_desc'], '
', $context['tfa_backup'], '
';
}
/**
* Simple template for showing the 2FA area when editing a profile.
*/
function template_profile_tfa()
{
global $context, $txt, $scripturl, $modSettings;
echo '