Chris@76: ';
Chris@76:
Chris@76: // Prevent Chrome from auto completing fields when viewing/editing other members profiles
Chris@76: if ($context['browser']['is_chrome'] && !$context['user']['is_owner'])
Chris@76: echo '
Chris@76: ';
Chris@76:
Chris@76: // If an error occurred while trying to save previously, give the user a clue!
Chris@76: if (!empty($context['post_errors']))
Chris@76: echo '
Chris@76: ', template_error_message();
Chris@76:
Chris@76: // If the profile was update successfully, let the user know this.
Chris@76: if (!empty($context['profile_updated']))
Chris@76: echo '
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // Template for closing off table started in profile_above.
Chris@76: function template_profile_below()
Chris@76: {
Chris@76: }
Chris@76:
Chris@76: // This template displays users details without any option to edit them.
Chris@76: function template_summary()
Chris@76: {
Chris@76: global $context, $settings, $options, $scripturl, $modSettings, $txt;
Chris@76:
Chris@76: // Display the basic information about the user
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // What about if we allow email only via the forum??
Chris@76: if ($context['member']['show_email'] === 'yes' || $context['member']['show_email'] === 'no_through_forum' || $context['member']['show_email'] === 'yes_permission_override')
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Don't show an icon if they haven't specified a website.
Chris@76: if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Are there any custom profile fields for the summary?
Chris@76: if (!empty($context['custom_fields']))
Chris@76: {
Chris@76: foreach ($context['custom_fields'] as $field)
Chris@76: if (($field['placement'] == 1 || empty($field['output_html'])) && !empty($field['value']))
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Only show the email address fully if it's not hidden - and we reveal the email.
Chris@76: if ($context['member']['show_email'] == 'yes')
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // ... Or if the one looking at the profile is an admin they can see it anyway.
Chris@76: elseif ($context['member']['show_email'] == 'yes_permission_override')
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Can they view/issue a warning?
Chris@76: if ($context['can_view_warning'] && $context['member']['warning'])
Chris@76: {
Chris@76: echo '
Chris@76:
', $txt['profile_warning_level'], ':
Chris@76:
Chris@76: ', $context['member']['warning'], '%';
Chris@76:
Chris@76: // Can we provide information on what this means?
Chris@76: if (!empty($context['warning_status']))
Chris@76: echo '
Chris@76: (', $context['warning_status'], ')';
Chris@76:
Chris@76: echo '
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // Is this member requiring activation and/or banned?
Chris@76: if (!empty($context['activate_message']) || !empty($context['member']['bans']))
Chris@76: {
Chris@76:
Chris@76: // If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
Chris@76: if (!empty($context['activate_message']))
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // If the current member is banned, show a message and possibly a link to the ban.
Chris@76: if (!empty($context['member']['bans']))
Chris@76: {
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // If the person looking is allowed, they can check the members IP address and hostname.
Chris@76: if ($context['can_see_ip'])
Chris@76: {
Chris@76: if (!empty($context['member']['ip']))
Chris@76: echo '
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // Template for showing all the posts of the user, in chronological order.
Chris@76: function template_showPosts()
Chris@76: {
Chris@76: global $context, $settings, $options, $scripturl, $modSettings, $txt;
Chris@76:
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Button shortcuts
Chris@76: $quote_button = create_button('quote.gif', 'reply_quote', 'quote', 'align="middle"');
Chris@76: $reply_button = create_button('reply_sm.gif', 'reply', 'reply', 'align="middle"');
Chris@76: $remove_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
Chris@76: $notify_button = create_button('notify_sm.gif', 'notify_replies', 'notify', 'align="middle"');
Chris@76:
Chris@76: // Are we displaying posts or attachments?
Chris@76: if (!isset($context['attachments']))
Chris@76: {
Chris@76: // For every post to be displayed, give it its own div, and show the important details of the post.
Chris@76: foreach ($context['posts'] as $post)
Chris@76: {
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // Looks like we need to do all the attachments instead!
Chris@76: $alternate = false;
Chris@76: foreach ($context['attachments'] as $attachment)
Chris@76: {
Chris@76: echo '
Chris@76:
';
Chris@76: $alternate = !$alternate;
Chris@76: }
Chris@76:
Chris@76: // No posts? Just end the table with a informative message.
Chris@76: if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
Chris@76: echo '
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // Template for showing all the buddies of the current user.
Chris@76: function template_editBuddies()
Chris@76: {
Chris@76: global $context, $settings, $options, $scripturl, $modSettings, $txt;
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76: ', $txt['editBuddies'], '
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
', $txt['name'], '
Chris@76:
', $txt['status'], '
Chris@76:
', $txt['email'], '
Chris@76:
', $txt['icq'], '
Chris@76:
', $txt['aim'], '
Chris@76:
', $txt['yim'], '
Chris@76:
', $txt['msn'], '
Chris@76:
Chris@76:
';
Chris@76:
Chris@76: // If they don't have any buddies don't list them!
Chris@76: if (empty($context['buddies']))
Chris@76: echo '
Chris@76:
Chris@76:
', $txt['no_buddies'], '
Chris@76:
';
Chris@76:
Chris@76: // Now loop through each buddy showing info on each.
Chris@76: $alternate = false;
Chris@76: foreach ($context['buddies'] as $buddy)
Chris@76: {
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Add a new buddy?
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76:
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: // Template for showing the ignore list of the current user.
Chris@76: function template_editIgnoreList()
Chris@76: {
Chris@76: global $context, $settings, $options, $scripturl, $modSettings, $txt;
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76: ', $txt['editIgnoreList'], '
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
', $txt['name'], '
Chris@76:
', $txt['status'], '
Chris@76:
', $txt['email'], '
Chris@76:
', $txt['icq'], '
Chris@76:
', $txt['aim'], '
Chris@76:
', $txt['yim'], '
Chris@76:
', $txt['msn'], '
Chris@76:
Chris@76:
';
Chris@76:
Chris@76: // If they don't have anyone on their ignore list, don't list it!
Chris@76: if (empty($context['ignore_list']))
Chris@76: echo '
Chris@76:
Chris@76:
', $txt['no_ignore'], '
Chris@76:
';
Chris@76:
Chris@76: // Now loop through each buddy showing info on each.
Chris@76: $alternate = false;
Chris@76: foreach ($context['ignore_list'] as $member)
Chris@76: {
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Add a new buddy?
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76:
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: // This template shows an admin information on a users IP addresses used and errors attributed to them.
Chris@76: function template_trackActivity()
Chris@76: {
Chris@76: global $context, $settings, $options, $scripturl, $txt;
Chris@76:
Chris@76: // The first table shows IP information about the user.
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // Show the track user list.
Chris@76: template_show_list('track_user_list');
Chris@76: }
Chris@76:
Chris@76: // The template for trackIP, allowing the admin to see where/who a certain IP has been used.
Chris@76: function template_trackIP()
Chris@76: {
Chris@76: global $context, $settings, $options, $scripturl, $txt;
Chris@76:
Chris@76: // This function always defaults to the last IP used by a member but can be set to track any IP.
Chris@76: // The first table in the template gives an input box to allow the admin to enter another IP to track.
Chris@76: echo '
Chris@76:
Chris@76:
', $txt['trackIP'], '
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // The table inbetween the first and second table shows links to the whois server for every region.
Chris@76: if ($context['single_ip'])
Chris@76: {
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: // The second table lists all the members who have been logged as using this IP address.
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // Loop through each of the members and display them.
Chris@76: foreach ($context['ips'] as $ip => $memberlist)
Chris@76: echo '
Chris@76:
';
Chris@76: }
Chris@76: }
Chris@76:
Chris@76: // Template for user statistics, showing graphs and the like.
Chris@76: function template_statPanel()
Chris@76: {
Chris@76: global $context, $settings, $options, $scripturl, $modSettings, $txt;
Chris@76:
Chris@76: // First, show a few text statistics such as post/topic count.
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Two columns with the most popular boards by posts and activity (activity = users posts / total posts).
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Draw a bar for every board.
Chris@76: foreach ($context['board_activity'] as $activity)
Chris@76: {
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Do our best to get pretty javascript enabled.
Chris@76: echo '
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: // Template to show for deleting a users account - now with added delete post capability!
Chris@76: function template_deleteAccount()
Chris@76: {
Chris@76: global $context, $settings, $options, $scripturl, $txt, $scripturl;
Chris@76:
Chris@76: // The main containing header.
Chris@76: echo '
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: // Template for the password box/save button stuck at the bottom of every profile page.
Chris@76: function template_profile_save()
Chris@76: {
Chris@76: global $context, $settings, $options, $txt;
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // Only show the password box if it's actually needed.
Chris@76: if ($context['require_password'])
Chris@76: echo '
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // Small template for showing an error message upon a save problem in the profile.
Chris@76: function template_error_message()
Chris@76: {
Chris@76: global $context, $txt;
Chris@76:
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Cycle through each error and display an error message.
Chris@76: foreach ($context['post_errors'] as $error)
Chris@76: echo '
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // Display a load of drop down selectors for allowing the user to change group.
Chris@76: function template_profile_group_manage()
Chris@76: {
Chris@76: global $context, $txt, $scripturl;
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76: ';
Chris@76: // For each membergroup show a checkbox so members can be assigned to more than one group.
Chris@76: foreach ($context['member_groups'] as $member_group)
Chris@76: if ($member_group['can_be_additional'])
Chris@76: echo '
Chris@76: ';
Chris@76: echo '
Chris@76:
Chris@76: ', $txt['additional_membergroups_show'], '
Chris@76:
Chris@76:
';
Chris@76:
Chris@76: }
Chris@76:
Chris@76: // Callback function for entering a birthdate!
Chris@76: function template_profile_birthdate()
Chris@76: {
Chris@76: global $txt, $context;
Chris@76:
Chris@76: // Just show the pretty box!
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // If there is a limit at all!
Chris@76: if (!empty($context['signature_limits']['max_length']))
Chris@76: echo '
Chris@76: ', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' ', $context['signature_limits']['max_length'], ' ';
Chris@76:
Chris@76: if ($context['signature_warning'])
Chris@76: echo '
Chris@76: ', $context['signature_warning'], '';
Chris@76:
Chris@76: // Load the spell checker?
Chris@76: if ($context['show_spellchecking'])
Chris@76: echo '
Chris@76: ';
Chris@76:
Chris@76: // Some javascript used to count how many characters have been used so far in the signature.
Chris@76: echo '
Chris@76:
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: function template_profile_avatar_select()
Chris@76: {
Chris@76: global $context, $txt, $modSettings;
Chris@76:
Chris@76: // Start with the upper menu
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // If users are allowed to choose avatars stored on the server show selection boxes to choice them from.
Chris@76: if (!empty($context['member']['avatar']['allow_server_stored']))
Chris@76: {
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // If the user can link to an off server avatar, show them a box to input the address.
Chris@76: if (!empty($context['member']['avatar']['allow_external']))
Chris@76: {
Chris@76: echo '
Chris@76:
Chris@76:
', $txt['avatar_by_url'], '
Chris@76:
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: // If the user is able to upload avatars to the server show them an upload box.
Chris@76: if (!empty($context['member']['avatar']['allow_upload']))
Chris@76: {
Chris@76: echo '
Chris@76: