Browse Source

Initial Commit.

Nathaniel van Diepen 9 years ago
parent
commit
2d30eb33be
100 changed files with 8773 additions and 21 deletions
  1. 1 21
      .gitattributes
  2. 1749 0
      PersonalMessage.template.php
  3. 3024 0
      Profile.template.php
  4. 3115 0
      css/index.css
  5. 866 0
      css/rtl.css
  6. BIN
      images/Female.gif
  7. BIN
      images/Male.gif
  8. BIN
      images/OneallSocialLogin.providers.png
  9. BIN
      images/admin/administration.gif
  10. BIN
      images/admin/attachment.gif
  11. BIN
      images/admin/ban.gif
  12. BIN
      images/admin/boards.gif
  13. BIN
      images/admin/calendar.gif
  14. BIN
      images/admin/change_menu.png
  15. BIN
      images/admin/change_menu2.png
  16. BIN
      images/admin/corefeatures.gif
  17. BIN
      images/admin/current_theme.gif
  18. BIN
      images/admin/engines.gif
  19. BIN
      images/admin/feature_cd.png
  20. BIN
      images/admin/feature_cp.png
  21. BIN
      images/admin/feature_dp.png
  22. BIN
      images/admin/feature_k.png
  23. BIN
      images/admin/feature_ml.png
  24. BIN
      images/admin/feature_pm.png
  25. BIN
      images/admin/feature_ps.png
  26. BIN
      images/admin/feature_rg.png
  27. BIN
      images/admin/feature_sp.png
  28. BIN
      images/admin/feature_w.png
  29. BIN
      images/admin/features.gif
  30. BIN
      images/admin/features_and_options.png
  31. BIN
      images/admin/forum_maintenance.png
  32. BIN
      images/admin/ignore.gif
  33. 9 0
      images/admin/index.php
  34. BIN
      images/admin/languages.gif
  35. BIN
      images/admin/logs.gif
  36. BIN
      images/admin/mail.gif
  37. BIN
      images/admin/maintain.gif
  38. BIN
      images/admin/membergroups.gif
  39. BIN
      images/admin/members.gif
  40. BIN
      images/admin/members.png
  41. BIN
      images/admin/modifications.gif
  42. BIN
      images/admin/news.gif
  43. BIN
      images/admin/package_ops.gif
  44. BIN
      images/admin/packages.gif
  45. BIN
      images/admin/packages.png
  46. BIN
      images/admin/paid.gif
  47. BIN
      images/admin/permissions.gif
  48. BIN
      images/admin/permissions.png
  49. BIN
      images/admin/post_moderation_allow.gif
  50. BIN
      images/admin/post_moderation_deny.gif
  51. BIN
      images/admin/post_moderation_moderate.gif
  52. BIN
      images/admin/posts.gif
  53. BIN
      images/admin/regcenter.gif
  54. BIN
      images/admin/reports.gif
  55. BIN
      images/admin/scheduled.gif
  56. BIN
      images/admin/search.gif
  57. BIN
      images/admin/security.gif
  58. BIN
      images/admin/server.gif
  59. BIN
      images/admin/smiley.gif
  60. BIN
      images/admin/smilies_and_messageicons.png
  61. BIN
      images/admin/subsection.gif
  62. BIN
      images/admin/support.gif
  63. BIN
      images/admin/support_and_credits.png
  64. BIN
      images/admin/switch_off.png
  65. BIN
      images/admin/switch_on.png
  66. BIN
      images/admin/tapatalk_settings.png
  67. BIN
      images/admin/themes.gif
  68. BIN
      images/admin/themes_and_layout.png
  69. BIN
      images/aim.gif
  70. BIN
      images/bar_stats.png
  71. BIN
      images/bbc/badbehavior_bbc.gif
  72. BIN
      images/bbc/bbc_bg.gif
  73. BIN
      images/bbc/bbc_hoverbg.gif
  74. BIN
      images/bbc/bold.gif
  75. BIN
      images/bbc/center.gif
  76. BIN
      images/bbc/code.gif
  77. BIN
      images/bbc/divider.gif
  78. BIN
      images/bbc/email.gif
  79. BIN
      images/bbc/flash.gif
  80. BIN
      images/bbc/ftp.gif
  81. BIN
      images/bbc/glow.gif
  82. BIN
      images/bbc/hr.gif
  83. BIN
      images/bbc/img.gif
  84. 9 0
      images/bbc/index.php
  85. BIN
      images/bbc/italicize.gif
  86. BIN
      images/bbc/left.gif
  87. BIN
      images/bbc/list.gif
  88. BIN
      images/bbc/move.gif
  89. BIN
      images/bbc/orderlist.gif
  90. BIN
      images/bbc/pre.gif
  91. BIN
      images/bbc/quote.gif
  92. BIN
      images/bbc/resize-handle.gif
  93. BIN
      images/bbc/right.gif
  94. BIN
      images/bbc/shadow.gif
  95. BIN
      images/bbc/strike.gif
  96. BIN
      images/bbc/sub.gif
  97. BIN
      images/bbc/sup.gif
  98. BIN
      images/bbc/table.gif
  99. BIN
      images/bbc/tele.gif
  100. BIN
      images/bbc/toggle.gif

+ 1 - 21
.gitattributes

@@ -1,22 +1,2 @@
 # Auto detect text files and perform LF normalization
-* text=auto
-
-# Custom for Visual Studio
-*.cs     diff=csharp
-*.sln    merge=union
-*.csproj merge=union
-*.vbproj merge=union
-*.fsproj merge=union
-*.dbproj merge=union
-
-# Standard to msysgit
-*.doc	 diff=astextplain
-*.DOC	 diff=astextplain
-*.docx diff=astextplain
-*.DOCX diff=astextplain
-*.dot  diff=astextplain
-*.DOT  diff=astextplain
-*.pdf  diff=astextplain
-*.PDF	 diff=astextplain
-*.rtf	 diff=astextplain
-*.RTF	 diff=astextplain
+* text=auto

+ 1749 - 0
PersonalMessage.template.php

@@ -0,0 +1,1749 @@
+<?php
+/**
+ * Simple Machines Forum (SMF)
+ *
+ * @package SMF
+ * @author Simple Machines
+ * @copyright 2011 Simple Machines
+ * @license http://www.simplemachines.org/about/smf/license.php BSD
+ *
+ * @version 2.0
+ */
+
+// This is the main sidebar for the personal messages section.
+function template_pm_above()
+{
+	global $context, $settings, $options, $txt;
+
+	echo '
+	<div id="personal_messages">';
+
+	// Show the capacity bar, if available.
+	if (!empty($context['limit_bar']))
+		echo '
+		<div class="title_bar">
+			<h3 class="titlebg">
+				<span class="floatleft">', $txt['pm_capacity'], ':</span>
+				<span class="floatleft capacity_bar">
+					<span class="', $context['limit_bar']['percent'] > 85 ? 'full' : ($context['limit_bar']['percent'] > 40 ? 'filled' : 'empty'), '" style="width: ', $context['limit_bar']['percent'] / 10, 'em;"></span>
+				</span>
+				<span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span>
+			</h3>
+		</div>';
+
+	// Message sent? Show a small indication.
+	if (isset($context['pm_sent']))
+		echo '
+		<div class="windowbg" id="profile_success">
+			', $txt['pm_sent'], '
+		</div>';
+}
+
+// Just the end of the index bar, nothing special.
+function template_pm_below()
+{
+	global $context, $settings, $options;
+
+	echo '
+	</div>';
+}
+
+function template_folder()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	// The every helpful javascript!
+	echo '
+	<script type="text/javascript"><!-- // --><![CDATA[
+		var allLabels = {};
+		var currentLabels = {};
+		function loadLabelChoices()
+		{
+			var listing = document.forms.pmFolder.elements;
+			var theSelect = document.forms.pmFolder.pm_action;
+			var add, remove, toAdd = {length: 0}, toRemove = {length: 0};
+
+			if (theSelect.childNodes.length == 0)
+				return;';
+
+	// This is done this way for internationalization reasons.
+	echo '
+			if (!(\'-1\' in allLabels))
+			{
+				for (var o = 0; o < theSelect.options.length; o++)
+					if (theSelect.options[o].value.substr(0, 4) == "rem_")
+						allLabels[theSelect.options[o].value.substr(4)] = theSelect.options[o].text;
+			}
+
+			for (var i = 0; i < listing.length; i++)
+			{
+				if (listing[i].name != "pms[]" || !listing[i].checked)
+					continue;
+
+				var alreadyThere = [], x;
+				for (x in currentLabels[listing[i].value])
+				{
+					if (!(x in toRemove))
+					{
+						toRemove[x] = allLabels[x];
+						toRemove.length++;
+					}
+					alreadyThere[x] = allLabels[x];
+				}
+
+				for (x in allLabels)
+				{
+					if (!(x in alreadyThere))
+					{
+						toAdd[x] = allLabels[x];
+						toAdd.length++;
+					}
+				}
+			}
+
+			while (theSelect.options.length > 2)
+				theSelect.options[2] = null;
+
+			if (toAdd.length != 0)
+			{
+				theSelect.options[theSelect.options.length] = new Option("', $txt['pm_msg_label_apply'], '", "");
+				setInnerHTML(theSelect.options[theSelect.options.length - 1], "', $txt['pm_msg_label_apply'], '");
+				theSelect.options[theSelect.options.length - 1].disabled = true;
+
+				for (i in toAdd)
+				{
+					if (i != "length")
+						theSelect.options[theSelect.options.length] = new Option(toAdd[i], "add_" + i);
+				}
+			}
+
+			if (toRemove.length != 0)
+			{
+				theSelect.options[theSelect.options.length] = new Option("', $txt['pm_msg_label_remove'], '", "");
+				setInnerHTML(theSelect.options[theSelect.options.length - 1], "', $txt['pm_msg_label_remove'], '");
+				theSelect.options[theSelect.options.length - 1].disabled = true;
+
+				for (i in toRemove)
+				{
+					if (i != "length")
+						theSelect.options[theSelect.options.length] = new Option(toRemove[i], "rem_" + i);
+				}
+			}
+		}
+	// ]]></script>';
+
+	echo '
+<form class="flow_hidden" action="', $scripturl, '?action=pm;sa=pmactions;', $context['display_mode'] == 2 ? 'conversation;' : '', 'f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '" method="post" accept-charset="', $context['character_set'], '" name="pmFolder">';
+
+	// If we are not in single display mode show the subjects on the top!
+	if ($context['display_mode'] != 1)
+	{
+		template_subject_list();
+		echo '<div class="clear_right"><br /></div>';
+	}
+
+	// Got some messages to display?
+	if ($context['get_pmessage']('message', true))
+	{
+		// Show the helpful titlebar - generally.
+		if ($context['display_mode'] != 1)
+			echo '
+				<div class="cat_bar">
+					<h3 class="catbg">
+						<span id="author">', $txt['author'], '</span>
+						<span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span>
+					</h3>
+				</div>';
+
+		// Show a few buttons if we are in conversation mode and outputting the first message.
+		if ($context['display_mode'] == 2)
+		{
+			// Build the normal button array.
+			$conversation_buttons = array(
+				'reply' => array('text' => 'reply_to_all', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=pm;sa=send;f=' . $context['folder'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';pmsg=' . $context['current_pm'] . ';u=all', 'active' => true),
+				'delete' => array('text' => 'delete_conversation', 'image' => 'delete.gif', 'lang' => true, 'url' => $scripturl . '?action=pm;sa=pmactions;pm_actions[' . $context['current_pm'] . ']=delete;conversation;f=' . $context['folder'] . ';start=' . $context['start'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';' . $context['session_var'] . '=' . $context['session_id'], 'custom' => 'onclick="return confirm(\'' . addslashes($txt['remove_message']) . '?\');"'),
+			);
+
+			// Show the conversation buttons.
+			echo '
+					<div class="pagesection">';
+
+			template_button_strip($conversation_buttons, 'right');
+
+			echo '
+					</div>';
+		}
+		echo '<div id="messagelist">';
+		while ($message = $context['get_pmessage']('message'))
+		{
+			$window_class = $message['alternate'] == 0 ? 'windowbg' : 'windowbg2';
+
+			echo '
+	<div class="', $window_class, ' clear">
+		<span class="topslice"><span></span></span>
+		<div class="poster">
+			<a id="msg', $message['id'], '"></a>
+			<h4>';
+
+			// Show online and offline buttons?
+			if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
+				echo '
+				<img src="', $message['member']['online']['image_href'], '" alt="', $message['member']['online']['text'], '" />';
+
+			echo '
+				', $message['member']['link'], '
+			</h4>
+			<ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">';
+
+			// Show the member's custom title, if they have one.
+			if (isset($message['member']['title']) && $message['member']['title'] != '')
+				echo '
+				<li class="title">', $message['member']['title'], '</li>';
+
+			// Show the member's primary group (like 'Administrator') if they have one.
+			if (isset($message['member']['group']) && $message['member']['group'] != '')
+				echo '
+				<li class="membergroup">', $message['member']['group'], '</li>';
+
+			// Don't show these things for guests.
+			if (!$message['member']['is_guest'])
+			{
+				// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
+				if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
+					echo '
+				<li class="postgroup">', $message['member']['post_group'], '</li>';
+				echo '
+				<li class="stars">', $message['member']['group_stars'], '</li>';
+
+				// Show avatars, images, etc.?
+				if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
+					echo '
+				<li class="avatar">
+					<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
+						', $message['member']['avatar']['image'], '
+					</a>
+				</li>';
+
+				// Show how many posts they have made.
+				if (!isset($context['disabled_fields']['posts']))
+					echo '
+				<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
+
+				// Is karma display enabled?  Total or +/-?
+				if ($modSettings['karmaMode'] == '1')
+					echo '
+				<li class="karma">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
+				elseif ($modSettings['karmaMode'] == '2')
+					echo '
+				<li class="karma">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>';
+
+				// Is this user allowed to modify this member's karma?
+				if ($message['member']['karma']['allow'])
+					echo '
+				<li class="karma_allow">
+					<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pm=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a> <a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pm=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a>
+				</li>';
+
+				// Show the member's gender icon?
+				if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender']))
+					echo '
+				<li class="gender">', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>';
+
+				// Show their personal text?
+				if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
+					echo '
+				<li class="blurb">', $message['member']['blurb'], '</li>';
+
+				// Any custom fields to show as icons?
+				if (!empty($message['member']['custom_fields']))
+				{
+					$shown = false;
+					foreach ($message['member']['custom_fields'] as $custom)
+					{
+						if ($custom['placement'] != 1 || empty($custom['value']))
+							continue;
+						if (empty($shown))
+						{
+							$shown = true;
+							echo '
+				<li class="im_icons">
+					<ul>';
+						}
+						echo '
+						<li>', $custom['value'], '</li>';
+					}
+					if ($shown)
+					echo '
+					</ul>
+				</li>';
+				}
+
+				// This shows the popular messaging icons.
+				if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
+					echo '
+				<li class="im_icons">
+					<ul>', !isset($context['disabled_fields']['icq']) && !empty($message['member']['icq']['link']) ? '
+						<li>' . $message['member']['icq']['link'] . '</li>' : '', !isset($context['disabled_fields']['msn']) && !empty($message['member']['msn']['link']) ? '
+						<li>' . $message['member']['msn']['link'] . '</li>' : '', !isset($context['disabled_fields']['aim']) && !empty($message['member']['aim']['link']) ? '
+						<li>' . $message['member']['aim']['link'] . '</li>' : '', !isset($context['disabled_fields']['yim']) && !empty($message['member']['yim']['link']) ? '
+						<li>' . $message['member']['yim']['link'] . '</li>' : '', '
+					</ul>
+				</li>';
+
+				// Show the profile, website, email address, and personal message buttons.
+				if ($settings['show_profile_buttons'])
+				{
+					echo '
+				<li class="profile">
+					<ul>';
+
+					// Show the profile button
+					echo '
+						<li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '" />' : $txt['view_profile']), '</a></li>';
+
+					// Don't show an icon if they haven't specified a website.
+					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
+						echo '
+						<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $message['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
+
+					// Don't show the email address if they want it hidden.
+					if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')))
+						echo '
+						<li><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $message['member']['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';
+
+					// Since we know this person isn't a guest, you *can* message them.
+					if ($context['can_send_pm'])
+						echo '
+						<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
+
+					echo '
+					</ul>
+				</li>';
+				}
+
+				// Any custom fields for standard placement?
+				if (!empty($message['member']['custom_fields']))
+				{
+					foreach ($message['member']['custom_fields'] as $custom)
+						if (empty($custom['placement']) || empty($custom['value']))
+							echo '
+				<li class="custom">', $custom['title'], ': ', $custom['value'], '</li>';
+				}
+
+				// Are we showing the warning status?
+				if ($message['member']['can_see_warning'])
+				echo '
+				<li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<img src="', $settings['images_url'], '/warning_', $message['member']['warning_status'], '.gif" alt="', $txt['user_warn_' . $message['member']['warning_status']], '" />', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>';
+			}
+
+			// Done with the information about the poster... on to the post itself.
+			echo '
+			</ul>
+		</div>
+		<div class="postarea">
+			<div class="flow_hidden">
+				<div class="keyinfo">
+					<h5 id="subject_', $message['id'], '">
+						', $message['subject'], '
+					</h5>';
+
+			// Show who the message was sent to.
+			echo '
+					<span class="smalltext">&#171; <strong> ', $txt['sent_to'], ':</strong> ';
+
+			// People it was sent directly to....
+			if (!empty($message['recipients']['to']))
+				echo implode(', ', $message['recipients']['to']);
+			// Otherwise, we're just going to say "some people"...
+			elseif ($context['folder'] != 'sent')
+				echo '(', $txt['pm_undisclosed_recipients'], ')';
+
+			echo '
+						<strong> ', $txt['on'], ':</strong> ', $message['time'], ' &#187;
+					</span>';
+
+			// If we're in the sent items, show who it was sent to besides the "To:" people.
+			if (!empty($message['recipients']['bcc']))
+				echo '
+					<br /><span class="smalltext">&#171; <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' &#187;</span>';
+
+			if (!empty($message['is_replied_to']))
+				echo '
+					<br /><span class="smalltext">&#171; ', $txt['pm_is_replied_to'], ' &#187;</span>';
+
+			echo '
+				</div>
+				<ul class="reset smalltext quickbuttons">';
+
+			// Show reply buttons if you have the permission to send PMs.
+			if ($context['can_send_pm'])
+			{
+				// You can't really reply if the member is gone.
+				if (!$message['member']['is_guest'])
+				{
+					// Is there than more than one recipient you can reply to?
+					if ($message['number_recipients'] > 1 && $context['display_mode'] != 2)
+						echo '
+					<li class="reply_all_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $txt['reply_to_all'], '</a></li>';
+
+					echo '
+					<li class="reply_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $txt['reply'], '</a></li>
+					<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '">', $txt['quote'], '</a></li>';
+				}
+				// This is for "forwarding" - even if the member is gone.
+				else
+					echo '
+					<li class="forward_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $txt['reply_quote'], '</a></li>';
+			}
+			echo '
+					<li class="remove_button"><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions[', $message['id'], ']=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', addslashes($txt['remove_message']), '?\');">', $txt['delete'], '</a></li>';
+
+			if (empty($context['display_mode']))
+				echo '
+					<li class="inline_mod_check"><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;" class="input_check" /></li>';
+
+			echo '
+				</ul>
+			</div>
+			<div class="post">
+				<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
+				<div class="smalltext reportlinks">
+					', (!empty($modSettings['enableReportPM']) && $context['folder'] != 'sent' ? '<div class="righttext"><a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '">' . $txt['pm_report_to_admin'] . '</a></div>' : '');
+
+			echo '
+				</div>';
+
+			// Are there any custom profile fields for above the signature?
+			if (!empty($message['member']['custom_fields']))
+			{
+				$shown = false;
+				foreach ($message['member']['custom_fields'] as $custom)
+				{
+					if ($custom['placement'] != 2 || empty($custom['value']))
+						continue;
+					if (!$shown)
+					{
+						$shown = true;
+						echo '
+				<div class="custom_fields_above_signature">
+					<ul class="reset nolist">';
+					}
+					echo '
+						<li>', $custom['value'], '</li>';
+				}
+				if ($shown)
+					echo '
+					</ul>
+				</div>';
+			}
+
+			// Show the member's signature?
+			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
+				echo '
+				<div class="signature">', $message['member']['signature'], '</div>';
+
+			// Add an extra line at the bottom if we have labels enabled.
+			if ($context['folder'] != 'sent' && !empty($context['currently_using_labels']) && $context['display_mode'] != 2)
+			{
+				echo '
+				<div class="labels righttext">';
+				// Add the label drop down box.
+				if (!empty($context['currently_using_labels']))
+				{
+					echo '
+					<select name="pm_actions[', $message['id'], ']" onchange="if (this.options[this.selectedIndex].value) form.submit();">
+						<option value="">', $txt['pm_msg_label_title'], ':</option>
+						<option value="" disabled="disabled">---------------</option>';
+
+					// Are there any labels which can be added to this?
+					if (!$message['fully_labeled'])
+					{
+						echo '
+						<option value="" disabled="disabled">', $txt['pm_msg_label_apply'], ':</option>';
+						foreach ($context['labels'] as $label)
+							if (!isset($message['labels'][$label['id']]))
+								echo '
+							<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
+					}
+					// ... and are there any that can be removed?
+					if (!empty($message['labels']) && (count($message['labels']) > 1 || !isset($message['labels'][-1])))
+					{
+						echo '
+						<option value="" disabled="disabled">', $txt['pm_msg_label_remove'], ':</option>';
+						foreach ($message['labels'] as $label)
+							echo '
+							<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
+					}
+					echo '
+					</select>
+					<noscript>
+						<input type="submit" value="', $txt['pm_apply'], '" class="button_submit" />
+					</noscript>';
+				}
+				echo '
+				</div>';
+			}
+
+			echo '
+			</div>
+			<br class="clear" />
+		</div>
+		<div class="moderatorbar">
+		</div>
+		<span class="botslice"><span></span></span>
+	</div>';
+		}
+		echo '</div>';
+		if (empty($context['display_mode']))
+			echo '
+
+	<div class="pagesection">
+		<div class="floatleft">', $txt['pages'], ': ', $context['page_index'], '</div>
+		<div class="floatright"><input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" style="font-weight: normal;" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button_submit" /></div>
+	</div>';
+
+		// Show a few buttons if we are in conversation mode and outputting the first message.
+		elseif ($context['display_mode'] == 2 && isset($conversation_buttons))
+		{
+			echo '
+
+	<div class="pagesection">';
+
+			template_button_strip($conversation_buttons, 'right');
+
+			echo '
+	</div>';
+		}
+
+		echo '
+		<br />';
+	}
+
+	// Individual messages = buttom list!
+	if ($context['display_mode'] == 1)
+	{
+		template_subject_list();
+		echo '<br />';
+	}
+
+	echo '
+	<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+</form>';
+}
+
+// Just list all the personal message subjects - to make templates easier.
+function template_subject_list()
+{
+	global $context, $options, $settings, $modSettings, $txt, $scripturl;
+
+	echo '
+	<div>
+	<table width="100%" class="table_grid">
+	<thead>
+		<tr class="catbg">
+			<th align="center" width="4%" class="first_th">
+				<a href="', $scripturl, '?action=pm;view;f=', $context['folder'], ';start=', $context['start'], ';sort=', $context['sort_by'], ($context['sort_direction'] == 'up' ? '' : ';desc'), ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : ''), '"><img src="', $settings['images_url'], '/im_switch.gif" alt="', $txt['pm_change_view'], '" title="', $txt['pm_change_view'], '" width="16" height="16" /></a>
+			</th>
+			<th class="lefttext" width="22%">
+				<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=date', $context['sort_by'] == 'date' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', $txt['date'], $context['sort_by'] == 'date' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
+			</th>
+			<th class="lefttext" width="46%">
+				<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
+			</th>
+			<th class="lefttext">
+				<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', ($context['from_or_to'] == 'from' ? $txt['from'] : $txt['to']), $context['sort_by'] == 'name' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
+			</th>
+			<th align="center" width="4%" class="last_th">
+				<input type="checkbox" onclick="invertAll(this, this.form);" class="input_check" />
+			</th>
+		</tr>
+	</thead>
+	<tbody>';
+	if (!$context['show_delete'])
+		echo '
+		<tr class="windowbg2">
+			<td colspan="5">', $txt['msg_alert_none'], '</td>
+		</tr>';
+	$next_alternate = false;
+
+	while ($message = $context['get_pmessage']('subject'))
+	{
+		echo '
+		<tr class="', $next_alternate ? 'windowbg' : 'windowbg2', '">
+			<td align="center" width="4%">
+			<script type="text/javascript"><!-- // --><![CDATA[
+				currentLabels[', $message['id'], '] = {';
+
+		if (!empty($message['labels']))
+		{
+			$first = true;
+			foreach ($message['labels'] as $label)
+			{
+				echo $first ? '' : ',', '
+				"', $label['id'], '": "', $label['name'], '"';
+				$first = false;
+			}
+		}
+
+		echo '
+				};
+			// ]]></script>
+				', $message['is_replied_to'] ? '<img src="' . $settings['images_url'] . '/icons/pm_replied.gif" style="margin-right: 4px;" alt="' . $txt['pm_replied'] . '" />' : '<img src="' . $settings['images_url'] . '/icons/pm_read.gif" style="margin-right: 4px;" alt="' . $txt['pm_read'] . '" />', '</td>
+			<td>', $message['time'], '</td>
+			<td>', ($context['display_mode'] != 0 && $context['current_pm'] == $message['id'] ? '<img src="' . $settings['images_url'] . '/selected.gif" alt="*" />' : ''), '<a href="', ($context['display_mode'] == 0 || $context['current_pm'] == $message['id'] ? '' : ($scripturl . '?action=pm;pmid=' . $message['id'] . ';kstart;f=' . $context['folder'] . ';start=' . $context['start'] . ';sort=' . $context['sort_by'] . ($context['sort_direction'] == 'up' ? ';' : ';desc') . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : ''))), '#msg', $message['id'], '">', $message['subject'], '</a>', $message['is_unread'] ? '&nbsp;<img src="' . $settings['lang_images_url'] . '/new.gif" alt="' . $txt['new'] . '" />' : '', '</td>
+			<td>', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '</td>
+			<td align="center" width="4%"><input type="checkbox" name="pms[]" id="deletelisting', $message['id'], '" value="', $message['id'], '"', $message['is_selected'] ? ' checked="checked"' : '', ' onclick="if (document.getElementById(\'deletedisplay', $message['id'], '\')) document.getElementById(\'deletedisplay', $message['id'], '\').checked = this.checked;" class="input_check" /></td>
+		</tr>';
+			$next_alternate = !$next_alternate;
+	}
+
+	echo '
+	</tbody>
+	</table>
+	</div>
+	<div class="pagesection">
+		<div class="floatleft">', $txt['pages'], ': ', $context['page_index'], '</div>
+		<div class="floatright">&nbsp;';
+
+	if ($context['show_delete'])
+	{
+		if (!empty($context['currently_using_labels']) && $context['folder'] != 'sent')
+		{
+			echo '
+				<select name="pm_action" onchange="if (this.options[this.selectedIndex].value) this.form.submit();" onfocus="loadLabelChoices();">
+					<option value="">', $txt['pm_sel_label_title'], ':</option>
+					<option value="" disabled="disabled">---------------</option>';
+
+			echo '
+									<option value="" disabled="disabled">', $txt['pm_msg_label_apply'], ':</option>';
+			foreach ($context['labels'] as $label)
+				if ($label['id'] != $context['current_label_id'])
+					echo '
+					<option value="add_', $label['id'], '">&nbsp;', $label['name'], '</option>';
+			echo '
+					<option value="" disabled="disabled">', $txt['pm_msg_label_remove'], ':</option>';
+			foreach ($context['labels'] as $label)
+				echo '
+					<option value="rem_', $label['id'], '">&nbsp;', $label['name'], '</option>';
+			echo '
+				</select>
+				<noscript>
+					<input type="submit" value="', $txt['pm_apply'], '" class="button_submit" />
+				</noscript>';
+		}
+
+		echo '
+				<input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button_submit" />';
+	}
+
+	echo '
+				</div>
+	</div>';
+}
+
+function template_search()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	echo '
+	<script type="text/javascript"><!-- // --><![CDATA[
+		function expandCollapseLabels()
+		{
+			var current = document.getElementById("searchLabelsExpand").style.display != "none";
+
+			document.getElementById("searchLabelsExpand").style.display = current ? "none" : "";
+			document.getElementById("expandLabelsIcon").src = smf_images_url + (current ? "/expand.gif" : "/collapse.gif");
+		}
+	// ]]></script>
+	<form action="', $scripturl, '?action=pm;sa=search2" method="post" accept-charset="', $context['character_set'], '" name="searchform" id="searchform">
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['pm_search_title'], '</h3>
+		</div>';
+
+	if (!empty($context['search_errors']))
+	{
+		echo '
+		<div class="errorbox">
+			', implode('<br />', $context['search_errors']['messages']), '
+		</div>';
+	}
+
+	if ($context['simple_search'])
+	{
+		echo '
+		<fieldset id="simple_search">
+			<span class="upperframe"><span></span></span>
+			<div class="roundframe">
+				<div id="search_term_input">
+					<strong>', $txt['pm_search_text'], ':</strong>
+					<input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' size="40" class="input_text" />
+					<input type="submit" name="submit" value="', $txt['pm_search_go'], '" class="button_submit" />
+				</div>
+				<a href="', $scripturl, '?action=pm;sa=search;advanced" onclick="this.href += \';search=\' + escape(document.forms.searchform.search.value);">', $txt['pm_search_advanced'], '</a>
+				<input type="hidden" name="advanced" value="0" />
+			</div>
+			<span class="lowerframe"><span></span></span>
+		</fieldset>';
+	}
+
+	// Advanced search!
+	else
+	{
+		echo '
+		<fieldset id="advanced_search">
+			<span class="upperframe"><span></span></span>
+			<div class="roundframe">
+				<input type="hidden" name="advanced" value="1" />
+				<span class="enhanced">
+					<strong>', $txt['pm_search_text'], ':</strong>
+					<input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' size="40" class="input_text" />
+					<script type="text/javascript"><!-- // --><![CDATA[
+						function initSearch()
+						{
+							if (document.forms.searchform.search.value.indexOf("%u") != -1)
+								document.forms.searchform.search.value = unescape(document.forms.searchform.search.value);
+						}
+						createEventListener(window);
+						window.addEventListener("load", initSearch, false);
+					// ]]></script>
+					<select name="searchtype">
+						<option value="1"', empty($context['search_params']['searchtype']) ? ' selected="selected"' : '', '>', $txt['pm_search_match_all'], '</option>
+						<option value="2"', !empty($context['search_params']['searchtype']) ? ' selected="selected"' : '', '>', $txt['pm_search_match_any'], '</option>
+					</select>
+				</span>
+				<dl id="search_options">
+					<dt>', $txt['pm_search_user'], ':</dt>
+					<dd><input type="text" name="userspec" value="', empty($context['search_params']['userspec']) ? '*' : $context['search_params']['userspec'], '" size="40" class="input_text" /></dd>
+					<dt>', $txt['pm_search_order'], ':</dt>
+					<dd>
+						<select name="sort">
+							<option value="relevance|desc">', $txt['pm_search_orderby_relevant_first'], '</option>
+							<option value="id_pm|desc">', $txt['pm_search_orderby_recent_first'], '</option>
+							<option value="id_pm|asc">', $txt['pm_search_orderby_old_first'], '</option>
+						</select>
+					</dd>
+					<dt class="options">', $txt['pm_search_options'], ':</dt>
+					<dd class="options">
+						<label for="show_complete"><input type="checkbox" name="show_complete" id="show_complete" value="1"', !empty($context['search_params']['show_complete']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['pm_search_show_complete'], '</label><br />
+						<label for="subject_only"><input type="checkbox" name="subject_only" id="subject_only" value="1"', !empty($context['search_params']['subject_only']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['pm_search_subject_only'], '</label>
+					</dd>
+					<dt class="between">', $txt['pm_search_post_age'], ':</dt>
+					<dd>', $txt['pm_search_between'], ' <input type="text" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="5" class="input_text" />&nbsp;', $txt['pm_search_between_and'], '&nbsp;<input type="text" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="5" class="input_text" /> ', $txt['pm_search_between_days'], '</dd>
+				</dl>';
+		if (!$context['currently_using_labels'])
+			echo '
+				<input type="submit" name="submit" value="', $txt['pm_search_go'], '" class="button_submit floatright" />';
+			echo '
+				<br class="clear" />
+			</div>
+			<span class="lowerframe"><span></span></span>
+		</fieldset>';
+
+		// Do we have some labels setup? If so offer to search by them!
+		if ($context['currently_using_labels'])
+		{
+			echo '
+		<fieldset class="labels">
+			<span class="upperframe"><span></span></span>
+			<div class="roundframe">
+				<div class="title_bar">
+					<h4 class="titlebg">
+						<span class="ie6_header floatleft"><a href="javascript:void(0);" onclick="expandCollapseLabels(); return false;"><img src="', $settings['images_url'], '/expand.gif" id="expandLabelsIcon" alt="" /></a> <a href="javascript:void(0);" onclick="expandCollapseLabels(); return false;"><strong>', $txt['pm_search_choose_label'], '</strong></a></span>
+					</h4>
+				</div>
+				<ul id="searchLabelsExpand" class="reset" ', $context['check_all'] ? 'style="display: none;"' : '', '>';
+
+			foreach ($context['search_labels'] as $label)
+				echo '
+					<li>
+						<label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '" ', $label['checked'] ? 'checked="checked"' : '', ' class="input_check" />
+						', $label['name'], '</label>
+					</li>';
+
+			echo '
+				</ul>
+				<p>
+					<span class="floatleft"><input type="checkbox" name="all" id="check_all" value="" ', $context['check_all'] ? 'checked="checked"' : '', ' onclick="invertAll(this, this.form, \'searchlabel\');" class="input_check" /><em> <label for="check_all">', $txt['check_all'], '</label></em></span>
+					<input type="submit" name="submit" value="', $txt['pm_search_go'], '" class="button_submit floatright" />
+				</p><br class="clear" />
+			</div>
+			<span class="lowerframe"><span></span></span>
+		</fieldset>';
+		}
+	}
+
+	echo '
+	</form>';
+}
+
+function template_search_results()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	echo '
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['pm_search_results'], '</h3>
+		</div>
+		<div class="pagesection">
+			<strong>', $txt['pages'], ':</strong> ', $context['page_index'], '
+		</div>';
+
+	// complete results ?
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
+		echo '
+	<table width="100%" class="table_grid">
+	<thead>
+		<tr class="catbg">
+			<th class="lefttext first_th" width="30%">', $txt['date'], '</th>
+			<th class="lefttext" width="50%">', $txt['subject'], '</th>
+			<th class="lefttext last_th" width="20%">', $txt['from'], '</th>
+		</tr>
+	</thead>
+	<tbody>';
+
+	$alternate = true;
+	// Print each message out...
+	foreach ($context['personal_messages'] as $message)
+	{
+		// We showing it all?
+		if (!empty($context['search_params']['show_complete']))
+		{
+			echo '
+			<div class="title_bar">
+				<h3 class="titlebg">
+					<span class="floatright">', $txt['search_on'], ': ', $message['time'], '</span>
+					<span class="floatleft">', $message['counter'], '&nbsp;&nbsp;<a href="', $message['href'], '">', $message['subject'], '</a></span>
+				</h3>
+			</div>
+			<div class="cat_bar">
+				<h3 class="catbg">', $txt['from'], ': ', $message['member']['link'], ', ', $txt['to'], ': ';
+
+				// Show the recipients.
+				// !!! This doesn't deal with the sent item searching quite right for bcc.
+				if (!empty($message['recipients']['to']))
+					echo implode(', ', $message['recipients']['to']);
+				// Otherwise, we're just going to say "some people"...
+				elseif ($context['folder'] != 'sent')
+					echo '(', $txt['pm_undisclosed_recipients'], ')';
+
+					echo '
+				</h3>
+			</div>
+			<div class="windowbg', $alternate ? '2': '', '">
+				<span class="topslice"><span></span></span>
+				<div class="content">
+					', $message['body'], '
+					<p class="pm_reply righttext middletext">';
+
+				if ($context['can_send_pm'])
+				{
+					$quote_button = create_button('quote.gif', 'reply_quote', 'reply_quote', 'align="middle"');
+					$reply_button = create_button('im_reply.gif', 'reply', 'reply', 'align="middle"');
+					// You can only reply if they are not a guest...
+					if (!$message['member']['is_guest'])
+						echo '
+								<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], '
+								<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator'];
+					// This is for "forwarding" - even if the member is gone.
+					else
+						echo '
+								<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator'];
+				}
+
+				echo '
+					</p>
+				</div>
+				<span class="botslice"><span></span></span>
+			</div>';
+		}
+		// Otherwise just a simple list!
+		else
+		{
+			// !!! No context at all of the search?
+			echo '
+			<tr class="', $alternate ? 'windowbg' : 'windowbg2', '" valign="top">
+				<td>', $message['time'], '</td>
+				<td>', $message['link'], '</td>
+				<td>', $message['member']['link'], '</td>
+			</tr>';
+		}
+
+		$alternate = !$alternate;
+	}
+
+	// Finish off the page...
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
+		echo '
+		</tbody>
+		</table>';
+
+	// No results?
+	if (empty($context['personal_messages']))
+		echo '
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				<p class="centertext">', $txt['pm_search_none_found'], '</p>
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>';
+
+	echo '
+		<div class="pagesection">
+			<strong>', $txt['pages'], ':</strong> ', $context['page_index'], '
+		</div>';
+
+}
+
+function template_send()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	// Show which messages were sent successfully and which failed.
+	if (!empty($context['send_log']))
+	{
+		echo '
+			<div class="cat_bar">
+				<h3 class="catbg">', $txt['pm_send_report'], '</h3>
+			</div>
+			<div class="windowbg">
+				<span class="topslice"><span></span></span>
+				<div class="content">';
+				if (!empty($context['send_log']['sent']))
+					foreach ($context['send_log']['sent'] as $log_entry)
+						echo '<span class="error">', $log_entry, '</span><br />';
+				if (!empty($context['send_log']['failed']))
+					foreach ($context['send_log']['failed'] as $log_entry)
+						echo '<span class="error">', $log_entry, '</span><br />';
+				echo '
+				</div>
+				<span class="botslice"><span></span></span>
+			</div>
+			<br />';
+	}
+
+	// Show the preview of the personal message.
+	if (isset($context['preview_message']))
+	echo '
+		<div class="cat_bar">
+			<h3 class="catbg">', $context['preview_subject'], '</h3>
+		</div>
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				', $context['preview_message'], '
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>
+		<br />';
+
+	// Main message editing box.
+	echo '
+		<div class="cat_bar">
+			<h3 class="catbg">
+					<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/im_newmsg.gif" alt="', $txt['new_message'], '" title="', $txt['new_message'], '" />&nbsp;', $txt['new_message'], '</span>
+			</h3>
+		</div>';
+
+	echo '
+	<form action="', $scripturl, '?action=pm;sa=send2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" class="flow_hidden" onsubmit="submitonce(this);smc_saveEntities(\'postmodify\', [\'subject\', \'message\']);">
+		<div>
+			<span class="upperframe"><span></span></span>
+			<div class="roundframe"><br class="clear" />';
+
+	// If there were errors for sending the PM, show them.
+	if (!empty($context['post_error']['messages']))
+	{
+		echo '
+				<div class="errorbox">
+					<strong>', $txt['error_while_submitting'], '</strong>
+					<ul class="reset">';
+
+		foreach ($context['post_error']['messages'] as $error)
+			echo '
+						<li class="error">', $error, '</li>';
+
+		echo '
+					</ul>
+				</div>';
+	}
+
+	echo '
+				<dl id="post_header">';
+
+	// To and bcc. Include a button to search for members.
+	echo '
+					<dt>
+						<span', (isset($context['post_error']['no_to']) || isset($context['post_error']['bad_to']) ? ' class="error"' : ''), '>', $txt['pm_to'], ':</span>
+					</dt>';
+
+	// Autosuggest will be added by the JavaScript later on.
+	echo '
+					<dd id="pm_to" class="clear_right">
+						<input type="text" name="to" id="to_control" value="', $context['to_value'], '" tabindex="', $context['tabindex']++, '" size="40" style="width: 130px;" class="input_text" />';
+
+	// A link to add BCC, only visible with JavaScript enabled.
+	echo '
+						<span class="smalltext" id="bcc_link_container" style="display: none;"></span>';
+
+	// A div that'll contain the items found by the autosuggest.
+	echo '
+						<div id="to_item_list_container"></div>';
+
+	echo '
+					</dd>';
+
+	// This BCC row will be hidden by default if JavaScript is enabled.
+	echo '
+					<dt  class="clear_left" id="bcc_div">
+						<span', (isset($context['post_error']['no_to']) || isset($context['post_error']['bad_bcc']) ? ' class="error"' : ''), '>', $txt['pm_bcc'], ':</span>
+					</dt>
+					<dd id="bcc_div2">
+						<input type="text" name="bcc" id="bcc_control" value="', $context['bcc_value'], '" tabindex="', $context['tabindex']++, '" size="40" style="width: 130px;" class="input_text" />
+						<div id="bcc_item_list_container"></div>
+					</dd>';
+
+	// The subject of the PM.
+	echo '
+					<dt class="clear_left">
+						<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), '>', $txt['subject'], ':</span>
+					</dt>
+					<dd id="pm_subject">
+						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="60" maxlength="60" />
+					</dd>
+				</dl><hr class="clear" />';
+
+	// Showing BBC?
+	if ($context['show_bbc'])
+	{
+		echo '
+				<div id="bbcBox_message"></div>';
+	}
+
+	// What about smileys?
+	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
+		echo '
+				<div id="smileyBox_message"></div>';
+
+	// Show BBC buttons, smileys and textbox.
+	echo '
+				', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
+
+	// Require an image to be typed to save spamming?
+	if ($context['require_verification'])
+	{
+		echo '
+				<div class="post_verification">
+					<strong>', $txt['pm_visual_verification_label'], ':</strong>
+					', template_control_verification($context['visual_verification_id'], 'all'), '
+				</div>';
+	}
+
+	// Send, Preview, spellcheck buttons.
+	echo '
+				<p><label for="outbox"><input type="checkbox" name="outbox" id="outbox" value="1" tabindex="', $context['tabindex']++, '"', $context['copy_to_outbox'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['pm_save_outbox'], '</label></p>
+				<p id="shortcuts" class="smalltext">
+					', $context['browser']['is_firefox'] ? $txt['shortcuts_firefox'] : $txt['shortcuts'], '
+				</p>
+				<p id="post_confirm_strip" class="righttext">
+					', template_control_richedit_buttons($context['post_box_name']), '
+				</p>
+				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+				<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
+				<input type="hidden" name="replied_to" value="', !empty($context['quoted_message']['id']) ? $context['quoted_message']['id'] : 0, '" />
+				<input type="hidden" name="pm_head" value="', !empty($context['quoted_message']['pm_head']) ? $context['quoted_message']['pm_head'] : 0, '" />
+				<input type="hidden" name="f" value="', isset($context['folder']) ? $context['folder'] : '', '" />
+				<input type="hidden" name="l" value="', isset($context['current_label_id']) ? $context['current_label_id'] : -1, '" />
+				<br class="clear" />
+				</div>
+			<span class="lowerframe"><span></span></span>
+		</div>
+	</form>';
+
+	// Show the message you're replying to.
+	if ($context['reply'])
+		echo '
+	<br />
+	<br />
+	<div class="cat_bar">
+		<h3 class="catbg">', $txt['subject'], ': ', $context['quoted_message']['subject'], '</h3>
+	</div>
+	<div class="windowbg2">
+		<span class="topslice"><span></span></span>
+		<div class="content">
+			<div class="clear">
+				<span class="smalltext floatright">', $txt['on'], ': ', $context['quoted_message']['time'], '</span>
+				<strong>', $txt['from'], ': ', $context['quoted_message']['member']['name'], '</strong>
+			</div><hr />
+			', $context['quoted_message']['body'], '
+		</div>
+		<span class="botslice"><span></span></span>
+	</div><br class="clear" />';
+
+	echo '
+		<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/PersonalMessage.js?fin20"></script>
+		<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
+		<script type="text/javascript"><!-- // --><![CDATA[
+			var oPersonalMessageSend = new smf_PersonalMessageSend({
+				sSelf: \'oPersonalMessageSend\',
+				sSessionId: \'', $context['session_id'], '\',
+				sSessionVar: \'', $context['session_var'], '\',
+				sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
+				sToControlId: \'to_control\',
+				aToRecipients: [';
+	foreach ($context['recipients']['to'] as $i => $member)
+		echo '
+					{
+						sItemId: ', JavaScriptEscape($member['id']), ',
+						sItemName: ', JavaScriptEscape($member['name']), '
+					}', $i == count($context['recipients']['to']) - 1 ? '' : ',';
+
+	echo '
+				],
+				aBccRecipients: [';
+	foreach ($context['recipients']['bcc'] as $i => $member)
+		echo '
+					{
+						sItemId: ', JavaScriptEscape($member['id']), ',
+						sItemName: ', JavaScriptEscape($member['name']), '
+					}', $i == count($context['recipients']['bcc']) - 1 ? '' : ',';
+
+	echo '
+				],
+				sBccControlId: \'bcc_control\',
+				sBccDivId: \'bcc_div\',
+				sBccDivId2: \'bcc_div2\',
+				sBccLinkId: \'bcc_link\',
+				sBccLinkContainerId: \'bcc_link_container\',
+				bBccShowByDefault: ', empty($context['recipients']['bcc']) && empty($context['bcc_value']) ? 'false' : 'true', ',
+				sShowBccLinkTemplate: ', JavaScriptEscape('
+					<a href="#" id="bcc_link">' . $txt['make_bcc'] . '</a> <a href="' . $scripturl . '?action=helpadmin;help=pm_bcc" onclick="return reqWin(this.href);">(?)</a>'
+				), '
+			});
+		';
+
+	echo '
+		// ]]></script>';
+}
+
+// This template asks the user whether they wish to empty out their folder/messages.
+function template_ask_delete()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	echo '
+		<div class="cat_bar">
+			<h3 class="catbg">', ($context['delete_all'] ? $txt['delete_message'] : $txt['delete_all']), '</h3>
+		</div>
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				<p>', $txt['delete_all_confirm'], '</p><br />
+				<strong><a href="', $scripturl, '?action=pm;sa=removeall2;f=', $context['folder'], ';', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '">', $txt['yes'], '</a> - <a href="javascript:history.go(-1);">', $txt['no'], '</a></strong>
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>';
+}
+
+// This template asks the user what messages they want to prune.
+function template_prune()
+{
+	global $context, $settings, $options, $scripturl, $txt;
+
+	echo '
+	<form action="', $scripturl, '?action=pm;sa=prune" method="post" accept-charset="', $context['character_set'], '" onsubmit="return confirm(\'', $txt['pm_prune_warning'], '\');">
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['pm_prune'], '</h3>
+		</div>
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				<p>', $txt['pm_prune_desc1'], ' <input type="text" name="age" size="3" value="14" class="input_text" /> ', $txt['pm_prune_desc2'], '</p>
+				<div class="righttext">
+					<input type="submit" value="', $txt['delete'], '" class="button_submit" />
+				</div>
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>
+		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+	</form>';
+}
+
+// Here we allow the user to setup labels, remove labels and change rules for labels (i.e, do quite a bit)
+function template_labels()
+{
+	global $context, $settings, $options, $scripturl, $txt;
+
+	echo '
+	<form action="', $scripturl, '?action=pm;sa=manlabels" method="post" accept-charset="', $context['character_set'], '">
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['pm_manage_labels'], '</h3>
+		</div>
+		<div class="description">
+			', $txt['pm_labels_desc'], '
+		</div>
+		<table width="100%" class="table_grid">
+		<thead>
+			<tr class="catbg">
+				<th class="lefttext first_th">
+					', $txt['pm_label_name'], '
+				</th>
+				<th class="centertext last_th" width="4%">';
+
+	if (count($context['labels']) > 2)
+		echo '
+					<input type="checkbox" class="input_check" onclick="invertAll(this, this.form);" />';
+
+	echo '
+				</th>
+			</tr>
+		</thead>
+		<tbody>';
+	if (count($context['labels']) < 2)
+		echo '
+			<tr class="windowbg2">
+				<td colspan="2" align="center">', $txt['pm_labels_no_exist'], '</td>
+			</tr>';
+	else
+	{
+		$alternate = true;
+		foreach ($context['labels'] as $label)
+		{
+			if ($label['id'] == -1)
+				continue;
+
+				echo '
+			<tr class="', $alternate ? 'windowbg2' : 'windowbg', '">
+				<td>
+					<input type="text" name="label_name[', $label['id'], ']" value="', $label['name'], '" size="30" maxlength="30" class="input_text" />
+				</td>
+				<td width="4%" align="center"><input type="checkbox" class="input_check" name="delete_label[', $label['id'], ']" /></td>
+			</tr>';
+
+			$alternate = !$alternate;
+		}
+	}
+	echo '
+		</tbody>
+		</table>';
+
+	if (!count($context['labels']) < 2)
+		echo '
+		<div class="padding righttext">
+			<input type="submit" name="save" value="', $txt['save'], '" class="button_submit" />
+			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" onclick="return confirm(\'', $txt['pm_labels_delete'], '\');" class="button_submit" />
+		</div>';
+
+	echo '
+		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+	</form>
+	<form action="', $scripturl, '?action=pm;sa=manlabels" method="post" accept-charset="', $context['character_set'], '" style="margin-top: 1ex;">
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['pm_label_add_new'], '</h3>
+		</div>
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				<dl class="settings">
+					<dt>
+						<strong><label for="add_label">', $txt['pm_label_name'], '</label>:</strong>
+					</dt>
+					<dd>
+						<input type="text" id="add_label" name="label" value="" size="30" maxlength="30" class="input_text" />
+					</dd>
+				</dl>
+				<div class="righttext">
+					<input type="submit" name="add" value="', $txt['pm_label_add_new'], '" class="button_submit" />
+				</div>
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>
+		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+	</form><br />';
+}
+
+// Template for reporting a personal message.
+function template_report_message()
+{
+	global $context, $settings, $options, $txt, $scripturl;
+
+	echo '
+	<form action="', $scripturl, '?action=pm;sa=report;l=', $context['current_label_id'], '" method="post" accept-charset="', $context['character_set'], '">
+		<input type="hidden" name="pmsg" value="', $context['pm_id'], '" />
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['pm_report_title'], '</h3>
+		</div>
+		<div class="description">
+			', $txt['pm_report_desc'], '
+		</div>
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				<dl class="settings">';
+
+	// If there is more than one admin on the forum, allow the user to choose the one they want to direct to.
+	// !!! Why?
+	if ($context['admin_count'] > 1)
+	{
+		echo '
+					<dt>
+						<strong>', $txt['pm_report_admins'], ':</strong>
+					</dt>
+					<dd>
+						<select name="ID_ADMIN">
+							<option value="0">', $txt['pm_report_all_admins'], '</option>';
+		foreach ($context['admins'] as $id => $name)
+			echo '
+							<option value="', $id, '">', $name, '</option>';
+		echo '
+						</select>
+					</dd>';
+	}
+
+	echo '
+					<dt>
+						<strong>', $txt['pm_report_reason'], ':</strong>
+					</dt>
+					<dd>
+						<textarea name="reason" rows="4" cols="70" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 80%; min-width: 80%' : 'width: 80%') . ';"></textarea>
+					</dd>
+				</dl>
+				<div class="righttext">
+					<input type="submit" name="report" value="', $txt['pm_report_message'], '" class="button_submit" />
+				</div>
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>
+		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+	</form>';
+}
+
+// Little template just to say "Yep, it's been submitted"
+function template_report_message_complete()
+{
+	global $context, $settings, $options, $txt, $scripturl;
+
+	echo '
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['pm_report_title'], '</h3>
+		</div>
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				<p>', $txt['pm_report_done'], '</p>
+				<a href="', $scripturl, '?action=pm;l=', $context['current_label_id'], '">', $txt['pm_report_return'], '</a>
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>';
+}
+
+// Manage rules.
+function template_rules()
+{
+	global $context, $settings, $options, $txt, $scripturl;
+
+	echo '
+	<form action="', $scripturl, '?action=pm;sa=manrules" method="post" accept-charset="', $context['character_set'], '" name="manRules" id="manrules">
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['pm_manage_rules'], '</h3>
+		</div>
+		<div class="description">
+			', $txt['pm_manage_rules_desc'], '
+		</div>
+		<table width="100%" class="table_grid">
+		<thead>
+			<tr class="catbg">
+				<th class="lefttext first_th">
+					', $txt['pm_rule_title'], '
+				</th>
+				<th width="4%" class="centertext last_th">';
+
+	if (!empty($context['rules']))
+		echo '
+					<input type="checkbox" onclick="invertAll(this, this.form);" class="input_check" />';
+
+	echo '
+				</th>
+			</tr>
+		</thead>
+		<tbody>';
+
+	if (empty($context['rules']))
+		echo '
+			<tr class="windowbg2">
+				<td colspan="2" align="center">
+					', $txt['pm_rules_none'], '
+				</td>
+			</tr>';
+
+	$alternate = false;
+	foreach ($context['rules'] as $rule)
+	{
+		echo '
+			<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
+				<td>
+					<a href="', $scripturl, '?action=pm;sa=manrules;add;rid=', $rule['id'], '">', $rule['name'], '</a>
+				</td>
+				<td width="4%" align="center">
+					<input type="checkbox" name="delrule[', $rule['id'], ']" class="input_check" />
+				</td>
+			</tr>';
+		$alternate = !$alternate;
+	}
+
+	echo '
+		</tbody>
+		</table>
+		<div class="righttext">
+			[<a href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>]';
+
+	if (!empty($context['rules']))
+		echo '
+			[<a href="', $scripturl, '?action=pm;sa=manrules;apply;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['pm_js_apply_rules_confirm'], '\');">', $txt['pm_apply_rules'], '</a>]';
+
+	if (!empty($context['rules']))
+		echo '
+			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" onclick="return confirm(\'', $txt['pm_js_delete_rule_confirm'], '\');" class="button_submit smalltext" />';
+
+	echo '
+		</div>
+	</form>';
+
+}
+
+// Template for adding/editing a rule.
+function template_add_rule()
+{
+	global $context, $settings, $options, $txt, $scripturl;
+
+	echo '
+	<script type="text/javascript"><!-- // --><![CDATA[
+			var criteriaNum = 0;
+			var actionNum = 0;
+			var groups = new Array()
+			var labels = new Array()';
+
+	foreach ($context['groups'] as $id => $title)
+		echo '
+			groups[', $id, '] = "', addslashes($title), '";';
+
+	foreach ($context['labels'] as $label)
+		if ($label['id'] != -1)
+			echo '
+			labels[', ($label['id'] + 1), '] = "', addslashes($label['name']), '";';
+
+	echo '
+			function addCriteriaOption()
+			{
+				if (criteriaNum == 0)
+				{
+					for (var i = 0; i < document.forms.addrule.elements.length; i++)
+						if (document.forms.addrule.elements[i].id.substr(0, 8) == "ruletype")
+							criteriaNum++;
+				}
+				criteriaNum++
+
+				setOuterHTML(document.getElementById("criteriaAddHere"), \'<br /><select name="ruletype[\' + criteriaNum + \']" id="ruletype\' + criteriaNum + \'" onchange="updateRuleDef(\' + criteriaNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_criteria_pick']), ':<\' + \'/option><option value="mid">', addslashes($txt['pm_rule_mid']), '<\' + \'/option><option value="gid">', addslashes($txt['pm_rule_gid']), '<\' + \'/option><option value="sub">', addslashes($txt['pm_rule_sub']), '<\' + \'/option><option value="msg">', addslashes($txt['pm_rule_msg']), '<\' + \'/option><option value="bud">', addslashes($txt['pm_rule_bud']), '<\' + \'/option><\' + \'/select>&nbsp;<span id="defdiv\' + criteriaNum + \'" style="display: none;"><input type="text" name="ruledef[\' + criteriaNum + \']" id="ruledef\' + criteriaNum + \'" onkeyup="rebuildRuleDesc();" value="" class="input_text" /><\' + \'/span><span id="defseldiv\' + criteriaNum + \'" style="display: none;"><select name="ruledefgroup[\' + criteriaNum + \']" id="ruledefgroup\' + criteriaNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_group']), '<\' + \'/option>';
+
+	foreach ($context['groups'] as $id => $group)
+		echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
+
+	echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\');
+			}
+
+			function addActionOption()
+			{
+				if (actionNum == 0)
+				{
+					for (var i = 0; i < document.forms.addrule.elements.length; i++)
+						if (document.forms.addrule.elements[i].id.substr(0, 7) == "acttype")
+							actionNum++;
+				}
+				actionNum++
+
+				setOuterHTML(document.getElementById("actionAddHere"), \'<br /><select name="acttype[\' + actionNum + \']" id="acttype\' + actionNum + \'" onchange="updateActionDef(\' + actionNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_action']), ':<\' + \'/option><option value="lab">', addslashes($txt['pm_rule_label']), '<\' + \'/option><option value="del">', addslashes($txt['pm_rule_delete']), '<\' + \'/option><\' + \'/select>&nbsp;<span id="labdiv\' + actionNum + \'" style="display: none;"><select name="labdef[\' + actionNum + \']" id="labdef\' + actionNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_label']), '<\' + \'/option>';
+
+	foreach ($context['labels'] as $label)
+		if ($label['id'] != -1)
+			echo '<option value="', ($label['id'] + 1), '">', addslashes($label['name']), '<\' + \'/option>';
+
+	echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\');
+			}
+
+			function updateRuleDef(optNum)
+			{
+				if (document.getElementById("ruletype" + optNum).value == "gid")
+				{
+					document.getElementById("defdiv" + optNum).style.display = "none";
+					document.getElementById("defseldiv" + optNum).style.display = "";
+				}
+				else if (document.getElementById("ruletype" + optNum).value == "bud" || document.getElementById("ruletype" + optNum).value == "")
+				{
+					document.getElementById("defdiv" + optNum).style.display = "none";
+					document.getElementById("defseldiv" + optNum).style.display = "none";
+				}
+				else
+				{
+					document.getElementById("defdiv" + optNum).style.display = "";
+					document.getElementById("defseldiv" + optNum).style.display = "none";
+				}
+			}
+
+			function updateActionDef(optNum)
+			{
+				if (document.getElementById("acttype" + optNum).value == "lab")
+				{
+					document.getElementById("labdiv" + optNum).style.display = "";
+				}
+				else
+				{
+					document.getElementById("labdiv" + optNum).style.display = "none";
+				}
+			}
+
+			// Rebuild the rule description!
+			function rebuildRuleDesc()
+			{
+				// Start with nothing.
+				var text = "";
+				var joinText = "";
+				var actionText = "";
+				var hadBuddy = false;
+				var foundCriteria = false;
+				var foundAction = false;
+				var curNum, curVal, curDef;
+
+				for (var i = 0; i < document.forms.addrule.elements.length; i++)
+				{
+					if (document.forms.addrule.elements[i].id.substr(0, 8) == "ruletype")
+					{
+						if (foundCriteria)
+							joinText = document.getElementById("logic").value == \'and\' ? ', JavaScriptEscape(' ' . $txt['pm_readable_and'] . ' '), ' : ', JavaScriptEscape(' ' . $txt['pm_readable_or'] . ' '), ';
+						else
+							joinText = \'\';
+						foundCriteria = true;
+
+						curNum = document.forms.addrule.elements[i].id.match(/\d+/);
+						curVal = document.forms.addrule.elements[i].value;
+						if (curVal == "gid")
+							curDef = document.getElementById("ruledefgroup" + curNum).value.php_htmlspecialchars();
+						else if (curVal != "bud")
+							curDef = document.getElementById("ruledef" + curNum).value.php_htmlspecialchars();
+						else
+							curDef = "";
+
+						// What type of test is this?
+						if (curVal == "mid" && curDef)
+							text += joinText + ', JavaScriptEscape($txt['pm_readable_member']), '.replace("{MEMBER}", curDef);
+						else if (curVal == "gid" && curDef && groups[curDef])
+							text += joinText + ', JavaScriptEscape($txt['pm_readable_group']), '.replace("{GROUP}", groups[curDef]);
+						else if (curVal == "sub" && curDef)
+							text += joinText + ', JavaScriptEscape($txt['pm_readable_subject']), '.replace("{SUBJECT}", curDef);
+						else if (curVal == "msg" && curDef)
+							text += joinText + ', JavaScriptEscape($txt['pm_readable_body']), '.replace("{BODY}", curDef);
+						else if (curVal == "bud" && !hadBuddy)
+						{
+							text += joinText + ', JavaScriptEscape($txt['pm_readable_buddy']), ';
+							hadBuddy = true;
+						}
+					}
+					if (document.forms.addrule.elements[i].id.substr(0, 7) == "acttype")
+					{
+						if (foundAction)
+							joinText = ', JavaScriptEscape(' ' . $txt['pm_readable_and'] . ' '), ';
+						else
+							joinText = "";
+						foundAction = true;
+
+						curNum = document.forms.addrule.elements[i].id.match(/\d+/);
+						curVal = document.forms.addrule.elements[i].value;
+						if (curVal == "lab")
+							curDef = document.getElementById("labdef" + curNum).value.php_htmlspecialchars();
+						else
+							curDef = "";
+
+						// Now pick the actions.
+						if (curVal == "lab" && curDef && labels[curDef])
+							actionText += joinText + ', JavaScriptEscape($txt['pm_readable_label']), '.replace("{LABEL}", labels[curDef]);
+						else if (curVal == "del")
+							actionText += joinText + ', JavaScriptEscape($txt['pm_readable_delete']), ';
+					}
+				}
+
+				// If still nothing make it default!
+				if (text == "" || !foundCriteria)
+					text = "', $txt['pm_rule_not_defined'], '";
+				else
+				{
+					if (actionText != "")
+						text += ', JavaScriptEscape(' ' . $txt['pm_readable_then'] . ' '), ' + actionText;
+					text = ', JavaScriptEscape($txt['pm_readable_start']), ' + text + ', JavaScriptEscape($txt['pm_readable_end']), ';
+				}
+
+				// Set the actual HTML!
+				setInnerHTML(document.getElementById("ruletext"), text);
+			}
+	// ]]></script>';
+
+	echo '
+	<form action="', $scripturl, '?action=pm;sa=manrules;save;rid=', $context['rid'], '" method="post" accept-charset="', $context['character_set'], '" name="addrule" id="addrule" class="flow_hidden">
+		<div class="cat_bar">
+			<h3 class="catbg">', $context['rid'] == 0 ? $txt['pm_add_rule'] : $txt['pm_edit_rule'], '</h3>
+		</div>
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				<dl class="addrules">
+					<dt class="floatleft">
+						<strong>', $txt['pm_rule_name'], ':</strong><br />
+						<span class="smalltext">', $txt['pm_rule_name_desc'], '</span>
+					</dt>
+					<dd class="floatleft">
+						<input type="text" name="rule_name" value="', empty($context['rule']['name']) ? $txt['pm_rule_name_default'] : $context['rule']['name'], '" size="50" class="input_text" />
+					</dd>
+				</dl>
+				<fieldset>
+					<legend>', $txt['pm_rule_criteria'], '</legend>';
+
+	// Add a dummy criteria to allow expansion for none js users.
+	$context['rule']['criteria'][] = array('t' => '', 'v' => '');
+
+	// For each criteria print it out.
+	$isFirst = true;
+	foreach ($context['rule']['criteria'] as $k => $criteria)
+	{
+		if (!$isFirst && $criteria['t'] == '')
+			echo '<div id="removeonjs1">';
+		elseif (!$isFirst)
+			echo '<br />';
+
+		echo '
+					<select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();">
+						<option value="">', $txt['pm_rule_criteria_pick'], ':</option>
+						<option value="mid" ', $criteria['t'] == 'mid' ? 'selected="selected"' : '', '>', $txt['pm_rule_mid'], '</option>
+						<option value="gid" ', $criteria['t'] == 'gid' ? 'selected="selected"' : '', '>', $txt['pm_rule_gid'], '</option>
+						<option value="sub" ', $criteria['t'] == 'sub' ? 'selected="selected"' : '', '>', $txt['pm_rule_sub'], '</option>
+						<option value="msg" ', $criteria['t'] == 'msg' ? 'selected="selected"' : '', '>', $txt['pm_rule_msg'], '</option>
+						<option value="bud" ', $criteria['t'] == 'bud' ? 'selected="selected"' : '', '>', $txt['pm_rule_bud'], '</option>
+					</select>
+					<span id="defdiv', $k, '" ', !in_array($criteria['t'], array('gid', 'bud')) ? '' : 'style="display: none;"', '>
+						<input type="text" name="ruledef[', $k, ']" id="ruledef', $k, '" onkeyup="rebuildRuleDesc();" value="', in_array($criteria['t'], array('mid', 'sub', 'msg')) ? $criteria['v'] : '', '" class="input_text" />
+					</span>
+					<span id="defseldiv', $k, '" ', $criteria['t'] == 'gid' ? '' : 'style="display: none;"', '>
+						<select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();">
+							<option value="">', $txt['pm_rule_sel_group'], '</option>';
+
+		foreach ($context['groups'] as $id => $group)
+			echo '
+							<option value="', $id, '" ', $criteria['t'] == 'gid' && $criteria['v'] == $id ? 'selected="selected"' : '', '>', $group, '</option>';
+		echo '
+						</select>
+					</span>';
+
+		// If this is the dummy we add a means to hide for non js users.
+		if ($isFirst)
+			$isFirst = false;
+		elseif ($criteria['t'] == '')
+			echo '</div>';
+	}
+
+	echo '
+					<span id="criteriaAddHere"></span><br />
+					<a href="#" onclick="addCriteriaOption(); return false;" id="addonjs1" style="display: none;">(', $txt['pm_rule_criteria_add'], ')</a>
+					<br /><br />
+					', $txt['pm_rule_logic'], ':
+					<select name="rule_logic" id="logic" onchange="rebuildRuleDesc();">
+						<option value="and" ', $context['rule']['logic'] == 'and' ? 'selected="selected"' : '', '>', $txt['pm_rule_logic_and'], '</option>
+						<option value="or" ', $context['rule']['logic'] == 'or' ? 'selected="selected"' : '', '>', $txt['pm_rule_logic_or'], '</option>
+					</select>
+				</fieldset>
+				<fieldset>
+					<legend>', $txt['pm_rule_actions'], '</legend>';
+
+	// As with criteria - add a dummy action for "expansion".
+	$context['rule']['actions'][] = array('t' => '', 'v' => '');
+
+	// Print each action.
+	$isFirst = true;
+	foreach ($context['rule']['actions'] as $k => $action)
+	{
+		if (!$isFirst && $action['t'] == '')
+			echo '<div id="removeonjs2">';
+		elseif (!$isFirst)
+			echo '<br />';
+
+		echo '
+					<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
+						<option value="">', $txt['pm_rule_sel_action'] , ':</option>
+						<option value="lab" ', $action['t'] == 'lab' ? 'selected="selected"' : '', '>', $txt['pm_rule_label'] , '</option>
+						<option value="del" ', $action['t'] == 'del' ? 'selected="selected"' : '', '>', $txt['pm_rule_delete'] , '</option>
+					</select>
+					<span id="labdiv', $k, '">
+						<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
+							<option value="">', $txt['pm_rule_sel_label'], '</option>';
+		foreach ($context['labels'] as $label)
+			if ($label['id'] != -1)
+				echo '
+							<option value="', ($label['id'] + 1), '" ', $action['t'] == 'lab' && $action['v'] == $label['id'] ? 'selected="selected"' : '', '>', $label['name'], '</option>';
+
+		echo '
+						</select>
+					</span>';
+
+		if ($isFirst)
+			$isFirst = false;
+		elseif ($action['t'] == '')
+			echo '
+				</div>';
+	}
+
+	echo '
+					<span id="actionAddHere"></span><br />
+					<a href="#" onclick="addActionOption(); return false;" id="addonjs2" style="display: none;">(', $txt['pm_rule_add_action'], ')</a>
+				</fieldset>
+			</div>
+			<span class="botslice"><span></span></span>
+		</div><br class="clear" />
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['pm_rule_description'], '</h3>
+		</div>
+		<div class="information">
+			<div id="ruletext">', $txt['pm_rule_js_disabled'], '</div>
+		</div>
+		<div class="righttext">
+			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+			<input type="submit" name="save" value="', $txt['pm_rule_save'], '" class="button_submit" />
+		</div>
+	</form>';
+
+	// Now setup all the bits!
+		echo '
+	<script type="text/javascript"><!-- // --><![CDATA[';
+
+	foreach ($context['rule']['criteria'] as $k => $c)
+		echo '
+			updateRuleDef(', $k, ');';
+
+	foreach ($context['rule']['actions'] as $k => $c)
+		echo '
+			updateActionDef(', $k, ');';
+
+	echo '
+			rebuildRuleDesc();';
+
+	// If this isn't a new rule and we have JS enabled remove the JS compatibility stuff.
+	if ($context['rid'])
+		echo '
+			document.getElementById("removeonjs1").style.display = "none";
+			document.getElementById("removeonjs2").style.display = "none";';
+
+	echo '
+			document.getElementById("addonjs1").style.display = "";
+			document.getElementById("addonjs2").style.display = "";';
+
+	echo '
+		// ]]></script>';
+}
+
+?>

+ 3024 - 0
Profile.template.php

@@ -0,0 +1,3024 @@
+<?php
+/**
+ * Simple Machines Forum (SMF)
+ *
+ * @package SMF
+ * @author Simple Machines
+ * @copyright 2011 Simple Machines
+ * @license http://www.simplemachines.org/about/smf/license.php BSD
+ *
+ * @version 2.0
+ */
+
+// Template for the profile side bar - goes before any other profile template.
+function template_profile_above()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	echo '
+	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/profile.js"></script>';
+
+	// Prevent Chrome from auto completing fields when viewing/editing other members profiles
+	if ($context['browser']['is_chrome'] && !$context['user']['is_owner'])
+		echo '
+	<script type="text/javascript"><!-- // --><![CDATA[
+		disableAutoComplete();
+	// ]]></script>';
+
+	// 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 '
+					<div class="windowbg" id="profile_success">
+						', $context['profile_updated'], '
+					</div>';
+}
+
+// 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 '
+<div id="profileview" class="flow_auto">
+	<div class="cat_bar">
+		<h3 class="catbg">
+			<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['summary'], '</span>
+		</h3>
+	</div>
+	<div id="basicinfo">
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content flow_auto">
+				<div class="username"><h4>', $context['member']['name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4></div>
+				', $context['member']['avatar']['image'], '
+				<ul class="reset">';
+
+	// 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 '
+					<li><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '" title="', $context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'yes_permission_override' ? $context['member']['email'] : '', '" rel="nofollow"><img src="', $settings['images_url'], '/email_sm.gif" alt="', $txt['email'], '" /></a></li>';
+
+	// Don't show an icon if they haven't specified a website.
+	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
+		echo '
+					<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $context['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
+
+	// 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 '
+					<li class="custom_field">', $field['output_html'], '</li>';
+	}
+
+	echo '
+				', !isset($context['disabled_fields']['icq']) && !empty($context['member']['icq']['link']) ? '<li>' . $context['member']['icq']['link'] . '</li>' : '', '
+				', !isset($context['disabled_fields']['msn']) && !empty($context['member']['msn']['link']) ? '<li>' . $context['member']['msn']['link'] . '</li>' : '', '
+				', !isset($context['disabled_fields']['aim']) && !empty($context['member']['aim']['link']) ? '<li>' . $context['member']['aim']['link'] . '</li>' : '', '
+				', !isset($context['disabled_fields']['yim']) && !empty($context['member']['yim']['link']) ? '<li>' . $context['member']['yim']['link'] . '</li>' : '', '
+			</ul>
+			<span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '';
+
+	// Can they add this member as a buddy?
+	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
+		echo '
+				<br /><a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';
+
+	echo '
+				</span>';
+
+	echo '
+				<p id="infolinks">';
+
+	if (!$context['user']['is_owner'] && $context['can_send_pm'])
+		echo '
+					<a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '">', $txt['profile_sendpm_short'], '</a><br />';
+	echo '
+					<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
+					<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '">', $txt['statPanel'], '</a>
+				</p>';
+
+	echo '
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>
+	</div>
+	<div id="detailedinfo">
+		<div class="windowbg2">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				<dl>';
+
+	if ($context['user']['is_owner'] || $context['user']['is_admin'])
+		echo '
+					<dt>', $txt['username'], ': </dt>
+					<dd>', $context['member']['username'], '</dd>';
+
+	if (!isset($context['disabled_fields']['posts']))
+		echo '
+					<dt>', $txt['profile_posts'], ': </dt>
+					<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
+
+	// Only show the email address fully if it's not hidden - and we reveal the email.
+	if ($context['member']['show_email'] == 'yes')
+		echo '
+					<dt>', $txt['email'], ': </dt>
+					<dd><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></dd>';
+
+	// ... 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 '
+					<dt>', $txt['email'], ': </dt>
+					<dd><em><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></em></dd>';
+
+	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
+		echo '
+					<dt>', $txt['custom_title'], ': </dt>
+					<dd>', $context['member']['title'], '</dd>';
+
+	if (!empty($context['member']['blurb']))
+		echo '
+					<dt>', $txt['personal_text'], ': </dt>
+					<dd>', $context['member']['blurb'], '</dd>';
+
+	// If karma enabled show the members karma.
+	if ($modSettings['karmaMode'] == '1')
+		echo '
+					<dt>', $modSettings['karmaLabel'], ' </dt>
+					<dd>', ($context['member']['karma']['good'] - $context['member']['karma']['bad']), '</dd>';
+
+	elseif ($modSettings['karmaMode'] == '2')
+		echo '
+					<dt>', $modSettings['karmaLabel'], ' </dt>
+					<dd>+', $context['member']['karma']['good'], '/-', $context['member']['karma']['bad'], '</dd>';
+
+	if (!isset($context['disabled_fields']['gender']) && !empty($context['member']['gender']['name']))
+		echo '
+					<dt>', $txt['gender'], ': </dt>
+					<dd>', $context['member']['gender']['name'], '</dd>';
+
+	echo '
+					<dt>', $txt['age'], ':</dt>
+					<dd>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' &nbsp; <img src="' . $settings['images_url'] . '/cake.png" alt="" />' : ''), '</dd>';
+
+	if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
+		echo '
+					<dt>', $txt['location'], ':</dt>
+					<dd>', $context['member']['location'], '</dd>';
+
+	echo '
+				</dl>';
+
+	// 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 '
+				<dl>';
+				$shown = true;
+			}
+
+			echo '
+					<dt>', $field['name'], ':</dt>
+					<dd>', $field['output_html'], '</dd>';
+		}
+
+		if (!empty($shown))
+			echo '
+				</dl>';
+	}
+
+	echo '
+				<dl class="noborder">';
+
+	// Can they view/issue a warning?
+	if ($context['can_view_warning'] && $context['member']['warning'])
+	{
+		echo '
+					<dt>', $txt['profile_warning_level'], ': </dt>
+					<dd>
+						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', $context['can_issue_warning'] ? 'issuewarning' : 'viewwarning', '">', $context['member']['warning'], '%</a>';
+
+		// Can we provide information on what this means?
+		if (!empty($context['warning_status']))
+			echo '
+						<span class="smalltext">(', $context['warning_status'], ')</span>';
+
+		echo '
+					</dd>';
+	}
+
+	// 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 '
+					<dt class="clear"><span class="alert">', $context['activate_message'], '</span>&nbsp;(<a href="' . $scripturl . '?action=profile;save;area=activateaccount;u=' . $context['id_member'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '"', ($context['activate_type'] == 4 ? ' onclick="return confirm(\'' . $txt['profileConfirm'] . '\');"' : ''), '>', $context['activate_link_text'], '</a>)</dt>';
+
+		// If the current member is banned, show a message and possibly a link to the ban.
+		if (!empty($context['member']['bans']))
+		{
+			echo '
+					<dt class="clear"><span class="alert">', $txt['user_is_banned'], '</span>&nbsp;[<a href="#" onclick="document.getElementById(\'ban_info\').style.display = document.getElementById(\'ban_info\').style.display == \'none\' ? \'\' : \'none\';return false;">' . $txt['view_ban'] . '</a>]</dt>
+					<dt class="clear" id="ban_info" style="display: none;">
+						<strong>', $txt['user_banned_by_following'], ':</strong>';
+
+			foreach ($context['member']['bans'] as $ban)
+				echo '
+						<br /><span class="smalltext">', $ban['explanation'], '</span>';
+
+			echo '
+					</dt>';
+		}
+	}
+
+	echo '
+					<dt>', $txt['date_registered'], ': </dt>
+					<dd>', $context['member']['registered'], '</dd>';
+
+	// 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 '
+					<dt>', $txt['ip'], ': </dt>
+					<dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
+
+		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
+			echo '
+					<dt>', $txt['hostname'], ': </dt>
+					<dd>', $context['member']['hostname'], '</dd>';
+	}
+
+	echo '
+					<dt>', $txt['local_time'], ':</dt>
+					<dd>', $context['member']['local_time'], '</dd>';
+
+	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
+		echo '
+					<dt>', $txt['language'], ':</dt>
+					<dd>', $context['member']['language'], '</dd>';
+
+	echo '
+					<dt>', $txt['lastLoggedIn'], ': </dt>
+					<dd>', $context['member']['last_login'], '</dd>
+				</dl>';
+
+	// 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 '
+				<div class="custom_fields_above_signature">
+					<ul class="reset nolist">';
+			}
+			echo '
+						<li>', $field['output_html'], '</li>';
+		}
+		if ($shown)
+				echo '
+					</ul>
+				</div>';
+	}
+
+	// Show the users signature.
+	if ($context['signature_enabled'] && !empty($context['member']['signature']))
+		echo '
+				<div class="signature">
+					<h5>', $txt['signature'], ':</h5>
+					', $context['member']['signature'], '
+				</div>';
+
+	echo '
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>
+	</div>
+<div class="clear"></div>
+</div>';
+
+}
+
+// Template for showing all the posts of the user, in chronological order.
+function template_showPosts()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	echo '
+		<div class="cat_bar">
+			<h3 class="catbg">
+				', (!isset($context['attachments']) && empty($context['is_topics']) ? $txt['showMessages'] : (!empty($context['is_topics']) ? $txt['showTopics'] : $txt['showAttachments'])), ' - ', $context['member']['name'], '
+			</h3>
+		</div>
+		<div class="pagesection">
+			<span>', $txt['pages'], ': ', $context['page_index'], '</span>
+		</div>';
+
+	// 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 '
+		<div class="topic">
+			<div class="', $post['alternate'] == 0 ? 'windowbg2' : 'windowbg', ' core_posts">
+				<span class="topslice"><span></span></span>
+				<div class="content">
+					<div class="counter">', $post['counter'], '</div>
+					<div class="topic_details">
+						<h5><strong><a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a></strong></h5>
+						<span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> ', $post['time'], '&nbsp;&#187;</span>
+					</div>
+					<div class="list_posts">';
+
+			if (!$post['approved'])
+				echo '
+					<div class="approve_post">
+						<em>', $txt['post_awaiting_approval'], '</em>
+					</div>';
+
+			echo '
+					', $post['body'], '
+					</div>
+				</div>';
+
+			if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
+				echo '
+				<div class="floatright">
+					<ul class="reset smalltext quickbuttons">';
+
+			// If they *can* reply?
+			if ($post['can_reply'])
+				echo '
+						<li class="reply_button"><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span>', $txt['reply'], '</span></a></li>';
+
+			// If they *can* quote?
+			if ($post['can_quote'])
+				echo '
+						<li class="quote_button"><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span>', $txt['quote'], '</span></a></li>';
+
+			// Can we request notification of topics?
+			if ($post['can_mark_notify'])
+				echo '
+						<li class="notify_button"><a href="', $scripturl, '?action=notify;topic=', $post['topic'], '.', $post['start'], '"><span>', $txt['notify'], '</span></a></li>';
+
+			// How about... even... remove it entirely?!
+			if ($post['can_delete'])
+				echo '
+						<li class="remove_button"><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');"><span>', $txt['remove'], '</span></a></li>';
+
+			if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
+				echo '
+					</ul>
+				</div>';
+
+			echo '
+				<br class="clear" />
+				<span class="botslice"><span></span></span>
+			</div>
+		</div>';
+		}
+	}
+	else
+	{
+		echo '
+		<table border="0" width="100%" cellspacing="1" cellpadding="2" class="table_grid" align="center">
+			<thead>
+				<tr class="titlebg">
+					<th class="first_th lefttext" scope="col" width="25%">
+						<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=filename', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'filename' ? ';asc' : ''), '">
+							', $txt['show_attach_filename'], '
+							', ($context['sort_order'] == 'filename' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
+						</a>
+					</th>
+					<th scope="col" width="12%">
+						<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=downloads', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'downloads' ? ';asc' : ''), '">
+							', $txt['show_attach_downloads'], '
+							', ($context['sort_order'] == 'downloads' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
+						</a>
+					</th>
+					<th class="lefttext" scope="col" width="30%">
+						<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=subject', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'subject' ? ';asc' : ''), '">
+							', $txt['message'], '
+							', ($context['sort_order'] == 'subject' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
+						</a>
+					</th>
+					<th class="last_th lefttext" scope="col">
+						<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=posted', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'posted' ? ';asc' : ''), '">
+						', $txt['show_attach_posted'], '
+						', ($context['sort_order'] == 'posted' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
+						</a>
+					</th>
+				</tr>
+			</thead>
+			<tbody>';
+
+		// Looks like we need to do all the attachments instead!
+		$alternate = false;
+		foreach ($context['attachments'] as $attachment)
+		{
+			echo '
+				<tr class="', $attachment['approved'] ? ($alternate ? 'windowbg' : 'windowbg2') : 'approvebg', '">
+					<td><a href="', $scripturl, '?action=dlattach;topic=', $attachment['topic'], '.0;attach=', $attachment['id'], '">', $attachment['filename'], '</a>', !$attachment['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : '', '</td>
+					<td align="center">', $attachment['downloads'], '</td>
+					<td><a href="', $scripturl, '?topic=', $attachment['topic'], '.msg', $attachment['msg'], '#msg', $attachment['msg'], '" rel="nofollow">', $attachment['subject'], '</a></td>
+					<td>', $attachment['posted'], '</td>
+				</tr>';
+			$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 '
+				<tr>
+					<td class="tborder windowbg2 padding centertext" colspan="4">
+						', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
+					</td>
+				</tr>';
+
+		echo '
+			</tbody>
+		</table>';
+	}
+	// Show more page numbers.
+	echo '
+		<div class="pagesection" style="margin-bottom: 0;">
+			<span>', $txt['pages'], ': ', $context['page_index'], '</span>
+		</div>';
+}
+
+// Template for showing all the buddies of the current user.
+function template_editBuddies()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	echo '
+		<div class="title_bar">
+			<h3 class="titlebg">
+				<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/online.gif" alt="" class="icon" />', $txt['editBuddies'], '</span>
+			</h3>
+		</div>
+		<table border="0" width="100%" cellspacing="1" cellpadding="4" class="table_grid" align="center">
+			<tr class="catbg">
+				<th class="first_th lefttext" scope="col" width="20%">', $txt['name'], '</th>
+				<th scope="col">', $txt['status'], '</th>
+				<th scope="col">', $txt['email'], '</th>
+				<th scope="col">', $txt['icq'], '</th>
+				<th scope="col">', $txt['aim'], '</th>
+				<th scope="col">', $txt['yim'], '</th>
+				<th scope="col">', $txt['msn'], '</th>
+				<th class="last_th" scope="col"></th>
+			</tr>';
+
+	// If they don't have any buddies don't list them!
+	if (empty($context['buddies']))
+		echo '
+			<tr class="windowbg2">
+				<td colspan="8" align="center"><strong>', $txt['no_buddies'], '</strong></td>
+			</tr>';
+
+	// Now loop through each buddy showing info on each.
+	$alternate = false;
+	foreach ($context['buddies'] as $buddy)
+	{
+		echo '
+			<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
+				<td>', $buddy['link'], '</td>
+				<td align="center"><a href="', $buddy['online']['href'], '"><img src="', $buddy['online']['image_href'], '" alt="', $buddy['online']['label'], '" title="', $buddy['online']['label'], '" /></a></td>
+				<td align="center">', ($buddy['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $buddy['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $buddy['name'] . '" /></a>'), '</td>
+				<td align="center">', $buddy['icq']['link'], '</td>
+				<td align="center">', $buddy['aim']['link'], '</td>
+				<td align="center">', $buddy['yim']['link'], '</td>
+				<td align="center">', $buddy['msn']['link'], '</td>
+				<td align="center"><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.gif" alt="', $txt['buddy_remove'], '" title="', $txt['buddy_remove'], '" /></a></td>
+			</tr>';
+
+		$alternate = !$alternate;
+	}
+
+	echo '
+		</table>';
+
+	// Add a new buddy?
+	echo '
+	<br />
+	<form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=buddies" method="post" accept-charset="', $context['character_set'], '">
+		<div class="tborder add_buddy">
+			<div class="title_bar">
+				<h3 class="titlebg">', $txt['buddy_add'], '</h3>
+			</div>
+			<span class="upperframe"><span></span></span>
+			<div class="roundframe">
+					<label for="new_buddy">
+						<strong>', $txt['who_member'], ':</strong>
+					</label>
+					<input type="text" name="new_buddy" id="new_buddy" size="25" class="input_text" />
+					<input type="submit" value="', $txt['buddy_add_button'], '" class="button_submit" />
+			</div>
+			<span class="lowerframe"><span></span></span>
+		</div>
+	</form>
+	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
+	<script type="text/javascript"><!-- // --><![CDATA[
+		var oAddBuddySuggest = new smc_AutoSuggest({
+			sSelf: \'oAddBuddySuggest\',
+			sSessionId: \'', $context['session_id'], '\',
+			sSessionVar: \'', $context['session_var'], '\',
+			sSuggestId: \'new_buddy\',
+			sControlId: \'new_buddy\',
+			sSearchType: \'member\',
+			sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
+			bItemList: false
+		});
+	// ]]></script>';
+}
+
+// Template for showing the ignore list of the current user.
+function template_editIgnoreList()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	echo '
+		<div class="title_bar">
+			<h3 class="titlebg">
+				<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['editIgnoreList'], '</span>
+			</h3>
+		</div>
+		<table border="0" width="100%" cellspacing="1" cellpadding="4" class="table_grid" align="center">
+			<tr class="catbg">
+				<th class="first_th" scope="col" width="20%">', $txt['name'], '</th>
+				<th scope="col">', $txt['status'], '</th>
+				<th scope="col">', $txt['email'], '</th>
+				<th scope="col">', $txt['icq'], '</th>
+				<th scope="col">', $txt['aim'], '</th>
+				<th scope="col">', $txt['yim'], '</th>
+				<th scope="col">', $txt['msn'], '</th>
+				<th class="last_th" scope="col"></th>
+			</tr>';
+
+	// If they don't have anyone on their ignore list, don't list it!
+	if (empty($context['ignore_list']))
+		echo '
+			<tr class="windowbg2">
+				<td colspan="8" align="center"><strong>', $txt['no_ignore'], '</strong></td>
+			</tr>';
+
+	// Now loop through each buddy showing info on each.
+	$alternate = false;
+	foreach ($context['ignore_list'] as $member)
+	{
+		echo '
+			<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
+				<td>', $member['link'], '</td>
+				<td align="center"><a href="', $member['online']['href'], '"><img src="', $member['online']['image_href'], '" alt="', $member['online']['label'], '" title="', $member['online']['label'], '" /></a></td>
+				<td align="center">', ($member['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $member['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $member['name'] . '" /></a>'), '</td>
+				<td align="center">', $member['icq']['link'], '</td>
+				<td align="center">', $member['aim']['link'], '</td>
+				<td align="center">', $member['yim']['link'], '</td>
+				<td align="center">', $member['msn']['link'], '</td>
+				<td align="center"><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.gif" alt="', $txt['ignore_remove'], '" title="', $txt['ignore_remove'], '" /></a></td>
+			</tr>';
+
+		$alternate = !$alternate;
+	}
+
+	echo '
+		</table>';
+
+	// Add a new buddy?
+	echo '
+	<br />
+	<form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore" method="post" accept-charset="', $context['character_set'], '">
+		<div class="tborder add_buddy">
+			<div class="title_bar">
+				<h3 class="titlebg">', $txt['ignore_add'], '</h3>
+			</div>
+			<span class="upperframe"><span></span></span>
+			<div class="roundframe">
+					<label for="new_buddy">
+						<strong>', $txt['who_member'], ':</strong>
+					</label>
+					<input type="text" name="new_ignore" id="new_ignore" size="25" class="input_text" />
+					<input type="submit" value="', $txt['ignore_add_button'], '" class="button_submit" />
+			</div>
+			<span class="lowerframe"><span></span></span>
+		</div>
+	</form>
+	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
+	<script type="text/javascript"><!-- // --><![CDATA[
+		var oAddIgnoreSuggest = new smc_AutoSuggest({
+			sSelf: \'oAddIgnoreSuggest\',
+			sSessionId: \'', $context['session_id'], '\',
+			sSessionVar: \'', $context['session_var'], '\',
+			sSuggestId: \'new_ignore\',
+			sControlId: \'new_ignore\',
+			sSearchType: \'member\',
+			sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
+			bItemList: false
+		});
+	// ]]></script>';
+}
+
+// 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 '
+			<div class="title_bar">
+				<h3 class="titlebg"><strong>', $txt['view_ips_by'], ' ', $context['member']['name'], '</strong></h3>
+			</div>';
+
+	// The last IP the user used.
+	echo '
+			<div id="tracking" class="windowbg2">
+				<span class="topslice"><span></span></span>
+				<div class="content">
+					<dl class="noborder">
+						<dt>', $txt['most_recent_ip'], ':
+							', (empty($context['last_ip2']) ? '' : '<br />
+							<span class="smalltext">(<a href="' . $scripturl . '?action=helpadmin;help=whytwoip" onclick="return reqWin(this.href);">' . $txt['why_two_ip_address'] . '</a>)</span>'), '
+						</dt>
+						<dd>
+							<a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
+
+	// Second address detected?
+	if (!empty($context['last_ip2']))
+		echo '
+							, <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
+
+	echo '
+						</dd>';
+
+	// Lists of IP addresses used in messages / error messages.
+	echo '
+						<dt>', $txt['ips_in_messages'], ':</dt>
+						<dd>
+							', (count($context['ips']) > 0 ? implode(', ', $context['ips']) : '(' . $txt['none'] . ')'), '
+						</dd>
+						<dt>', $txt['ips_in_errors'], ':</dt>
+						<dd>
+							', (count($context['ips']) > 0 ? implode(', ', $context['error_ips']) : '(' . $txt['none'] . ')'), '
+						</dd>';
+
+	// List any members that have used the same IP addresses as the current member.
+	echo '
+						<dt>', $txt['members_in_range'], ':</dt>
+						<dd>
+							', (count($context['members_in_range']) > 0 ? implode(', ', $context['members_in_range']) : '(' . $txt['none'] . ')'), '
+						</dd>
+					</dl>
+				</div>
+				<span class="botslice"><span></span></span>
+			</div>
+		<br />';
+
+	// 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 '
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['trackIP'], '</h3>
+		</div>
+		<div class="windowbg2">
+			<span class="topslice"><span></span></span>
+			<form action="', $context['base_url'], '" method="post" accept-charset="', $context['character_set'], '">
+				<div class="padding">', $txt['enter_ip'], ':&nbsp;&nbsp;<input type="text" name="searchip" value="', $context['ip'], '" class="input_text" />&nbsp;&nbsp;<input type="submit" value="', $txt['trackIP'], '" class="button_submit" /></div>
+			</form>
+			<span class="botslice"><span></span></span>
+		</div>
+		<br />';
+
+	// The table inbetween the first and second table shows links to the whois server for every region.
+	if ($context['single_ip'])
+	{
+		echo '
+			<div class="title_bar">
+				<h3 class="titlebg">', $txt['whois_title'], ' ', $context['ip'], '</h3>
+			</div>
+			<div class="windowbg2">
+				<span class="topslice"><span></span></span>
+				<div class="padding">';
+			foreach ($context['whois_servers'] as $server)
+				echo '
+					<a href="', $server['url'], '" target="_blank" class="new_win"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br />';
+			echo '
+				</div>
+				<span class="botslice"><span></span></span>
+			</div>
+		<br />';
+	}
+
+	// The second table lists all the members who have been logged as using this IP address.
+	echo '
+		<div class="title_bar">
+			<h3 class="titlebg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
+		</div>';
+	if (empty($context['ips']))
+		echo '
+		<p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
+	else
+	{
+		echo '
+		<table class="table_grid" cellspacing="0" width="100%">
+			<thead>
+				<tr class="catbg">
+					<th class="first_th" scope="col">', $txt['ip_address'], '</th>
+					<th class="last_th" scope="col">', $txt['display_name'], '</th>
+				</tr>
+			</thead>
+			<tbody>';
+
+		// Loop through each of the members and display them.
+		foreach ($context['ips'] as $ip => $memberlist)
+			echo '
+				<tr>
+					<td class="windowbg2"><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
+					<td class="windowbg2">', implode(', ', $memberlist), '</td>
+				</tr>';
+
+		echo '
+			</tbody>
+		</table>
+		<br />';
+	}
+
+	template_show_list('track_message_list');
+
+	echo '<br />';
+
+	template_show_list('track_user_list');
+}
+
+function template_showPermissions()
+{
+	global $context, $settings, $options, $scripturl, $txt;
+
+	echo '
+		<div class="cat_bar">
+			<h3 class="catbg">
+				<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['showPermissions'], '</span>
+			</h3>
+		</div>';
+
+	if ($context['member']['has_all_permissions'])
+	{
+		echo '
+		<p class="windowbg description">', $txt['showPermissions_all'], '</p>';
+	}
+	else
+	{
+		echo '
+		<p class="description">',$txt['showPermissions_help'],'</p>
+		<div id="permissions" class="flow_hidden">';
+
+		if (!empty($context['no_access_boards']))
+		{
+			echo '
+				<div class="cat_bar">
+					<h3 class="catbg">', $txt['showPermissions_restricted_boards'], '</h3>
+				</div>
+				<div class="windowbg smalltext">
+					<span class="topslice"><span></span></span>
+					<div class="content">', $txt['showPermissions_restricted_boards_desc'], ':<br />';
+				foreach ($context['no_access_boards'] as $no_access_board)
+					echo '
+						<a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
+				echo '
+					</div>
+					<span class="botslice"><span></span></span>
+				</div>';
+		}
+
+		// General Permissions section.
+		echo '
+				<div class="tborder">
+					<div class="cat_bar">
+						<h3 class="catbg">', $txt['showPermissions_general'], '</h3>
+					</div>';
+		if (!empty($context['member']['permissions']['general']))
+		{
+			echo '
+					<table class="table_grid" width="100%" cellspacing="0">
+						<thead>
+							<tr class="titlebg">
+								<th class="lefttext first_th" scope="col" width="50%">', $txt['showPermissions_permission'], '</th>
+								<th class="lefttext last_th" scope="col" width="50%">', $txt['showPermissions_status'], '</th>
+							</tr>
+						</thead>
+						<tbody>';
+
+			foreach ($context['member']['permissions']['general'] as $permission)
+			{
+				echo '
+							<tr>
+								<td class="windowbg" title="', $permission['id'], '">
+									', $permission['is_denied'] ? '<del>' . $permission['name'] . '</del>' : $permission['name'], '
+								</td>
+								<td class="windowbg2 smalltext">';
+
+				if ($permission['is_denied'])
+					echo '
+									<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']),'</span>';
+				else
+					echo '
+									', $txt['showPermissions_given'], ':&nbsp;', implode(', ', $permission['groups']['allowed']);
+
+					echo '
+								</td>
+							</tr>';
+			}
+			echo '
+						</tbody>
+					</table>
+				</div><br />';
+		}
+		else
+			echo '
+			<p class="windowbg2 description">', $txt['showPermissions_none_general'], '</p>';
+
+		// Board permission section.
+		echo '
+			<div class="tborder">
+				<form action="' . $scripturl . '?action=profile;u=', $context['id_member'], ';area=permissions#board_permissions" method="post" accept-charset="', $context['character_set'], '">
+					<div class="cat_bar">
+						<h3 class="catbg"><span class="ie6_header floatleft">
+							<a id="board_permissions"></a>', $txt['showPermissions_select'], ':
+							<select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
+								<option value="0"', $context['board'] == 0 ? ' selected="selected"' : '', '>', $txt['showPermissions_global'], '&nbsp;</option>';
+				if (!empty($context['boards']))
+					echo '
+								<option value="" disabled="disabled">---------------------------</option>';
+
+				// Fill the box with any local permission boards.
+				foreach ($context['boards'] as $board)
+					echo '
+								<option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
+
+				echo '
+							</select></span>
+						</h3>
+					</div>
+				</form>';
+		if (!empty($context['member']['permissions']['board']))
+		{
+			echo '
+				<table class="table_grid" width="100%" cellspacing="0">
+					<thead>
+						<tr class="titlebg">
+							<th class="lefttext first_th" scope="col" width="50%">', $txt['showPermissions_permission'], '</th>
+							<th class="lefttext last_th" scope="col" width="50%">', $txt['showPermissions_status'], '</th>
+						</tr>
+					</thead>
+					<tbody>';
+			foreach ($context['member']['permissions']['board'] as $permission)
+			{
+				echo '
+						<tr>
+							<td class="windowbg" title="', $permission['id'], '">
+								', $permission['is_denied'] ? '<del>' . $permission['name'] . '</del>' : $permission['name'], '
+							</td>
+							<td class="windowbg2 smalltext">';
+
+				if ($permission['is_denied'])
+				{
+					echo '
+								<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
+				}
+				else
+				{
+					echo '
+								', $txt['showPermissions_given'], ': &nbsp;', implode(', ', $permission['groups']['allowed']);
+				}
+				echo '
+							</td>
+						</tr>';
+			}
+			echo '
+					</tbody>
+				</table>';
+		}
+		else
+			echo '
+			<p class="windowbg2 description">', $txt['showPermissions_none_board'], '</p>';
+	echo '
+			</div>
+		</div>';
+	}
+}
+
+// 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 '
+	<div id="profileview">
+		<div id="generalstats">
+			<div class="cat_bar">
+				<h3 class="catbg">
+					<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_info.gif" alt="" class="icon" />
+					', $txt['statPanel_generalStats'], ' - ', $context['member']['name'], '
+					</span>
+				</h3>
+			</div>
+			<div class="windowbg2">
+				<span class="topslice"><span></span></span>
+				<div class="content">
+					<dl>
+						<dt>', $txt['statPanel_total_time_online'], ':</dt>
+						<dd>', $context['time_logged_in'], '</dd>
+						<dt>', $txt['statPanel_total_posts'], ':</dt>
+						<dd>', $context['num_posts'], ' ', $txt['statPanel_posts'], '</dd>
+						<dt>', $txt['statPanel_total_topics'], ':</dt>
+						<dd>', $context['num_topics'], ' ', $txt['statPanel_topics'], '</dd>
+						<dt>', $txt['statPanel_users_polls'], ':</dt>
+						<dd>', $context['num_polls'], ' ', $txt['statPanel_polls'], '</dd>
+						<dt>', $txt['statPanel_users_votes'], ':</dt>
+						<dd>', $context['num_votes'], ' ', $txt['statPanel_votes'], '</dd>
+					</dl>
+				</div>
+				<span class="botslice"><span></span></span>
+			</div>
+		</div>';
+
+	// This next section draws a graph showing what times of day they post the most.
+	echo '
+		<div id="activitytime" class="flow_hidden">
+			<div class="cat_bar">
+				<h3 class="catbg">
+				<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_history.gif" alt="" class="icon" />', $txt['statPanel_activityTime'], '</span>
+				</h3>
+			</div>
+			<div class="windowbg2">
+				<span class="topslice"><span></span></span>
+				<div class="content">';
+
+	// If they haven't post at all, don't draw the graph.
+	if (empty($context['posts_by_time']))
+		echo '
+					<span>', $txt['statPanel_noPosts'], '</span>';
+	// Otherwise do!
+	else
+	{
+		echo '
+					<ul class="activity_stats flow_hidden">';
+
+		// The labels.
+		foreach ($context['posts_by_time'] as $time_of_day)
+		{
+			echo '
+						<li', $time_of_day['is_last'] ? ' class="last"' : '', '>
+							<div class="bar" style="padding-top: ', ((int) (100 - $time_of_day['relative_percent'])), 'px;" title="', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '">
+								<div style="height: ', (int) $time_of_day['relative_percent'], 'px;">
+									<span>', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '</span>
+								</div>
+							</div>
+							<span class="stats_hour">', $time_of_day['hour_format'], '</span>
+						</li>';
+		}
+
+		echo '
+
+					</ul>';
+	}
+
+	echo '
+					<span class="clear" />
+				</div>
+				<span class="botslice"><span></span></span>
+			</div>
+		</div>';
+
+	// Two columns with the most popular boards by posts and activity (activity = users posts / total posts).
+	echo '
+		<div class="flow_hidden">
+			<div id="popularposts">
+				<div class="cat_bar">
+					<h3 class="catbg">
+						<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_replies.gif" alt="" class="icon" />', $txt['statPanel_topBoards'], '</span>
+					</h3>
+				</div>
+				<div class="windowbg2">
+					<span class="topslice"><span></span></span>
+					<div class="content">';
+
+	if (empty($context['popular_boards']))
+		echo '
+						<span>', $txt['statPanel_noPosts'], '</span>';
+
+	else
+	{
+		echo '
+						<dl>';
+
+		// Draw a bar for every board.
+		foreach ($context['popular_boards'] as $board)
+		{
+			echo '
+							<dt>', $board['link'], '</dt>
+							<dd>
+								<div class="profile_pie" style="background-position: -', ((int) ($board['posts_percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_memberposts'], $board['posts'], $board['total_posts_member'], $board['posts_percent']), '">
+									', sprintf($txt['statPanel_topBoards_memberposts'], $board['posts'], $board['total_posts_member'], $board['posts_percent']), '
+								</div>
+								<span>', empty($context['hide_num_posts']) ? $board['posts'] : '', '</span>
+							</dd>';
+		}
+
+		echo '
+						</dl>';
+	}
+	echo '
+					</div>
+					<span class="botslice"><span></span></span>
+				</div>
+			</div>';
+	echo '
+			<div id="popularactivity">
+				<div class="cat_bar">
+					<h3 class="catbg">
+					<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_replies.gif" alt="" class="icon" />', $txt['statPanel_topBoardsActivity'], '</span>
+					</h3>
+				</div>
+				<div class="windowbg2">
+					<span class="topslice"><span></span></span>
+					<div class="content">';
+
+	if (empty($context['board_activity']))
+		echo '
+						<span>', $txt['statPanel_noPosts'], '</span>';
+	else
+	{
+		echo '
+						<dl>';
+
+		// Draw a bar for every board.
+		foreach ($context['board_activity'] as $activity)
+		{
+			echo '
+							<dt>', $activity['link'], '</dt>
+							<dd>
+								<div class="profile_pie" style="background-position: -', ((int) ($activity['percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '">
+									', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '
+								</div>
+								<span>', $activity['percent'], '%</span>
+							</dd>';
+		}
+
+		echo '
+						</dl>';
+	}
+	echo '
+					</div>
+					<span class="botslice"><span></span></span>
+				</div>
+			</div>
+		</div>';
+
+	echo '
+	</div>
+	<br class="clear" />';
+}
+
+// Template for editing profile options.
+function template_edit_options()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	// The main header!
+	echo '
+		<form action="', (!empty($context['profile_custom_submit_url']) ? $context['profile_custom_submit_url'] : $scripturl . '?action=profile;area=' . $context['menu_item_selected'] . ';u=' . $context['id_member'] . ';save'), '" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" enctype="multipart/form-data" onsubmit="return checkProfileSubmit();">
+			<div class="cat_bar">
+				<h3 class="catbg">
+					<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />';
+
+		// Don't say "Profile" if this isn't the profile...
+		if (!empty($context['profile_header_text']))
+			echo '
+					', $context['profile_header_text'];
+		else
+			echo '
+					', $txt['profile'];
+
+		echo '
+					</span>
+				</h3>
+			</div>';
+
+	// Have we some description?
+	if ($context['page_desc'])
+		echo '
+			<p class="windowbg description">', $context['page_desc'], '</p>';
+
+	echo '
+			<div class="windowbg2">
+				<span class="topslice"><span></span></span>
+				<div class="content">';
+
+	// Any bits at the start?
+	if (!empty($context['profile_prehtml']))
+		echo '
+					<div>', $context['profile_prehtml'], '</div>';
+
+	if (!empty($context['profile_fields']))
+		echo '
+					<dl>';
+
+	// Start the big old loop 'of love.
+	$lastItem = 'hr';
+	foreach ($context['profile_fields'] as $key => $field)
+	{
+		// We add a little hack to be sure we never get more than one hr in a row!
+		if ($lastItem == 'hr' && $field['type'] == 'hr')
+			continue;
+
+		$lastItem = $field['type'];
+		if ($field['type'] == 'hr')
+		{
+			echo '
+					</dl>
+					<hr width="100%" size="1" class="hrcolor clear" />
+					<dl>';
+		}
+		elseif ($field['type'] == 'callback')
+		{
+			if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
+			{
+				$callback_func = 'template_profile_' . $field['callback_func'];
+				$callback_func();
+			}
+		}
+		else
+		{
+			echo '
+						<dt>
+							<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['label'], '</strong>';
+
+			// Does it have any subtext to show?
+			if (!empty($field['subtext']))
+				echo '
+							<br />
+							<span class="smalltext">', $field['subtext'], '</span>';
+
+			echo '
+						</dt>
+						<dd>';
+
+			// Want to put something infront of the box?
+			if (!empty($field['preinput']))
+				echo '
+							', $field['preinput'];
+
+			// What type of data are we showing?
+			if ($field['type'] == 'label')
+				echo '
+							', $field['value'];
+
+			// Maybe it's a text box - very likely!
+			elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
+				echo '
+							<input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '" />';
+
+			// You "checking" me out? ;)
+			elseif ($field['type'] == 'check')
+				echo '
+							<input type="hidden" name="', $key, '" value="0" /><input type="checkbox" name="', $key, '" id="', $key, '" ', !empty($field['value']) ? ' checked="checked"' : '', ' value="1" class="input_check" ', $field['input_attr'], ' />';
+
+			// Always fun - select boxes!
+			elseif ($field['type'] == 'select')
+			{
+				echo '
+							<select name="', $key, '" id="', $key, '">';
+
+				if (isset($field['options']))
+				{
+					// Is this some code to generate the options?
+					if (!is_array($field['options']))
+						$field['options'] = eval($field['options']);
+					// Assuming we now have some!
+					if (is_array($field['options']))
+						foreach ($field['options'] as $value => $name)
+							echo '
+								<option value="', $value, '" ', $value == $field['value'] ? 'selected="selected"' : '', '>', $name, '</option>';
+				}
+
+				echo '
+							</select>';
+			}
+
+			// Something to end with?
+			if (!empty($field['postinput']))
+				echo '
+							', $field['postinput'];
+
+			echo '
+						</dd>';
+		}
+	}
+
+	if (!empty($context['profile_fields']))
+		echo '
+					</dl>';
+
+	// Are there any custom profile fields - if so print them!
+	if (!empty($context['custom_fields']))
+	{
+		if ($lastItem != 'hr')
+			echo '
+					<hr width="100%" size="1" class="hrcolor clear" />';
+
+		echo '
+					<dl>';
+
+		foreach ($context['custom_fields'] as $field)
+		{
+			echo '
+						<dt>
+							<strong>', $field['name'], ': </strong><br />
+							<span class="smalltext">', $field['desc'], '</span>
+						</dt>
+						<dd>
+							', $field['input_html'], '
+						</dd>';
+		}
+
+		echo '
+					</dl>';
+
+	}
+
+		// OneAll Social Login (https://docs.oneall.com/plugins/)
+	if (!empty ($modSettings['oasl_api_key']) && !empty ($modSettings['oasl_enabled_providers']))
+	{
+		if ( ! empty ($context['user']['is_owner']) && ! empty ($context['user']['id']))
+		{		
+			global $boardurl, $sourcedir;
+			
+			// Include the OneAll Toolbox.
+			require_once($sourcedir . '/OneallSocialLogin.sdk.php');
+				
+			//Extract providers
+			$oasl_enabled_providers = explode (',', trim ($modSettings['oasl_enabled_providers']));
+			
+			//User Token
+			$oasl_user_token = oneall_social_login_get_user_token_for_id_member($context['user']['id']);
+			
+			//Random integer
+			$rand = mt_rand (99999, 9999999);
+			
+			echo '
+				<hr width="100%" size="1" class="hrcolor clear" />
+				<dl id="oasl_social_link">
+					<dt>
+						<strong>'.$modSettings['oasl_settings_profile_caption'].'</strong><br />
+						<span class="smalltext">'.$modSettings['oasl_settings_profile_desc'].'</span>
+					</dt>
+					<dd>
+						<div class="oneall_social_login_providers" id="oneall_social_login_providers_'.$rand.'"></div>
+							<script type="text/javascript">
+								oneall.api.plugins.social_link.build("oneall_social_login_providers_'.$rand.'", {
+									"providers": [\''.implode ("', '", $oasl_enabled_providers).'\'], 
+									"user_token": \''.$oasl_user_token.'\',
+									"callback_uri": \''.$boardurl.'/index.php?action=oasl_callback;oasl_source=profile;oasl_uid='.$context['user']['id'].'\'
+								});
+							</script>
+							<!-- OneAll.com / Social Login for SMF -->
+					</dd>
+				</dl>';		
+		}
+	 }
+	 
+	// Any closing HTML?
+	if (!empty($context['profile_posthtml']))
+		echo '
+					<div>', $context['profile_posthtml'], '</div>';
+	elseif ($lastItem != 'hr')
+		echo '
+					<hr width="100%" size="1" class="hrcolor clear" />';
+
+	// Only show the password box if it's actually needed.
+	if ($context['require_password'])
+		echo '
+					<dl>
+						<dt>
+							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br />
+							<span class="smalltext">', $txt['required_security_reasons'], '</span>
+						</dt>
+						<dd>
+							<input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
+						</dd>
+					</dl>';
+
+	echo '
+					<div class="righttext">';
+
+	// The button shouldn't say "Change profile" unless we're changing the profile...
+	if (!empty($context['submit_button_text']))
+		echo '
+						<input type="submit" value="', $context['submit_button_text'], '" class="button_submit" />';
+	else
+		echo '
+						<input type="submit" value="', $txt['change_profile'], '" class="button_submit" />';
+
+	echo '
+						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+						<input type="hidden" name="u" value="', $context['id_member'], '" />
+						<input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
+					</div>
+				</div>
+				<span class="botslice"><span></span></span>
+			</div>
+			<br />
+		</form>';
+
+	// Some javascript!
+	echo '
+		<script type="text/javascript"><!-- // --><![CDATA[
+			function checkProfileSubmit()
+			{';
+
+	// If this part requires a password, make sure to give a warning.
+	if ($context['require_password'])
+		echo '
+				// Did you forget to type your password?
+				if (document.forms.creator.oldpasswrd.value == "")
+				{
+					alert("', $txt['required_security_reasons'], '");
+					return false;
+				}';
+
+	// Any onsubmit javascript?
+	if (!empty($context['profile_onsubmit_javascript']))
+		echo '
+				', $context['profile_javascript'];
+
+	echo '
+			}';
+
+	// Any totally custom stuff?
+	if (!empty($context['profile_javascript']))
+		echo '
+			', $context['profile_javascript'];
+
+	echo '
+		// ]]></script>';
+
+	// Any final spellchecking stuff?
+	if (!empty($context['show_spellchecking']))
+		echo '
+		<form name="spell_form" id="spell_form" method="post" accept-charset="', $context['character_set'], '" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value="" /></form>';
+}
+
+// Personal Message settings.
+function template_profile_pm_settings()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	echo '
+								<dt>
+										<label for="pm_prefs">', $txt['pm_display_mode'], ':</label>
+								</dt>
+								<dd>
+										<select name="pm_prefs" id="pm_prefs" onchange="if (this.value == 2 &amp;&amp; !document.getElementById(\'copy_to_outbox\').checked) alert(\'', $txt['pm_recommend_enable_outbox'], '\');">
+											<option value="0"', $context['display_mode'] == 0 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_all'], '</option>
+											<option value="1"', $context['display_mode'] == 1 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_one'], '</option>
+											<option value="2"', $context['display_mode'] == 2 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_linked'], '</option>
+										</select>
+								</dd>
+								<dt>
+										<label for="view_newest_pm_first">', $txt['recent_pms_at_top'], '</label>
+								</dt>
+								<dd>
+										<input type="hidden" name="default_options[view_newest_pm_first]" value="0" />
+										<input type="checkbox" name="default_options[view_newest_pm_first]" id="view_newest_pm_first" value="1"', !empty($context['member']['options']['view_newest_pm_first']) ? ' checked="checked"' : '', ' class="input_check" />
+								</dd>
+						</dl>
+						<hr />
+						<dl>
+								<dt>
+										<label for="pm_receive_from">', $txt['pm_receive_from'], '</label>
+								</dt>
+								<dd>
+										<select name="pm_receive_from" id="pm_receive_from">
+												<option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected="selected"' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
+
+	if (!empty($modSettings['enable_buddylist']))
+		echo '
+												<option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_ignore'], '</option>
+												<option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
+
+	echo '
+												<option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_admins'], '</option>
+										</select>
+								</dd>
+								<dt>
+										<label for="pm_email_notify">', $txt['email_notify'], '</label>
+								</dt>
+								<dd>
+										<select name="pm_email_notify" id="pm_email_notify">
+												<option value="0"', empty($context['send_email']) ? ' selected="selected"' : '', '>', $txt['email_notify_never'], '</option>
+												<option value="1"', !empty($context['send_email']) && ($context['send_email'] == 1 || (empty($modSettings['enable_buddylist']) && $context['send_email'] > 1)) ? ' selected="selected"' : '', '>', $txt['email_notify_always'], '</option>';
+
+	if (!empty($modSettings['enable_buddylist']))
+		echo '
+												<option value="2"', !empty($context['send_email']) && $context['send_email'] > 1 ? ' selected="selected"' : '', '>', $txt['email_notify_buddies'], '</option>';
+
+	echo '
+										</select>
+								</dd>
+								<dt>
+										<label for="popup_messages">', $txt['popup_messages'], '</label>
+								</dt>
+								<dd>
+										<input type="hidden" name="default_options[popup_messages]" value="0" />
+										<input type="checkbox" name="default_options[popup_messages]" id="popup_messages" value="1"', !empty($context['member']['options']['popup_messages']) ? ' checked="checked"' : '', ' class="input_check" />
+								</dd>
+						</dl>
+						<hr />
+						<dl>
+								<dt>
+										<label for="copy_to_outbox"> ', $txt['copy_to_outbox'], '</label>
+								</dt>
+								<dd>
+										<input type="hidden" name="default_options[copy_to_outbox]" value="0" />
+										<input type="checkbox" name="default_options[copy_to_outbox]" id="copy_to_outbox" value="1"', !empty($context['member']['options']['copy_to_outbox']) ? ' checked="checked"' : '', ' class="input_check" />
+								</dd>
+								<dt>
+										<label for="pm_remove_inbox_label">', $txt['pm_remove_inbox_label'], '</label>
+								</dt>
+								<dd>
+										<input type="hidden" name="default_options[pm_remove_inbox_label]" value="0" />
+										<input type="checkbox" name="default_options[pm_remove_inbox_label]" id="pm_remove_inbox_label" value="1"', !empty($context['member']['options']['pm_remove_inbox_label']) ? ' checked="checked"' : '', ' class="input_check" />
+								</dd>';
+
+}
+
+// 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 '
+							<dd></dd>
+						</dl>
+						<ul id="theme_settings">
+							<li>
+								<input type="hidden" name="default_options[show_board_desc]" value="0" />
+								<label for="show_board_desc"><input type="checkbox" name="default_options[show_board_desc]" id="show_board_desc" value="1"', !empty($context['member']['options']['show_board_desc']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['board_desc_inside'], '</label>
+							</li>
+							<li>
+								<input type="hidden" name="default_options[show_children]" value="0" />
+								<label for="show_children"><input type="checkbox" name="default_options[show_children]" id="show_children" value="1"', !empty($context['member']['options']['show_children']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['show_children'], '</label>
+							</li>
+							<li>
+								<input type="hidden" name="default_options[use_sidebar_menu]" value="0" />
+								<label for="use_sidebar_menu"><input type="checkbox" name="default_options[use_sidebar_menu]" id="use_sidebar_menu" value="1"', !empty($context['member']['options']['use_sidebar_menu']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['use_sidebar_menu'], '</label>
+							</li>
+							<li>
+								<input type="hidden" name="default_options[show_no_avatars]" value="0" />
+								<label for="show_no_avatars"><input type="checkbox" name="default_options[show_no_avatars]" id="show_no_avatars" value="1"', !empty($context['member']['options']['show_no_avatars']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['show_no_avatars'], '</label>
+							</li>
+							<li>
+								<input type="hidden" name="default_options[show_no_signatures]" value="0" />
+								<label for="show_no_signatures"><input type="checkbox" name="default_options[show_no_signatures]" id="show_no_signatures" value="1"', !empty($context['member']['options']['show_no_signatures']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['show_no_signatures'], '</label>
+							</li>';
+
+	if ($settings['allow_no_censored'])
+		echo '
+							<li>
+								<input type="hidden" name="default_options[show_no_censored]" value="0" />
+								<label for="show_no_censored"><input type="checkbox" name="default_options[show_no_censored]" id="show_no_censored" value="1"' . (!empty($context['member']['options']['show_no_censored']) ? ' checked="checked"' : '') . ' class="input_check" /> ' . $txt['show_no_censored'] . '</label>
+							</li>';
+
+	echo '
+							<li>
+								<input type="hidden" name="default_options[return_to_post]" value="0" />
+								<label for="return_to_post"><input type="checkbox" name="default_options[return_to_post]" id="return_to_post" value="1"', !empty($context['member']['options']['return_to_post']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['return_to_post'], '</label>
+							</li>
+							<li>
+								<input type="hidden" name="default_options[no_new_reply_warning]" value="0" />
+								<label for="no_new_reply_warning"><input type="checkbox" name="default_options[no_new_reply_warning]" id="no_new_reply_warning" value="1"', !empty($context['member']['options']['no_new_reply_warning']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['no_new_reply_warning'], '</label>
+							</li>';
+
+	if (!empty($modSettings['enable_buddylist']))
+		echo '
+							<li>
+								<input type="hidden" name="default_options[posts_apply_ignore_list]" value="0" />
+								<label for="posts_apply_ignore_list"><input type="checkbox" name="default_options[posts_apply_ignore_list]" id="posts_apply_ignore_list" value="1"', !empty($context['member']['options']['posts_apply_ignore_list']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['posts_apply_ignore_list'], '</label>
+							</li>';
+
+	echo '
+							<li>
+								<input type="hidden" name="default_options[view_newest_first]" value="0" />
+								<label for="view_newest_first"><input type="checkbox" name="default_options[view_newest_first]" id="view_newest_first" value="1"', !empty($context['member']['options']['view_newest_first']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['recent_posts_at_top'], '</label>
+							</li>';
+
+	// Choose WYSIWYG settings?
+	if (empty($modSettings['disable_wysiwyg']))
+		echo '
+							<li>
+								<input type="hidden" name="default_options[wysiwyg_default]" value="0" />
+								<label for="wysiwyg_default"><input type="checkbox" name="default_options[wysiwyg_default]" id="wysiwyg_default" value="1"', !empty($context['member']['options']['wysiwyg_default']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['wysiwyg_default'], '</label>
+							</li>';
+
+	if (empty($modSettings['disableCustomPerPage']))
+	{
+		echo '
+							<li>
+								<label for="topics_per_page">', $txt['topics_per_page'], '</label>
+								<select name="default_options[topics_per_page]" id="topics_per_page">
+									<option value="0"', empty($context['member']['options']['topics_per_page']) ? ' selected="selected"' : '', '>', $txt['per_page_default'], ' (', $modSettings['defaultMaxTopics'], ')</option>
+									<option value="5"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 5 ? ' selected="selected"' : '', '>5</option>
+									<option value="10"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 10 ? ' selected="selected"' : '', '>10</option>
+									<option value="25"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 25 ? ' selected="selected"' : '', '>25</option>
+									<option value="50"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 50 ? ' selected="selected"' : '', '>50</option>
+								</select>
+							</li>
+							<li>
+								<label for="messages_per_page">', $txt['messages_per_page'], '</label>
+								<select name="default_options[messages_per_page]" id="messages_per_page">
+									<option value="0"', empty($context['member']['options']['messages_per_page']) ? ' selected="selected"' : '', '>', $txt['per_page_default'], ' (', $modSettings['defaultMaxMessages'], ')</option>
+									<option value="5"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 5 ? ' selected="selected"' : '', '>5</option>
+									<option value="10"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 10 ? ' selected="selected"' : '', '>10</option>
+									<option value="25"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 25 ? ' selected="selected"' : '', '>25</option>
+									<option value="50"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 50 ? ' selected="selected"' : '', '>50</option>
+								</select>
+							</li>';
+	}
+
+	if (!empty($modSettings['cal_enabled']))
+		echo '
+							<li>
+								<label for="calendar_start_day">', $txt['calendar_start_day'], ':</label>
+								<select name="default_options[calendar_start_day]" id="calendar_start_day">
+									<option value="0"', empty($context['member']['options']['calendar_start_day']) ? ' selected="selected"' : '', '>', $txt['days'][0], '</option>
+									<option value="1"', !empty($context['member']['options']['calendar_start_day']) && $context['member']['options']['calendar_start_day'] == 1 ? ' selected="selected"' : '', '>', $txt['days'][1], '</option>
+									<option value="6"', !empty($context['member']['options']['calendar_start_day']) && $context['member']['options']['calendar_start_day'] == 6 ? ' selected="selected"' : '', '>', $txt['days'][6], '</option>
+								</select>
+							</li>';
+
+	echo '
+							<li>
+								<label for="display_quick_reply">', $txt['display_quick_reply'], '</label>
+								<select name="default_options[display_quick_reply]" id="display_quick_reply">
+									<option value="0"', empty($context['member']['options']['display_quick_reply']) ? ' selected="selected"' : '', '>', $txt['display_quick_reply1'], '</option>
+									<option value="1"', !empty($context['member']['options']['display_quick_reply']) && $context['member']['options']['display_quick_reply'] == 1 ? ' selected="selected"' : '', '>', $txt['display_quick_reply2'], '</option>
+									<option value="2"', !empty($context['member']['options']['display_quick_reply']) && $context['member']['options']['display_quick_reply'] == 2 ? ' selected="selected"' : '', '>', $txt['display_quick_reply3'], '</option>
+								</select>
+							</li>
+							<li>
+								<label for="display_quick_mod">', $txt['display_quick_mod'], '</label>
+								<select name="default_options[display_quick_mod]" id="display_quick_mod">
+									<option value="0"', empty($context['member']['options']['display_quick_mod']) ? ' selected="selected"' : '', '>', $txt['display_quick_mod_none'], '</option>
+									<option value="1"', !empty($context['member']['options']['display_quick_mod']) && $context['member']['options']['display_quick_mod'] == 1 ? ' selected="selected"' : '', '>', $txt['display_quick_mod_check'], '</option>
+									<option value="2"', !empty($context['member']['options']['display_quick_mod']) && $context['member']['options']['display_quick_mod'] != 1 ? ' selected="selected"' : '', '>', $txt['display_quick_mod_image'], '</option>
+								</select>
+							</li>
+						</ul>
+						<dl>
+							<dd></dd>';
+}
+
+function template_notification()
+{
+	global $context, $settings, $options, $txt, $scripturl, $modSettings;
+
+	// The main containing header.
+	echo '
+			<div class="cat_bar">
+				<h3 class="catbg">
+					<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['profile'], '</span>
+				</h3>
+			</div>
+			<p class="windowbg description">', $txt['notification_info'], '</p>
+			<div class="windowbg2">
+				<span class="topslice"><span></span></span>
+				<div class="content">
+					<form action="', $scripturl, '?action=profile;area=notification;save" method="post" accept-charset="', $context['character_set'], '" id="notify_options" class="flow_hidden">';
+
+	// Allow notification on announcements to be disabled?
+	if (!empty($modSettings['allow_disableAnnounce']))
+		echo '
+						<input type="hidden" name="notify_announcements" value="0" />
+						<label for="notify_announcements"><input type="checkbox" id="notify_announcements" name="notify_announcements"', !empty($context['member']['notify_announcements']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['notify_important_email'], '</label><br />';
+
+	// More notification options.
+	echo '
+						<input type="hidden" name="default_options[auto_notify]" value="0" />
+						<label for="auto_notify"><input type="checkbox" id="auto_notify" name="default_options[auto_notify]" value="1"', !empty($context['member']['options']['auto_notify']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['auto_notify'], '</label><br />';
+
+	if (empty($modSettings['disallow_sendBody']))
+		echo '
+						<input type="hidden" name="notify_send_body" value="0" />
+						<label for="notify_send_body"><input type="checkbox" id="notify_send_body" name="notify_send_body"', !empty($context['member']['notify_send_body']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['notify_send_body'], '</label><br />';
+
+	echo '
+						<br />
+						<label for="notify_regularity">', $txt['notify_regularity'], ':</label>
+						<select name="notify_regularity" id="notify_regularity">
+							<option value="0"', $context['member']['notify_regularity'] == 0 ? ' selected="selected"' : '', '>', $txt['notify_regularity_instant'], '</option>
+							<option value="1"', $context['member']['notify_regularity'] == 1 ? ' selected="selected"' : '', '>', $txt['notify_regularity_first_only'], '</option>
+							<option value="2"', $context['member']['notify_regularity'] == 2 ? ' selected="selected"' : '', '>', $txt['notify_regularity_daily'], '</option>
+							<option value="3"', $context['member']['notify_regularity'] == 3 ? ' selected="selected"' : '', '>', $txt['notify_regularity_weekly'], '</option>
+						</select>
+						<br /><br />
+						<label for="notify_types">', $txt['notify_send_types'], ':</label>
+						<select name="notify_types" id="notify_types">
+							<option value="1"', $context['member']['notify_types'] == 1 ? ' selected="selected"' : '', '>', $txt['notify_send_type_everything'], '</option>
+							<option value="2"', $context['member']['notify_types'] == 2 ? ' selected="selected"' : '', '>', $txt['notify_send_type_everything_own'], '</option>
+							<option value="3"', $context['member']['notify_types'] == 3 ? ' selected="selected"' : '', '>', $txt['notify_send_type_only_replies'], '</option>
+							<option value="4"', $context['member']['notify_types'] == 4 ? ' selected="selected"' : '', '>', $txt['notify_send_type_nothing'], '</option>
+						</select><br class="clear" />
+
+						<div>
+							<input id="notify_submit" type="submit" value="', $txt['notify_save'], '" class="button_submit floatright" />
+							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+							<input type="hidden" name="u" value="', $context['id_member'], '" />
+							<input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
+						</div><br class="clear" />
+					</form>
+				</div>
+				<span class="botslice"><span></span></span>
+			</div>
+			<br />';
+
+	template_show_list('topic_notification_list');
+
+	echo '
+		<br />';
+
+	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 '
+		<form action="', $scripturl, '?action=profile;area=groupmembership;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
+			<div class="cat_bar">
+				<h3 class="catbg">
+					<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['profile'], '</span>
+				</h3>
+			</div>
+			<p class="description">', $txt['groupMembership_info'], '</p>';
+
+	// Do we have an update message?
+	if (!empty($context['update_message']))
+		echo '
+			<div id="profile_success">
+				', $context['update_message'], '.
+			</div>';
+
+	// Requesting membership to a group?
+	if (!empty($context['group_request']))
+	{
+		echo '
+			<div class="groupmembership">
+				<div class="cat_bar">
+					<h3 class="catbg">', $txt['request_group_membership'], '</h3>
+				</div>
+				<span class="upperframe"><span></span></span>
+				<div class="roundframe"><div class="innerframe">
+					', $txt['request_group_membership_desc'], ':
+					<textarea name="reason" rows="4" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 99%; min-width: 99%' : 'width: 99%') . ';"></textarea>
+					<div class="righttext" style="margin: 0.5em 0.5% 0 0.5%;">
+						<input type="hidden" name="gid" value="', $context['group_request']['id'], '" />
+						<input type="submit" name="req" value="', $txt['submit_request'], '" class="button_submit" />
+					</div>
+				</div></div>
+				<span class="lowerframe"><span></span></span>
+			</div>';
+	}
+	else
+	{
+		echo '
+			<table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_grid">
+				<thead>
+					<tr class="catbg">
+						<th class="first_th" scope="col" ', $context['can_edit_primary'] ? ' colspan="2"' : '', '>', $txt['current_membergroups'], '</th>
+						<th class="last_th" scope="col"></th>
+					</tr>
+				</thead>
+				<tbody>';
+
+		$alternate = true;
+		foreach ($context['groups']['member'] as $group)
+		{
+			echo '
+					<tr class="', $alternate ? 'windowbg' : 'windowbg2', '" id="primdiv_', $group['id'], '">';
+
+				if ($context['can_edit_primary'])
+					echo '
+						<td width="4%">
+							<input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '" ', $group['is_primary'] ? 'checked="checked"' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');" ', $group['can_be_primary'] ? '' : 'disabled="disabled"', ' class="input_radio" />
+						</td>';
+
+				echo '
+						<td>
+							<label for="primary_', $group['id'], '"><strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br /><span class="smalltext">' . $group['desc'] . '</span>' : ''), '</label>
+						</td>
+						<td width="15%" class="righttext">';
+
+				// Can they leave their group?
+				if ($group['can_leave'])
+					echo '
+							<a href="' . $scripturl . '?action=profile;save;u=' . $context['id_member'] . ';area=groupmembership;' . $context['session_var'] . '=' . $context['session_id'] . ';gid=' . $group['id'] . '">' . $txt['leave_group'] . '</a>';
+				echo '
+						</td>
+					</tr>';
+			$alternate = !$alternate;
+		}
+
+		echo '
+				</tbody>
+			</table>';
+
+		if ($context['can_edit_primary'])
+			echo '
+			<div class="padding righttext">
+				<input type="submit" value="', $txt['make_primary'], '" class="button_submit" />
+			</div>';
+
+		// Any groups they can join?
+		if (!empty($context['groups']['available']))
+		{
+			echo '
+			<br />
+			<table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_grid">
+				<thead>
+					<tr class="catbg">
+						<th class="first_th" scope="col">
+							', $txt['available_groups'], '
+						</th>
+						<th class="last_th" scope="col"></th>
+					</tr>
+				</thead>
+				<tbody>';
+
+			$alternate = true;
+			foreach ($context['groups']['available'] as $group)
+			{
+				echo '
+					<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
+						<td>
+							<strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br /><span class="smalltext">' . $group['desc'] . '</span>' : ''), '
+						</td>
+						<td width="15%" class="lefttext">';
+
+				if ($group['type'] == 3)
+					echo '
+							<a href="', $scripturl, '?action=profile;save;u=', $context['id_member'], ';area=groupmembership;', $context['session_var'], '=', $context['session_id'], ';gid=', $group['id'], '">', $txt['join_group'], '</a>';
+				elseif ($group['type'] == 2 && $group['pending'])
+					echo '
+							', $txt['approval_pending'];
+				elseif ($group['type'] == 2)
+					echo '
+							<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '">', $txt['request_group'], '</a>';
+
+				echo '
+						</td>
+					</tr>';
+				$alternate = !$alternate;
+			}
+			echo '
+				</tbody>
+			</table>';
+		}
+
+		// Javascript for the selector stuff.
+		echo '
+		<script type="text/javascript"><!-- // --><![CDATA[
+		var prevClass = "";
+		var prevDiv = "";
+		function highlightSelected(box)
+		{
+			if (prevClass != "")
+			{
+				prevDiv.className = prevClass;
+			}
+			prevDiv = document.getElementById(box);
+			prevClass = prevDiv.className;
+
+			prevDiv.className = "highlight2";
+		}';
+		if (isset($context['groups']['member'][$context['primary_group']]))
+			echo '
+		highlightSelected("primdiv_' . $context['primary_group'] . '");';
+		echo '
+	// ]]></script>';
+	}
+
+	echo '
+				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+				<input type="hidden" name="u" value="', $context['id_member'], '" />
+			</form>';
+}
+
+function template_ignoreboards()
+{
+	global $context, $txt, $settings, $scripturl;
+	// The main containing header.
+	echo '
+	<script type="text/javascript"><!-- // --><![CDATA[
+		function selectBoards(ids)
+		{
+			var toggle = true;
+
+			for (i = 0; i < ids.length; i++)
+				toggle = toggle & document.forms.creator["ignore_brd" + ids[i]].checked;
+
+			for (i = 0; i < ids.length; i++)
+				document.forms.creator["ignore_brd" + ids[i]].checked = !toggle;
+		}
+	// ]]></script>
+
+	<form action="', $scripturl, '?action=profile;area=ignoreboards;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
+		<div class="cat_bar">
+			<h3 class="catbg">
+				<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['profile'], '</span>
+			</h3>
+		</div>
+		<p class="description">', $txt['ignoreboards_info'], '</p>
+		<div class="windowbg2">
+			<span class="topslice"><span></span></span>
+			<div class="content flow_hidden">
+				<ul class="ignoreboards floatleft">';
+
+	$i = 0;
+	$limit = ceil($context['num_boards'] / 2);
+	foreach ($context['categories'] as $category)
+	{
+		if ($i == $limit)
+		{
+			echo '
+				</ul>
+				<ul class="ignoreboards floatright">';
+
+			$i++;
+		}
+
+		echo '
+					<li class="category">
+						<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), ']); return false;">', $category['name'], '</a>
+						<ul>';
+
+		foreach ($category['boards'] as $board)
+		{
+			if ($i == $limit)
+				echo '
+						</ul>
+					</li>
+				</ul>
+				<ul class="ignoreboards floatright">
+					<li class="category">
+						<ul>';
+
+			echo '
+							<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
+								<label for="ignore_brd', $board['id'], '"><input type="checkbox" id="ignore_brd', $board['id'], '" name="ignore_brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked="checked"' : '', ' class="input_check" /> ', $board['name'], '</label>
+							</li>';
+
+			$i++;
+		}
+
+		echo '
+						</ul>
+					</li>';
+	}
+
+	echo '
+				</ul>
+				<br class="clear" />';
+
+	// Show the standard "Save Settings" profile button.
+	template_profile_save();
+
+	echo '
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>
+	</form>
+	<br />';
+}
+
+// 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 '
+		<div class="title_bar">
+			<h3 class="titlebg">
+				<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />
+				', sprintf($txt['profile_viewwarning_for_user'], $context['member']['name']), '
+				</span>
+			</h3>
+		</div>
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				<dl class="settings">
+					<dt>
+						<strong>', $txt['profile_warning_name'], ':</strong>
+					</dt>
+					<dd>
+						', $context['member']['name'], '
+					</dd>
+					<dt>
+						<strong>', $txt['profile_warning_level'], ':</strong>
+					</dt>
+					<dd>
+						<div>
+							<div>
+								<div style="font-size: 8pt; height: 12pt; width: ', $context['warningBarWidth'], 'px; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
+									<div id="warning_text" style="padding-top: 1pt; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['member']['warning'], '%</div>
+									<div id="warning_progress" style="width: ', $context['member']['warning'], '%; height: 12pt; z-index: 1; background-color: ', $context['current_color'], ';">&nbsp;</div>
+								</div>
+							</div>
+						</div>
+					</dd>';
+
+		// There's some impact of this?
+		if (!empty($context['level_effects'][$context['current_level']]))
+			echo '
+					<dt>
+						<strong>', $txt['profile_viewwarning_impact'], ':</strong>
+					</dt>
+					<dd>
+						', $context['level_effects'][$context['current_level']], '
+					</dd>';
+
+		echo '
+				</dl>
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>';
+
+	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 '
+	<script type="text/javascript"><!-- // --><![CDATA[
+		function setWarningBarPos(curEvent, isMove, changeAmount)
+		{
+			barWidth = ', $context['warningBarWidth'], ';
+
+			// Are we passing the amount to change it by?
+			if (changeAmount)
+			{
+				if (document.getElementById(\'warning_level\').value == \'SAME\')
+					percent = ', $context['member']['warning'], ' + changeAmount;
+				else
+					percent = parseInt(document.getElementById(\'warning_level\').value) + changeAmount;
+			}
+			// If not then it\'s a mouse thing.
+			else
+			{
+				if (!curEvent)
+					var curEvent = window.event;
+
+				// If it\'s a movement check the button state first!
+				if (isMove)
+				{
+					if (!curEvent.button || curEvent.button != 1)
+						return false
+				}
+
+				// Get the position of the container.
+				contain = document.getElementById(\'warning_contain\');
+				position = 0;
+				while (contain != null)
+				{
+					position += contain.offsetLeft;
+					contain = contain.offsetParent;
+				}
+
+				// Where is the mouse?
+				if (curEvent.pageX)
+				{
+					mouse = curEvent.pageX;
+				}
+				else
+				{
+					mouse = curEvent.clientX;
+					mouse += document.documentElement.scrollLeft != "undefined" ? document.documentElement.scrollLeft : document.body.scrollLeft;
+				}
+
+				// Is this within bounds?
+				if (mouse < position || mouse > position + barWidth)
+					return;
+
+				percent = Math.round(((mouse - position) / barWidth) * 100);
+
+				// Round percent to the nearest 5 - by kinda cheating!
+				percent = Math.round(percent / 5) * 5;
+			}
+
+			// What are the limits?
+			minLimit = ', $context['min_allowed'], ';
+			maxLimit = ', $context['max_allowed'], ';
+
+			percent = Math.max(percent, minLimit);
+			percent = Math.min(percent, maxLimit);
+
+			size = barWidth * (percent/100);
+
+			setInnerHTML(document.getElementById(\'warning_text\'), percent + "%");
+			document.getElementById(\'warning_level\').value = percent;
+			document.getElementById(\'warning_progress\').style.width = size + "px";
+
+			// Get the right color.
+			color = "black"';
+
+	foreach ($context['colors'] as $limit => $color)
+		echo '
+			if (percent >= ', $limit, ')
+				color = "', $color, '";';
+
+	echo '
+			document.getElementById(\'warning_progress\').style.backgroundColor = color;
+
+			// Also set the right effect.
+			effectText = "";';
+
+	foreach ($context['level_effects'] as $limit => $text)
+		echo '
+			if (percent >= ', $limit, ')
+				effectText = "', $text, '";';
+
+	echo '
+			setInnerHTML(document.getElementById(\'cur_level_div\'), effectText);
+		}
+
+		// Disable notification boxes as required.
+		function modifyWarnNotify()
+		{
+			disable = !document.getElementById(\'warn_notify\').checked;
+			document.getElementById(\'warn_sub\').disabled = disable;
+			document.getElementById(\'warn_body\').disabled = disable;
+			document.getElementById(\'warn_temp\').disabled = disable;
+			document.getElementById(\'new_template_link\').style.display = disable ? \'none\' : \'\';
+		}
+
+		function changeWarnLevel(amount)
+		{
+			setWarningBarPos(false, false, amount);
+		}
+
+		// Warn template.
+		function populateNotifyTemplate()
+		{
+			index = document.getElementById(\'warn_temp\').value;
+			if (index == -1)
+				return false;
+
+			// Otherwise see what we can do...';
+
+	foreach ($context['notification_templates'] as $k => $type)
+		echo '
+			if (index == ', $k, ')
+				document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
+
+	echo '
+		}
+
+	// ]]></script>';
+
+	echo '
+	<form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=issuewarning" method="post" class="flow_hidden" accept-charset="', $context['character_set'], '">
+		<div class="cat_bar">
+			<h3 class="catbg">
+				<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />
+				', $context['user']['is_owner'] ? $txt['profile_warning_level'] : $txt['profile_issue_warning'], '
+				</span>
+			</h3>
+		</div>';
+
+	if (!$context['user']['is_owner'])
+		echo '
+		<p class="description">', $txt['profile_warning_desc'], '</p>';
+
+	echo '
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">
+				<dl class="settings">';
+
+	if (!$context['user']['is_owner'])
+		echo '
+					<dt>
+						<strong>', $txt['profile_warning_name'], ':</strong>
+					</dt>
+					<dd>
+						<strong>', $context['member']['name'], '</strong>
+					</dd>';
+
+	echo '
+					<dt>
+						<strong>', $txt['profile_warning_level'], ':</strong>';
+
+	// Is there only so much they can apply?
+	if ($context['warning_limit'])
+		echo '
+						<br /><span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
+
+	echo '
+					</dt>
+					<dd>
+						<div id="warndiv1" style="display: none;">
+							<div>
+								<span class="floatleft" style="padding: 0 0.5em"><a href="#" onclick="changeWarnLevel(-5); return false;">[-]</a></span>
+								<div class="floatleft" id="warning_contain" style="font-size: 8pt; height: 12pt; width: ', $context['warningBarWidth'], 'px; border: 1px solid black; background-color: white; padding: 1px; position: relative;" onmousedown="setWarningBarPos(event, true);" onmousemove="setWarningBarPos(event, true);" onclick="setWarningBarPos(event);">
+									<div id="warning_text" style="padding-top: 1pt; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['member']['warning'], '%</div>
+									<div id="warning_progress" style="width: ', $context['member']['warning'], '%; height: 12pt; z-index: 1; background-color: ', $context['current_color'], ';">&nbsp;</div>
+								</div>
+								<span class="floatleft" style="padding: 0 0.5em"><a href="#" onclick="changeWarnLevel(5); return false;">[+]</a></span>
+								<div class="clear_left smalltext">', $txt['profile_warning_impact'], ': <span id="cur_level_div">', $context['level_effects'][$context['current_level']], '</span></div>
+							</div>
+							<input type="hidden" name="warning_level" id="warning_level" value="SAME" />
+						</div>
+						<div id="warndiv2">
+							<input type="text" name="warning_level_nojs" size="6" maxlength="4" value="', $context['member']['warning'], '" class="input_text" />&nbsp;', $txt['profile_warning_max'], '
+							<div class="smalltext">', $txt['profile_warning_impact'], ':<br />';
+	// For non-javascript give a better list.
+	foreach ($context['level_effects'] as $limit => $effect)
+		echo '
+							', sprintf($txt['profile_warning_effect_text'], $limit, $effect), '<br />';
+
+	echo '
+							</div>
+						</div>
+					</dd>';
+
+	if (!$context['user']['is_owner'])
+	{
+		echo '
+					<dt>
+						<strong>', $txt['profile_warning_reason'], ':</strong><br />
+						<span class="smalltext">', $txt['profile_warning_reason_desc'], '</span>
+					</dt>
+					<dd>
+						<input type="text" name="warn_reason" id="warn_reason" value="', $context['warning_data']['reason'], '" size="50" style="width: 80%;" class="input_text" />
+					</dd>
+				</dl>
+				<hr />
+				<dl class="settings">
+					<dt>
+						<strong>', $txt['profile_warning_notify'], ':</strong>
+					</dt>
+					<dd>
+						<input type="checkbox" name="warn_notify" id="warn_notify" onclick="modifyWarnNotify();" ', $context['warning_data']['notify'] ? 'checked="checked"' : '', ' class="input_check" />
+					</dd>
+					<dt>
+						<strong>', $txt['profile_warning_notify_subject'], ':</strong>
+					</dt>
+					<dd>
+						<input type="text" name="warn_sub" id="warn_sub" value="', empty($context['warning_data']['notify_subject']) ? $txt['profile_warning_notify_template_subject'] : $context['warning_data']['notify_subject'], '" size="50" style="width: 80%;" class="input_text" />
+					</dd>
+					<dt>
+						<strong>', $txt['profile_warning_notify_body'], ':</strong>
+					</dt>
+					<dd>
+						<select name="warn_temp" id="warn_temp" disabled="disabled" onchange="populateNotifyTemplate();" style="font-size: x-small;">
+							<option value="-1">', $txt['profile_warning_notify_template'], '</option>
+							<option value="-1">------------------------------</option>';
+
+		foreach ($context['notification_templates'] as $id_template => $template)
+			echo '
+							<option value="', $id_template, '">', $template['title'], '</option>';
+
+		echo '
+						</select>
+						<span class="smalltext" id="new_template_link" style="display: none;">[<a href="', $scripturl, '?action=moderate;area=warnings;sa=templateedit;tid=0" target="_blank" class="new_win">', $txt['profile_warning_new_template'], '</a>]</span><br />
+						<textarea name="warn_body" id="warn_body" cols="40" rows="8">', $context['warning_data']['notify_body'], '</textarea>
+					</dd>';
+	}
+	echo '
+				</dl>
+				<div class="righttext">
+					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+					<input type="submit" name="save" value="', $context['user']['is_owner'] ? $txt['change_profile'] : $txt['profile_warning_issue'], '" class="button_submit" />
+				</div>
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>
+	</form>';
+
+	// Previous warnings?
+	echo '<br />
+		<div class="cat_bar">
+			<h3 class="catbg">
+				', $txt['profile_warning_previous'], '
+			</h3>
+		</div>
+		<table border="0" width="100%" cellspacing="0" cellpadding="5" class="table_grid">
+			<thead>
+				<tr class="titlebg lefttext">
+					<th class="first_th" scope="col" width="20%">', $txt['profile_warning_previous_issued'], '</th>
+					<th scope="col" width="30%">', $txt['profile_warning_previous_time'], '</th>
+					<th scope="col">', $txt['profile_warning_previous_reason'], '</th>
+					<th class="last_th" scope="col" width="6%">', $txt['profile_warning_previous_level'], '</th>
+				</tr>
+			</thead>
+			<tbody>';
+
+	// Print the warnings.
+	$alternate = 0;
+	foreach ($context['previous_warnings'] as $warning)
+	{
+		$alternate = !$alternate;
+		echo '
+				<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
+					<td class="smalltext">', $warning['issuer']['link'], '</td>
+					<td class="smalltext">', $warning['time'], '</td>
+					<td class="smalltext">
+						<div class="floatleft">
+							', $warning['reason'], '
+						</div>';
+
+		if (!empty($warning['id_notice']))
+			echo '
+						<div class="floatright">
+							<a href="', $scripturl, '?action=moderate;area=notice;nid=', $warning['id_notice'], '" onclick="window.open(this.href, \'\', \'scrollbars=yes,resizable=yes,width=400,height=250\');return false;" target="_blank" class="new_win" title="', $txt['profile_warning_previous_notice'], '"><img src="', $settings['images_url'], '/filter.gif" alt="" /></a>
+						</div>';
+		echo '
+					</td>
+					<td class="smalltext">', $warning['counter'], '</td>
+				</tr>';
+	}
+
+	if (empty($context['previous_warnings']))
+		echo '
+				<tr class="windowbg2">
+					<td align="center" colspan="4">
+						', $txt['profile_warning_previous_none'], '
+					</td>
+				</tr>';
+
+	echo '
+			</tbody>
+		</table>
+		<div class="pagesection">', $txt['pages'], ': ', $context['page_index'], '</div>';
+
+	// Do our best to get pretty javascript enabled.
+	echo '
+	<script type="text/javascript"><!-- // --><![CDATA[
+		document.getElementById(\'warndiv1\').style.display = "";
+		document.getElementById(\'warndiv2\').style.display = "none";';
+
+	if (!$context['user']['is_owner'])
+		echo '
+		modifyWarnNotify();';
+
+	echo '
+	// ]]></script>';
+}
+
+// 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 '
+		<form action="', $scripturl, '?action=profile;area=deleteaccount;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
+			<div class="title_bar">
+				<h3 class="titlebg">
+					<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['deleteAccount'], '</span>
+				</h3>
+			</div>';
+	// If deleting another account give them a lovely info box.
+	if (!$context['user']['is_owner'])
+		echo '
+			<p class="windowbg2 description">', $txt['deleteAccount_desc'], '</p>';
+	echo '
+			<div class="windowbg2">
+				<span class="topslice"><span></span></span>
+				<div class="content">';
+
+	// If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
+	if ($context['needs_approval'])
+		echo '
+					<div id ="profile_error" class="alert">', $txt['deleteAccount_approval'], '</div>';
+
+	// If the user is deleting their own account warn them first - and require a password!
+	if ($context['user']['is_owner'])
+	{
+		echo '
+					<div class="alert">', $txt['own_profile_confirm'], '</div>
+					<div>
+						<strong', (isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : ''), '>', $txt['current_password'], ': </strong>
+						<input type="password" name="oldpasswrd" size="20" class="input_password" />&nbsp;&nbsp;&nbsp;&nbsp;
+						<input type="submit" value="', $txt['yes'], '" class="button_submit" />
+						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+						<input type="hidden" name="u" value="', $context['id_member'], '" />
+						<input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
+					</div>';
+	}
+	// Otherwise an admin doesn't need to enter a password - but they still get a warning - plus the option to delete lovely posts!
+	else
+	{
+		echo '
+					<div class="alert">', $txt['deleteAccount_warning'], '</div>';
+
+		// Only actually give these options if they are kind of important.
+		if ($context['can_delete_posts'])
+			echo '
+					<div>
+						', $txt['deleteAccount_posts'], ':
+						<select name="remove_type">
+							<option value="none">', $txt['deleteAccount_none'], '</option>
+							<option value="posts">', $txt['deleteAccount_all_posts'], '</option>
+							<option value="topics">', $txt['deleteAccount_topics'], '</option>
+						</select>
+					</div>';
+
+		echo '
+					<div>
+						<label for="deleteAccount"><input type="checkbox" name="deleteAccount" id="deleteAccount" value="1" class="input_check" onclick="if (this.checked) return confirm(\'', $txt['deleteAccount_confirm'], '\');" /> ', $txt['deleteAccount_member'], '.</label>
+					</div>
+					<div>
+						<input type="submit" value="', $txt['delete'], '" class="button_submit" />
+						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+						<input type="hidden" name="u" value="', $context['id_member'], '" />
+						<input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
+					</div>';
+	}
+	echo '
+				</div>
+				<span class="botslice"><span></span></span>
+			</div>
+			<br />
+		</form>';
+}
+
+// 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 '
+
+					<hr width="100%" size="1" class="hrcolor clear" />';
+
+	// Only show the password box if it's actually needed.
+	if ($context['require_password'])
+		echo '
+					<dl>
+						<dt>
+							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br />
+							<span class="smalltext">', $txt['required_security_reasons'], '</span>
+						</dt>
+						<dd>
+							<input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
+						</dd>
+					</dl>';
+
+	echo '
+					<div class="righttext">
+						<input type="submit" value="', $txt['change_profile'], '" class="button_submit" />
+						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+						<input type="hidden" name="u" value="', $context['id_member'], '" />
+						<input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
+					</div>';
+}
+
+// Small template for showing an error message upon a save problem in the profile.
+function template_error_message()
+{
+	global $context, $txt;
+
+	echo '
+		<div class="windowbg" id="profile_error">
+			<span>', !empty($context['custom_error_title']) ? $context['custom_error_title'] : $txt['profile_errors_occurred'], ':</span>
+			<ul class="reset">';
+
+		// Cycle through each error and display an error message.
+		foreach ($context['post_errors'] as $error)
+			echo '
+				<li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '.</li>';
+
+		echo '
+			</ul>
+		</div>';
+}
+
+// Display a load of drop down selectors for allowing the user to change group.
+function template_profile_group_manage()
+{
+	global $context, $txt, $scripturl;
+
+	echo '
+							<dt>
+								<strong>', $txt['primary_membergroup'], ': </strong><br />
+								<span class="smalltext">(<a href="', $scripturl, '?action=helpadmin;help=moderator_why_missing" onclick="return reqWin(this.href);">', $txt['moderator_why_missing'], '</a>)</span>
+							</dt>
+							<dd>
+								<select name="id_group" ', ($context['user']['is_owner'] && $context['member']['group_id'] == 1 ? 'onchange="if (this.value != 1 &amp;&amp; !confirm(\'' . $txt['deadmin_confirm'] . '\')) this.value = 1;"' : ''), '>';
+		// Fill the select box with all primary member groups that can be assigned to a member.
+		foreach ($context['member_groups'] as $member_group)
+			if (!empty($member_group['can_be_primary']))
+				echo '
+									<option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected="selected"' : '', '>
+										', $member_group['name'], '
+									</option>';
+		echo '
+								</select>
+							</dd>
+							<dt>
+								<strong>', $txt['additional_membergroups'], ':</strong>
+							</dt>
+							<dd>
+								<span id="additional_groupsList">
+									<input type="hidden" name="additional_groups[]" value="0" />';
+		// 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 '
+									<label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked="checked"' : '', ' class="input_check" /> ', $member_group['name'], '</label><br />';
+		echo '
+								</span>
+								<a href="javascript:void(0);" onclick="document.getElementById(\'additional_groupsList\').style.display = \'block\'; document.getElementById(\'additional_groupsLink\').style.display = \'none\'; return false;" id="additional_groupsLink" style="display: none;">', $txt['additional_membergroups_show'], '</a>
+								<script type="text/javascript"><!-- // --><![CDATA[
+									document.getElementById("additional_groupsList").style.display = "none";
+									document.getElementById("additional_groupsLink").style.display = "";
+								// ]]></script>
+							</dd>';
+
+}
+
+// Callback function for entering a birthdate!
+function template_profile_birthdate()
+{
+	global $txt, $context;
+
+	// Just show the pretty box!
+	echo '
+							<dt>
+								<strong>', $txt['dob'], ':</strong><br />
+								<span class="smalltext">', $txt['dob_year'], ' - ', $txt['dob_month'], ' - ', $txt['dob_day'], '</span>
+							</dt>
+							<dd>
+								<input type="text" name="bday3" size="4" maxlength="4" value="', $context['member']['birth_date']['year'], '" class="input_text" /> -
+								<input type="text" name="bday1" size="2" maxlength="2" value="', $context['member']['birth_date']['month'], '" class="input_text" /> -
+								<input type="text" name="bday2" size="2" maxlength="2" value="', $context['member']['birth_date']['day'], '" class="input_text" />
+							</dd>';
+}
+
+// Show the signature editing box?
+function template_profile_signature_modify()
+{
+	global $txt, $context, $settings;
+
+	echo '
+							<dt>
+								<strong>', $txt['signature'], ':</strong><br />
+								<span class="smalltext">', $txt['sig_info'], '</span><br />
+								<br />';
+
+	if ($context['show_spellchecking'])
+		echo '
+								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button_submit" />';
+
+		echo '
+							</dt>
+							<dd>
+								<textarea class="editor" onkeyup="calcCharLeft();" name="signature" rows="5" cols="50">', $context['member']['signature'], '</textarea><br />';
+
+	// If there is a limit at all!
+	if (!empty($context['signature_limits']['max_length']))
+		echo '
+								<span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br />';
+
+	if ($context['signature_warning'])
+		echo '
+								<span class="smalltext">', $context['signature_warning'], '</span>';
+
+	// Load the spell checker?
+	if ($context['show_spellchecking'])
+		echo '
+								<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/spellcheck.js"></script>';
+
+	// Some javascript used to count how many characters have been used so far in the signature.
+	echo '
+								<script type="text/javascript"><!-- // --><![CDATA[
+									function tick()
+									{
+										if (typeof(document.forms.creator) != "undefined")
+										{
+											calcCharLeft();
+											setTimeout("tick()", 1000);
+										}
+										else
+											setTimeout("tick()", 800);
+									}
+
+									function calcCharLeft()
+									{
+										var maxLength = ', $context['signature_limits']['max_length'], ';
+										var oldSignature = "", currentSignature = document.forms.creator.signature.value;
+
+										if (!document.getElementById("signatureLeft"))
+											return;
+
+										if (oldSignature != currentSignature)
+										{
+											oldSignature = currentSignature;
+
+											if (currentSignature.replace(/\r/, "").length > maxLength)
+												document.forms.creator.signature.value = currentSignature.replace(/\r/, "").substring(0, maxLength);
+											currentSignature = document.forms.creator.signature.value.replace(/\r/, "");
+										}
+
+										setInnerHTML(document.getElementById("signatureLeft"), maxLength - currentSignature.length);
+									}
+
+									addLoadEvent(tick);
+								// ]]></script>
+							</dd>';
+}
+
+function template_profile_avatar_select()
+{
+	global $context, $txt, $modSettings;
+
+	// Start with the upper menu
+	echo '
+							<dt>
+								<strong id="personal_picture">', $txt['personal_picture'], '</strong>
+								<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_none" value="none"' . ($context['member']['avatar']['choice'] == 'none' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_none"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['no_avatar'] . '</label><br />
+								', !empty($context['member']['avatar']['allow_server_stored']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_server_stored" value="server_stored"' . ($context['member']['avatar']['choice'] == 'server_stored' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_server_stored"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['choose_avatar_gallery'] . '</label><br />' : '', '
+								', !empty($context['member']['avatar']['allow_external']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_external" value="external"' . ($context['member']['avatar']['choice'] == 'external' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_external"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['my_own_pic'] . '</label><br />' : '', '
+								', !empty($context['member']['avatar']['allow_upload']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_upload" value="upload"' . ($context['member']['avatar']['choice'] == 'upload' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_upload"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['avatar_will_upload'] . '</label>' : '', '
+							</dt>
+							<dd>';
+
+	// 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 '
+								<div id="avatar_server_stored">
+									<div>
+										<select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
+		// This lists all the file catergories.
+		foreach ($context['avatars'] as $avatar)
+			echo '
+											<option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected="selected"' : ''), '>', $avatar['name'], '</option>';
+		echo '
+										</select>
+									</div>
+									<div>
+										<select name="file" id="file" size="10" style="display: none;" onchange="showAvatar()" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');" disabled="disabled"><option></option></select>
+									</div>
+									<div><img name="avatar" id="avatar" src="', !empty($context['member']['avatar']['allow_external']) && $context['member']['avatar']['choice'] == 'external' ? $context['member']['avatar']['external'] : $modSettings['avatar_url'] . '/blank.gif', '" alt="Do Nothing" /></div>
+									<script type="text/javascript"><!-- // --><![CDATA[
+										var files = ["' . implode('", "', $context['avatar_list']) . '"];
+										var avatar = document.getElementById("avatar");
+										var cat = document.getElementById("cat");
+										var selavatar = "' . $context['avatar_selected'] . '";
+										var avatardir = "' . $modSettings['avatar_url'] . '/";
+										var size = avatar.alt.substr(3, 2) + " " + avatar.alt.substr(0, 2) + String.fromCharCode(117, 98, 116);
+										var file = document.getElementById("file");
+
+										if (avatar.src.indexOf("blank.gif") > -1)
+											changeSel(selavatar);
+										else
+											previewExternalAvatar(avatar.src)
+
+										function changeSel(selected)
+										{
+											if (cat.selectedIndex == -1)
+												return;
+
+											if (cat.options[cat.selectedIndex].value.indexOf("/") > 0)
+											{
+												var i;
+												var count = 0;
+
+												file.style.display = "inline";
+												file.disabled = false;
+
+												for (i = file.length; i >= 0; i = i - 1)
+													file.options[i] = null;
+
+												for (i = 0; i < files.length; i++)
+													if (files[i].indexOf(cat.options[cat.selectedIndex].value) == 0)
+													{
+														var filename = files[i].substr(files[i].indexOf("/") + 1);
+														var showFilename = filename.substr(0, filename.lastIndexOf("."));
+														showFilename = showFilename.replace(/[_]/g, " ");
+
+														file.options[count] = new Option(showFilename, files[i]);
+
+														if (filename == selected)
+														{
+															if (file.options.defaultSelected)
+																file.options[count].defaultSelected = true;
+															else
+																file.options[count].selected = true;
+														}
+
+														count++;
+													}
+
+												if (file.selectedIndex == -1 && file.options[0])
+													file.options[0].selected = true;
+
+												showAvatar();
+											}
+											else
+											{
+												file.style.display = "none";
+												file.disabled = true;
+												document.getElementById("avatar").src = avatardir + cat.options[cat.selectedIndex].value;
+												document.getElementById("avatar").style.width = "";
+												document.getElementById("avatar").style.height = "";
+											}
+										}
+
+										function showAvatar()
+										{
+											if (file.selectedIndex == -1)
+												return;
+
+											document.getElementById("avatar").src = avatardir + file.options[file.selectedIndex].value;
+											document.getElementById("avatar").alt = file.options[file.selectedIndex].text;
+											document.getElementById("avatar").alt += file.options[file.selectedIndex].text == size ? "!" : "";
+											document.getElementById("avatar").style.width = "";
+											document.getElementById("avatar").style.height = "";
+										}
+
+										function previewExternalAvatar(src)
+										{
+											if (!document.getElementById("avatar"))
+												return;
+
+											var maxHeight = ', !empty($modSettings['avatar_max_height_external']) ? $modSettings['avatar_max_height_external'] : 0, ';
+											var maxWidth = ', !empty($modSettings['avatar_max_width_external']) ? $modSettings['avatar_max_width_external'] : 0, ';
+											var tempImage = new Image();
+
+											tempImage.src = src;
+											if (maxWidth != 0 && tempImage.width > maxWidth)
+											{
+												document.getElementById("avatar").style.height = parseInt((maxWidth * tempImage.height) / tempImage.width) + "px";
+												document.getElementById("avatar").style.width = maxWidth + "px";
+											}
+											else if (maxHeight != 0 && tempImage.height > maxHeight)
+											{
+												document.getElementById("avatar").style.width = parseInt((maxHeight * tempImage.width) / tempImage.height) + "px";
+												document.getElementById("avatar").style.height = maxHeight + "px";
+											}
+											document.getElementById("avatar").src = src;
+										}
+									// ]]></script>
+								</div>';
+	}
+
+	// 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 '
+								<div id="avatar_external">
+									<div class="smalltext">', $txt['avatar_by_url'], '</div>
+									<input type="text" name="userpicpersonal" size="45" value="', $context['member']['avatar']['external'], '" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'external\');" onchange="if (typeof(previewExternalAvatar) != \'undefined\') previewExternalAvatar(this.value);" class="input_text" />
+								</div>';
+	}
+
+	// If the user is able to upload avatars to the server show them an upload box.
+	if (!empty($context['member']['avatar']['allow_upload']))
+	{
+		echo '
+								<div id="avatar_upload">
+									<input type="file" size="44" name="attachment" value="" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'upload\');" class="input_file" />
+									', ($context['member']['avatar']['id_attach'] > 0 ? '<br /><br /><img src="' . $context['member']['avatar']['href'] . (strpos($context['member']['avatar']['href'], '?') === false ? '?' : '&amp;') . 'time=' . time() . '" alt="" /><input type="hidden" name="id_attach" value="' . $context['member']['avatar']['id_attach'] . '" />' : ''), '
+								</div>';
+	}
+
+	echo '
+								<script type="text/javascript"><!-- // --><![CDATA[
+									', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "' . ($context['member']['avatar']['choice'] == 'server_stored' ? '' : 'none') . '";' : '', '
+									', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "' . ($context['member']['avatar']['choice'] == 'external' ? '' : 'none') . '";' : '', '
+									', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "' . ($context['member']['avatar']['choice'] == 'upload' ? '' : 'none') . '";' : '', '
+
+									function swap_avatar(type)
+									{
+										switch(type.id)
+										{
+											case "avatar_choice_server_stored":
+												', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "";' : '', '
+												', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "none";' : '', '
+												', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "none";' : '', '
+												break;
+											case "avatar_choice_external":
+												', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "none";' : '', '
+												', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "";' : '', '
+												', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "none";' : '', '
+												break;
+											case "avatar_choice_upload":
+												', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "none";' : '', '
+												', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "none";' : '', '
+												', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "";' : '', '
+												break;
+											case "avatar_choice_none":
+												', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "none";' : '', '
+												', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "none";' : '', '
+												', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "none";' : '', '
+												break;
+										}
+									}
+								// ]]></script>
+							</dd>';
+}
+
+// Callback for modifying karam.
+function template_profile_karma_modify()
+{
+	global $context, $modSettings, $txt;
+
+		echo '
+							<dt>
+								<strong>', $modSettings['karmaLabel'], '</strong>
+							</dt>
+							<dd>
+								', $modSettings['karmaApplaudLabel'], ' <input type="text" name="karma_good" size="4" value="', $context['member']['karma']['good'], '" onchange="setInnerHTML(document.getElementById(\'karmaTotal\'), this.value - this.form.karma_bad.value);" style="margin-right: 2ex;" class="input_text" /> ', $modSettings['karmaSmiteLabel'], ' <input type="text" name="karma_bad" size="4" value="', $context['member']['karma']['bad'], '" onchange="this.form.karma_good.onchange();" class="input_text" /><br />
+								(', $txt['total'], ': <span id="karmaTotal">', ($context['member']['karma']['good'] - $context['member']['karma']['bad']), '</span>)
+							</dd>';
+}
+
+// Select the time format!
+function template_profile_timeformat_modify()
+{
+	global $context, $modSettings, $txt, $scripturl, $settings;
+
+	echo '
+							<dt>
+								<strong>', $txt['time_format'], ':</strong><br />
+								<a href="', $scripturl, '?action=helpadmin;help=time_format" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="floatleft" /></a>
+								<span class="smalltext">&nbsp;', $txt['date_format'], '</span>
+							</dt>
+							<dd>
+								<select name="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">';
+	// Help the user by showing a list of common time formats.
+	foreach ($context['easy_timeformats'] as $time_format)
+		echo '
+									<option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected="selected"' : '', '>', $time_format['title'], '</option>';
+	echo '
+								</select><br />
+								<input type="text" name="time_format" value="', $context['member']['time_format'], '" size="30" class="input_text" />
+							</dd>';
+}
+
+// Time offset?
+function template_profile_timeoffset_modify()
+{
+	global $txt, $context;
+
+	echo '
+							<dt>
+								<strong', (isset($context['modify_error']['bad_offset']) ? ' class="error"' : ''), '>', $txt['time_offset'], ':</strong><br />
+								<span class="smalltext">', $txt['personal_time_offset'], '</span>
+							</dt>
+							<dd>
+								<input type="text" name="time_offset" id="time_offset" size="5" maxlength="5" value="', $context['member']['time_offset'], '" class="input_text" /> <a href="javascript:void(0);" onclick="currentDate = new Date(', $context['current_forum_time_js'], '); document.getElementById(\'time_offset\').value = autoDetectTimeOffset(currentDate); return false;">', $txt['timeoffset_autodetect'], '</a><br />', $txt['current_time'], ': <em>', $context['current_forum_time'], '</em>
+							</dd>';
+}
+
+// Theme?
+function template_profile_theme_pick()
+{
+	global $txt, $context, $scripturl;
+
+	echo '
+							<dt>
+								<strong>', $txt['current_theme'], ':</strong>
+							</dt>
+							<dd>
+								', $context['member']['theme']['name'], ' <a href="', $scripturl, '?action=theme;sa=pick;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['change'], '</a>
+							</dd>';
+}
+
+// Smiley set picker.
+function template_profile_smiley_pick()
+{
+	global $txt, $context, $modSettings, $settings;
+
+	echo '
+							<dt>
+								<strong>', $txt['smileys_current'], ':</strong>
+							</dt>
+							<dd>
+								<select name="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.gif\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">';
+	foreach ($context['smiley_sets'] as $set)
+		echo '
+									<option value="', $set['id'], '"', $set['selected'] ? ' selected="selected"' : '', '>', $set['name'], '</option>';
+	echo '
+								</select> <img id="smileypr" src="', $context['member']['smiley_set']['id'] != 'none' ? $modSettings['smileys_url'] . '/' . ($context['member']['smiley_set']['id'] != '' ? $context['member']['smiley_set']['id'] : (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'])) . '/smiley.gif' : $settings['images_url'] . '/blank.gif', '" alt=":)" align="top" style="padding-left: 20px;" />
+							</dd>';
+}
+
+// Change the way you login to the forum.
+function template_authentication_method()
+{
+	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+
+	// The main header!
+	echo '
+		<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/register.js"></script>
+		<form action="', $scripturl, '?action=profile;area=authentication;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" enctype="multipart/form-data">
+			<div class="cat_bar">
+				<h3 class="catbg">
+					<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['authentication'], '</span>
+				</h3>
+			</div>
+			<p class="windowbg description">', $txt['change_authentication'], '</p>
+			<div class="windowbg2">
+				<span class="topslice"><span></span></span>
+				<div class="content">
+					<dl>
+						<dt>
+							<input type="radio" onclick="updateAuthMethod();" name="authenticate" value="openid" id="auth_openid"', $context['auth_method'] == 'openid' ? ' checked="checked"' : '', ' class="input_radio" /><label for="auth_openid"><strong>', $txt['authenticate_openid'], '</strong></label>&nbsp;<em><a href="', $scripturl, '?action=helpadmin;help=register_openid" onclick="return reqWin(this.href);" class="help">(?)</a></em><br />
+							<input type="radio" onclick="updateAuthMethod();" name="authenticate" value="passwd" id="auth_pass"', $context['auth_method'] == 'password' ? ' checked="checked"' : '', ' class="input_radio" /><label for="auth_pass"><strong>', $txt['authenticate_password'], '</strong></label>
+						</dt>
+						<dd>
+							<dl id="auth_openid_div">
+								<dt>
+									<em>', $txt['authenticate_openid_url'], ':</em>
+								</dt>
+								<dd>
+									<input type="text" name="openid_identifier" id="openid_url" size="30" tabindex="', $context['tabindex']++, '" value="', $context['member']['openid_uri'], '" class="input_text openid_login" />
+								</dd>
+							</dl>
+							<dl id="auth_pass_div">
+								<dt>
+									<em>', $txt['choose_pass'], ':</em>
+								</dt>
+								<dd>
+									<input type="password" name="passwrd1" id="smf_autov_pwmain" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
+									<span id="smf_autov_pwmain_div" style="display: none;"><img id="smf_autov_pwmain_img" src="', $settings['images_url'], '/icons/field_invalid.gif" alt="*" /></span>
+								</dd>
+								<dt>
+									<em>', $txt['verify_pass'], ':</em>
+								</dt>
+								<dd>
+									<input type="password" name="passwrd2" id="smf_autov_pwverify" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
+									<span id="smf_autov_pwverify_div" style="display: none;"><img id="smf_autov_pwverify_img" src="', $settings['images_url'], '/icons/field_valid.gif" alt="*" /></span>
+								</dd>
+							</dl>
+						</dd>
+					</dl>';
+
+	if ($context['require_password'])
+		echo '
+					<hr width="100%" size="1" class="hrcolor clear" />
+					<dl>
+						<dt>
+							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br />
+							<span class="smalltext">', $txt['required_security_reasons'], '</span>
+						</dt>
+						<dd>
+							<input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
+						</dd>
+					</dl>';
+
+echo '
+					<div class="righttext">
+						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+						<input type="hidden" name="u" value="', $context['id_member'], '" />
+						<input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
+						<input type="submit" value="', $txt['change_profile'], '" class="button_submit" />
+					</div>
+				</div>
+				<span class="botslice"><span></span></span>
+			</div>
+		</form>';
+
+	// The password stuff.
+	echo '
+	<script type="text/javascript"><!-- // --><![CDATA[
+	var regTextStrings = {
+		"password_short": "', $txt['registration_password_short'], '",
+		"password_reserved": "', $txt['registration_password_reserved'], '",
+		"password_numbercase": "', $txt['registration_password_numbercase'], '",
+		"password_no_match": "', $txt['registration_password_no_match'], '",
+		"password_valid": "', $txt['registration_password_valid'], '"
+	};
+	var verificationHandle = new smfRegister("creator", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
+	var currentAuthMethod = \'passwd\';
+	function updateAuthMethod()
+	{
+		// What authentication method is being used?
+		if (!document.getElementById(\'auth_openid\') || !document.getElementById(\'auth_openid\').checked)
+			currentAuthMethod = \'passwd\';
+		else
+			currentAuthMethod = \'openid\';
+
+		// No openID?
+		if (!document.getElementById(\'auth_openid\'))
+			return true;
+
+		document.forms.creator.openid_url.disabled = currentAuthMethod == \'openid\' ? false : true;
+		document.forms.creator.smf_autov_pwmain.disabled = currentAuthMethod == \'passwd\' ? false : true;
+		document.forms.creator.smf_autov_pwverify.disabled = currentAuthMethod == \'passwd\' ? false : true;
+		document.getElementById(\'smf_autov_pwmain_div\').style.display = currentAuthMethod == \'passwd\' ? \'\' : \'none\';
+		document.getElementById(\'smf_autov_pwverify_div\').style.display = currentAuthMethod == \'passwd\' ? \'\' : \'none\';
+
+		if (currentAuthMethod == \'passwd\')
+		{
+			verificationHandle.refreshMainPassword();
+			verificationHandle.refreshVerifyPassword();
+			document.forms.creator.openid_url.style.backgroundColor = \'\';
+			document.getElementById("auth_openid_div").style.display = "none";
+			document.getElementById("auth_pass_div").style.display = "";
+		}
+		else
+		{
+			document.forms.creator.smf_autov_pwmain.style.backgroundColor = \'\';
+			document.forms.creator.smf_autov_pwverify.style.backgroundColor = \'\';
+			document.forms.creator.openid_url.style.backgroundColor = \'#FCE184\';
+			document.getElementById("auth_openid_div").style.display = "";
+			document.getElementById("auth_pass_div").style.display = "none";
+		}
+	}
+	updateAuthMethod();
+	// ]]></script>';
+}
+
+?>

+ 3115 - 0
css/index.css

@@ -0,0 +1,3115 @@
+/* Styles for the general looks for the Curve theme.
+------------------------------------------------------- */
+
+* {
+	/*-webkit-text-stroke: 1px rgba(0,0,0,0.1);*/
+	-webkit-font-smoothing: antialiased;
+}
+
+/* Normal, standard links. */
+a:link, a:visited{
+	color: #346;
+	text-decoration: none;
+}
+a:hover{
+	text-decoration: underline;
+	cursor: pointer;
+}
+
+/* Links that open in a new window. */
+a.new_win:link, a.new_win:visited{
+	color: #346;
+	text-decoration: none;
+}
+a.new_win:hover{
+	text-decoration: underline;
+}
+
+/* Tables should show empty cells. */
+table{
+	empty-cells: show;
+}
+
+/* Set a fontsize that will look the same in all browsers. */
+body{
+	background: black;
+	font: 78%/130% "Verdana", "Arial", "Helvetica", sans-serif;
+	margin: 0 auto;
+	padding: 15px 0;
+}
+
+/* Help popups require a different styling of the body element. */
+body#help_popup{
+	padding: 1em;
+}
+
+/* use dark grey for the text, leaving #000 for headers etc */
+body, td, th, tr{
+	color: #444;
+}
+
+/* This division wraps the entire forum when a forum width is set. */
+div#wrapper{
+	border-radius: 5px;
+	margin: 0 auto;
+	min-width: 1035px;
+	max-width: 2300px;
+}
+
+/* lets give all forms zero padding/margins */
+form{
+	padding: 0;
+	margin: 0;
+}
+/* Force br's to actually be on a newline when there are floats */
+div.dp_news br{
+	clear: both;
+}
+
+/* We can style the different types of input buttons to be uniform throughout different browsers and their color themes.
+	.button_submit - covers input[type=submit], input[type=button], button[type=submit] and button[type=button] in all browsers
+	.button_reset  - covers input[type=reset] and button[type=reset] throughout all browsers
+	.input_check	- covers input[type=checkbox] throughout all browsers
+	.input_radio	- covers input[type=radio] throughout all browsers
+	.input_text	 - covers input[type=text] throughout all browsers
+	.input_file	 - covers input[type=file] throughout all browsers
+*/
+
+input, button, select, textarea{
+	font: 95%/115% verdana, Helvetica, sans-serif;
+	color: #000;
+	background: #fff;
+	border: 1px solid #7f9db9;
+	padding: 2px;
+}
+
+/* Select elements look horrible with the extra padding, so leave them unpadded. */
+select{
+	padding: 0;
+}
+
+/* Add some padding to the options instead. */
+select option{
+	padding: 1px;
+}
+
+/* The font size of textareas should be just a little bit larger. */
+textarea{
+	font: 100%/130% verdana, Helvetica, sans-serif;
+}
+
+/* Buttons should be styled a bit differently, in order to make them look more button'ish. */
+.button_submit, .button_reset{
+	border: 1px solid #aaa;
+	cursor: pointer;
+	font-weight: normal;
+	border-radius: 3px;
+}
+.button_submit{
+	background-color: #9FCA96;
+}
+.button_reset{
+	background-color: #B8BFC1;
+}
+input:hover, textarea:hover, button:hover, select:hover{
+	border: 1px solid #454545;
+}
+.button_submit:hover, .button_reset:hover{
+	border: 1px solid #aaa;
+	background: #cde7ff;
+}
+input:focus, textarea:focus, button:focus, select:focus{
+	border: 1px solid #454545;
+}
+
+/* All input elements that are checkboxes or radio buttons shouldn't have a border around them. */
+input.input_check, input.input_radio{
+	border: none;
+	background: none;
+}
+h3.catbg input.input_check{
+	margin: 9px 7px 0 7px;
+}
+
+/* Give disabled text input elements a different background color. */
+input[disabled].input_text{
+	background-color: #eee;
+}
+
+/* Standard horizontal rule.. ([hr], etc.) */
+hr, .hrcolor{
+	height: 1px;
+	border: 0;
+	color: #ccc;
+	background-color: #ccc;
+}
+
+/* By default set the color on these tags as #000. */
+h1, h2, h3, h4, h5, h6{
+	color: #000;
+	font-size: 1em;
+	margin: 0;
+	padding: 0;
+}
+
+/* Fieldsets are used to group elements. */
+fieldset{
+	border: 1px solid #c4c4c4;
+	padding: 1em;
+	margin: 0 0 0.5em 0;
+}
+fieldset legend{
+	font-weight: bold;
+	color: #444;
+}
+/* No image should have a border when linked. */
+a img{
+	border: 0;
+}
+
+/* Define strong as bold, and em as italics */
+strong{
+	font-weight: bold;
+}
+
+em{
+	font-style: italic;
+}
+/* Alternative for u tag */
+.underline{
+	text-decoration: underline;
+}
+
+/* Common classes to easy styling.
+------------------------------------------------------- */
+
+.floatright{
+	float: right;
+}
+.floatleft{
+	float: left;
+}
+
+.flow_auto{
+	overflow: auto;
+}
+.flow_hidden{
+	overflow: hidden;
+}
+.flow_hidden .windowbg, .flow_hidden .windowbg2{
+	margin-top: 2px;
+}
+.clear{
+	clear: both;
+}
+.clear_left{
+	clear: left;
+}
+.clear_right{
+	clear: right;
+}
+
+/* Default font sizes: small (8pt), normal (10pt), and large (14pt). */
+.smalltext, tr.smalltext th{
+	font-size: 0.85em;
+	font-family: verdana, sans-serif;
+}
+.middletext{
+	font-size: 0.9em;
+	line-height: 1em;
+	font-family: verdana, sans-serif;
+}
+.normaltext{
+	font-size: 1em;
+	line-height: 1.2em;
+}
+.largetext{
+	font-size: 1.4em;
+}
+.centertext{
+	margin: 0 auto;
+	text-align: center;
+}
+.righttext{
+	margin-left: auto;
+	margin-right: 0;
+	text-align: right;
+}
+.lefttext{
+	margin-left: 0;
+	margin-right: auto;
+	text-align: left;
+}
+.double_height{
+	line-height: 2em;
+}
+/* some common padding styles */
+.padding{
+	padding: 0.7em;
+}
+.main_section, .lower_padding{
+	padding-bottom: 0.5em;
+}
+.main_section{
+	background-color: #E7E7E7;
+	color: black;
+}
+/* a quick reset list class. */
+ul.reset, ul.reset li{
+	padding: 0;
+	margin: 0;
+	list-style: none;
+}
+
+/* Some BBC related styles.
+------------------------------------------------------- */
+
+/* A quote, perhaps from another post. */
+blockquote.bbc_standard_quote, blockquote.bbc_alternate_quote{
+	font-size: x-small;
+	color: #000;
+	line-height: 1.4em;
+	background: url(../images/theme/quote.png) 0.1em 0.1em no-repeat;
+	border-top: 2px solid #99A;
+	border-bottom: 2px solid #99A;
+	padding: 1.1em 1.4em;
+	margin: 0.1em 0 0.3em 0;
+	overflow: auto;
+}
+
+/* Alterate blockquote stylings */
+blockquote.bbc_standard_quote{
+	background-color: #d7daec;
+}
+blockquote.bbc_alternate_quote{
+	background-color: #e7eafc;
+}
+
+/* A code block - maybe PHP ;). */
+code.bbc_code{
+	display: block;
+	font-family: "dejavu sans mono", "monaco", "lucida console", "courier new", monospace;
+	font-size: x-small;
+	background: #eef;
+	border-top: 2px solid #999;
+	border-bottom: 2px solid #999;
+	line-height: 1.5em;
+	padding: 3px 1em;
+	overflow: auto;
+	white-space: nowrap;
+	/* Show a scrollbar after about 24 lines. */
+	max-height: 24em;
+	max-width:80%;
+	overflow: scroll;
+}
+
+/* The "Quote:" and "Code:" header parts... */
+.codeheader, .quoteheader{
+	color: #666;
+	font-size: x-small;
+	font-weight: bold;
+	padding: 0 0.3em;
+}
+
+/* For links to change the code stuff... */
+.codeoperation{
+	font-weight: normal;
+}
+
+/* Styling for BBC tags */
+.bbc_link:link, .bbc_link:visited{
+	border-bottom: 1px solid #A8B6CF;
+}
+.bbc_link:hover{
+	text-decoration: none;
+	border-bottom: 1px solid #346;
+}
+.bbc_size{
+	line-height: 1.4em;
+}
+.bbc_color a{
+	color: inherit;
+}
+.bbc_img{
+	border: 0;
+}
+.bbc_table{
+	font: inherit;
+	color: inherit;
+}
+.bbc_table td{
+	font: inherit;
+	color: inherit;
+	vertical-align: top;
+}
+.bbc_u{
+	text-decoration: underline;
+}
+.bbc_list{
+	text-align: left;
+}
+.bbc_tt{
+	font-family: "dejavu sans mono", "monaco", "lucida console", "courier new", monospace;
+}
+
+/* Generally, those [?] icons.  This makes your cursor a help icon. */
+.help{
+	cursor: help;
+}
+
+/* /me uses this a lot. (emote, try typing /me in a post.) */
+.meaction{
+	color: red;
+}
+
+/* Highlighted text - such as search results. */
+.highlight{
+	font-weight: bold;
+	color: #ff7200 !important;
+	font-size: 1.1em;
+}
+
+/* A more discreet highlight color, for selected membergroups etc. */
+.highlight2{
+	background-color: #D1E1EF;
+	color: #000 !important;
+}
+
+/* Generic, mostly color-related, classes.
+------------------------------------------------------- */
+
+.titlebg, .titlebg2, tr.titlebg th, tr.titlebg td, tr.titlebg2 td{
+	color: #222;
+	font-family: arial, helvetica, sans-serif;
+	font-size: 1.1em;
+	font-weight: bold;
+	background: #e3e9ef;
+}
+.catbg, .catbg2, tr.catbg td, tr.catbg2 td, tr.catbg th, tr.catbg2 th{
+	color: #fff;
+	font-family: arial, helvetica, sans-serif;
+	font-size: 1.1em;
+	font-weight: bold;
+	background: #81A5C3;
+}
+
+/* adjust the table versions of headers */
+tr.titlebg th, tr.titlebg2 th, td.titlebg, td.titlebg2, tr.catbg th, tr.catbg2 th, td.catbg, td.catbg2{
+	padding: 0 6px;
+}
+tr.titlebg th a:link, tr.titlebg th a:visited, tr.titlebg2 td a:link, tr.titlebg2 td a:visited{
+	color: #222;
+}
+tr.catbg th a:link, tr.catbg th a:visited, tr.catbg2 td a:link, tr.catbg2 td a:visited{
+	color: #fff;
+}
+.catbg select{
+	height: 1.5em;
+	font-size: 0.85em;
+}
+
+/* Alternating backgrounds for posts, and several other sections of the forum. */
+.windowbg, #preview_body{
+	color: #000;
+	background-color: #E7E7E7;
+}
+.windowbg2{
+	color: #000;
+	background-color: #E7E7E7;
+}
+.windowbg3{
+	color: #000;
+	background-color: #E7E7E7;
+}
+
+/* the page navigation area */
+.pagesection{
+	font-size: 0.9em;
+	padding: 0.2em;
+	overflow: hidden;
+	margin-bottom: 1px;
+	background-color: #E7E7E7;
+	color: black;
+	border-radius: 3px;
+}
+div.pagesection div.floatright input{
+	margin-top: 3px;
+}
+.pagelinks{
+	padding: 0.6em 0 0.4em 0;
+	color: ##346;
+}
+.pagesection a{
+	color: #346;
+}
+/* Colors for background of posts requiring approval */
+.approvebg{
+	color: #000;
+	background-color: #ffeaea;
+}
+.approvebg2{
+	color: #000;
+	background-color: #fff2f2;
+}
+
+/* Color for background of *topics* requiring approval */
+.approvetbg{
+	color: #000;
+	background-color: #e4a17c;
+}
+.approvetbg2{
+	color: #000;
+	background-color: #f3bd9f;
+}
+
+/* Sticky topics get a different background */
+.stickybg{
+	background: #e8d8cf;
+}
+.stickybg2{
+	background: #f2e3d9;
+}
+
+/* Locked posts get a different shade, too! */
+.lockedbg{
+	background: #d4dce2;
+	font-style: italic;
+}
+.lockedbg2{
+	background: #d8e1e7;
+	font-style: italic;
+}
+
+/* Posts and personal messages displayed throughout the forum. */
+.post, .personalmessage{
+	overflow: auto;
+	line-height: 1.4em;
+	padding: 0.1em 0;
+}
+
+/* All the signatures used in the forum.  If your forum users use Mozilla, Opera, or Safari, you might add max-height here ;). */
+.signature, .attachments{
+	width: 98%;
+	overflow: auto;
+	clear: right;
+	padding: 1em 0 3px 0;
+	border-top: 1px solid #aaa;
+	line-height: 1.4em;
+	font-size: 0.85em;
+}
+.custom_fields_above_signature{
+	width: 98%;
+	clear: right;
+	padding: 1em 0 3px 0;
+	border-top: 1px solid #aaa;
+	line-height: 1.4em;
+	font-size: 0.85em;
+}
+
+/* Sometimes there will be an error when you post */
+.error{
+	color: red;
+}
+
+/* Messages that somehow need to attract the attention. */
+.alert{
+	color: red;
+}
+
+/* Calendar colors for birthdays, events and holidays */
+.birthday{
+	color: #920ac4;
+}
+
+.event{
+	color: #078907;
+}
+
+.holiday{
+	color: #000080;
+}
+
+/* Colors for warnings */
+.warn_mute{
+	color: red;
+}
+
+.warn_moderate{
+	color: #ffa500;
+}
+
+.warn_watch, .success{
+	color: green;
+}
+
+a.moderation_link, a.moderation_link:visited{
+	color: red;
+	font-weight: bold;
+}
+
+.openid_login{
+	background: white url(../images/openid.gif) no-repeat;
+	padding-left: 18px;
+}
+
+/* a descriptive style */
+.description, .description_board, .plainbox{
+	padding: 0.5em 1em;
+	font-size: 0.9em;
+	line-height: 1.4em;
+	border: 1px solid #bbb;
+	background: #f5f5f0;
+	margin: 0.2em 1px 1em 1px;
+	border-radius: 5px;
+	color: black;
+}
+.description_board{
+	margin: 1em 1px 0 1px;
+}
+
+/* an informative style */
+.information{
+	padding: 0.5em 1em;
+	font-size: 0.9em;
+	line-height: 1.3em;
+	border: 1px solid #bbb;
+	background: #f0f6f0;
+	margin: 0.2em 1px 1em 1px;
+	color: black;
+}
+.information p{
+	padding: 1em;
+	margin: 0;
+}
+p.para2{
+	padding: 1em 0 3.5em 0;
+	margin: 0;
+}
+/* AJAX notification bar
+------------------------------------------------------- */
+#ajax_in_progress{
+	background: url(../images/theme/loadingbar.png) repeat-x;
+	color: #f96f00;
+	text-align: center;
+	font-size: 16pt;
+	padding: 8px;
+	width: 100%;
+	height: 66px;
+	line-height: 25px;
+	position: fixed;
+	top: 0;
+	left: 0;
+}
+
+#ajax_in_progress a{
+	color: orange;
+	text-decoration: underline;
+	font-size: smaller;
+	float: right;
+	margin-right: 20px;
+}
+
+/* Lists with settings use these a lot.
+------------------------------------------------------- */
+dl.settings{
+	clear: right;
+	overflow: auto;
+	margin: 0 0 10px 0;
+	padding: 0;
+}
+dl.settings dt{
+	width: 40%;
+	float: left;
+	margin: 0 0 10px 0;
+	padding: 0;
+	clear: both;
+}
+dl.settings dt.settings_title{
+	width: 100%;
+	float: none;
+	margin: 0 0 10px 0;
+	padding: 5px 0 0 0;
+	font-weight: bold;
+	clear: both;
+}
+dl.settings dt.windowbg{
+	width: 98%;
+	float: left;
+	margin: 0 0 3px 0;
+	padding: 0 0 5px 0;
+	clear: both;
+}
+dl.settings dd{
+	width: 56%;
+	float: right;
+	overflow: auto;
+	margin: 0 0 3px 0;
+	padding: 0;
+}
+dl.settings img{
+	margin: 0 10px 0 0;
+}
+/* help icons */
+dl.settings dt a img{
+	position: relative;
+	top: 2px;
+}
+
+/* Styles for rounded headers.
+------------------------------------------------------- */
+h3.catbg, h3.catbg2, h3.titlebg, h4.titlebg, h4.catbg{
+	overflow: hidden;
+	height: 31px;
+	line-height: 31px;
+	font-size: 1.2em;
+	font-weight: bold;
+}
+h3.catbg a:link, h3.catbg a:visited, h4.catbg a:link, h4.catbg a:visited, h3.catbg, .table_list tbody.header td, .table_list tbody.header td a{
+	color: #fff;
+}
+h3.catbg2 a, h3.catbg2{
+	color: #feb;
+}
+h3.catbg a:hover, h4.catbg a:hover, .table_list tbody.header td a:hover{
+	color: #fd9;
+	text-decoration: none;
+}
+h3.catbg2 a:hover{
+	color: #fff;
+	text-decoration: none;
+}
+h3.titlebg a, h3.titlebg, h4.titlebg, h4.titlebg a{
+	color: #222;
+}
+h3.titlebg a:hover, h4.titlebg a:hover{
+	color: #53616f;
+	text-decoration: none;
+}
+h3.catbg img.icon, h4.titlebg img.icon{
+	vertical-align: middle;
+	margin: -2px 5px 0 0;
+}
+h4.catbg a.toggle img{
+	vertical-align: middle;
+	margin: -2px 5px 0 5px;
+}
+h4.catbg, h4.catbg2 , h3.catbg , h3.catbg2 , .table_list tbody.header td.catbg{
+	
+	padding-right: 9px;
+}
+h4.titlebg, h3.titlebg{
+	
+	padding-right: 9px;
+}
+h4.titlebg img.icon{
+	float: left;
+	margin: 5px 8px 0 0;
+}
+div.cat_bar{
+	background: #81A5C3;
+	padding-left: 9px;
+	height: 31px;
+	overflow: hidden;
+	margin-bottom: 1px;
+}
+div.title_bar{
+	background: #e3e9ef;
+	padding-left: 9px;
+	height: 31px;
+	overflow: hidden;
+	margin-bottom: 1px;
+}
+
+/* rounded bars needs a different background here */
+
+div.roundframe div.cat_bar{
+	margin-bottom: 0;
+}
+div.roundframe{
+	background-color: #E7E7E7;
+	color: black;
+}
+div.cat_bar h3.catbg{
+	background: #81A5C3;
+}
+div.title_barIC{
+	background: #dadfe6;
+	padding-left: 9px;
+	height: 31px;
+	overflow: hidden;
+	margin-bottom: 1px;
+	color: black;
+}
+div.title_barIC h4.titlebg{
+	
+}
+#upshrinkHeaderIC p.pminfo{
+	margin: 0;
+	padding: 0.5em;
+}
+img#upshrink_ic, img#newsupshrink{
+	float: right;
+	margin: 10px 5px 0 0;
+}
+table.table_list a.unreadlink, table.table_list a.collapse{
+	float: right;
+}
+table.table_list a.collapse{
+	margin: 10px 5px 0 1em;
+	height: 31px;
+	line-height: 31px;
+}
+
+/* The half-round header bars for some tables. */
+.table_grid tr.catbg, .table_grid tr.titlebg{
+	font-size: 0.95em;
+	border-bottom: 1px solid #fff;
+}
+.table_grid tr.catbg th, .table_grid tr.titlebg th{
+	height: 28px;
+	line-height: 28px;
+}
+tr.catbg th.first_th{
+	background: #a7b9cd;
+}
+tr.catbg th.last_th{
+	background: #a7b9cd;
+}
+tr.titlebg th.first_th{
+	background: #e3e9ef;
+}
+tr.titlebg th.last_th{
+	background: #e3e9ef;
+}
+.table_grid th.last_th input{
+	margin: 0 2px;
+}
+.table_grid th.lefttext{
+	padding: 0 0.7em;
+}
+
+/* a general table class */
+table.table_grid{
+	border-collapse: collapse;
+	margin-top: 0.1em;
+}
+table.table_grid td{
+	padding: 3px;
+	border-bottom: 1px solid #fff;
+	border-right: 1px solid #fff;
+}
+
+/* GenericList */
+.additional_row{
+	padding: 0.5em 0 0.5em 0;
+}
+table.table_grid thead tr.catbg th{
+	white-space: nowrap;
+}
+
+/* table_grid styles for Profile > Show Permissions. */
+#permissions table.table_grid  td{
+	padding: 0.4em 0.8em;
+	cursor: default;
+} 
+
+/* Common styles used to add corners to divisions.
+------------------------------------------------------- */
+.windowbg span.topslice{
+	display: block;
+	padding-left: 20px;
+	
+}
+.windowbg span.topslice span{
+	display: block;
+	
+	height: 11px;
+}
+.windowbg span.botslice{
+	display: block;
+	padding-left: 20px;
+	
+	font-size: 5px;
+	line-height: 5px;
+	margin-bottom: 0.2em;
+}
+.windowbg span.botslice span{
+	display: block;
+	
+	height: 11px;
+}
+
+.windowbg2 span.topslice{
+	display: block;
+	padding-left: 20px;
+	
+}
+.windowbg2 span.topslice span{
+	display: block;
+	
+	height: 11px;
+}
+.windowbg2 span.botslice{
+	display: block;
+	padding-left: 20px;
+	
+	font-size: 5px;
+	line-height: 5px;
+	margin-bottom: 0.2em;
+}
+.windowbg2 span.botslice span{
+	display: block;
+	
+	height: 11px;
+}
+.approvebg span.topslice{
+	display: block;
+	padding-left: 20px;
+	
+}
+.approvebg span.topslice span{
+	display: block;
+	
+	height: 11px;
+}
+.approvebg span.botslice{
+	display: block;
+	padding-left: 20px;
+	
+	margin-bottom: 0.2em;
+}
+.approvebg span.botslice span{
+	display: block;
+	
+	height: 11px;
+}
+.postbg{
+	border-left: 1px solid #7f7f7f;
+	border-right: 1px solid #7f7f7f;
+}
+
+/* Used for sections that need somewhat larger corners.
+----------------------------------------------------------- */
+.roundframe{
+	padding: 10px;
+	background: #f5f5f5;
+	border-left: 1px solid #c5c5c5;
+	border-right: 1px solid #c5c5c5;
+	border-radius: 5px;
+}
+.roundframe dl, .roundframe dt, .roundframe p{
+	margin: 0;
+}
+.roundframe p{
+	padding: 0.5em;
+}
+span.upperframe{
+	padding: 0;
+	display: block;
+	
+	padding-left: 20px;
+}
+span.upperframe span{
+	padding: 0;
+	height: 12px;
+	display: block;
+	
+}
+span.lowerframe{
+	padding: 0;
+	display: block;
+	
+	padding-left: 20px;
+}
+span.lowerframe span{
+	padding: 0;
+	height: 12px;
+	display: block;
+	
+}
+
+/* The main content area.
+------------------------------------------------------- */
+.content{
+	padding: 0.5em 1.2em;
+	margin: 0;
+	border: none;
+}
+.content p{
+	margin: 0 0 0.5em 0;
+}
+
+/* Styles used by the auto suggest control.
+------------------------------------------------------- */
+.auto_suggest_div{
+	border: 1px solid #000;
+	position: absolute;
+	visibility: hidden;
+}
+.auto_suggest_item{
+	background-color: #ddd;
+}
+.auto_suggest_item_hover{
+	background-color: #888;
+	cursor: pointer;
+	color: #eee;
+}
+
+/* Styles for the standard dropdown menus.
+------------------------------------------------------- */
+#main_menu{
+	padding: 0 0.5em;
+	float: left;
+	margin: 0;
+	width: 98%;
+	color: black;
+}
+
+.dropmenu, .dropmenu ul{
+	list-style: none;
+	line-height: 1em;
+	padding: 0;
+	margin: 0;
+}
+.dropmenu{
+	padding: 0 0.5em;
+	background-color: #E7E7E7;
+	border-radius: 3px;
+}
+.dropmenu a{
+	display: block;
+	color: #000;
+	text-decoration: none;
+}
+.dropmenu a span{
+	display: block;
+	padding: 0 0 0 5px;
+	font-size: 0.9em;
+}
+/* the background's first level only */
+.dropmenu li a.firstlevel{
+	margin-right: 8px;
+}
+.dropmenu li a.firstlevel span.firstlevel{
+	display: block;
+	position: relative;
+	left: -5px;
+	padding-left: 5px;
+	height: 22px;
+	line-height: 19px;
+	white-space: pre;
+}
+.dropmenu li{
+	float: left;
+	padding: 0;
+	margin: 0;
+	position: relative;
+}
+.dropmenu li ul{
+	z-index: 90;
+	display: none;
+	position: absolute;
+	width: 19.2em;
+	font-weight: normal;
+	border: 1px solid black;
+	background-color: white;
+	padding: 7px 0 0 0;
+}
+.dropmenu li li{
+	width: 19em;
+	margin: 0;
+}
+.dropmenu li li a span{
+	display: block;
+	padding: 8px;
+}
+.dropmenu li ul ul{
+	margin: -1.8em 0 0 13em;
+}
+
+/* the active button */
+.dropmenu li a.active{
+	
+	color: blue;
+	font-weight: bold;
+}
+.dropmenu li a.active span.firstlevel{
+	
+}
+/* the hover effects */
+.dropmenu li a.firstlevel:hover, .dropmenu li:hover a.firstlevel{
+	
+	color: blue;
+	cursor: pointer;
+	text-decoration: none;
+}
+.dropmenu li a.firstlevel:hover span.firstlevel, .dropmenu li:hover a.firstlevel span.firstlevel{
+	
+}
+/* the hover effects on level2 and 3 */
+.dropmenu li li a:hover, .dropmenu li li:hover>a{
+	background: #d4dbe4;
+	color: #000;
+	text-decoration: none;
+}
+.dropmenu li:hover ul ul, .dropmenu li:hover ul ul ul{
+	top: -999em;
+}
+.dropmenu li li:hover ul{
+	top: auto;
+}
+.dropmenu li:hover ul{
+	display: block;
+}
+.dropmenu li li.additional_items{
+	background-color: #fff;
+}
+
+/* The dropdown menu toggle image */
+#menu_toggle{
+	float: right;
+	margin-right: 10px;
+	padding-top: 3px;
+}
+#menu_toggle span{
+	position: relative;
+	right: 5000px;
+}
+
+/* Styles for the standard button lists.
+------------------------------------------------------- */
+
+.buttonlist ul{
+	z-index: 100;
+	padding: 5px;
+	margin: 0 0.2em 5px 0;
+}
+.buttonlist ul li{
+	margin: 0;
+	padding: 0;
+	list-style: none;
+	float: left;
+}
+.buttonlist ul li a{
+	display: block;
+	font-size: 0.8em;
+	color: #000;
+	background: #e8e8e8;
+	padding: 0 0 0 8px;
+	margin-left: 12px;
+	text-transform: uppercase;
+	cursor: pointer;
+	border-radius: 3px;
+	border: 1px solid #AAA;
+}
+.buttonlist ul li a:hover{
+	color: #E7E7E7;
+	text-decoration: none;
+}
+.buttonlist ul li a span{
+	display: block;
+	height: 19px;
+	line-height: 19px;
+	padding: 0 8px 0 0;
+}
+.buttonlist ul li a:hover{
+	background: #fff;
+	color: black;
+}
+/* the active one */
+.buttonlist ul li a.active{
+	background: #5a6c85;
+	color: #E7E7E7;
+	font-weight: bold;
+}
+.buttonlist ul li a.active span{
+	
+}
+.buttonlist ul li a.active{
+	font-weight: bold;
+}
+.buttonlist ul li a.active:hover{
+	color: black;
+	background: #fff;
+}
+.align_top ul li a, .align_bottom ul li a{
+	margin: 0 12px 0 0;
+}
+
+/* the navigation list */
+ul#navigation{
+	margin: 0;
+	font-size: 0.9em;
+	padding: 1em 0.4em;
+}
+ul#navigation li{
+	float: none;
+	font-size: 0.95em;
+	display: inline;
+}
+
+#adm_submenus{
+	padding-left: 2em;
+	overflow: hidden;
+	background: #E7E7E7;
+}
+
+/* Styles for the general looks for the Curve theme.
+------------------------------------------------------- */
+
+/* the framing graphics */
+#header{
+	background: #E7E7E7;
+	padding-left: 20px;
+	border-top-right-radius: 5px;
+	border-top-left-radius: 5px;
+}
+#header div.frame{
+	
+	display: block;
+	padding: 5px 20px 1em 0;
+}
+#welcome{
+	color: black;
+}
+/* the content section */
+#content_section{
+	background: #312f2f;
+	border-bottom-right-radius: 5px;
+	border-bottom-left-radius: 5px;
+	color: #E7E7E7;
+	padding-left: 20px;
+	padding-bottom: 10px;
+}
+#content_section div.frame{
+	
+	display: block;
+	padding: 0 20px 0 0;
+}
+#content_section a{
+	
+}
+.navigate_section a{
+	color: lightblue;
+}
+#main_content_section{
+	width: 100%;
+	min-height: 200px;
+}
+
+/* the main title, always stay at 45 pixels in height! */
+h1.forumtitle{
+	line-height: 45px;
+	font-size: 1.8em;
+	font-family: Geneva, verdana, sans-serif;
+	margin: 0;
+	padding: 0;
+	float: left;
+}
+/* float these items to the right */
+#siteslogan, img#logo{
+	margin: 0;
+	padding: 0;
+	float: right;
+	line-height: 3em;
+}
+h3, h4{
+	padding-bottom: 3px;
+}
+/* the upshrink image needs some tweaking */
+img#upshrink{
+	float: right;
+	margin: 1em;
+}
+/* ..so does the SMF logo */
+img#logo{
+	margin-left: 1em;
+}
+/* the upper_section, float the two each way */
+#upper_section{
+	padding: 5px;
+	margin-bottom: 1.5em;
+}
+#upper_section ul li.greeting{
+	font-size: 1.3em;
+	font-weight: bold;
+	line-height: 1.5em;
+}
+#upper_section div.news{
+	width: 50%;
+	float: right;
+	text-align: right;
+}
+#guest_form{
+	overflow: hidden;
+}
+#guest_form .info{
+	padding: 4px 0 ;
+	line-height: 1.3em;
+}
+div#upper_section div.user{
+	width: 50%;
+	float: left;
+	overflow: auto;
+}
+div#upper_section div.user p{
+	float: left;
+	margin: 0 1em 1em 0;
+	padding: 0;
+}
+div#upper_section div.user ul{
+	margin: 0;
+	padding-left: 10px;
+}
+div#upper_section div.user ul li{
+	margin-bottom: 2px;
+}
+div#upper_section div.news p{
+	display: inline;
+}
+div#upper_section div.news form{
+	padding-bottom: 10px;
+}
+/* clearing the floats */
+#top_section{
+	min-height: 65px;
+	overflow: hidden;
+	margin-bottom: 3px;
+}
+#upper_section{
+	overflow: hidden;
+}
+
+/* The navigation list (i.e. linktree) */
+.navigate_section{
+	padding: 0.5em;
+	margin: 0 0 0 0;
+}
+.navigate_section ul{
+	display: block;
+	margin: 0;
+	font-size: 0.9em;
+	padding: 1em 0 0.5em 0;
+	border-top: 1px solid #ccc;
+	overflow: hidden;
+	list-style: none;
+	clear: both;
+	width: 100%;
+}
+.navigate_section ul li{
+	float: left;
+	padding: 0 0.5em 0 0;
+	font-size: 0.95em;
+}
+.navigate_section ul li a{
+	white-space: pre;
+}
+
+/* The footer wih copyright links etc. */
+#footer_section{
+	text-align: center;
+	color: #E7E7E7;
+	padding-left: 20px;
+}
+#footer_section span.smalltext{
+	font-size: 100%;
+}
+#footer_section div.frame{
+	
+	display: block;
+	padding: 60px 0 0 0;
+}
+#footer_section ul li, #footer_section p{
+	font-size: 0.8em;
+}
+#footer_section ul li{
+	display: inline;
+	padding-right: 5px;
+}
+#footer_section ul li.copyright{
+	display: block;
+}
+select.qaction, input.qaction{
+	font-size: 0.85em;
+	padding: 0;
+}
+#mlist table tbody td.windowbg2{
+	text-align: center;
+}
+
+/* Styles for a typical table.
+------------------------------------------------------- */
+table.table_list{
+	width: 100%;
+}
+table.table_list p{
+	padding: 0;
+	margin: 0;
+}
+table.table_list td, table.table_list th{
+	padding: 5px;
+}
+table.table_list tbody.header td{
+	padding: 0;
+}
+table.table_list tbody.content td.stats{
+	font-size: 90%;
+	width: 15%;
+	text-align: center;
+}
+table.table_list tbody.content td.lastpost{
+	line-height: 1.3em;
+	font-size: 85%;
+	width: 24%;
+}
+table.table_list tbody.content td.icon{
+	text-align: center;
+	width: 6%;
+}
+
+/* Styles for the board index.
+------------------------------------------------- */
+
+/* the board title! */
+.table_list tbody.content td.info a.subject{
+	font-weight: bold;
+	font-size: 110%;
+	color: #d97b33;
+}
+.table_list tbody.content td.children{
+	color: #555;
+	font-size: 85%;
+}
+p.moderators{
+	font-size: 0.8em;
+	font-family: verdana, sans-serif;
+}
+/* hide the table header/footer parts - but its here for those needing to style it */
+#boardindex_table .table_list thead, #boardindex_table .table_list tfoot{
+	display: none;
+}
+
+/* the posting icons */
+#posting_icons{
+	padding: 0 1em 0.5em 1em;
+	margin: 0 0 1em 0;
+	line-height: 1em;
+}
+#posting_icons ul{
+	font-size: 0.8em;
+}
+#posting_icons img{
+	vertical-align: middle;
+	margin: 0 0 0 4ex;
+}
+#postbuttons_upper ul li a span{
+	line-height: 19px;
+	padding: 0 0 0 6px;
+}
+.nextlinks{
+	text-align: right;
+	margin-top: -1px;
+}
+.nextlinks_bottom{
+	clear: right;
+	text-align: right;
+}
+.mark_read{
+	padding: 0 0.5em;
+}
+
+/* the newsfader */
+#newsfader{
+	margin: 0 2px;
+}
+#smfFadeScroller{
+	text-align: center;
+	padding: 0 2em;
+	overflow: auto;
+	margin: 1em 0;
+	color: #575757; /* shouldn't be shorthand style due to a JS bug in IE! */
+}
+
+/* Styles for the info center on the board index.
+---------------------------------------------------- */
+
+#upshrinkHeaderIC{
+	margin-top: 4px;
+}
+dl#ic_recentposts{
+	margin: 0 0 0.5em 0;
+	padding: 0.5em;
+	line-height: 1.3em;
+}
+dl#ic_recentposts dt{
+	float: left;
+}
+dl#ic_recentposts dd{
+	text-align: right;
+}
+#upshrinkHeaderIC p{
+	margin: 0 0 0.5em 0;
+	padding: 0.5em;
+}
+#upshrinkHeaderIC p.last{
+	margin: 0;
+	padding: 0.5em;
+	border-top: 2px dotted #bbb;
+}
+#upshrinkHeaderIC p.inline{
+	border: none;
+	margin: 0;
+	padding: 0.2em 0.5em 0.2em 0.5em;
+}
+#upshrinkHeaderIC p.stats{
+	font-size: 1.1em;
+	padding-top: 8px;
+}
+form#ic_login{
+	padding: 0.5em;
+	height: 2em;
+}
+form#ic_login ul li{
+	margin: 0;
+	padding: 0;
+	float: left;
+	width: 20%;
+	text-align: center;
+}
+form#ic_login ul li label{
+	display: block;
+}
+
+/* the small stats */
+#index_common_stats{
+	display: block;
+	margin: 0 0 0.5em 0;
+	text-align: right;
+	font-size: 0.9em;
+	position: relative;
+	top: -20px;
+	line-height: 1px;
+}
+
+img.new_posts{
+	padding: 0 0.1em;
+}
+/* Styles for the message (topic) index.
+---------------------------------------------------- */
+div.table_frame .table_list{
+	border-collapse: collapse;
+	margin: 2px 0;
+}
+.table_frame .table_list td.icon, .table_frame .table_list td.info, .table_frame .table_list td.stats{
+	border-right: 2px solid white;
+}
+#messageindex{
+	clear: both;
+}
+/* the page navigation area */
+.childboards{
+	margin-bottom: 0.2em;
+}
+#childboards h3{
+	padding-bottom: 0;
+}
+#childboards .table_list thead{
+	display: none;
+}
+#childboards .table_list{
+	margin-bottom: 1em;
+}
+.lastpost img{
+	float: right;
+	padding: 4px;
+}
+
+/* Styles for the display template (topic view).
+---------------------------------------------------- */
+
+#postbuttons div.buttons{
+	padding: 0.5em;
+	width: 40%;
+	float: right;
+}
+#postbuttons div.middletext{
+	width: 60%;
+}
+#postbuttons span{
+	display: block;
+	text-align: right;
+}
+#postbuttons span.lower{
+	clear: right;
+}
+#postbuttons .buttonlist{
+	float: right;
+}
+#postbuttons #pagelinks{
+	padding-top: 1em;
+}
+#moderationbuttons{
+	overflow: hidden;
+}
+/* Events */
+.linked_events{
+	padding: 1em 0;
+}
+.edit_event{
+	margin: 0 1em;
+	vertical-align: middle;
+}
+/* Poll question */
+#poll{
+	overflow: hidden;
+}
+#poll .content{
+	padding: 0 1em;
+}
+h4#pollquestion{
+	padding: 0 0 0.5em 2em;
+}
+
+/* Poll vote options */
+#poll_options ul.options{
+	border-top: 1px solid #9999aa;
+	padding: 1em 2.5em 0 2em;
+	margin: 0 0 1em 0;
+}
+#poll_options div.submitbutton{
+	border-bottom: 1px solid #9999aa;
+	clear: both;
+	padding: 0 0 1em 2em;
+	margin: 0 0 1em 0;
+}
+
+/* Poll results */
+#poll_options dl.options{
+	border: solid #9999aa;
+	border-width: 1px 0;
+	padding: 1em 2.5em 1em 2em;
+	margin: 0 1em 1em 0;
+	line-height: 1.1em !important;
+}
+
+#poll_options dl.options dt{
+	padding: 0.3em 0;
+	width: 30%;
+	float: left;
+	margin: 0;
+	clear: left;
+}
+
+#poll_options dl.options .voted{
+	font-weight: bold;
+}
+
+#poll_options dl.options dd{
+	margin: 0 0 0 2em;
+	padding: 0.1em 0 0 0;
+	width: 60%;
+	max-width: 450px;
+	float: left;
+}
+
+#poll_options dl.options .percentage{
+	display: block;
+	float: right;
+	padding: 0.2em 0 0.3em 0;
+}
+
+/* Poll notices */
+#poll_options p{
+	margin: 0 1.5em 0.2em 1.5em;
+	padding: 0 0.5em 0.5em 0.5em;
+}
+
+div#pollmoderation{
+	margin: 0;
+	padding: 0;
+	overflow: auto;
+}
+
+/* onto the posts */
+#forumposts{
+	border-bottom-right-radius: 5px;
+	border-bottom-left-radius: 5px;
+	clear: both;
+	overflow: hidden;
+}
+#forumposts .cat_bar{
+	margin: 0 0 1px 0;
+}
+/* author and topic information */
+#forumposts h3 span#author{
+	margin: 0 7.7em 0 0;
+}
+#forumposts h3 img{
+	float: left;
+	margin: 4px 0.5em 0 0;
+}
+#forumposts h3.catbg{
+	margin-bottom: 3px;
+}
+p#whoisviewing{
+	margin: 0;
+	padding: 0.5em;
+        background: none repeat scroll 0% 0% #81A5C3;
+        padding: 0.1em 0.1em 0.1em 12px;
+        overflow: hidden;
+        margin-bottom: 1px;
+       /* border-bottom-left-radius: 5px;*/
+       /* border-bottom-right-radius: 5px;*/
+}
+/* poster and postarea + moderation area underneath */
+.post_wrapper{
+	float:left;
+	width:100%;
+}
+.poster{
+	float: left;
+	width: 15em;
+}
+.postarea, .moderatorbar{
+	margin: 0 0 0 16em;
+}
+.postarea div.flow_hidden{
+	width: 100%;
+}
+
+.moderatorbar{
+	clear: right;
+}
+/* poster details and list of items */
+.poster h4, .poster ul{
+	padding: 0;
+	margin: 0 1em 0 1.5em;
+}
+.poster h4{
+	margin: 0.2em 0 0.4em 1.1em;
+	font-size: 120%;
+}
+.poster h4, .poster h4 a{
+	color: #c06002;
+}
+.poster ul ul{
+	margin: 0.3em 1em 0 0;
+	padding: 0;
+}
+.poster ul ul li{
+	display: inline;
+}
+.poster li.stars, .poster li.avatar, .poster li.blurb, li.postcount, li.im_icons ul{
+	margin-top: 0.5em;
+}
+.poster li.avatar{
+	overflow: hidden;
+}
+.poster li.warning{
+	line-height: 1.2em;
+	padding-top: 1em;
+}
+.poster li.warning a img{
+	vertical-align: bottom;
+	padding: 0 0.2em;
+}
+.messageicon{
+	float: left;
+	margin: 0 0.5em 0 0;
+}
+.messageicon img{
+	padding: 6px 3px;
+}
+.keyinfo{
+	float: left;
+	width: 50%;
+}
+.modifybutton{
+	clear: right;
+	float: right;
+	margin: 6px 20px 10px 0;
+	text-align: right;
+	font: bold 0.85em arial, sans-serif;
+	color: #334466;	
+}
+
+/* The quick buttons */
+div.quickbuttons_wrap{
+	padding: 0.2em 0;
+	width: 100%;
+	float: left;
+}
+
+ul.quickbuttons{
+	margin: 0.9em 11px 0 0;
+	clear: right;
+	float: right;
+	text-align: right;
+	font: bold 0.85em arial, sans-serif;
+}
+ul.quickbuttons li{
+	float: left;
+	display: inline;
+	margin: 0 0 0 11px;
+}
+ul.quickbuttons li a{
+	padding: 0 0 0 20px;
+	display: block;
+	height: 20px;
+	line-height: 18px;
+	float: left;
+}
+ul.quickbuttons a:hover{
+	color: #a70;
+}
+ul.quickbuttons li.quote_button{
+	background: url(../images/theme/quickbuttons.png) no-repeat 0 0;
+}
+ul.quickbuttons li.remove_button{
+	background: url(../images/theme/quickbuttons.png) no-repeat 0 -30px;
+}
+ul.quickbuttons li.modify_button{
+	background: url(../images/theme/quickbuttons.png) no-repeat 0 -60px;
+}
+ul.quickbuttons li.approve_button{
+	background: url(../images/theme/quickbuttons.png) no-repeat 0 -90px;
+}
+ul.quickbuttons li.restore_button{
+	background: url(../images/theme/quickbuttons.png) no-repeat 0 -120px;
+}
+ul.quickbuttons li.split_button{
+	background: url(../images/theme/quickbuttons.png) no-repeat 0 -150px;
+}
+ul.quickbuttons li.reply_button{
+	background: url(../images/theme/quickbuttons.png) no-repeat 0 -180px;
+}
+ul.quickbuttons li.reply_all_button{
+	background: url(../images/theme/quickbuttons.png) no-repeat 0 -180px;
+}
+ul.quickbuttons li.notify_button{
+	background: url(../images/theme/quickbuttons.png) no-repeat 0 -210px;
+}
+ul.quickbuttons li.inline_mod_check{
+	margin: 0 0 0 5px;
+}
+
+.post{
+	margin-top: 0.5em;
+	clear: right;
+}
+.inner{
+	padding: 1em 1em 2px 0;
+	margin: 0 1em 0 0;
+	border-top: 1px solid #99a;
+}
+img.smiley{
+	vertical-align: bottom;
+}
+#forumposts .modified{
+	float: left;
+}
+#forumposts .reportlinks{
+	margin-right: 1.5em;
+	text-align: right;
+	clear: right;
+}
+#forumposts .signature, .post .signature{
+	margin: 1em 0 0 0;
+}
+#forumposts span.botslice{
+	clear: both;
+}
+.attachments hr{
+	clear: both;
+	margin: 1em 0 1em 0;
+}
+.attachments{
+	padding: 1em 0 2em 0;
+}
+.attachments div{
+	padding: 0 0.5em;
+}
+
+/* Styles for the quick reply area.
+---------------------------------------------------- */
+
+#quickreplybox{
+	padding-bottom: 1px;
+}
+#quickReplyOptions .roundframe{
+	padding: 0 10%;
+	color: black;
+}
+#quickReplyOptions form textarea{
+	height: 100px;
+	width: 635px;
+	max-width: 100%;
+	min-width: 100%;
+	margin: 0.25em 0 1em 0;
+}
+/* The jump to box */
+#display_jump_to{
+	clear: both;
+	padding: 5px;
+	margin-top: 6px;
+	text-align: right;
+}
+
+/* Separator of posts. More useful in the print stylesheet. */
+#forumposts .post_separator{
+	display: none;
+}
+
+/* Styles for edit post section
+---------------------------------------------------- */
+form#postmodify .roundframe{
+	padding: 0 12%;
+}
+#post_header, .postbox{
+	padding: 0.5em;
+	overflow: hidden;
+}
+#post_header dt, .postbox dt{
+	float: left;
+	padding: 0;
+	width: 15%;
+	margin: .5em 0 0 0;
+	font-weight: bold;
+}
+#post_header dd, .postbox dd{
+	float: left;
+	padding: 0;
+	width: 83%;
+	margin: .3em 0;
+}
+#post_header img{
+	vertical-align: middle;
+}
+ul.post_options{
+	margin: 0 0 0 1em;
+	padding: 0;
+	list-style: none;
+	overflow: hidden;
+}
+ul.post_options li{
+	margin: 0.2em 0;
+	width: 49%;
+	float: left;
+}
+#postAdditionalOptionsHeader{
+	margin-top: 1em;
+}
+#postMoreOptions{
+	border-bottom: 1px solid #cacdd3;
+	padding: 0.5em;
+}
+#postAttachment, #postAttachment2{
+	overflow: hidden;
+	margin: .5em 0;
+	padding: 0;
+	border-bottom: 1px solid #cacdd3;
+	padding: 0.5em;
+}
+#postAttachment dd, #postAttachment2 dd{
+	margin: .3em 0 .3em 1em;
+}
+#postAttachment dt, #postAttachment2 dt{
+	font-weight: bold;
+}
+#postAttachment3{
+	margin-left: 1em;
+}
+#post_confirm_strip, #shortcuts{
+	padding: 1em 0 0 0;
+}
+.post_verification{
+	margin-top: .5em;
+}
+.post_verification #verification_control{
+	margin: .3em 0 .3em 1em;
+}
+/* The BBC buttons */
+#bbcBox_message{
+	margin: 0.75em 0.5em;
+}
+#bbcBox_message div{
+	margin: 0.2em 0;
+	vertical-align: top;
+}
+#bbcBox_message div img{
+	margin: 0 1px 0 0;
+	vertical-align: top;
+}
+#bbcBox_message select{
+	margin: 0 2px;
+}
+/* The smiley strip */
+#smileyBox_message{
+	margin: 0.5em;
+}
+
+/* Styles for edit event section
+---------------------------------------------------- */
+#post_event .roundframe{
+	padding: 0 12%;
+}
+#post_event fieldset{
+	padding: 0.5em;
+	clear: both;
+}
+#post_event #event_main input{
+	margin: 0 0 1em 0;
+	float: left;
+}
+#post_event #event_main div.smalltext{
+	width: 33em;
+	float: right;
+}
+#post_event div.event_options{
+	float: right;
+}
+#post_event ul.event_main, ul.event_options{
+	padding: 0;
+	overflow: hidden;
+}
+#post_event ul.event_main li{
+	list-style-type: none;
+	margin: 0.2em 0;
+	width: 49%;
+	float: left;
+}
+#post_event ul.event_options{
+	margin: 0;
+	padding: 0 0 .7em .7em;
+}
+#post_event ul.event_options li{
+	list-style-type: none;
+	margin: 0;
+	float: left;
+}
+#post_event #event_main select, #post_event ul.event_options li select, #post_event ul.event_options li .input_check{
+	margin: 0 1em 0 0;
+}
+
+/* Styles for edit poll section.
+---------------------------------------------------- */
+
+#edit_poll{
+	overflow: hidden;
+}
+#edit_poll fieldset{
+	padding: 0.5em;
+	clear: both;
+	overflow: hidden;
+}
+#edit_poll fieldset input{
+	margin-left: 8.1em;
+}
+#edit_poll ul.poll_main li{
+	padding-left: 1em;
+}
+#edit_poll ul.poll_main input{
+	margin-left: 1em;
+}
+#edit_poll ul.poll_main, dl.poll_options{
+	overflow: hidden;
+	padding: 0 0 .7em .7em;
+	list-style: none;
+}
+#edit_poll ul.poll_main li{
+	margin: 0.2em 0;
+}
+#edit_poll dl.poll_options dt{
+	width: 33%;
+	padding: 0 0 0 1em;
+}
+#edit_poll dl.poll_options dd{
+	width: 65%;
+}
+#edit_poll dl.poll_options dd input{
+	margin-left: 0; 
+}
+
+/* Styles for the recent messages section.
+---------------------------------------------------- */
+
+#readbuttons_top .pagelinks, #readbuttons .pagelinks{
+	padding-bottom: 1em;
+	width: 60%;
+}
+#readbuttons .pagelinks{
+	padding-top: 1em;
+}
+#recent{
+	clear: both;
+	padding-bottom: 0;
+}
+#recent>div:last-child{
+	margin-bottom: 0;
+}
+
+/* Styles for the move topic section.
+---------------------------------------------------- */
+
+#move_topic dl{
+	margin-bottom: 0;
+}
+#move_topic dl.settings dt{
+	width: 40%;
+}
+#move_topic dl.settings dd{
+	width: 59%;
+}
+.move_topic{
+	width: 710px;
+	margin: auto;
+	text-align: left;
+}
+div.move_topic fieldset{
+	padding: 0.5em;
+}
+
+/* Styles for the send topic section.
+---------------------------------------------------- */
+
+fieldset.send_topic{
+	border: none;
+	padding: 0.5em;
+}
+dl.send_topic{
+	margin-bottom: 0;
+}
+dl.send_mail dt{
+	width: 35%;
+}
+dl.send_mail dd{
+	width: 64%;
+}
+
+/* Styles for the report topic section.
+---------------------------------------------------- */
+
+#report_topic dl{
+	margin-bottom: 0;
+}
+#report_topic dl.settings dt{
+	width: 20%;
+}
+#report_topic dl.settings dd{
+	width: 79%;
+}
+
+/* Styles for the split topic section.
+---------------------------------------------------- */
+
+div#selected, div#not_selected{
+	width: 49%;
+}
+ul.split_messages li.windowbg, ul.split_messages li.windowbg2{
+	margin: 1px;
+}
+ul.split_messages li a.split_icon{
+	padding: 0 0.5em;
+}
+ul.split_messages div.post{
+	padding: 1em 0 0 0;
+	border-top: 1px solid #fff;
+}
+
+/* Styles for the merge topic section.
+---------------------------------------------------- */
+ul.merge_topics li{
+	list-style-type: none;
+}
+dl.merge_topic dt{
+	width: 25%;
+}
+dl.merge_topic dd{
+	width: 74%;
+}
+fieldset.merge_options{
+	clear: both;
+}
+.custom_subject{
+	margin: 0.5em 0;
+}
+
+/* Styles for the login areas.
+------------------------------------------------------- */
+.login{
+	width: 540px;
+	margin: 0 auto;
+}
+.login dl{
+	overflow: auto;
+	clear: right;
+}
+.login dt, .login dd{
+	margin: 0 0 0.4em 0;
+	width: 44%;
+	padding: 0.1em;
+}
+.login dt{
+	float: left;
+	clear: both;
+	text-align: right;
+	font-weight: bold;
+}
+.login dd{
+	width: 54%;
+	float: right;
+	text-align: left;
+}
+.login p{
+	text-align: center;
+}
+
+/* Styles for the registration section.
+------------------------------------------------------- */
+.register_error{
+	border: 1px dashed red;
+	padding: 5px;
+	margin: 0 1ex 1ex 1ex;
+}
+.register_error span{
+	text-decoration: underline;
+}
+
+/* Additional profile fields */
+dl.register_form{
+	margin: 0;
+	clear: right;
+}
+
+dl.register_form dt{
+	font-weight: normal;
+	float: left;
+	clear: both;
+	width: 50%;
+	margin: 0.5em 0 0 0;
+}
+
+dl.register_form dt strong{
+	font-weight: bold;
+}
+
+dl.register_form dt span{
+	display: block;
+}
+
+dl.register_form dd{
+	float: left;
+	width: 49%;
+	margin: 0.5em 0 0 0;
+}
+
+#confirm_buttons{
+	text-align: center;
+	padding: 1em 0;
+}
+
+.coppa_contact{
+	padding: 4px;
+	width: 32ex;
+	background-color: #fff;
+	color: #000;
+	margin-left: 5ex;
+	border: 1px solid #000;
+}
+
+.valid_input{
+	background-color: #f5fff0;
+}
+.invalid_input{
+	background-color: #fff0f0;
+}
+
+/* Styles for maintenance mode.
+------------------------------------------------------- */
+#maintenance_mode{
+	width: 75%;
+	min-width: 520px;
+	text-align: left;
+}
+#maintenance_mode img.floatleft{
+	margin-right: 1em;
+}
+
+/* common for all admin sections */
+h3.titlebg img{
+	vertical-align: middle;
+	margin-right: 0.5em;
+	margin-top: -1px;
+}
+tr.titlebg td{
+	padding-left: 0.7em;
+}
+#admin_menu{
+	min-height: 2em;
+	padding-left: 0;
+}
+#admin_content{
+	clear: left;
+	padding-top: 0.5em;
+}
+/* Custom profile fields like to play with us some times. */
+#admin_content .custom_field{
+	margin-bottom: 15px;
+}
+#admin_login .centertext{
+	padding: 1em;
+	color: black;
+}
+#admin_login .centertext .error{
+	padding: 0 0 1em 0;
+}
+
+/* Styles for sidebar menus.
+------------------------------------------------------- */
+.left_admmenu, .left_admmenu ul, .left_admmenu li{
+	padding: 0;
+	margin: 0;
+	list-style: none;
+}
+#left_admsection{
+	width: 150px;
+	float: left;
+	margin-right: 10px;
+	background-color: #E7E7E7;
+	border-radius: 5px;
+	overflow: hidden;
+}
+.borderRadius,#live_news,#supportVersionsTable,#forumposts,#quickreplybox,#display_jump_to,.title_barIC,#admincenter>div.windowbg2.clear_right,#admincenter,#adm_submenus,#main_admsection,#postmodify>div.cat_bar,#preview_section,#recent,#quickreplybox>div.cat_bar,#memberlist>div.cat_bar,#mlist,#admincenter>div.cat_bar,#personal_messages>form[name=pmFolder]>div:first-child,#personal_messages>div.cat_bar{
+	border-radius: 5px;
+	overflow: hidden;
+}
+.borderRadiusBottom,#messagelist>div:last-child,#profileview>#basicinfo,#profileview>div:last-child{
+	border-bottom-right-radius: 5px;
+	border-bottom-left-radius: 5px;
+	overflow: hidden;
+}
+.borderRadiusTop,#personal_messages>form[name=pmFolder]>div.cat_bar,#profileview>div.cat_bar{
+	border-top-right-radius: 5px;
+	border-top-left-radius: 5px;
+	overflow: hidden;
+}
+.borderRadiusTopLeft{
+	border-top-left-radius: 5px;
+	overflow: hidden;
+}
+#admin_menu{
+	background: #E7E7E7;
+	color: black;
+	border-radius: 5px;
+}
+#admincenter{
+	padding-bottom: 5px;
+}
+.adm_section h4.titlebg{
+	font-size: 95%;
+	margin-bottom: 5px;
+}
+#main_container{
+	position: relative;
+}
+.left_admmenu li{
+	padding: 0 0 0 0.5em;
+}
+.left_admmenu{
+	margin-bottom: 0.5em;
+}
+#main_admsection{
+	position: relative;
+	left: 0;
+	right: 0;
+	overflow: hidden;
+}
+
+tr.windowbg td, tr.windowbg2 td, tr.approvebg td, tr.highlight2 td{
+	padding: 0.3em 0.7em;
+}
+#credits p{
+	padding: 0;
+	font-style: italic;
+	margin: 0;
+}
+
+/* Styles for generic tables.
+------------------------------------------------------- */
+.topic_table table{
+	width: 100%;
+}
+.topic_table .icon1, .topic_table .icon2, .topic_table .stats{
+	text-align: center;
+}
+#topic_icons{
+	margin: 1em 0 0 0;
+}
+#topic_icons .description{
+	margin: 0;
+}
+.topic_table table thead{
+	border-bottom: 1px solid #fff;
+}
+/* the subject column */
+.topic_table td{
+	font-size: 1em;
+}
+.topic_table td.subject p, .topic_table td.stats{
+	font-size: 0.85em;
+	padding: 0;
+	margin: 0;
+}
+.topic_table td.lastpost{
+	font-size: 0.85em;
+	line-height: 1.3em;
+	padding: 4px;
+}
+.topic_table td.stickybg2{
+	background-image: url(../images/icons/quick_sticky.gif);
+	background-repeat: no-repeat;
+	background-position: 98% 4px;
+}
+.topic_table td.lockedbg2{
+	background-image: url(../images/icons/quick_lock.gif);
+	background-repeat: no-repeat;
+	background-position: 98% 4px;
+}
+.topic_table td.locked_sticky2{
+	background-image: url(../images/icons/quick_sticky_lock.gif);
+	background-repeat: no-repeat;
+	background-position: 98% 4px;
+}
+.topic_table td.lastpost{
+	background-image: none;
+}
+
+/* Styles for (fatal) errors.
+------------------------------------------------- */
+
+#fatal_error{
+	width: 80%;
+	margin: auto;
+}
+
+.errorbox{
+	padding: 1em;
+	border: 1px solid #cc3344;
+	color: #000;
+	background-color: #ffe4e9;
+	margin-bottom: 1em;
+}
+.errorbox h3{
+	padding: 0;
+	margin: 0;
+	font-size: 1.1em;
+	text-decoration: underline;
+}
+.errorbox p{
+	margin: 1em 0 0 0;
+}
+.errorbox p.alert{
+	padding: 0;
+	margin: 0;
+	float: left;
+	width: 1em;
+	font-size: 1.5em;
+}
+
+/* Styles for the profile section.
+------------------------------------------------- */
+
+dl{
+	overflow: auto;
+	margin: 0;
+	padding: 0;
+}
+
+/* The basic user info on the left */
+#basicinfo{
+	width: 20%;
+	float: left;
+}
+#basicinfo .windowbg .content{
+	padding-left: 20px;
+}
+#detailedinfo{
+	width: 79.5%;
+	float: right;
+}
+#basicinfo h4{
+	font-size: 135%;
+	font-weight: 100;
+	line-height: 105%;
+	white-space: pre-wrap;
+	overflow: hidden;
+}
+#basicinfo h4 span.position{
+	font-size: 80%;
+	font-weight: 100;
+	display: block;
+}
+#basicinfo img.avatar{
+	display: block;
+	margin: 10px 0 0 0;
+}
+#basicinfo ul{
+	list-style-type: none;
+	margin: 10px 0 0 0;
+}
+#basicinfo ul li{
+	display: block;
+	float: left;
+	margin-right: 5px;
+	height: 20px;
+}
+#basicinfo span#userstatus{
+	display: block;
+	clear: both;
+}
+#basicinfo span#userstatus img{
+	vertical-align: middle;
+}
+#detailedinfo div.content dl, #tracking div.content dl{
+	clear: right;
+	overflow: auto;
+	margin: 0 0 18px 0;
+	padding: 0 0 15px 0;
+	border-bottom: 1px #ccc solid;
+}
+#detailedinfo div.content dt, #tracking div.content dt{
+	width: 35%;
+	float: left;
+	margin: 0 0 3px 0;
+	padding: 0;
+	font-weight: bold;
+	clear: both;
+}
+#detailedinfo div.content dd, #tracking div.content dd{
+	width: 65%;
+	float: left;
+	margin: 0 0 3px 0;
+	padding: 0;
+}
+#detailedinfo div.content dl.noborder{
+	border-bottom: 0;
+}
+#detailedinfo div.content dt.clear{
+	width: 100%;
+}
+.signature, .custom_fields_above_signature{
+	border-top: 1px #ccc solid;
+}
+.signature h5{
+	font-size: 0.85em;
+	margin-bottom: 10px;
+}
+#personal_picture{
+	display: block;
+	margin-bottom: 0.3em;
+}
+#avatar_server_stored div{
+	float: left;
+}
+#avatar_upload{
+	overflow: auto;
+}
+#main_admsection #basicinfo, #main_admsection #detailedinfo{
+	width: 100%;
+}
+#main_admsection #basicinfo h4{
+	float: left;
+	width: 35%;
+}
+#main_admsection #basicinfo img.avatar{
+	float: right;
+	vertical-align: top;
+}
+#main_admsection #basicinfo ul{
+	clear: left;
+}
+#main_admsection #basicinfo span#userstatus{
+	clear: left;
+}
+#main_admsection #basicinfo p#infolinks{
+	display: none;
+	clear: both;
+}
+#main_admsection #basicinfo .botslice{
+	clear: both;
+}
+
+/* Simple feedback messages */
+div#profile_error, div#profile_success{
+	margin: 0 0 1em 0;
+	padding: 1em 2em;
+	border: 1px solid;
+}
+div#profile_error{
+	border-color: red;
+	color: red;
+	background: #fee;
+}
+
+div#profile_error span{
+	text-decoration: underline;
+}
+
+div#profile_success{
+	border-color: green;
+	color: green;
+	background: #efe;
+}
+
+/* Profile statistics */
+#generalstats div.content dt{
+	width: 50%;
+	float: left;
+	margin: 0 0 3px 0;
+	padding: 0;
+	font-weight: bold;
+	clear: both;
+}
+#generalstats div.content dd{
+	width: 50%;
+	float: left;
+	margin: 0 0 3px 0;
+	padding: 0;
+}
+
+/* Activity by time */
+#activitytime{
+	margin: 6px 0;
+}
+.activity_stats{
+	margin: 0;
+	padding: 0;
+	list-style: none;
+}
+.activity_stats li{
+	margin: 0;
+	padding: 0;
+	width: 4.16%;
+	float: left;
+}
+.activity_stats li span{
+	display: block;
+	border: solid #000;
+	border-width: 1px 1px 0 0;
+	text-align: center;
+}
+.activity_stats li.last span{
+	border-right: none;
+}
+.activity_stats li div.bar{
+	margin: 0 auto;
+	width: 15px;
+}
+.activity_stats li div.bar div{
+	background: #6294CE;
+}
+.activity_stats li div.bar span{
+	position: absolute;
+	top: -1000em;
+	left: -1000em;
+}
+
+/* Most popular boards by posts and activity */
+#popularposts{
+	width: 49.5%;
+	float: left;
+}
+#popularactivity{
+	width: 49.5%;
+	float: right;
+}
+
+#popularposts div.content dt, #popularactivity div.content dt{
+	width: 65%;
+	float: left;
+	margin: 0 0 3px 0;
+	padding: 0;
+	font-weight: bold;
+	clear: both;
+}
+#popularposts div.content dd, #popularactivity div.content dd{
+	width: 35%;
+	float: left;
+	margin: 0 0 3px 0;
+	padding: 0;
+}
+
+.profile_pie{
+	background-image: url(../images/stats_pie.png);
+	float: left;
+	height: 20px;
+	width: 20px;
+	margin: 0 1em 0 0;
+	padding: 0;
+	text-indent: -1000em;
+}
+
+/* View posts */
+.topic .time{
+	float: right;
+}
+
+.counter{
+	margin: 0 0 0 0;
+	padding: 0.2em 0.5em 0.1em 0.2em;
+	font-size: 2.2em;
+	font-weight: bold;
+	color: #3f3f3f;
+	float: left;
+}
+.list_posts{
+	border-top: 2px solid #b3b3bf;
+	padding-top: 12px;
+	margin-top: 6px;
+	overflow: auto;
+}
+
+.topic h4{
+	margin: 3px 0;
+}
+
+.topic .post{
+	margin: 0 1em;
+	min-height: 80px;
+	height: auto !important;
+	height: 80px;
+}
+
+.topic .mod_icons{
+	text-align: right;
+	margin-right: 1em;
+}
+
+#tracking div.content dl{
+	border-bottom: 0;
+	margin: 0;
+	padding: 0;
+}
+
+#creator dl{
+	margin: 0;
+}
+#creator dt{
+	width: 40%;
+	float: left;
+	clear: both;
+	margin: 0 0 10px 0;
+}
+#creator dd{
+	float: right;
+	width: 55%;
+	margin: 0 0 10px 2px;
+	overflow: auto;
+}
+
+.ignoreboards{
+	margin: 0 2%;
+	padding: 0;
+	width: 45%;
+}
+.ignoreboards a{
+	font-weight: bold;
+	border-bottom: 1px solid #c4c4c4;
+	padding: 0.1em 0;
+}
+.ignoreboards a:hover{
+	text-decoration: none;
+	border-bottom: 1px solid #334466;
+}
+.ignoreboards ul{
+	margin: 0;
+	padding: 0;
+}
+.ignoreboards li{
+	list-style: none;
+	float: left;
+	clear: both;
+}
+.ignoreboards li.category{
+	margin: 0.7em 0 0 0;
+	width: 100%;
+}
+.ignoreboards li ul{
+	margin: 0.2em 0 0 0;
+}
+.ignoreboards li.category ul li.board{
+	width: 93%;
+}
+
+#theme_settings{
+	overflow: auto;
+	margin: 0;
+	padding: 0;
+}
+
+#theme_settings li{
+	list-style: none;
+	margin: 10px 0;
+	padding: 0;
+}
+/* Paid Subscriptions */
+#paid_subscription{
+	width: 100%;
+}
+#paid_subscription dl.settings{
+	margin-bottom: 0;
+}
+#paid_subscription dl.settings dd, #paid_subscription dl.settings dt{
+	margin-bottom: 4px;
+}
+/* Pick theme */
+#pick_theme{
+	width: 100%;
+	float: left;
+}
+/*Issue a warning*/
+#warn_body{
+	width: 80%;
+	font-size: 0.9em;
+}
+
+/* Styles for the statistics center.
+------------------------------------------------- */
+#statistics{
+	padding: 0.5em 0;
+}
+#statistics div.title_bar{
+	margin: 4px 0 -2px 0;
+}
+#statistics h3.catbg{
+	text-align: center;
+}
+#statistics div.content{
+	min-height: 210px;
+}
+#statistics div.top_row{
+	min-height: 150px;
+}
+#stats_left, #top_posters, #top_topics_replies, #top_topics_starter{
+	float: left;
+	width: 49.5%;
+}
+#stats_right, #top_boards, #top_topics_views, #most_online{
+	float: right;
+	width: 49.5%;
+}
+dl.stats{
+	clear: both;
+	overflow: hidden;
+	margin: 0;
+	padding: 0;
+}
+dl.stats dt{
+	width: 49%;
+	float: left;
+	margin: 0 0 4px 0;
+	line-height: 16px;
+	padding: 0;
+	clear: both;
+	font-size: 1em;
+}
+dl.stats dd{
+	text-align: right;
+	width: 50%;
+	font-size: 1em;
+	float: right;
+	margin: 0 0 4px 0;
+	line-height: 16px;
+	padding: 0;
+}
+.statsbar div.bar{
+	float: left;
+	background: url(../images/bar_stats.png) no-repeat;
+	display: block;
+	margin: 0 4px;
+	height: 16px;
+}
+.statsbar div.bar div{
+	position: relative;
+	right: -4px;
+	padding: 0 4px 0 0;
+	background: url(../images/bar_stats.png) no-repeat 100%;
+	height: 16px;
+}
+tr.windowbg2 th.stats_month{
+	width: 25%;
+	padding: 0 2em;
+	text-align: left;
+}
+tr.windowbg2 td.stats_day{
+	padding: 0 3.5em;
+	text-align: left;
+}
+
+/* Styles for the personal messages section.
+------------------------------------------------- */
+
+#personal_messages h3 span#author, #personal_messages h3 span#topic_title{
+	float: left;
+}
+#personal_messages h3 span#author{
+	margin: 0 0 0 0.5em;
+}
+#personal_messages h3 span#topic_title{
+	margin: 0 0 0 9em;
+}
+#personal_messages div.labels{
+	padding: 0 1em 0 0;
+}
+#personal_messages .capacity_bar{
+	background: #f0f4f7;
+	display: block;
+	margin: 0.5em 0 0 1em;
+	height: 1em;
+	border: 1px solid #adadad;
+	width: 10em;
+}
+#personal_messages .capacity_bar span{
+	border-right: 1px solid #adadad;
+	display: block;
+	height: 1em;
+}
+#personal_messages .capacity_bar span.empty{
+	background: #a6d69d;
+}
+#personal_messages .capacity_bar span.filled{
+	background: #eea800;
+}
+#personal_messages .capacity_bar span.full{
+	background: #f10909;
+}
+#personal_messages .reportlinks{
+	padding: 0.5em 1.3em;
+}
+#searchLabelsExpand li{
+	padding: 0.3em 0.5em;
+}
+#manrules div.righttext{
+	padding: 0.3em 0.1em;
+}
+dl.addrules dt.floatleft{
+	width: 15em;
+	color: #333;
+	padding: 0 1.25em 0.5em 1.25em;
+}
+#addrule fieldset{
+	clear: both;
+}
+
+/* Styles for the calendar section.
+------------------------------------------------- */
+.calendar_table{
+	margin-bottom: 0.7em;
+}
+
+/* Used to indicate the current day in the grid. */
+.calendar_today{
+	background-color: #fff;
+}
+
+#month_grid{
+	width: 200px;
+	text-align: center;
+	float: left;
+}
+#month_grid div.cat_bar{
+	height: 25px;
+}
+#month_grid h3.catbg{
+	height: 25px;
+	line-height: 27px;
+}
+#month_grid table{
+	width: 200px;
+}
+#main_grid table{
+	width: 100%;
+	padding-bottom: 4px;
+}
+#main_grid table h3.catbg{
+	text-align: center;
+	height: 29px;
+	border-top: 2px solid #fff;
+	border-bottom: none;
+}
+#main_grid table.weeklist td.windowbg{
+	text-align: center;
+	height: 49px;
+	width: 25px;
+	font-size: large;
+	padding: 0 7px;
+	border-bottom: 2px solid #fff;
+}
+#main_grid table.weeklist td.weekdays{
+	height: 49px;
+	width: 100%;
+	padding: 4px;
+	text-align: left;
+	vertical-align: middle;
+	border-bottom: 2px solid #fff;
+}
+#main_grid h3.weekly{
+	text-align: center;
+	padding-left: 0;
+	font-size: large;
+	height: 29px;
+}
+#main_grid h3 span.floatleft, #main_grid h3 span.floatright{
+	display: block;
+	font-weight: bold;
+}
+#main_grid table th.days{
+	width: 14%;
+	padding: 4px 0;
+}
+#main_grid table.weeklist h4.titlebg{
+	margin: 0 0 0 0;
+	height: 23px;
+	line-height: 27px;
+}
+#main_grid table td.weeks{
+	vertical-align: middle;
+	text-align: center;
+	font-weight: bold;
+	font-size: large;
+}
+#main_grid table td.days{
+	vertical-align: top;
+	text-align: center;
+}
+
+a.modify_event{
+	color: red;
+}
+
+span.hidelink{
+	font-style: italic;
+}
+
+#calendar_navigation{
+	text-align: center;
+}
+
+/* Styles for the memberlist section.
+------------------------------------------------- */
+#mlist_search{
+	margin: auto;
+	width: 500px;
+}
+
+/* Styles for the basic search section.
+------------------------------------------------- */
+#searchform, #simple_search p{
+	padding: 0.5em;
+	margin: 0;
+}
+#simple_search, #simple_search p, #advanced_search{
+	text-align: center !important;
+	margin: 0;
+}
+#search_error{
+	font-style: italic;
+	padding: 0.3em 1em;
+}
+#search_term_input{
+	font-size: 115%;
+	margin: 0 0 1em;
+}
+
+/* Styles for the advanced search section.
+------------------------------------------------- */
+#searchform fieldset{
+	text-align: left;
+	padding: 0;
+	border: none;
+}
+#advanced_search dl#search_options{
+	margin: 0 auto;
+	width: 600px;
+	padding-top: 1em;
+	overflow: hidden;
+}
+#advanced_search dt{
+	clear: both;
+	float: left;
+	padding: 0.2em;
+	text-align: right;
+	width: 20%;
+}
+#advanced_search dd{
+	width: 75%;
+	float: left;
+	padding: 0.2em;
+	margin: 0 0 0 0.5em;
+	text-align: left;
+}
+#searchform p.clear{
+	clear: both;
+}
+
+/* Styles for the search results page.
+------------------------------------------------- */
+.topic_table td blockquote, .topic_table td .quoteheader{
+	margin: 0.5em;
+}
+.search_results_posts{
+	overflow: hidden;
+}
+.search_results_posts .buttons{
+	padding: 5px 1em 0 0;
+}
+
+/* Styles for the help section.
+------------------------------------------------- */
+
+#help_container{
+	margin: 4px 0 0 0;
+	padding: 0 0 8px 0;
+}
+#helpmain{
+	padding: 0 1em;
+}
+#helpmain p{
+	margin: 0 0 1.5em 0;
+	line-height: 1.5em;
+}
+#helpmain ul{
+	line-height: 1.5em;
+}
+
+/* Styles for print media.
+------------------------------------------------------- */
+@media print{
+	#headerarea
+	{
+		display: none;
+	}
+
+	.tborder
+	{
+		border: none;
+	}
+}
+.floatRight{
+	float: right;
+}
+.floatLeft{
+	float: left;
+}
+.clear{
+	clear: both;
+}
+.clearRight{
+	clear: right;
+}
+.clearLeft{
+	clear: left;
+}
+#moreNewsItems_link a{
+	color: #ADD8E6;
+}

+ 866 - 0
css/rtl.css

@@ -0,0 +1,866 @@
+/* Common classes to ease styling.
+------------------------------------------------------- */
+
+.floatright{
+	float: left;
+}
+.floatleft{
+	float: right;
+}
+.clear_left{
+	clear: right;
+}
+.clear_right{
+	clear: left;
+}
+.righttext{
+	margin-left: auto;
+	margin-right: 0;
+	text-align: left;
+}
+.lefttext{
+	margin-left: 0;
+	margin-right: auto;
+	text-align: right;
+}
+
+/* Styling for BBC tags */
+.bbc_list{
+	text-align: right;
+}
+
+/* GenericList */
+.additional_row input{
+	margin-left: 0;
+	margin-right: 1em;
+}
+/* All the signatures used in the forum.  If your forum users use Mozilla, Opera, or Safari, you might add max-height here ;). */
+.signature, .attachments{
+	clear: left;
+}
+.custom_fields_above_signature{
+	clear: left;
+}
+.openid_login{
+	padding-right: 18px;
+	padding-left: 0;
+}
+
+/* Lists with settings use these a lot.
+------------------------------------------------------- */
+dl.settings{
+	clear: left;
+}
+dl.settings dt{
+	float: right;
+	clear: both;
+}
+dl.settings dt.windowbg{
+	float: right;
+}
+dl.settings dd{
+	float: left;
+}
+dl.settings img{
+	margin: 0 0 0 10px;
+}
+
+/* Styles for rounded headers.
+------------------------------------------------------- */
+
+h3.catbg img.icon, h4.titlebg img.icon{
+	vertical-align: middle;
+	margin: -2px 0 0 5px;
+}
+h4.titlebg, h3.titlebg{
+	padding-right: 9px;
+	padding-left: 0;
+}
+h4.titlebg img.icon{
+	float: right;
+	margin: 5px 0 0 8px;
+}
+
+table.table_list a.unreadlink, table.table_list a.collapse{
+	float: left;
+}
+table.table_list a.collapse{
+	margin: 10px 1em 0 5px;
+}
+.table_grid th.first_th, tr.catbg th.first_th{
+	background: #a8bace url(../images/theme/main_block.png) no-repeat 100% -240px;
+}
+.table_grid th.last_th, tr.catbg th.last_th{
+	background: #a8bace url(../images/theme/main_block.png) no-repeat 0 -240px;
+}
+tr.titlebg th.first_th{
+	background: #e3e9ef url(../images/theme/main_block.png) no-repeat 100% -340px;
+}
+tr.titlebg th.last_th{
+	background: #e3e9ef url(../images/theme/main_block.png) no-repeat 0 -340px;
+}
+
+/* Styles for the standard dropdown menus.
+------------------------------------------------------- */
+#main_menu{
+	padding: 0 0.5em;
+	float: right;
+	text-align: right;
+}
+.dropmenu li{
+	float: right;
+	margin: 0 0 0 8px;
+}
+.dropmenu li ul ul{
+	right: 15em;
+}
+.dropmenu li ul{
+	background: url(../images/theme/menu_gfx.png) 100% -130px no-repeat;
+	right: 5px;
+}
+
+/* The dropdown menu toggle image */
+#menu_toggle{
+	float: left;
+	margin-right: 0;
+	margin-left: 10px;
+	padding-top: 3px;
+}
+#menu_toggle span{
+	position: relative;
+	left: 0;
+}
+
+/* Styles for the standard button lists.
+------------------------------------------------------- */
+.buttonlist ul{
+	margin: 0 0 0 0.2em;
+}
+.buttonlist ul li a{
+	margin-left: 0;
+	margin-right: 12px;
+}
+.buttonlist ul li a span{
+	left: 8px;
+}
+.align_top ul li a, .align_bottom ul li a{
+	margin: 0 0 0 12px;
+}
+#adm_submenus{
+	padding-left: 0;
+	padding-right: 2em;
+}
+/* the main title, always stay at 45 pixels in height! */
+h1.forumtitle{
+	float: right;
+}
+/* float these items to the left */
+#siteslogan, img#logo{
+	float: left;
+}
+/* the upshrink image needs some tweaking */
+img#upshrink{
+	float: left;
+}
+/* ..so does the SMF logo */
+img#logo{
+	margin-right: 1em;
+}
+#upper_section div.news{
+	float: left;
+	text-align: left;
+}
+div#upper_section div.user{
+	float: right;
+}
+div#upper_section div.user p{
+	float: right;
+	margin: 0 0 1em 1em;
+}
+div#upper_section div.user ul{
+	padding-left: 0;
+	padding-right: 10px;
+}
+
+/* The navigation list (i.e. linktree) */
+.navigate_section ul li{
+	float: right;
+	padding: 0 0 0 0.5em;
+}
+
+/* Styles for the board index.
+------------------------------------------------- */
+
+/* the posting icons */
+#posting_icons{
+	padding: 0 1em 0.5em 1em;
+}
+#posting_icons img{
+	margin: 0 4ex 0 0;
+}
+#posting_icons .buttonlist{
+	float: left;
+}
+#postbuttons_upper ul li a span{
+	line-height: 19px;
+	padding: 0 6px 0 0;
+}
+
+dl#ic_recentposts dt{
+	float: right;
+}
+dl#ic_recentposts dd{
+	text-align: left;
+}
+form#ic_login ul li{
+	float: right;
+	width: 20%;
+}
+
+/* the small stats */
+#index_common_stats{
+	text-align: left;
+}
+img#upshrink_ic, img#newsupshrink{
+	float: right;
+	margin: 10px 0 0 5px;
+}
+
+/* Styles for the message (topic) index.
+---------------------------------------------------- */
+.table_frame .table_list td.icon, .table_frame .table_list td.info, .table_frame .table_list td.stats{
+	border-right: none;
+	border-left: 2px solid white;
+}
+.lastpost img{
+	float: left;
+}
+
+/* Styles for the display template (topic view).
+---------------------------------------------------- */
+#postbuttons div.buttons{
+	float: right;
+}
+#postbuttons span{
+	text-align: left;
+}
+#postbuttons span.lower{
+	clear: left;
+}
+#postbuttons .buttonlist{
+	float: left;
+}
+
+h4#pollquestion{
+	padding: 0.5em 2em 0.5em 0;
+}
+/* Poll vote options */
+#poll_options ul.options{
+	padding: 1em 2em 0 2.5em;
+	margin: 0 0 1em 0;
+}
+#poll_options div.submitbutton{
+	clear: both;
+	padding: 0 2em 1em 0;
+	margin: 0 0 1em 0;
+}
+
+/* Poll results */
+#poll_options dl.options{
+	padding: 1em 2em 1em 2.5em;
+	margin: 0 0 1em 1em;
+}
+#poll_options dl.options dt{
+	float: right;
+	clear: right;
+}
+#poll_options dl.options dd{
+	margin: 0 2em 0 0;
+	float: right;
+}
+span.percent{
+	float: left;
+}
+
+/* author and topic information */
+#forumposts h3 span#author{
+	margin: 0 0 0 7.7em;
+}
+#forumposts h3 img{
+	float: right;
+	margin: 4px 0 0 0.5em;
+}
+/* poster and postarea + moderation area underneath */
+.poster{
+	float: right;
+	width: 15em;
+}
+.postarea, .moderatorbar{
+	margin: 0 16em 0 0;
+}
+.moderatorbar{
+	clear: left;
+}
+/* poster details and list of items */
+.poster h4, .poster ul{
+	padding: 0;
+	margin: 0 1.5em 0 1em;
+}
+.poster h4{
+	margin: 0.2em 1.1em 0.4em 0;
+}
+.poster ul ul{
+	margin: 0.3em 0 0 1em;
+}
+.messageicon{
+	float: right;
+	margin: 0 0 0 0.5em;
+}
+
+.keyinfo{
+	float: right;
+}
+.modifybutton{
+	clear: left;
+	float: left;
+	margin: 8px 0 10px 20px;
+	text-align: left;
+}
+
+/* The quick buttons */
+ul.quickbuttons{
+	margin: 0.9em 0 0 11px;
+	clear: left;
+	float: left;
+	text-align: left;
+}
+ul.quickbuttons li{
+	float: left;
+	margin: 0 11px 0 0;
+}
+ul.quickbuttons li a{
+	padding: 0 20px 0 0;
+	float: left;
+}
+ul.quickbuttons li.quote_button{
+	background-position: 100% 0;
+}
+ul.quickbuttons li.remove_button{
+	background-position: 100% -30px;
+}
+ul.quickbuttons li.modify_button{
+	background-position: 100% -60px;
+}
+ul.quickbuttons li.approve_button{
+	background-position: 100% -90px;
+}
+ul.quickbuttons li.restore_button{
+	background-position: 100% -120px;
+}
+ul.quickbuttons li.split_button{
+	background-position: 100% -150px;
+}
+ul.quickbuttons li.reply_button{
+	background-position: 100% -180px;
+}
+ul.quickbuttons li.reply_all_button{
+	background-position: 100% -180px;
+}
+ul.quickbuttons li.notify_button{
+	background-position: 100% -210px;
+}
+ul.quickbuttons li.inline_mod_check{
+	margin: 0 5px 0 0;
+}
+.post{
+	clear: left;
+}
+.inner{
+	padding: 1em 0 0 1em;
+	margin: 0 0 0 1em;
+}
+#forumposts .modified{
+	float: right;
+}
+#forumposts .reportlinks{
+	margin-left: 1.5em;
+	text-align: left;
+	clear: left;
+}
+
+#moderationbuttons_strip{
+	float: right;
+}
+#moderationbuttons_strip ul{
+	margin: 0 0.2em 0 0;
+	padding: 0 1em 0 0;
+}
+/* The jump to box */
+#display_jump_to{
+	text-align: left;
+}
+
+/* Styles for edit post section
+---------------------------------------------------- */
+#post_header dt{
+	float: right;
+}
+#post_header dd{
+	float: right;
+}
+ul.post_options{
+	margin: 0 1em 0 0;
+}
+ul.post_options li{
+	float: right;
+}
+#postAttachment dd, #postAttachment2 dd{
+	margin: .3em 1em .3em 0;
+}
+#postAttachment dt, #postAttachment2 dt{
+	font-weight: bold;
+}
+#postAttachment3{
+	margin-left: 0;
+	margin-left: 1em;
+}
+.post_verification #verification_control{
+	margin: .3em 1em .3em 0;
+}
+
+/* Styles for edit event section
+---------------------------------------------------- */
+#post_event div.event_options{
+	float: left;
+}
+#post_event #event_main input{
+	margin: 0 0 1em 0;
+	float: right;
+}
+#post_event #event_main div.smalltext{
+	float: left;
+}
+#post_event ul.event_main li{
+	float: left;
+}
+#post_event ul.event_options{
+	padding: 0 .7em .7em 0;
+}
+#post_event #event_main select, #post_event ul.event_options li select, #post_event ul.event_options li .input_check{
+	margin: 0 0 0 1em;
+}
+
+/* Styles for edit poll section.
+---------------------------------------------------- */
+
+#edit_poll fieldset input{
+	margin-right: 7em;	
+}
+#edit_poll ul.poll_main li{
+	padding-right: 1em;
+}
+#edit_poll ul.poll_main input{
+	margin-right: 1em;
+}
+#edit_poll div.poll_options{
+	float: right;
+}
+#edit_poll ul.poll_main, dl.poll_options{
+	padding: 0 .7em 0 0;
+}
+#edit_poll dl.poll_options dt{
+	padding: 0 1em 0 0;
+}
+#edit_poll dl.poll_options dd input{
+	margin-right: 0; 
+}
+
+/* Styles for the personal messages section.
+------------------------------------------------- */
+
+#personal_messages h3 span#author, #personal_messages h3 span#topic_title{
+	float: right;
+}
+#personal_messages h3 span#author{
+	margin: 0 0.5em 0 0;
+}
+#personal_messages h3 span#topic_title{
+	margin: 0 9em 0 0;
+}
+#personal_messages .labels{
+	padding: 0 0 0 1em;
+}
+
+/* Styles for the move topic section.
+---------------------------------------------------- */
+.move_topic{
+	text-align: right;
+}
+/* Styles for the login areas.
+------------------------------------------------------- */
+.login dt{
+	float: right;
+}
+.login dd{
+	float: right;
+	text-align: right;
+}
+.login h3 img{
+	margin: 0 0 0.5em;
+}
+
+/* Additional profile fields */
+dl.register_form{
+	clear: left;
+}
+
+dl.register_form dt{
+	float: right;
+}
+/* Styles for maintenance mode.
+------------------------------------------------------- */
+#maintenance_mode{
+	text-align: right;
+}
+#maintenance_mode img.floatleft{
+	margin-left: 1em;
+}
+/* common for all admin sections */
+h3.titlebg img{
+	margin-left: 0.5em;
+}
+tr.titlebg td{
+	padding-right: 0.7em;
+}
+#admin_menu{
+	padding-right: 0;
+}
+#admin_content{
+	clear: right;
+}
+/* Styles for sidebar menus.
+------------------------------------------------------- */
+#left_admsection{
+	float: right;
+	padding-right: 0;
+	padding-left: 10px;
+}
+.left_admmenu li{
+	padding: 0 0.5em 0 0;
+}
+/* Styles for generic tables.
+------------------------------------------------------- */
+.topic_table td.stickybg2{
+	background-image: url(../images/icons/quick_sticky.gif);
+	background-repeat: no-repeat;
+	background-position: 2% 4px;
+}
+.topic_table td.lockedbg2{
+	background-image: url(../images/icons/quick_lock.gif);
+	background-repeat: no-repeat;
+	background-position: 2% 4px;
+}
+.topic_table td.locked_sticky2{
+	background-image: url(../images/icons/quick_sticky_lock.gif);
+	background-repeat: no-repeat;
+	background-position: 2% 4px;
+}
+.topic_table td.lastpost{
+	background-image: none;
+}
+/* Styles for (fatal) errors.
+------------------------------------------------- */
+.errorbox p.alert{
+	float: right;
+}
+/* Styles for the profile section.
+------------------------------------------------- */
+#basicinfo{
+	float: right;
+}
+#detailedinfo{
+	float: left;
+}
+#basicinfo ul li{
+	float: right;
+	margin-right: 0;
+	margin-left: 5px;
+}
+#detailedinfo div.content dl, #tracking div.content dl{
+	clear: left;
+}
+#detailedinfo div.content dt, #tracking div.content dt{
+	float: right;
+}
+#detailedinfo div.content dd, #tracking div.content dd{
+	float: right;
+}
+#avatar_server_stored div{
+	float: right;
+}
+
+#main_admsection #basicinfo h4{
+	float: right;
+}
+#main_admsection #basicinfo img.avatar{
+	float: left;
+}
+#main_admsection #basicinfo ul{
+	clear: right;
+}
+#main_admsection #basicinfo span#userstatus{
+	clear: right;
+}
+
+/* Profile statistics */
+#generalstats div.content dt{
+	float: right;
+}
+#generalstats div.content dd{
+	float: right;
+}
+
+/* Activity by time */
+#activitytime{
+	clear: right;
+}
+.activity_stats li{
+	float: right;
+}
+.activity_stats li span{
+	border-width: 1px 0 0 1px;
+}
+.activity_stats li.last span{
+	border-left: none;
+}
+
+/* Most popular boards by posts and activity */
+#popularposts{
+	float: right;
+}
+#popularactivity{
+	float: left;
+}
+
+#popularposts div.content dt, #popularactivity div.content dt{
+	float: right;
+}
+#popularposts div.content dd, #popularactivity div.content dd{
+	float: right;
+}
+
+.profile_pie{
+	background-image: url(../images/stats_pie_rtl.png);
+	float: right;
+	margin-right: 0;
+	margin-left: 1em;
+}
+
+/* View posts */
+.topic .time{
+	float: left;
+}
+.counter{
+	padding: 0.2em 0.2em 0.1em 0.5em;
+	float: right;
+}
+.topic .mod_icons{
+	text-align: left;
+	margin-right: 0;
+	margin-left: 1em;
+}
+#permissions div.permission_name{
+	margin: 0 0 0 1%;
+}
+
+#ip_list li.header, #ip_list li.ip{
+	float: right;
+}
+#creator dt{
+	float: right;
+}
+#creator dd{
+	float: right;
+}
+
+.ignoreboards ul{
+	margin: 0 1em 0 0;
+}
+.ignoreboards li{
+	float: right;
+}
+
+#pick_theme{
+	float: right;
+}
+/* Styles for the statistics center.
+------------------------------------------------- */
+#stats_left, #top_posters, #top_topics_replies, #top_topics_starter{
+	float: right;
+}
+#stats_right, #top_boards, #top_topics_views, #most_online{
+	float: left;
+}
+dl.stats dt{
+	float: right;
+}
+dl.stats dd{
+	text-align: left;
+}
+.statsbar div.bar{
+	float: right;
+}
+.statsbar div.bar div{
+	right: -6px;
+	padding: 0 0 0 6px;
+}
+tr.windowbg2 th.stats_month, tr.windowbg2 td.stats_day{
+	text-align: right;
+}
+
+/* Styles for the calendar section.
+------------------------------------------------- */
+#month_grid{
+	float: right;
+}
+
+#main_grid table.weeklist td.windowbg{
+
+	border-left: 2px solid #fff;
+	border-bottom: 2px solid #fff;
+}
+
+#main_grid table.weeklist td.weekdays{
+	text-align: left;
+	vertical-align: middle;
+	border-right: 2px solid #fff;
+	border-bottom: 2px solid #fff;
+}
+
+/* Styles for the advanced search section.
+------------------------------------------------- */
+#searchform fieldset{
+	text-align: right;
+}
+#advanced_search dt{
+	float: right;
+	text-align: left;
+}
+#advanced_search dd{
+	float: right;
+	margin: 0 0.5em 0 0;
+	text-align: right;
+}
+/* Boards picker */
+#searchform fieldset div#searchBoardsExpand ul{
+	margin: 0 1em 0 0;
+}
+#searchform fieldset div#searchBoardsExpand li{
+	float: right;
+}
+#searchform fieldset p{
+	text-align: right;
+}
+
+.search_results_posts .buttons{
+	padding: 5px 0 0 1em;
+}
+
+/* Styles for the help section.
+------------------------------------------------- */
+#helpmain h3.section{
+	padding: 0 0.5em 0.5em 0;
+}
+/* put back the bullets please */
+#helpmain ul{
+	margin: 0 2em 1em 0;
+	padding-left: 0;
+	padding-right: 1em;
+}
+#helpmain #messageindex{
+	clear: left;
+}
+/* Styles for the admincenter (reverse admin.css).
+------------------------------------------------- */
+#quick_search{
+	margin-left: 5px;
+}
+.features_image{
+	float: right;
+	margin: 0 1em 0.5em 2em;
+}
+.features_switch{
+	float: left;
+}
+.features h4{
+	padding: 1em 0.5em 0.5em 0;
+}
+/* admin home */
+#live_news div.content dl{
+	padding: 0.5em 0.5em 0 0;
+}
+#smfAnnouncements dd{
+	padding: 0;
+	margin: 0 1.5em 1em 0;
+}
+#quick_tasks li{
+	float: right;
+	list-style-type: none;
+}
+.home_image{
+	float: right;
+}
+/* common admin classes */
+.additional_row input{
+	margin-left: 0;
+	margin-right: 2em;
+}
+#error_log td div.marginleft{
+	margin: 0 1ex 0 0 !important;
+}
+
+/* Styles for the package manager.
+------------------------------------------------- */
+#package_list .tborder{
+	margin: .25em 26px .25em 0;
+}
+#package_list ol, #package_list ol li{
+	margin-left: 0;
+	margin-right: 50px;
+}
+/* ManageBoards */
+#manage_boards ul{
+	overflow: hidden;
+}
+#manage_boards li{
+	overflow: hidden;
+}
+.move_links{
+	padding: 0 0 0 13px;
+}
+
+span.search_weight{
+	text-align: left;
+}
+/* Manage Bans */
+.ban_restriction{
+	margin: 0.2em 2.2em 0.2em 0;
+}
+/* Themes */
+.is_directory{
+	padding-right: 18px;
+	background: url(../images/admin/boards.gif) no-repeat;
+	background-position: 100% 0;
+}
+/* Styles for the moderation center.
+------------------------------------------------- */
+.modblock_left{
+	float: right;
+	clear: left;
+}
+.modblock_right{
+	float: left;
+}
+ul.moderation_notes li{
+	padding: 4px 4px 4px 0;
+}

BIN
images/Female.gif


BIN
images/Male.gif


BIN
images/OneallSocialLogin.providers.png


BIN
images/admin/administration.gif


BIN
images/admin/attachment.gif


BIN
images/admin/ban.gif


BIN
images/admin/boards.gif


BIN
images/admin/calendar.gif


BIN
images/admin/change_menu.png


BIN
images/admin/change_menu2.png


BIN
images/admin/corefeatures.gif


BIN
images/admin/current_theme.gif


BIN
images/admin/engines.gif


BIN
images/admin/feature_cd.png


BIN
images/admin/feature_cp.png


BIN
images/admin/feature_dp.png


BIN
images/admin/feature_k.png


BIN
images/admin/feature_ml.png


BIN
images/admin/feature_pm.png


BIN
images/admin/feature_ps.png


BIN
images/admin/feature_rg.png


BIN
images/admin/feature_sp.png


BIN
images/admin/feature_w.png


BIN
images/admin/features.gif


BIN
images/admin/features_and_options.png


BIN
images/admin/forum_maintenance.png


BIN
images/admin/ignore.gif


+ 9 - 0
images/admin/index.php

@@ -0,0 +1,9 @@
+<?php
+
+// Try to handle it with the upper level index.php. (it should know what to do.)
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
+	include (dirname(dirname(__FILE__)) . '/index.php');
+else
+	exit;
+
+?>

BIN
images/admin/languages.gif


BIN
images/admin/logs.gif


BIN
images/admin/mail.gif


BIN
images/admin/maintain.gif


BIN
images/admin/membergroups.gif


BIN
images/admin/members.gif


BIN
images/admin/members.png


BIN
images/admin/modifications.gif


BIN
images/admin/news.gif


BIN
images/admin/package_ops.gif


BIN
images/admin/packages.gif


BIN
images/admin/packages.png


BIN
images/admin/paid.gif


BIN
images/admin/permissions.gif


BIN
images/admin/permissions.png


BIN
images/admin/post_moderation_allow.gif


BIN
images/admin/post_moderation_deny.gif


BIN
images/admin/post_moderation_moderate.gif


BIN
images/admin/posts.gif


BIN
images/admin/regcenter.gif


BIN
images/admin/reports.gif


BIN
images/admin/scheduled.gif


BIN
images/admin/search.gif


BIN
images/admin/security.gif


BIN
images/admin/server.gif


BIN
images/admin/smiley.gif


BIN
images/admin/smilies_and_messageicons.png


BIN
images/admin/subsection.gif


BIN
images/admin/support.gif


BIN
images/admin/support_and_credits.png


BIN
images/admin/switch_off.png


BIN
images/admin/switch_on.png


BIN
images/admin/tapatalk_settings.png


BIN
images/admin/themes.gif


BIN
images/admin/themes_and_layout.png


BIN
images/aim.gif


BIN
images/bar_stats.png


BIN
images/bbc/badbehavior_bbc.gif


BIN
images/bbc/bbc_bg.gif


BIN
images/bbc/bbc_hoverbg.gif


BIN
images/bbc/bold.gif


BIN
images/bbc/center.gif


BIN
images/bbc/code.gif


BIN
images/bbc/divider.gif


BIN
images/bbc/email.gif


BIN
images/bbc/flash.gif


BIN
images/bbc/ftp.gif


BIN
images/bbc/glow.gif


BIN
images/bbc/hr.gif


BIN
images/bbc/img.gif


+ 9 - 0
images/bbc/index.php

@@ -0,0 +1,9 @@
+<?php
+
+// Try to handle it with the upper level index.php. (it should know what to do.)
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
+	include (dirname(dirname(__FILE__)) . '/index.php');
+else
+	exit;
+
+?>

BIN
images/bbc/italicize.gif


BIN
images/bbc/left.gif


BIN
images/bbc/list.gif


BIN
images/bbc/move.gif


BIN
images/bbc/orderlist.gif


BIN
images/bbc/pre.gif


BIN
images/bbc/quote.gif


BIN
images/bbc/resize-handle.gif


BIN
images/bbc/right.gif


BIN
images/bbc/shadow.gif


BIN
images/bbc/strike.gif


BIN
images/bbc/sub.gif


BIN
images/bbc/sup.gif


BIN
images/bbc/table.gif


BIN
images/bbc/tele.gif


BIN
images/bbc/toggle.gif


Some files were not shown because too many files changed in this diff