';
// 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!
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()
{
}
// Tempate 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 '
';
// Firstly, an avatar.
if (!empty($context['user']['avatar']))
echo '
', $context['user']['avatar']['image'], '';
// Then a couple of bits and pieces that might be interesting
echo '
';
}
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 '
';
}
// 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 '
when no fields are visible
// 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' && $context['can_send_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 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 '
';
if ($context['can_send_email'])
{
// Only show the email address fully if it's not hidden - and we reveal the email.
if ($context['member']['show_email'] == 'yes')
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, $options, $scripturl, $modSettings, $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.
foreach ($context['posts'] as $post)
{
echo '
';
if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
echo '
';
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 '
';
// Show more page numbers.
if (!empty($context['page_index']))
echo '
', $context['page_index'], '
';
}
// Template for showing all the drafts of the user.
function template_showDrafts()
{
global $context, $settings, $options, $scripturl, $modSettings, $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.
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 all the buddies of the current user.
function template_editBuddies()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
$disabled_fields = isset($modSettings['disabled_profile_fields']) ? array_flip(explode(',', $modSettings['disabled_profile_fields'])) : array();
$buddy_fields = array('icq', 'aim', 'yim', 'skype');
if (!empty($context['saved_successful']))
echo '
';
// don't show them if they are disabled
foreach ($buddy_fields as $key => $column)
{
if (!isset($disabled_fields[$column]))
echo '
', $txt[$column], '
';
}
echo '
';
// 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'], '
';
if ($context['can_send_email'])
echo '
', ($buddy['show_email'] == 'no' ? '' : ''), '
';
// If these are off, don't show them
foreach ($buddy_fields as $key => $column)
{
if (!isset($disabled_fields[$column]))
echo '
', $buddy[$column]['link'], '
';
}
echo '
';
$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;
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.
$alternate = false;
foreach ($context['ignore_list'] as $member)
{
echo '
', $member['link'], '
';
if ($context['can_send_email'])
echo '
', ($member['show_email'] == 'no' ? '' : ''), '
';
echo '
', $member['icq']['link'], '
', $member['aim']['link'], '
', $member['yim']['link'], '
', $member['skype']['link'], '
';
$alternate = !$alternate;
}
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, $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, $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, $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, $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, $options, $scripturl, $modSettings, $txt;
echo '
';
if (!empty($modSettings['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 '
';
if ((!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])) && !empty($modSettings['drafts_autosave_enabled']))
echo '
';
if ((!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])) && !empty($modSettings['drafts_show_saved_enabled']))
echo '
';
echo '
';
}
function template_alert_configuration()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
echo '
', $txt['alert_prefs'], '
', $txt['alert_prefs_desc'], '
';
}
function template_alert_notifications_topics()
{
global $context, $options, $txt, $scripturl, $modSettings;
// The main containing header.
echo '
', $txt['watched_topics'], '
', $txt['watched_topics_desc'], '
';
template_show_list('topic_notification_list');
}
function template_alert_notifications_boards()
{
global $context, $options, $txt, $scripturl, $modSettings;
echo '
', $txt['watched_boards'], '
', $txt['watched_boards_desc'], '
';
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?
template_show_list('view_warnings');
// 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;
// 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, $options, $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, $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 '
';
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'], '';
// 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 '
';
}
// 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 '
';
}
?>