فهرست منبع

Merge branch 'release-2.1' of git://github.com/SimpleMachines/SMF2.1.git into avatar_stuff

Suki 10 سال پیش
والد
کامیت
b524694cbb
100فایلهای تغییر یافته به همراه1053 افزوده شده و 720 حذف شده
  1. 1 1
      README.md
  2. 15 15
      SSI.php
  3. 1 1
      Sources/Admin.php
  4. 2 0
      Sources/Class-Package.php
  5. 43 26
      Sources/Load.php
  6. 2 2
      Sources/ManageAttachments.php
  7. 1 1
      Sources/ManageMail.php
  8. 4 4
      Sources/ManageMaintenance.php
  9. 1 1
      Sources/ManageMembergroups.php
  10. 1 1
      Sources/ManagePosts.php
  11. 1 1
      Sources/ManageRegistration.php
  12. 3 3
      Sources/ManageServer.php
  13. 9 9
      Sources/ManageSettings.php
  14. 5 5
      Sources/ManageSmileys.php
  15. 2 2
      Sources/Memberlist.php
  16. 3 3
      Sources/MessageIndex.php
  17. 76 63
      Sources/ModerationCenter.php
  18. 4 2
      Sources/Modlog.php
  19. 10 33
      Sources/MoveTopic.php
  20. 2 2
      Sources/News.php
  21. 1 1
      Sources/PackageGet.php
  22. 2 2
      Sources/Packages.php
  23. 1 1
      Sources/PersonalMessage.php
  24. 3 3
      Sources/Post.php
  25. 16 17
      Sources/Profile-Modify.php
  26. 1 1
      Sources/Recent.php
  27. 2 2
      Sources/Register.php
  28. 1 1
      Sources/RemoveTopic.php
  29. 2 2
      Sources/ScheduledTasks.php
  30. 14 73
      Sources/SendTopic.php
  31. 17 19
      Sources/SplitTopics.php
  32. 3 3
      Sources/Subs-BoardIndex.php
  33. 0 3
      Sources/Subs-Db-postgresql.php
  34. 0 3
      Sources/Subs-Db-sqlite.php
  35. 0 3
      Sources/Subs-Db-sqlite3.php
  36. 1 1
      Sources/Subs-Editor.php
  37. 1 1
      Sources/Subs-Graphics.php
  38. 1 1
      Sources/Subs-List.php
  39. 1 1
      Sources/Subs-Members.php
  40. 1 1
      Sources/Subs-MessageIndex.php
  41. 12 3
      Sources/Subs-Notify.php
  42. 3 3
      Sources/Subs-Package.php
  43. 1 1
      Sources/Subs-Themes.php
  44. 12 63
      Sources/Subs.php
  45. 2 2
      Sources/Who.php
  46. 4 8
      Sources/tasks/GroupReq-Notify.php
  47. 2 6
      Sources/tasks/Likes-Notify.php
  48. 183 0
      Sources/tasks/MsgReport-Notify.php
  49. 213 0
      Sources/tasks/MsgReportReply-Notify.php
  50. 3 13
      Sources/tasks/Register-Notify.php
  51. 5 5
      Themes/default/Admin.template.php
  52. 2 2
      Themes/default/BoardIndex.template.php
  53. 1 1
      Themes/default/Compat.template.php
  54. 4 4
      Themes/default/Display.template.php
  55. 1 1
      Themes/default/Errors.template.php
  56. 1 1
      Themes/default/GenericControls.template.php
  57. 3 3
      Themes/default/GenericList.template.php
  58. 2 2
      Themes/default/GenericMenu.template.php
  59. 2 2
      Themes/default/Login.template.php
  60. 1 1
      Themes/default/ManageAttachments.template.php
  61. 1 1
      Themes/default/ManageBans.template.php
  62. 3 3
      Themes/default/ManageBoards.template.php
  63. 1 1
      Themes/default/ManageCalendar.template.php
  64. 1 1
      Themes/default/ManageLanguages.template.php
  65. 1 1
      Themes/default/ManageMail.template.php
  66. 16 14
      Themes/default/ManageMaintenance.template.php
  67. 5 5
      Themes/default/ManageMembergroups.template.php
  68. 2 2
      Themes/default/ManageMembers.template.php
  69. 2 2
      Themes/default/ManagePaid.template.php
  70. 4 4
      Themes/default/ManagePermissions.template.php
  71. 2 2
      Themes/default/ManageScheduledTasks.template.php
  72. 7 7
      Themes/default/ManageSearch.template.php
  73. 7 7
      Themes/default/ManageSmileys.template.php
  74. 2 2
      Themes/default/MessageIndex.template.php
  75. 116 51
      Themes/default/ModerationCenter.template.php
  76. 1 1
      Themes/default/MoveTopic.template.php
  77. 2 2
      Themes/default/Notify.template.php
  78. 15 15
      Themes/default/Packages.template.php
  79. 16 18
      Themes/default/PersonalMessage.template.php
  80. 1 1
      Themes/default/Poll.template.php
  81. 2 2
      Themes/default/Post.template.php
  82. 17 31
      Themes/default/Profile.template.php
  83. 2 2
      Themes/default/Recent.template.php
  84. 6 6
      Themes/default/Register.template.php
  85. 3 3
      Themes/default/Reminder.template.php
  86. 3 5
      Themes/default/Reports.template.php
  87. 3 3
      Themes/default/SendTopic.template.php
  88. 2 12
      Themes/default/Settings.template.php
  89. 19 8
      Themes/default/SplitTopics.template.php
  90. 11 11
      Themes/default/Themes.template.php
  91. 28 30
      Themes/default/Wireless.template.php
  92. 14 14
      Themes/default/Xml.template.php
  93. 4 4
      Themes/default/css/admin.css
  94. 23 14
      Themes/default/css/index.css
  95. BIN
      Themes/default/images/email_sm.png
  96. BIN
      Themes/default/images/field_icons.png
  97. BIN
      Themes/default/images/generic_icons.png
  98. BIN
      Themes/default/images/icons/package_installed.png
  99. BIN
      Themes/default/images/icons/package_old.png
  100. BIN
      Themes/default/images/im_sm_prefs.png

+ 1 - 1
README.md

@@ -21,7 +21,7 @@ by signing off your contributions, you acknowledge that you can and do license y
 * fork the repository. If you are not used to Github, please check out [fork a repository](http://help.github.com/fork-a-repo).
 * branch your repository, to commit the desired changes.
 * sign-off your commits, to acknowledge your submission under the license of the project.
- * an easy way to do so, is to define an alias for the git commit command, which includes -s switch (reference: [How to create Git aliases](http://githacks.com/post/1168909216/how-to-create-git-aliases))
+ * an easy way to do so, is to define an alias for the git commit command, which includes -s switch (reference: [How to create Git aliases](https://git.wiki.kernel.org/index.php/Aliases))
 * send a pull request to us.
 
 ######How to submit a pull request:

+ 15 - 15
SSI.php

@@ -260,7 +260,7 @@ function ssi_logout($redirect_to = '', $output_method = 'echo')
 // Recent post list:   [board] Subject by Poster	Date
 function ssi_recentPosts($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo', $limit_body = true)
 {
-	global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
+	global $context, $scripturl, $txt, $user_info;
 	global $modSettings, $smcFunc;
 
 	// Excluding certain boards...
@@ -328,7 +328,7 @@ function ssi_fetchPosts($post_ids = array(), $override_permissions = false, $out
 // This removes code duplication in other queries - don't call it direct unless you really know what you're up to.
 function ssi_queryPosts($query_where = '', $query_where_params = array(), $query_limit = 10, $query_order = 'm.id_msg DESC', $output_method = 'echo', $limit_body = false, $override_permissions = false)
 {
-	global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
+	global $context, $scripturl, $txt, $user_info;
 	global $modSettings, $smcFunc;
 
 	// Find all the posts. Newer ones will have higher IDs.
@@ -424,7 +424,7 @@ function ssi_queryPosts($query_where = '', $query_where_params = array(), $query
 // Recent topic list:   [board] Subject by Poster	Date
 function ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo')
 {
-	global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
+	global $context, $settings, $scripturl, $txt, $user_info;
 	global $modSettings, $smcFunc;
 
 	if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
@@ -574,7 +574,7 @@ function ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boar
 // Show the top poster's name and profile link.
 function ssi_topPoster($topNumber = 1, $output_method = 'echo')
 {
-	global $db_prefix, $scripturl, $smcFunc;
+	global $scripturl, $smcFunc;
 
 	// Find the latest poster.
 	$request = $smcFunc['db_query']('', '
@@ -611,7 +611,7 @@ function ssi_topPoster($topNumber = 1, $output_method = 'echo')
 // Show boards by activity.
 function ssi_topBoards($num_top = 10, $output_method = 'echo')
 {
-	global $context, $settings, $db_prefix, $txt, $scripturl, $user_info, $modSettings, $smcFunc;
+	global $context, $txt, $scripturl, $user_info, $modSettings, $smcFunc;
 
 	// Find boards with lots of posts.
 	$request = $smcFunc['db_query']('', '
@@ -667,7 +667,7 @@ function ssi_topBoards($num_top = 10, $output_method = 'echo')
 // Shows the top topics.
 function ssi_topTopics($type = 'replies', $num_topics = 10, $output_method = 'echo')
 {
-	global $db_prefix, $txt, $scripturl, $user_info, $modSettings, $smcFunc, $context;
+	global $txt, $scripturl, $user_info, $modSettings, $smcFunc, $context;
 
 	if ($modSettings['totalMessages'] > 100000)
 	{
@@ -764,7 +764,7 @@ function ssi_topTopicsViews($num_topics = 10, $output_method = 'echo')
 // Show a link to the latest member:  Please welcome, Someone, out latest member.
 function ssi_latestMember($output_method = 'echo')
 {
-	global $db_prefix, $txt, $scripturl, $context;
+	global $txt, $scripturl, $context;
 
 	if ($output_method == 'echo')
 		echo '
@@ -863,7 +863,7 @@ function ssi_fetchGroupMembers($group_id = null, $output_method = 'echo')
 // Fetch some member data!
 function ssi_queryMembers($query_where = null, $query_where_params = array(), $query_limit = '', $query_order = 'id_member DESC', $output_method = 'echo')
 {
-	global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
+	global $context, $scripturl, $txt, $user_info;
 	global $modSettings, $smcFunc, $memberContext;
 
 	if ($query_where === null)
@@ -929,7 +929,7 @@ function ssi_queryMembers($query_where = null, $query_where_params = array(), $q
 // Show some basic stats:  Total This: XXXX, etc.
 function ssi_boardStats($output_method = 'echo')
 {
-	global $db_prefix, $txt, $scripturl, $modSettings, $smcFunc;
+	global $txt, $scripturl, $modSettings, $smcFunc;
 
 	if (!allowedTo('view_stats'))
 		return;
@@ -1075,7 +1075,7 @@ function ssi_topPoll($output_method = 'echo')
 // Show the most recently posted poll.
 function ssi_recentPoll($topPollInstead = false, $output_method = 'echo')
 {
-	global $db_prefix, $txt, $settings, $boardurl, $user_info, $context, $smcFunc, $modSettings;
+	global $txt, $settings, $boardurl, $user_info, $context, $smcFunc, $modSettings;
 
 	$boardsAllowed = array_intersect(boardsAllowedTo('poll_view'), boardsAllowedTo('poll_vote'));
 
@@ -1113,7 +1113,7 @@ function ssi_recentPoll($topPollInstead = false, $output_method = 'echo')
 	$smcFunc['db_free_result']($request);
 
 	// This user has voted on all the polls.
-	if ($row === false)
+	if (empty($row) || !is_array($row))
 		return array();
 
 	// If this is a guest who's voted we'll through ourselves to show poll to show the results.
@@ -1207,7 +1207,7 @@ function ssi_recentPoll($topPollInstead = false, $output_method = 'echo')
 
 function ssi_showPoll($topic = null, $output_method = 'echo')
 {
-	global $db_prefix, $txt, $settings, $boardurl, $user_info, $context, $smcFunc, $modSettings;
+	global $txt, $settings, $boardurl, $user_info, $context, $smcFunc, $modSettings;
 
 	$boardsAllowed = boardsAllowedTo('poll_view');
 
@@ -1636,7 +1636,7 @@ function ssi_todaysCalendar($output_method = 'echo')
 // Show the latest news, with a template... by board.
 function ssi_boardNews($board = null, $limit = null, $start = null, $length = null, $output_method = 'echo')
 {
-	global $scripturl, $db_prefix, $txt, $settings, $modSettings, $context;
+	global $scripturl, $txt, $settings, $modSettings, $context;
 	global $smcFunc;
 
 	loadLanguage('Stats');
@@ -1817,7 +1817,7 @@ function ssi_boardNews($board = null, $limit = null, $start = null, $length = nu
 // Show the most recent events.
 function ssi_recentEvents($max_events = 7, $output_method = 'echo')
 {
-	global $db_prefix, $user_info, $scripturl, $modSettings, $txt, $context, $smcFunc;
+	global $user_info, $scripturl, $modSettings, $txt, $context, $smcFunc;
 
 	if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view'))
 		return;
@@ -1901,7 +1901,7 @@ function ssi_recentEvents($max_events = 7, $output_method = 'echo')
 // Check the passed id_member/password.  If $is_username is true, treats $id as a username.
 function ssi_checkPassword($id = null, $password = null, $is_username = false)
 {
-	global $db_prefix, $sourcedir, $smcFunc;
+	global $sourcedir, $smcFunc;
 
 	// If $id is null, this was most likely called from a query string and should do nothing.
 	if ($id === null)

+ 1 - 1
Sources/Admin.php

@@ -942,7 +942,7 @@ function AdminEndSession()
 		if (strpos($key, '-admin') !== false)
 			unset($_SESSION['token'][$key]);
 
-	redirectexit('action=admin');
+	redirectexit();
 }
 
 ?>

+ 2 - 0
Sources/Class-Package.php

@@ -784,6 +784,8 @@ class ftp_connection
 			$ftp_server = 'ssl://' . substr($ftp_server, 7);
 		if (strpos($ftp_server, 'http://') === 0)
 			$ftp_server = substr($ftp_server, 7);
+		elseif (strpos($ftp_server, 'https://') === 0)
+			$ftp_server = substr($ftp_server, 8);
 		$ftp_server = strtr($ftp_server, array('/' => '', ':' => '', '@' => ''));
 
 		// Connect to the FTP server.

+ 43 - 26
Sources/Load.php

@@ -1208,9 +1208,9 @@ function loadMemberContext($user, $display_custom_fields = false)
 			'posts' => $profile['posts'] > 500000 ? $txt['geek'] : comma_format($profile['posts']),
 			'avatar' => array(
 				'name' => $profile['avatar'],
-				'image' => $profile['avatar'] == '' ? ($profile['id_attach'] > 0 ? '<img class="avatar" src="' . (empty($profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $profile['filename']) . '" alt="" />' : '') : (stristr($profile['avatar'], 'http://') ? '<img class="avatar" src="' . $profile['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" />' : '<img class="avatar" src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($profile['avatar']) . '" alt="" />'),
-				'href' => $profile['avatar'] == '' ? ($profile['id_attach'] > 0 ? (empty($profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $profile['filename']) : '') : (stristr($profile['avatar'], 'http://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar']),
-				'url' => $profile['avatar'] == '' ? '' : (stristr($profile['avatar'], 'http://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar'])
+				'image' => $profile['avatar'] == '' ? ($profile['id_attach'] > 0 ? '<img class="avatar" src="' . (empty($profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $profile['filename']) . '" alt="" />' : '') : (stristr($profile['avatar'], 'http://') || stristr($profile['avatar'], 'https://') ? '<img class="avatar" src="' . $profile['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" />' : '<img class="avatar" src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($profile['avatar']) . '" alt="" />'),
+				'href' => $profile['avatar'] == '' ? ($profile['id_attach'] > 0 ? (empty($profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $profile['filename']) : '') : (stristr($profile['avatar'], 'http://') || stristr($profile['avatar'], 'https://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar']),
+				'url' => $profile['avatar'] == '' ? '' : (stristr($profile['avatar'], 'http://') || stristr($profile['avatar'], 'https://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar'])
 			),
 			'last_login' => empty($profile['last_login']) ? $txt['never'] : timeformat($profile['last_login']),
 			'last_login_timestamp' => empty($profile['last_login']) ? 0 : forum_time(0, $profile['last_login']),
@@ -1429,7 +1429,7 @@ function loadTheme($id_theme = 0, $initialize = true)
 {
 	global $user_info, $user_settings, $board_info, $boarddir;
 	global $txt, $boardurl, $scripturl, $mbname, $modSettings;
-	global $context, $settings, $options, $sourcedir, $ssi_theme, $smcFunc;
+	global $context, $settings, $options, $sourcedir, $ssi_theme, $smcFunc, $language;
 
 	// The theme was specified by parameter.
 	if (!empty($id_theme))
@@ -1631,27 +1631,44 @@ function loadTheme($id_theme = 0, $initialize = true)
 		}
 	}
 	// Set up the contextual user array.
-	$context['user'] = array(
-		'id' => $user_info['id'],
-		'is_logged' => !$user_info['is_guest'],
-		'is_guest' => &$user_info['is_guest'],
-		'is_admin' => &$user_info['is_admin'],
-		'is_mod' => &$user_info['is_mod'],
-		// A user can mod if they have permission to see the mod center, or they are a board/group/approval moderator.
-		'can_mod' => allowedTo('access_mod_center') || (!$user_info['is_guest'] && ($user_info['mod_cache']['gq'] != '0=1' || $user_info['mod_cache']['bq'] != '0=1' || ($modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap'])))),
-		'username' => $user_info['username'],
-		'language' => $user_info['language'],
-		'email' => $user_info['email'],
-		'ignoreusers' => $user_info['ignoreusers'],
-	);
-	if (!$context['user']['is_guest'])
-		$context['user']['name'] = $user_info['name'];
-	elseif ($context['user']['is_guest'] && !empty($txt['guest_title']))
-		$context['user']['name'] = $txt['guest_title'];
+	if (!empty($user_info))
+	{
+		$context['user'] = array(
+			'id' => $user_info['id'],
+			'is_logged' => !$user_info['is_guest'],
+			'is_guest' => &$user_info['is_guest'],
+			'is_admin' => &$user_info['is_admin'],
+			'is_mod' => &$user_info['is_mod'],
+			// A user can mod if they have permission to see the mod center, or they are a board/group/approval moderator.
+			'can_mod' => allowedTo('access_mod_center') || (!$user_info['is_guest'] && ($user_info['mod_cache']['gq'] != '0=1' || $user_info['mod_cache']['bq'] != '0=1' || ($modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap'])))),
+			'username' => $user_info['username'],
+			'language' => $user_info['language'],
+			'email' => $user_info['email'],
+			'ignoreusers' => $user_info['ignoreusers'],
+		);
+		if (!$context['user']['is_guest'])
+			$context['user']['name'] = $user_info['name'];
+		elseif ($context['user']['is_guest'] && !empty($txt['guest_title']))
+			$context['user']['name'] = $txt['guest_title'];
 
-	// Determine the current smiley set.
-	$user_info['smiley_set'] = (!in_array($user_info['smiley_set'], explode(',', $modSettings['smiley_sets_known'])) && $user_info['smiley_set'] != 'none') || empty($modSettings['smiley_sets_enable']) ? (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default']) : $user_info['smiley_set'];
-	$context['user']['smiley_set'] = $user_info['smiley_set'];
+		// Determine the current smiley set.
+		$user_info['smiley_set'] = (!in_array($user_info['smiley_set'], explode(',', $modSettings['smiley_sets_known'])) && $user_info['smiley_set'] != 'none') || empty($modSettings['smiley_sets_enable']) ? (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default']) : $user_info['smiley_set'];
+		$context['user']['smiley_set'] = $user_info['smiley_set'];
+	}
+	else
+	{
+		$context['user'] = array(
+			'id' => -1,
+			'is_logged' => false,
+			'is_guest' => true,
+			'is_mod' => false,
+			'can_mod' => false,
+			'name' => $txt['guest_title'],
+			'language' => $language,
+			'email' => '',
+			'ignoreusers' => array(),
+		);
+	}
 
 	// Some basic information...
 	if (!isset($context['html_headers']))
@@ -1678,7 +1695,7 @@ function loadTheme($id_theme = 0, $initialize = true)
 		$context['load_average'] = $modSettings['load_average'];
 
 	// Set some permission related settings.
-	$context['show_login_bar'] = $user_info['is_guest'] && !empty($modSettings['enableVBStyleLogin']);
+	$context['show_login_bar'] = !empty($user_info['is_guest']) && !empty($modSettings['enableVBStyleLogin']);
 
 	// Detect the browser. This is separated out because it's also used in attachment downloads
 	detectBrowser();
@@ -2426,7 +2443,7 @@ function getLanguages($use_cache = true, $favor_utf8 = true)
  */
 function censorText(&$text, $force = false)
 {
-	global $modSettings, $options, $settings, $txt;
+	global $modSettings, $options, $txt;
 	static $censor_vulgar = null, $censor_proper;
 
 	if ((!empty($options['show_no_censored']) && !empty($modSettings['allow_no_censored']) && !$force) || empty($modSettings['censor_vulgar']) || trim($text) === '')

+ 2 - 2
Sources/ManageAttachments.php

@@ -123,7 +123,7 @@ function ManageAttachmentSettings($return_config = false)
 	$txt['basedirectory_for_attachments_warning'] = $txt['basedirectory_for_attachments_current'] . $txt['basedirectory_for_attachments_warning'];
 
 	// Perform a test to see if the GD module or ImageMagick are installed.
-	$testImg = get_extension_funcs('gd') || class_exists('Imagick');
+	$testImg = get_extension_funcs('gd') || class_exists('Imagick') || get_extension_funcs('MagickWand');
 
 	// See if we can find if the server is set up to support the attacment limits
 	$post_max_size = ini_get('post_max_size');
@@ -1364,7 +1364,7 @@ function RepairAttachments()
 					if (!empty($modSettings['currentAttachmentUploadDir']))
 					{
 						// Get the attachment name with out the folder.
-						$attachment_name = !empty($row['file_hash']) ? $row['id_attach'] . '_' . $row['file_hash'] : getLegacyAttachmentFilename($row['filename'], $row['id_attach'], null, true);
+						$attachment_name = $row['id_attach'] . '_' . $row['file_hash'] .'.dat';
 
 						if (!is_array($modSettings['attachmentUploadDir']))
 							$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

+ 1 - 1
Sources/ManageMail.php

@@ -278,7 +278,7 @@ function list_getMailQueueSize()
  */
 function ModifyMailSettings($return_config = false)
 {
-	global $txt, $scripturl, $context, $settings, $modSettings, $txtBirthdayEmails;
+	global $txt, $scripturl, $context, $modSettings, $txtBirthdayEmails;
 
 	loadLanguage('EmailTemplates');
 

+ 4 - 4
Sources/ManageMaintenance.php

@@ -720,7 +720,7 @@ function ConvertUtf8()
 function ConvertMsgBody()
 {
 	global $scripturl, $context, $txt, $language, $db_character_set, $db_type;
-	global $modSettings, $user_info, $sourcedir, $smcFunc, $db_prefix, $time_start;
+	global $modSettings, $user_info, $sourcedir, $smcFunc, $time_start;
 
 	// Show me your badge!
 	isAllowedTo('admin_forum');
@@ -2324,12 +2324,12 @@ function list_integration_hooks()
 		),
 		'data' => array(
 			'function' => create_function('$data', '
-				global $txt, $settings, $scripturl, $context;
+				global $txt, $scripturl, $context;
 
 				if (!$data[\'hook_exists\'])
 					return \'
-					<a href="\' . $scripturl . \'?action=admin;area=maintain;sa=hooks;do=remove;hook=\' . $data[\'hook_name\'] . \';function=\' . urlencode($data[\'function_name\']) . $context[\'filter_url\'] . \';\' . $context[\'admin-hook_token_var\'] . \'=\' . $context[\'admin-hook_token\'] . \';\' . $context[\'session_var\'] . \'=\' . $context[\'session_id\'] . \'" onclick="return confirm(\' . javaScriptEscape($txt[\'quickmod_confirm\']) . \');">
-						<img src="\' . $settings[\'images_url\'] . \'/icons/quick_remove.png" alt="\' . $txt[\'hooks_button_remove\'] . \'" title="\' . $txt[\'hooks_button_remove\'] . \'" />
+					<a href="\' . $scripturl . \'?action=admin;area=maintain;sa=hooks;do=remove;hook=\' . $data[\'hook_name\'] . \';function=\' . urlencode($data[\'function_name\']) . $context[\'filter_url\'] . \';\' . $context[\'admin-hook_token_var\'] . \'=\' . $context[\'admin-hook_token\'] . \';\' . $context[\'session_var\'] . \'=\' . $context[\'session_id\'] . \'" onclick="return confirm(\' . JavaScriptEscape($txt[\'quickmod_confirm\']) . \');">
+						<span class="generic_icons delete" title="\' . $txt[\'hooks_button_remove\'] . \'"></span>
 					</a>\';
 			'),
 			'class' => 'centertext',

+ 1 - 1
Sources/ManageMembergroups.php

@@ -78,7 +78,7 @@ function ModifyMembergroups()
  */
 function MembergroupIndex()
 {
-	global $txt, $scripturl, $context, $settings, $smcFunc, $sourcedir;
+	global $txt, $scripturl, $context, $smcFunc, $sourcedir;
 
 	$context['page_title'] = $txt['membergroups_title'];
 

+ 1 - 1
Sources/ManagePosts.php

@@ -186,7 +186,7 @@ function SetCensor()
  */
 function ModifyPostSettings($return_config = false)
 {
-	global $context, $txt, $modSettings, $scripturl, $sourcedir, $smcFunc, $db_prefix, $db_type;
+	global $context, $txt, $modSettings, $scripturl, $sourcedir, $smcFunc, $db_type;
 
 	// Make an inline conditional a little shorter...
 	$can_spell_check = false;

+ 1 - 1
Sources/ManageRegistration.php

@@ -174,7 +174,7 @@ function AdminRegister()
 function EditAgreement()
 {
 	// I hereby agree not to be a lazy bum.
-	global $txt, $boarddir, $context, $modSettings, $smcFunc, $settings;
+	global $txt, $boarddir, $context, $modSettings, $smcFunc;
 
 	// By default we look at agreement.txt.
 	$context['current_agreement'] = '';

+ 3 - 3
Sources/ManageServer.php

@@ -200,7 +200,7 @@ function ModifyGeneralSettings($return_config = false)
  */
 function ModifyDatabaseSettings($return_config = false)
 {
-	global $scripturl, $context, $settings, $txt, $boarddir;
+	global $scripturl, $context, $txt, $boarddir;
 
 	/* If you're writing a mod, it's a bad idea to add things here....
 		For each option:
@@ -339,7 +339,7 @@ function ModifyCookieSettings($return_config = false)
  */
 function ModifyGeneralSecuritySettings($return_config = false)
 {
-	global $txt, $scripturl, $context, $settings, $sc, $modSettings;
+	global $txt, $scripturl, $context, $sc, $modSettings;
 
 	$config_vars = array(
 			array('int', 'failed_login_threshold'),
@@ -477,7 +477,7 @@ function ModifyCacheSettings($return_config = false)
  */
 function ModifyLoadBalancingSettings($return_config = false)
 {
-	global $txt, $scripturl, $context, $settings, $modSettings;
+	global $txt, $scripturl, $context, $modSettings;
 
 	// Setup a warning message, but disabled by default.
 	$disabled = true;

+ 9 - 9
Sources/ManageSettings.php

@@ -95,7 +95,7 @@ function ModifyFeatureSettings()
  */
 function ModifyModSettings()
 {
-	global $context, $txt, $scripturl, $modSettings, $settings;
+	global $context, $txt, $scripturl, $modSettings;
 
 	$context['page_title'] = $txt['admin_modifications'];
 
@@ -132,7 +132,7 @@ function ModifyModSettings()
  */
 function ModifyBasicSettings($return_config = false)
 {
-	global $txt, $scripturl, $context, $settings, $sc, $modSettings;
+	global $txt, $scripturl, $context, $sc, $modSettings;
 
 	// We need to know if personal text is enabled, and if it's in the registration fields option.
 	// If admins have set it up as an on-registration thing, they can't set a default value (because it'll never be used)
@@ -227,7 +227,7 @@ function ModifyBasicSettings($return_config = false)
  */
 function ModifyLayoutSettings($return_config = false)
 {
-	global $txt, $scripturl, $context, $settings, $sc;
+	global $txt, $scripturl, $context, $sc;
 
 	$config_vars = array(
 			// Pagination stuff.
@@ -278,7 +278,7 @@ function ModifyLayoutSettings($return_config = false)
  */
 function ModifyKarmaSettings($return_config = false)
 {
-	global $txt, $scripturl, $context, $settings, $modSettings;
+	global $txt, $scripturl, $context, $modSettings;
 
 	if (empty($modSettings['karmaMode']))
 		$config_vars = array(
@@ -330,7 +330,7 @@ function ModifyKarmaSettings($return_config = false)
  */
 function ModifyWarningSettings($return_config = false)
 {
-	global $txt, $scripturl, $context, $settings, $sc, $modSettings, $sourcedir;
+	global $txt, $scripturl, $context, $sc, $modSettings, $sourcedir;
 
 	// You need to be an admin to edit settings!
 	isAllowedTo('admin_forum');
@@ -1122,7 +1122,7 @@ function pauseSignatureApplySettings()
  */
 function ShowCustomProfiles()
 {
-	global $txt, $scripturl, $context, $settings, $sc, $smcFunc;
+	global $txt, $scripturl, $context, $sc, $smcFunc;
 	global $modSettings, $sourcedir;
 
 	$context['page_title'] = $txt['custom_profile_title'];
@@ -1432,7 +1432,7 @@ function list_getProfileFieldSize()
  */
 function EditCustomProfiles()
 {
-	global $txt, $scripturl, $context, $settings, $sc, $smcFunc;
+	global $txt, $scripturl, $context, $sc, $smcFunc;
 
 	// Sort out the context!
 	$context['fid'] = isset($_GET['fid']) ? (int) $_GET['fid'] : 0;
@@ -1837,7 +1837,7 @@ function EditCustomProfiles()
  */
 function ModifyLogSettings($return_config = false)
 {
-	global $txt, $scripturl, $sourcedir, $context, $settings, $sc, $modSettings;
+	global $txt, $scripturl, $sourcedir, $context, $sc, $modSettings;
 
 	// Make sure we understand what's going on.
 	loadLanguage('ManageSettings');
@@ -1954,7 +1954,7 @@ function ModifyLogSettings($return_config = false)
  */
 function ModifyGeneralModSettings($return_config = false)
 {
-	global $txt, $scripturl, $context, $settings, $sc, $modSettings;
+	global $txt, $scripturl, $context, $sc, $modSettings;
 
 	$config_vars = array(
 		// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!

+ 5 - 5
Sources/ManageSmileys.php

@@ -113,7 +113,7 @@ function ManageSmileys()
  */
 function EditSmileySettings($return_config = false)
 {
-	global $modSettings, $context, $settings, $txt, $boarddir, $sourcedir, $scripturl;
+	global $modSettings, $context, $txt, $boarddir, $sourcedir, $scripturl;
 
 	// The directories...
 	$context['smileys_dir'] = empty($modSettings['smileys_dir']) ? $boarddir . '/Smileys' : $modSettings['smileys_dir'];
@@ -190,7 +190,7 @@ function EditSmileySettings($return_config = false)
  */
 function EditSmileySets()
 {
-	global $modSettings, $context, $settings, $txt, $boarddir;
+	global $modSettings, $context, $txt, $boarddir;
 	global $smcFunc, $scripturl, $sourcedir;
 
 	// Set the right tab to be selected.
@@ -536,7 +536,7 @@ function list_getNumSmileySets()
  */
 function AddSmiley()
 {
-	global $modSettings, $context, $settings, $txt, $boarddir, $smcFunc;
+	global $modSettings, $context, $txt, $boarddir, $smcFunc;
 
 	// Get a list of all known smiley sets.
 	$context['smileys_dir'] = empty($modSettings['smileys_dir']) ? $boarddir . '/Smileys' : $modSettings['smileys_dir'];
@@ -785,7 +785,7 @@ function AddSmiley()
  */
 function EditSmileys()
 {
-	global $modSettings, $context, $settings, $txt, $boarddir;
+	global $modSettings, $context, $txt, $boarddir;
 	global $smcFunc, $scripturl, $sourcedir;
 
 	// Force the correct tab to be displayed.
@@ -1247,7 +1247,7 @@ function list_getNumSmileys()
  */
 function EditSmileyOrder()
 {
-	global $modSettings, $context, $settings, $txt, $boarddir, $smcFunc;
+	global $modSettings, $context, $txt, $boarddir, $smcFunc;
 
 	// Move smileys to another position.
 	if (isset($_REQUEST['reorder']))

+ 2 - 2
Sources/Memberlist.php

@@ -29,7 +29,7 @@ if (!defined('SMF'))
  */
 function Memberlist()
 {
-	global $scripturl, $txt, $modSettings, $context, $settings, $modSettings;
+	global $scripturl, $txt, $modSettings, $context, $modSettings;
 
 	// Make sure they can view the memberlist.
 	isAllowedTo('view_mlist');
@@ -598,7 +598,7 @@ function MLSearch()
 function printMemberListRows($request)
 {
 	global $scripturl, $txt, $user_info, $modSettings;
-	global $context, $settings, $memberContext, $smcFunc;
+	global $context, $memberContext, $smcFunc;
 
 	// Get the most posts.
 	$result = $smcFunc['db_query']('', '

+ 3 - 3
Sources/MessageIndex.php

@@ -578,9 +578,9 @@ function MessageIndex()
 			if (!empty($settings['avatars_on_indexes']))
 				$context['topics'][$row['id_topic']]['last_post']['member']['avatar'] = array(
 					'name' => $row['avatar'],
-					'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img class="avatar" src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" />' : '') : (stristr($row['avatar'], 'http://') ? '<img class="avatar" src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" />' : '<img class="avatar" src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row['avatar']) . '" alt="" />'),
-					'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
-					'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
+					'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img class="avatar" src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" />' : '') : (stristr($row['avatar'], 'http://') || stristr($row['avatar'], 'https://') ? '<img class="avatar" src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" />' : '<img class="avatar" src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row['avatar']) . '" alt="" />'),
+					'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') || stristr($row['avatar'], 'https://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
+					'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') || stristr($row['avatar'], 'https://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
 				);
 
 			determineTopicClass($context['topics'][$row['id_topic']]);

+ 76 - 63
Sources/ModerationCenter.php

@@ -23,7 +23,7 @@ if (!defined('SMF'))
  */
 function ModerationMain($dont_call = false)
 {
-	global $txt, $context, $scripturl, $sc, $modSettings, $user_info, $settings, $sourcedir, $options, $smcFunc;
+	global $txt, $context, $scripturl, $sc, $modSettings, $user_info, $sourcedir, $options, $smcFunc;
 
 	// Don't run this twice... and don't conflict with the admin bar.
 	if (isset($context['admin_area']))
@@ -227,7 +227,7 @@ function ModerationMain($dont_call = false)
  */
 function ModerationHome()
 {
-	global $txt, $context, $scripturl, $modSettings, $user_info, $user_settings;
+	global $txt, $context, $scripturl, $modSettings, $user_info, $user_settings, $options;
 
 	loadTemplate('ModerationCenter');
 	loadJavascriptFile('admin.js', array('default_theme' => true), 'admin.js');
@@ -249,23 +249,17 @@ function ModerationHome()
 		$valid_blocks['w'] = 'WatchedUsers';
 	}
 
-	if (empty($user_settings['mod_prefs']))
-		$user_blocks = 'n' . ($context['can_moderate_boards'] ? 'wr' : '') . ($context['can_moderate_groups'] ? 'g' : '');
-	else
-		list (, $user_blocks) = explode('|', $user_settings['mod_prefs']);
-
-	$user_blocks = str_split($user_blocks);
+	call_integration_hook('integrate_mod_centre_blocks', array(&$valid_blocks));
 
 	$context['mod_blocks'] = array();
 	foreach ($valid_blocks as $k => $block)
 	{
-		if (in_array($k, $user_blocks))
-		{
-			$block = 'ModBlock' . $block;
-			if (function_exists($block))
-				$context['mod_blocks'][] = $block();
-		}
+		$block = 'ModBlock' . $block;
+		if (function_exists($block))
+			$context['mod_blocks'][] = $block();
 	}
+
+	$context['admin_prefs'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();
 }
 
 /**
@@ -603,9 +597,27 @@ function ReportedPosts()
 			)
 		);
 
+		// Get the board, topic and message for this report
+		$request = $smcFunc['db_query']('', '
+			SELECT id_board, id_topic, id_msg
+			FROM {db_prefix}log_reported
+			WHERE id_report = {int:id_report}',
+			array(
+				'id_report' => $_GET['rid'],
+			)
+		);
+
+		// Set up the data for the log...
+		$extra = array('report' => $_GET['rid']);
+		list ($extra['board'], $extra['topic'], $extra['message']) = $smcFunc['db_fetch_row']($request);
+		$smcFunc['db_free_result']($request);
+
 		// Tell the user about it.
 		$context['report_post_action'] = isset($_GET['ignore']) ? (!empty($_GET['ignore']) ? 'ignore' : 'unignore') : (!empty($_GET['close']) ? 'close' : 'open');
 
+		// Log this action
+		logAction($context['report_post_action'] . '_report', $extra);
+
 		// Time to update.
 		updateSettings(array('last_mod_report_action' => time()));
 		recountOpenReports();
@@ -621,6 +633,32 @@ function ReportedPosts()
 
 		if (!empty($toClose))
 		{
+			// Get the data for each of these reports
+			$request = $smcFunc['db_query']('', '
+				SELECT id_report, id_board, id_topic, id_msg
+				FROM {db_prefix}log_reported
+				WHERE id_report IN ({array_int:report_list})
+					AND ' . $user_inf['mod_cache']['bq'],
+				array(
+					'id_report' => $_GET['rid'],
+				)
+			);
+
+			while ($reports = $smcFunc['db_fetch_assoc']($request))
+			{
+				$report_data = array(
+					'report' => $row['id_report'],
+					'board' => $row['id_board'],
+					'topic' => $row['id_topic'],
+					'message' => $row['id_msg'],
+				);
+
+				// Log that this report was closed
+				logAction('close_report', $report_data);
+			}
+
+			$smcFunc['db_free_result']($request);
+
 			$smcFunc['db_query']('', '
 				UPDATE {db_prefix}log_reported
 				SET closed = {int:is_closed}
@@ -889,6 +927,24 @@ function ModReport()
 				),
 				array('id_comment')
 			);
+			$last_comment = $smcFunc['db_insert_id']('{db_prefix}log_comments', 'id_comment');
+
+			// And get ready to notify people.
+			$smcFunc['db_insert']('insert',
+				'{db_prefix}background_tasks',
+				array('task_file' => 'string', 'task_class' => 'string', 'task_data' => 'string', 'claimed_time' => 'int'),
+				array('$sourcedir/tasks/MsgReportReply-Notify.php', 'MsgReportReply_Notify_Background', serialize(array(
+					'report_id' => $_REQUEST['report'],
+					'comment_id' => $last_comment,
+					'msg_id' => $row['id_msg'],
+					'topic_id' => $row['id_topic'],
+					'board_id' => $row['id_board'],
+					'sender_id' => $user_info['id'],
+					'sender_name' => $user_info['name'],
+					'time' => time(),
+				)), 0),
+				array('id_task')
+			);
 
 			// Redirect to prevent double submittion.
 			redirectexit($scripturl . '?action=moderate;area=reports;report=' . $_REQUEST['report']);
@@ -955,10 +1011,9 @@ function ModReport()
 		FROM {db_prefix}log_comments AS lc
 			LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = lc.id_member)
 		WHERE lc.id_notice = {int:id_report}
-			AND lc.comment_type = {string:reportc}',
+			AND lc.comment_type = {literal:reportc}',
 		array(
 			'id_report' => $context['report']['id'],
-			'reportc' => 'reportc',
 		)
 	);
 	while ($row = $smcFunc['db_fetch_assoc']($request))
@@ -2111,28 +2166,9 @@ function ModerationSettings()
 		'description' => $txt['mc_prefs_desc']
 	);
 
-	// What blocks can this user see?
-	$context['homepage_blocks'] = array();
-
-	if ($context['can_moderate_groups'])
-		$context['homepage_blocks']['g'] = $txt['mc_group_requests'];
-	if ($context['can_moderate_boards'])
-	{
-		$context['homepage_blocks']['r'] = $txt['mc_reported_posts'];
-		$context['homepage_blocks']['w'] = $txt['mc_watched_users'];
-	}
-
-	// Does the user have any settings yet?
-	if (empty($user_settings['mod_prefs']))
-	{
-		$mod_blocks = 'n' . ($context['can_moderate_boards'] ? 'wr' : '') . ($context['can_moderate_groups'] ? 'g' : '');
-		$pref_binary = 5;
-		$show_reports = 1;
-	}
-	else
-	{
-		list ($show_reports, $mod_blocks, $pref_binary) = explode('|', $user_settings['mod_prefs']);
-	}
+	$mod_blocks = '';
+	$pref_binary = 5;
+	$show_reports = 0;
 
 	// Are we saving?
 	if (isset($_POST['save']))
@@ -2147,46 +2183,23 @@ function ModerationSettings()
 				x = Show report count on forum header.
 				ABCD = Block indexes to show on moderation main page.
 				yyy = Integer with the following bit status:
-					- yyy & 1 = Always notify on reports.
-					- yyy & 2 = Notify on reports for moderators only.
 					- yyy & 4 = Notify about posts awaiting approval.
 		*/
 
-		// Do blocks first!
-		$mod_blocks = '';
-		if (!empty($_POST['mod_homepage']))
-			foreach ($_POST['mod_homepage'] as $k => $v)
-			{
-				// Make sure they can add this...
-				if (isset($context['homepage_blocks'][$k]))
-					$mod_blocks .= $k;
-			}
-
 		// Now check other options!
 		$pref_binary = 0;
 
 		if ($context['can_moderate_approvals'] && !empty($_POST['mod_notify_approval']))
 			$pref_binary |= 4;
 
-		if ($context['can_moderate_boards'])
-		{
-			if (!empty($_POST['mod_notify_report']))
-				$pref_binary |= ($_POST['mod_notify_report'] == 2 ? 1 : 2);
-
-			$show_reports = !empty($_POST['mod_show_reports']) ? 1 : 0;
-		}
-
 		// Put it all together.
-		$mod_prefs = $show_reports . '|' . $mod_blocks . '|' . $pref_binary;
+		$mod_prefs = '0||' . $pref_binary;
 		updateMemberData($user_info['id'], array('mod_prefs' => $mod_prefs));
 	}
 
 	// What blocks does the user currently have selected?
 	$context['mod_settings'] = array(
-		'show_reports' => $show_reports,
-		'notify_report' => $pref_binary & 2 ? 1 : ($pref_binary & 1 ? 2 : 0),
 		'notify_approval' => $pref_binary & 4,
-		'user_blocks' => str_split($mod_blocks),
 	);
 
 	createToken('mod-set');
@@ -2205,7 +2218,7 @@ function ModEndSession()
 		if (strpos($key, '-mod') !== false)
 			unset($_SESSION['token'][$key]);
 
-	redirectexit('action=moderate');
+	redirectexit();
 }
 
 ?>

+ 4 - 2
Sources/Modlog.php

@@ -28,7 +28,7 @@ if (!defined('SMF'))
  */
 function ViewModlog()
 {
-	global $txt, $modSettings, $context, $scripturl, $sourcedir, $user_info, $smcFunc, $settings;
+	global $txt, $modSettings, $context, $scripturl, $sourcedir, $user_info, $smcFunc;
 
 	// Are we looking at the moderation log or the administration log.
 	$context['log_type'] = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'adminlog' ? 3 : 1;
@@ -616,10 +616,12 @@ function list_getModLogEntries($start, $items_per_page, $sort, $query_string = '
 			if (!empty($entry['extra'][$type]) && is_numeric($entry['extra'][$type]))
 				$entries[$k]['extra'][$type] = sprintf($txt['modlog_id'], $entry['extra'][$type]);
 
+		if (isset($entry['extra']['report']))
+			$entries[$k]['extra']['report'] = '<a href="' . $scripturl . '?action=modlog;area=reports;report=' . $entry['extra']['report'] . '">' . $txt['modlog_report'] . '</a>';
+
 		if (empty($entries[$k]['action_text']))
 			$entries[$k]['action_text'] = isset($txt['modlog_ac_' . $entry['action']]) ? $txt['modlog_ac_' . $entry['action']] : $entry['action'];
 		$entries[$k]['action_text'] = preg_replace_callback('~\{([A-Za-z\d_]+)\}~i', $callback($entries, $k), $entries[$k]['action_text']);
-
 	}
 
 	// Back we go!

+ 10 - 33
Sources/MoveTopic.php

@@ -30,7 +30,7 @@ if (!defined('SMF'))
  */
 function MoveTopic()
 {
-	global $txt, $board, $topic, $user_info, $context, $language, $scripturl, $settings, $smcFunc, $modSettings;
+	global $txt, $board, $topic, $user_info, $context, $language, $scripturl, $smcFunc, $modSettings, $sourcedir;
 
 	if (empty($topic))
 		fatal_lang_error('no_access', false);
@@ -79,41 +79,18 @@ function MoveTopic()
 
 	loadTemplate('MoveTopic');
 
-	// Get a list of boards this moderator can move to.
-	$request = $smcFunc['db_query']('order_by_board_order', '
-		SELECT b.id_board, b.name, b.child_level, c.name AS cat_name, c.id_cat
-		FROM {db_prefix}boards AS b
-			LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
-		WHERE {query_see_board}
-			AND b.redirect = {string:blank_redirect}' . ($context['move_any'] ? '' : '
-			AND b.id_board IN ({array_int:boards})'),
-		array(
-			'blank_redirect' => '',
-			'current_board' => $board,
-			'boards' => $boards,
-		)
+	$options = array(
+		'not_redirection' => true,
 	);
-	$number_of_boards = $smcFunc['db_num_rows']($request);
-	while ($row = $smcFunc['db_fetch_assoc']($request))
-	{
-		if (!isset($context['categories'][$row['id_cat']]))
-			$context['categories'][$row['id_cat']] = array (
-				'name' => strip_tags($row['cat_name']),
-				'boards' => array(),
-			);
 
-		$context['categories'][$row['id_cat']]['boards'][] = array(
-			'id' => $row['id_board'],
-			'name' => strip_tags($row['name']),
-			'category' => strip_tags($row['cat_name']),
-			'child_level' => $row['child_level'],
-			'selected' => !empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] == $row['id_board'] && $row['id_board'] != $board,
-		);
-	}
-	$smcFunc['db_free_result']($request);
+	if (!empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] != $board)
+		$options['selected_board'] = $_SESSION['move_to_topic'];
+
+	if (!$context['move_any'])
+		$options['included_boards'] = $boards;
 
-	if (empty($context['categories']) || (!empty($number_of_boards) && $number_of_boards == 1))
-		fatal_lang_error('moveto_noboards', false);
+	require_once($sourcedir . '/Subs-MessageIndex.php');
+	$context['categories'] = getBoardList($options);
 
 	$context['page_title'] = $txt['move_topic'];
 

+ 2 - 2
Sources/News.php

@@ -594,7 +594,7 @@ function getXmlMembers($xml_format)
 function getXmlNews($xml_format)
 {
 	global $user_info, $scripturl, $modSettings, $board;
-	global $query_this_board, $smcFunc, $settings, $context;
+	global $query_this_board, $smcFunc, $context;
 
 	/* Find the latest posts that:
 		- are the first post in their topic.
@@ -728,7 +728,7 @@ function getXmlNews($xml_format)
 function getXmlRecent($xml_format)
 {
 	global $user_info, $scripturl, $modSettings, $board;
-	global $query_this_board, $smcFunc, $settings, $context;
+	global $query_this_board, $smcFunc, $context;
 
 	$done = false;
 	$loops = 0;

+ 1 - 1
Sources/PackageGet.php

@@ -330,7 +330,7 @@ function PackageGBrowse()
 			{
 				$remote_type = $thisPackage->exists('@type') ? $thisPackage->fetch('@type') : 'relative';
 
-				if ($remote_type == 'relative' && substr($thisPackage->fetch('@href'), 0, 7) != 'http://')
+				if ($remote_type == 'relative' && substr($thisPackage->fetch('@href'), 0, 7) != 'http://' && substr($this->Package->fetch('@href'), 0, 8) != 'https://')
 				{
 					if (isset($_GET['absolute']))
 						$current_url = $_GET['absolute'] . '/';

+ 2 - 2
Sources/Packages.php

@@ -1364,7 +1364,7 @@ function PackageRemove()
  */
 function PackageBrowse()
 {
-	global $txt, $boarddir, $scripturl, $context, $forum_version, $sourcedir, $settings;
+	global $txt, $boarddir, $scripturl, $context, $forum_version, $sourcedir;
 
 	$context['page_title'] .= ' - ' . $txt['browse_packages'];
 
@@ -1502,7 +1502,7 @@ function PackageBrowse()
 			'additional_rows' => array(
 				array(
 					'position' => 'bottom_of_list',
-					'value' => ($context['sub_action'] == 'browse' ? '<div class="padding smalltext">' . $txt['package_installed_key'] . '<img src="' . $settings['images_url'] . '/icons/package_installed.png" alt="" class="centericon" style="margin-left: 1ex;" /> ' . $txt['package_installed_current'] . '<img src="' . $settings['images_url'] . '/icons/package_old.png" alt="" class="centericon" style="margin-left: 2ex;" /> ' . $txt['package_installed_old'] . '</div>' :
+					'value' => ($context['sub_action'] == 'browse' ? '<div class="padding smalltext">' . $txt['package_installed_key'] . '<span class="generic_icons current centericon" style="margin-left: 1ex;"></span> ' . $txt['package_installed_current'] . '<span class="generic_icons old centericon" style="margin-left: 2ex;"></span> ' . $txt['package_installed_old'] . '</div>' :
 					'<a class="button_link" href="' . $scripturl . '?action=admin;area=packages;sa=flush;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['package_delete_list_warning'] . '\');">' . $txt['delete_list'] . '</a>'),
 				),
 			),

+ 1 - 1
Sources/PersonalMessage.php

@@ -230,7 +230,7 @@ function MessageMain()
  */
 function messageIndexBar($area)
 {
-	global $txt, $context, $scripturl, $sourcedir, $sc, $modSettings, $settings, $user_info, $options;
+	global $txt, $context, $scripturl, $sourcedir, $sc, $modSettings, $user_info, $options;
 
 	$pm_areas = array(
 		'folders' => array(

+ 3 - 3
Sources/Post.php

@@ -316,7 +316,7 @@ function Post($post_errors = array())
 	// only at preview
 	if (empty($_REQUEST['msg']) && !empty($topic))
 	{
-		if (empty($options['no_new_reply_warning']) && isset($_REQUEST['last_msg']) && $context['topic_last_message'] > $_REQUEST['last_msg'])
+		if (isset($_REQUEST['last_msg']) && $context['topic_last_message'] > $_REQUEST['last_msg'])
 		{
 			$request = $smcFunc['db_query']('', '
 				SELECT COUNT(*)
@@ -1341,7 +1341,7 @@ function Post2()
 		}
 
 		// If the number of replies has changed, if the setting is enabled, go back to Post() - which handles the error.
-		if (empty($options['no_new_reply_warning']) && isset($_POST['last_msg']) && $topic_info['id_last_msg'] > $_POST['last_msg'])
+		if (isset($_POST['last_msg']) && $topic_info['id_last_msg'] > $_POST['last_msg'])
 		{
 			$_REQUEST['preview'] = true;
 			return Post();
@@ -2530,7 +2530,7 @@ function getTopic()
  */
 function QuoteFast()
 {
-	global $modSettings, $user_info, $txt, $settings, $context;
+	global $modSettings, $user_info, $txt, $context;
 	global $sourcedir, $smcFunc;
 
 	loadLanguage('Post');

+ 16 - 17
Sources/Profile-Modify.php

@@ -932,7 +932,7 @@ function saveProfileFields()
 function saveProfileChanges(&$profile_vars, &$post_errors, $memID)
 {
 	global $user_info, $txt, $modSettings, $user_profile;
-	global $context, $settings, $sourcedir;
+	global $context, $sourcedir;
 	global $smcFunc;
 
 	// These make life easier....
@@ -1709,7 +1709,7 @@ function getAvatars($directory, $level)
  */
 function theme($memID)
 {
-	global $txt, $context, $user_profile, $modSettings, $settings, $user_info, $smcFunc;
+	global $txt, $context, $user_profile, $modSettings, $user_info, $smcFunc;
 
 	loadThemeOptions($memID);
 	if (allowedTo(array('profile_extra_own', 'profile_extra_any')))
@@ -1819,7 +1819,7 @@ function authentication($memID, $saving = false)
  */
 function notification($memID)
 {
-	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc, $sourcedir, $settings;
+	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc, $sourcedir;
 
 	// Going to want this for consistency.
 	loadCSSFile('admin.css', array(), 'admin');
@@ -1844,7 +1844,7 @@ function notification($memID)
 
 function alert_configuration($memID)
 {
-	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc, $sourcedir, $settings;
+	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc, $sourcedir;
 
 	$context['token_check'] = 'profile-nt' . $memID;
 	is_not_guest();
@@ -1894,7 +1894,6 @@ function alert_configuration($memID)
 		'members' => array(
 			'member_register' => array('alert' => 'yes', 'email' => 'yes', 'permission' => array('name' => 'moderate_forum', 'is_board' => false)),
 			'request_group' => array('alert' => 'yes', 'email' => 'yes'),
-			'warn_own' => array('alert' => 'yes', 'email' => 'yes'),
 			'warn_any' => array('alert' => 'yes', 'email' => 'yes', 'permission' => array('name' => 'issue_warning', 'is_board' => false)),
 		),
 		'calendar' => array(
@@ -2045,7 +2044,7 @@ function alert_configuration($memID)
 
 function alert_notifications_topics($memID)
 {
-	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc, $sourcedir, $settings;
+	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc, $sourcedir;
 
 	// Because of the way this stuff works, we want to do this ourselves.
 	if (isset($_POST['edit_notify_topics']))
@@ -2093,7 +2092,7 @@ function alert_notifications_topics($memID)
 				),
 				'data' => array(
 					'function' => create_function('$topic', '
-						global $settings, $txt;
+						global $txt;
 
 						$link = $topic[\'link\'];
 
@@ -2185,7 +2184,7 @@ function alert_notifications_topics($memID)
 
 function alert_notifications_boards($memID)
 {
-	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc, $sourcedir, $settings;
+	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc, $sourcedir;
 
 	// Because of the way this stuff works, we want to do this ourselves.
 	if (isset($_POST['edit_notify_boards']))
@@ -2226,7 +2225,7 @@ function alert_notifications_boards($memID)
 				),
 				'data' => array(
 					'function' => create_function('$board', '
-						global $settings, $txt;
+						global $txt;
 
 						$link = $board[\'link\'];
 
@@ -2559,7 +2558,7 @@ function ignoreboards($memID)
  */
 function profileLoadLanguages()
 {
-	global $context, $modSettings, $settings, $cur_profile, $language, $smcFunc;
+	global $context, $modSettings, $cur_profile, $language, $smcFunc;
 
 	$context['profile_languages'] = array();
 
@@ -2707,8 +2706,8 @@ function profileLoadAvatarData()
 
 	// Default context.
 	$context['member']['avatar'] += array(
-		'custom' => stristr($cur_profile['avatar'], 'http://') ? $cur_profile['avatar'] : 'http://',
-		'selection' => $cur_profile['avatar'] == '' || stristr($cur_profile['avatar'], 'http://') ? '' : $cur_profile['avatar'],
+		'custom' => stristr($cur_profile['avatar'], 'http://') || stristr($cur_profile['avatar'], 'https://') ? $cur_profile['avatar'] : 'http://',
+		'selection' => $cur_profile['avatar'] == '' || (stristr($cur_profile['avatar'], 'http://') || stristr($cur_profile['avatar'], 'https://')) ? '' : $cur_profile['avatar'],
 		'id_attach' => $cur_profile['id_attach'],
 		'filename' => $cur_profile['filename'],
 		'allow_server_stored' => allowedTo('profile_server_avatar') || (!$context['user']['is_owner'] && allowedTo('profile_extra_any')),
@@ -2725,7 +2724,7 @@ function profileLoadAvatarData()
 		);
 		$context['member']['avatar']['href'] = empty($cur_profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $cur_profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $cur_profile['filename'];
 	}
-	elseif (stristr($cur_profile['avatar'], 'http://') && $context['member']['avatar']['allow_external'])
+	elseif ((stristr($cur_profile['avatar'], 'http://') || stristr($cur_profile['avatar'], 'https://')) && $context['member']['avatar']['allow_external'])
 		$context['member']['avatar'] += array(
 			'choice' => 'external',
 			'server_pic' => 'blank.png',
@@ -2881,7 +2880,7 @@ function profileSaveAvatarData(&$value)
 	$id_folder = 1;
 
 	$downloadedExternalAvatar = false;
-	if ($value == 'external' && allowedTo('profile_remote_avatar') && stripos($_POST['userpicpersonal'], 'http://') === 0 && strlen($_POST['userpicpersonal']) > 7 && !empty($modSettings['avatar_download_external']))
+	if ($value == 'external' && allowedTo('profile_remote_avatar') && (stripos($_POST['userpicpersonal'], 'http://') === 0 || stripos($_POST['userpicpersonal'], 'https://') === 0) && strlen($_POST['userpicpersonal']) > 7 && !empty($modSettings['avatar_download_external']))
 	{
 		if (!is_writable($uploadDir))
 			fatal_lang_error('attachments_no_write', 'critical');
@@ -2889,7 +2888,7 @@ function profileSaveAvatarData(&$value)
 		require_once($sourcedir . '/Subs-Package.php');
 
 		$url = parse_url($_POST['userpicpersonal']);
-		$contents = fetch_web_data('http://' . $url['host'] . (empty($url['port']) ? '' : ':' . $url['port']) . str_replace(' ', '%20', trim($url['path'])));
+		$contents = fetch_web_data($url['scheme'] . '://' . $url['host'] . (empty($url['port']) ? '' : ':' . $url['port']) . str_replace(' ', '%20', trim($url['path'])));
 
 		$new_filename = $uploadDir . '/' . getAttachmentFilename('avatar_tmp_' . $memID, false, null, true);
 		if ($contents != false && $tmpAvatar = fopen($new_filename, 'wb'))
@@ -2926,7 +2925,7 @@ function profileSaveAvatarData(&$value)
 		// Get rid of their old avatar. (if uploaded.)
 		removeAttachments(array('id_member' => $memID));
 	}
-	elseif ($value == 'external' && allowedTo('profile_remote_avatar') && stripos($_POST['userpicpersonal'], 'http://') === 0 && empty($modSettings['avatar_download_external']))
+	elseif ($value == 'external' && allowedTo('profile_remote_avatar') && (stripos($_POST['userpicpersonal'], 'http://') === 0 || stripos($_POST['userpicpersonal'], 'https://') === 0) && empty($modSettings['avatar_download_external']))
 	{
 		// We need these clean...
 		$cur_profile['id_attach'] = 0;
@@ -2941,7 +2940,7 @@ function profileSaveAvatarData(&$value)
 		if ($profile_vars['avatar'] == 'http://' || $profile_vars['avatar'] == 'http:///')
 			$profile_vars['avatar'] = '';
 		// Trying to make us do something we'll regret?
-		elseif (substr($profile_vars['avatar'], 0, 7) != 'http://')
+		elseif (substr($profile_vars['avatar'], 0, 7) != 'http://' && substr($profile_vars['avatar'], 0, 8) != 'https://')
 			return 'bad_avatar';
 		// Should we check dimensions?
 		elseif (!empty($modSettings['avatar_max_height_external']) || !empty($modSettings['avatar_max_width_external']))

+ 1 - 1
Sources/Recent.php

@@ -575,7 +575,7 @@ function UnreadTopics()
 		$smcFunc['db_free_result']($request);
 
 		if (empty($boards))
-			fatal_lang_error('error_no_boards_selected');
+			fatal_lang_error('error_no_boards_available', false);
 
 		$query_this_board = 'id_board IN ({array_int:boards})';
 		$query_parameters['boards'] = $boards;

+ 2 - 2
Sources/Register.php

@@ -25,7 +25,7 @@ if (!defined('SMF'))
  */
 function Register($reg_errors = array())
 {
-	global $txt, $boarddir, $context, $settings, $modSettings, $user_info;
+	global $txt, $boarddir, $context, $modSettings, $user_info;
 	global $language, $scripturl, $smcFunc, $sourcedir, $smcFunc, $cur_profile;
 
 	// Is this an incoming AJAX check?
@@ -220,7 +220,7 @@ function Register($reg_errors = array())
 function Register2($verifiedOpenID = false)
 {
 	global $scripturl, $txt, $modSettings, $context, $sourcedir;
-	global $user_info, $options, $settings, $smcFunc;
+	global $user_info, $options, $smcFunc;
 
 	checkSession();
 	validateToken('register');

+ 1 - 1
Sources/RemoveTopic.php

@@ -11,7 +11,7 @@
  * @copyright 2013 Simple Machines and individual contributors
  * @license http://www.simplemachines.org/about/smf/license.php BSD
  *
- * @version 2.0
+ * @version 2.1 Alpha 1
  */
 
 if (!defined('SMF'))

+ 2 - 2
Sources/ScheduledTasks.php

@@ -1249,7 +1249,7 @@ function loadEssentialThemeData()
  */
 function scheduled_fetchSMfiles()
 {
-	global $sourcedir, $txt, $language, $settings, $forum_version, $modSettings, $smcFunc, $context;
+	global $sourcedir, $txt, $language, $forum_version, $modSettings, $smcFunc, $context;
 
 	// What files do we want to get
 	$request = $smcFunc['db_query']('', '
@@ -1282,7 +1282,7 @@ function scheduled_fetchSMfiles()
 	foreach ($js_files as $ID_FILE => $file)
 	{
 		// Create the url
-		$server = empty($file['path']) || substr($file['path'], 0, 7) != 'http://' ? 'http://www.simplemachines.org' : '';
+		$server = empty($file['path']) || (substr($file['path'], 0, 7) != 'http://' && substr($file['path'], 0, 8) != 'https://') ? 'http://www.simplemachines.org' : '';
 		$url = $server . (!empty($file['path']) ? $file['path'] : $file['path']) . $file['filename'] . (!empty($file['parameters']) ? '?' . $file['parameters'] : '');
 
 		// Get the file

+ 14 - 73
Sources/SendTopic.php

@@ -531,82 +531,23 @@ function ReportToModerator2()
 			),
 			array('id_comment')
 		);
-	}
-
-	// Find out who the real moderators are - for mod preferences.
-	$request = $smcFunc['db_query']('', '
-		SELECT id_member
-		FROM {db_prefix}moderators
-		WHERE id_board = {int:current_board}',
-		array(
-			'current_board' => $board,
-		)
-	);
-	$real_mods = array();
-	while ($row = $smcFunc['db_fetch_assoc']($request))
-		$real_mods[] = $row['id_member'];
-	$smcFunc['db_free_result']($request);
-
-	// Get any additional members who are in groups assigned to moderate this board
-	$request = $smcFunc['db_query']('', '
-		SELECT mem.id_member
-		FROM {db_prefix}members AS mem, {db_prefix}moderator_groups AS bm
-		WHERE bm.id_board = {int:current_board}
-			AND(
-				mem.id_group = bm.id_group
-				OR FIND_IN_SET(bm.id_group, mem.additional_groups) != 0
-			)',
-		array(
-			'current_board' => $board,
-		)
-	);
-
-	while ($row = $smcFunc['db_fetch_assoc']($request))
-		$real_mods[] = $row['id_member'];
-	$smcFunc['db_free_result']($request);
 
-	// Make sure we don't have any duplicates
-	$real_mods = array_unique($real_mods);
-
-	// Get the mods who want to be notified of stuff...
-	$request = $smcFunc['db_query']('', '
-		SELECT id_member, email_address, lngfile, mod_prefs
-		FROM {db_prefix}members
-		WHERE id_member IN ({array_int:moderator_list})
-			AND notify_types != {int:notify_types}
-		ORDER BY lngfile',
-		array(
-			'moderator_list' => $moderators,
-			'notify_types' => 4,
-		)
-	);
-
-	// Send every moderator an email.
-	while ($row = $smcFunc['db_fetch_assoc']($request))
-	{
-		// Maybe they don't want to know?!
-		if (!empty($row['mod_prefs']))
-		{
-			list(,, $pref_binary) = explode('|', $row['mod_prefs']);
-			if (!($pref_binary & 1) && (!($pref_binary & 2) || !in_array($row['id_member'], $real_mods)))
-				continue;
-		}
-
-		$replacements = array(
-			'TOPICSUBJECT' => $subject,
-			'POSTERNAME' => $poster_name,
-			'REPORTERNAME' => $reporterName,
-			'TOPICLINK' => $scripturl . '?topic=' . $topic . '.msg' . $_POST['msg'] . '#msg' . $_POST['msg'],
-			'REPORTLINK' => !empty($id_report) ? $scripturl . '?action=moderate;area=reports;report=' . $id_report : '',
-			'COMMENT' => $_POST['comment'],
+		// And get ready to notify people.
+		$smcFunc['db_insert']('insert',
+			'{db_prefix}background_tasks',
+			array('task_file' => 'string', 'task_class' => 'string', 'task_data' => 'string', 'claimed_time' => 'int'),
+			array('$sourcedir/tasks/MsgReport-Notify.php', 'MsgReport_Notify_Background', serialize(array(
+				'report_id' => $id_report,
+				'msg_id' => $_POST['msg'],
+				'topic_id' => $message['id_topic'],
+				'board_id' => $message['id_board'],
+				'sender_id' => $context['user']['id'],
+				'sender_name' => $context['user']['name'],
+				'time' => time(),
+			)), 0),
+			array('id_task')
 		);
-
-		$emaildata = loadEmailTemplate('report_to_moderator', $replacements, empty($row['lngfile']) || empty($modSettings['userLanguage']) ? $language : $row['lngfile']);
-
-		// Send it to the moderator.
-		sendmail($row['email_address'], $emaildata['subject'], $emaildata['body'], null, null, false, 2);
 	}
-	$smcFunc['db_free_result']($request);
 
 	// Keep track of when the mod reports get updated, that way we know when we need to look again.
 	updateSettings(array('last_mod_report_action' => time()));

+ 17 - 19
Sources/SplitTopics.php

@@ -830,7 +830,7 @@ function MergeTopics()
  */
 function MergeIndex()
 {
-	global $txt, $board, $context, $smcFunc;
+	global $txt, $board, $context, $smcFunc, $sourcedir;
 	global $scripturl, $topic, $user_info, $modSettings;
 
 	if (!isset($_GET['from']))
@@ -898,25 +898,23 @@ function MergeIndex()
 	if (empty($merge_boards))
 		fatal_lang_error('cannot_merge_any', 'user');
 
-	// Get a list of boards they can navigate to to merge.
-	$request = $smcFunc['db_query']('order_by_board_order', '
-		SELECT b.id_board, b.name AS board_name, c.name AS cat_name
-		FROM {db_prefix}boards AS b
-			LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
-		WHERE {query_see_board}' . (!in_array(0, $merge_boards) ? '
-			AND b.id_board IN ({array_int:merge_boards})' : ''),
-		array(
-			'merge_boards' => $merge_boards,
-		)
-	);
-	$context['boards'] = array();
-	while ($row = $smcFunc['db_fetch_assoc']($request))
-		$context['boards'][] = array(
-			'id' => $row['id_board'],
-			'name' => $row['board_name'],
-			'category' => $row['cat_name']
+	// No sense in loading this if you can only merge on this board
+	if (count($merge_boards) > 1 || in_array(0, $merge_boards))
+	{
+		require_once($sourcedir . '/Subs-MessageIndex.php');
+
+		// Set up a couple of options for our board list
+		$options = array(
+			'not_redirection' => true,
+			'selected_board' => $context['target_board'],
 		);
-	$smcFunc['db_free_result']($request);
+	
+		// Only include these boards in the list (0 means you're an admin')
+		if (!in_array(0, $merge_boards))
+			$options['included_boards'] = $merge_boards;
+
+		$context['merge_categories'] = getBoardList($options);
+	}
 
 	// Get some topics to merge it with.
 	$request = $smcFunc['db_query']('', '

+ 3 - 3
Sources/Subs-BoardIndex.php

@@ -319,9 +319,9 @@ function getBoardIndex($boardIndexOptions)
 		if (!empty($settings['avatars_on_indexes']))
 			$this_last_post['member']['avatar'] = array(
 				'name' => $row_board['avatar'],
-				'image' => $row_board['avatar'] == '' ? ($row_board['id_attach'] > 0 ? '<img class="avatar" src="' . (empty($row_board['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row_board['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" />' : '') : (stristr($row_board['avatar'], 'http://') ? '<img class="avatar" src="' . $row_board['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" />' : '<img class="avatar" src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row_board['avatar']) . '" alt="" />'),
-				'href' => $row_board['avatar'] == '' ? ($row_board['id_attach'] > 0 ? (empty($row_board['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row_board['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) : '') : (stristr($row_board['avatar'], 'http://') ? $row_board['avatar'] : $modSettings['avatar_url'] . '/' . $row_board['avatar']),
-				'url' => $row_board['avatar'] == '' ? '' : (stristr($row_board['avatar'], 'http://') ? $row_board['avatar'] : $modSettings['avatar_url'] . '/' . $row_board['avatar'])
+				'image' => $row_board['avatar'] == '' ? ($row_board['id_attach'] > 0 ? '<img class="avatar" src="' . (empty($row_board['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row_board['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" />' : '') : (stristr($row_board['avatar'], 'http://') || stristr($row_board['avatar'], 'https://') ? '<img class="avatar" src="' . $row_board['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" />' : '<img class="avatar" src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row_board['avatar']) . '" alt="" />'),
+				'href' => $row_board['avatar'] == '' ? ($row_board['id_attach'] > 0 ? (empty($row_board['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row_board['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) : '') : (stristr($row_board['avatar'], 'http://') || stristr($row_board['avatar'], 'https://') ? $row_board['avatar'] : $modSettings['avatar_url'] . '/' . $row_board['avatar']),
+				'url' => $row_board['avatar'] == '' ? '' : (stristr($row_board['avatar'], 'http://') || stristr($row_board['avatar'], 'https://') ? $row_board['avatar'] : $modSettings['avatar_url'] . '/' . $row_board['avatar'])
 			);
 
 		// Provide the href and link.

+ 0 - 3
Sources/Subs-Db-postgresql.php

@@ -321,9 +321,6 @@ function smf_db_query($identifier, $db_string, $db_values = array(), $connection
 		'insert_log_search_results_subject' => array(
 			'~NOT RLIKE~' => '!~',
 		),
-		'messageindex_fetch_boards' => array(
-			'~(.)$~' => '$1 ORDER BY b.board_order',
-		),
 		'select_message_icons' => array(
 			'~(.)$~' => '$1 ORDER BY icon_order',
 		),

+ 0 - 3
Sources/Subs-Db-sqlite.php

@@ -317,9 +317,6 @@ function smf_db_query($identifier, $db_string, $db_values = array(), $connection
 		'boardindex_fetch_boards' => array(
 			'~(.)$~' => '$1 ORDER BY b.board_order',
 		),
-		'messageindex_fetch_boards' => array(
-			'~(.)$~' => '$1 ORDER BY b.board_order',
-		),
 		'order_by_board_order' => array(
 			'~(.)$~' => '$1 ORDER BY b.board_order',
 		),

+ 0 - 3
Sources/Subs-Db-sqlite3.php

@@ -357,9 +357,6 @@ function smf_db_query($identifier, $db_string, $db_values = array(), $connection
 		'boardindex_fetch_boards' => array(
 			'~(.)$~' => '$1 ORDER BY b.board_order',
 		),
-		'messageindex_fetch_boards' => array(
-			'~(.)$~' => '$1 ORDER BY b.board_order',
-		),
 		'order_by_board_order' => array(
 			'~(.)$~' => '$1 ORDER BY b.board_order',
 		),

+ 1 - 1
Sources/Subs-Editor.php

@@ -1937,7 +1937,7 @@ function create_control_richedit($editorOptions)
 function create_control_verification(&$verificationOptions, $do_test = false)
 {
 	global $txt, $modSettings, $options, $smcFunc;
-	global $context, $settings, $user_info, $sourcedir, $scripturl, $language;
+	global $context, $user_info, $sourcedir, $scripturl, $language;
 
 	// First verification means we need to set up some bits...
 	if (empty($context['controls']['verification']))

+ 1 - 1
Sources/Subs-Graphics.php

@@ -343,7 +343,7 @@ function resizeImageFile($source, $destination, $max_width, $max_height, $prefer
 
 	// Get the image file, we have to work with something after all
 	$fp_destination = fopen($destination, 'wb');
-	if ($fp_destination && substr($source, 0, 7) == 'http://')
+	if ($fp_destination && (substr($source, 0, 7) == 'http://' || substr($source, 0, 8) == 'https://'))
 	{
 		$fileContents = fetch_web_data($source);
 

+ 1 - 1
Sources/Subs-List.php

@@ -22,7 +22,7 @@ if (!defined('SMF'))
 
 function createList($listOptions)
 {
-	global $context, $settings, $options, $txt, $modSettings, $scripturl, $smcFunc;
+	global $context, $options, $txt, $modSettings, $scripturl, $smcFunc;
 
 	assert(isset($listOptions['id']));
 	assert(isset($listOptions['columns']));

+ 1 - 1
Sources/Subs-Members.php

@@ -440,7 +440,7 @@ function deleteMembers($users, $check_not_admin = false)
 function registerMember(&$regOptions, $return_errors = false)
 {
 	global $scripturl, $txt, $modSettings, $context, $sourcedir;
-	global $user_info, $options, $settings, $smcFunc;
+	global $user_info, $options, $smcFunc;
 
 	loadLanguage('Login');
 

+ 1 - 1
Sources/Subs-MessageIndex.php

@@ -54,7 +54,7 @@ function getBoardList($boardListOptions = array())
 		$where_parameters['blank_redirect'] = '';
 	}
 
-	$request = $smcFunc['db_query']('messageindex_fetch_boards', '
+	$request = $smcFunc['db_query']('order_by_board_order', '
 		SELECT c.name AS cat_name, c.id_cat, b.id_board, b.name AS board_name, b.child_level
 		FROM {db_prefix}boards AS b
 			LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)' . (empty($where) ? '' : '

+ 12 - 3
Sources/Subs-Notify.php

@@ -20,9 +20,10 @@ if (!defined('SMF'))
  *
  * @param mixed $members A user id or an array of (integer) user ids to load preferences for
  * @param mixed $prefs An empty string to load all preferences, or a string (or array) of preference name(s) to load
+ * @param mixed $process_default Whether to apply the default values to the members' values or not.
  * @return array An array of user ids => array (pref name -> value), with user id 0 representing the defaults
  */
-function getNotifyPrefs($members, $prefs = '')
+function getNotifyPrefs($members, $prefs = '', $process_default = false)
 {
 	global $smcFunc;
 
@@ -52,8 +53,16 @@ function getNotifyPrefs($members, $prefs = '')
 		$result[$row['id_member']][$row['alert_pref']] = $row['alert_value'];
 	}
 
-	// Let's not bother to reduplicate the default value for all the other values,
-	// no point splurging on potentially a lot of memory unnecessarily.
+	// We may want to keep the default values separate from a given user's. Or we might not.
+	if ($process_default && isset($result[0]))
+	{
+		foreach ($members as $member)
+			if (!isset($result[$member]))
+				$result[$member] = $result[0];
+
+		unset ($result[0]);
+	}
+
 	return $result;
 }
 

+ 3 - 3
Sources/Subs-Package.php

@@ -31,7 +31,7 @@ if (!defined('SMF'))
  */
 function read_tgz_file($gzfilename, $destination, $single_file = false, $overwrite = false, $files_to_extract = null)
 {
-	if (substr($gzfilename, 0, 7) == 'http://')
+	if (substr($gzfilename, 0, 7) == 'http://' || substr($gzfilename, 0, 8) == 'https://')
 	{
 		$data = fetch_web_data($gzfilename);
 
@@ -434,7 +434,7 @@ function getPackageInfo($gzfilename)
 	global $boarddir, $sourcedir, $packagesdir, $smcFunc;
 
 	// Extract package-info.xml from downloaded file. (*/ is used because it could be in any directory.)
-	if (strpos($gzfilename, 'http://') !== false)
+	if (strpos($gzfilename, 'http://') !== false || strpos($gzfilename, 'https://') !== false)
 		$packageInfo = read_tgz_data(fetch_web_data($gzfilename, '', true), '*/package-info.xml', true);
 	else
 	{
@@ -1868,7 +1868,7 @@ function listtree($path, $sub_path = '')
  */
 function parseModification($file, $testing = true, $undo = false, $theme_paths = array())
 {
-	global $boarddir, $sourcedir, $settings, $txt, $modSettings, $package_ftp;
+	global $boarddir, $sourcedir, $txt, $modSettings, $package_ftp;
 
 	@set_time_limit(600);
 	require_once($sourcedir . '/Class-Package.php');

+ 1 - 1
Sources/Subs-Themes.php

@@ -460,7 +460,7 @@ function remove_dir($path)
  */
 function remove_theme($themeID)
 {
-	global $smcFunc, $modSetting;
+	global $smcFunc, $modSettings;
 
 	// Can't delete the default theme, sorry!
 	if (empty($themeID) || $themeID == 1)

+ 12 - 63
Sources/Subs.php

@@ -2887,15 +2887,13 @@ function setupThemeContext($forceload = false)
 		if (allowedTo('moderate_forum'))
 			$context['unapproved_members'] = (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2) || !empty($modSettings['approveAccountDeletion']) ? $modSettings['unapprovedMembers'] : 0;
 
-		$context['show_open_reports'] = empty($user_settings['mod_prefs']) || $user_settings['mod_prefs'][0] == 1;
-
 		$context['user']['avatar'] = array();
 
 		// Figure out the avatar... uploaded?
 		if ($user_info['avatar']['url'] == '' && !empty($user_info['avatar']['id_attach']))
 			$context['user']['avatar']['href'] = $user_info['avatar']['custom_dir'] ? $modSettings['custom_avatar_url'] . '/' . $user_info['avatar']['filename'] : $scripturl . '?action=dlattach;attach=' . $user_info['avatar']['id_attach'] . ';type=avatar';
 		// Full URL?
-		elseif (substr($user_info['avatar']['url'], 0, 7) == 'http://')
+		elseif (strpos($user_info['avatar']['url'], 'http://') === 0 || strpos($user_info['avatar']['url'], 'https://') === 0)
 		{
 			$context['user']['avatar']['href'] = $user_info['avatar']['url'];
 
@@ -3123,8 +3121,12 @@ function template_header()
 		if (in_array($layer, array('body', 'main')) && allowedTo('admin_forum') && !$user_info['is_guest'] && !$checked_securityFiles)
 		{
 			$checked_securityFiles = true;
-			// @todo add a hook here
+
 			$securityFiles = array('install.php', 'webinstall.php', 'upgrade.php', 'convert.php', 'repair_paths.php', 'repair_settings.php', 'Settings.php~', 'Settings_bak.php~');
+
+			// Add your own files.
+			call_integration_hook('integrate_security_files', array(&$securityFiles));
+
 			foreach ($securityFiles as $i => $securityFile)
 			{
 				if (!file_exists($boarddir . '/' . $securityFile))
@@ -3218,14 +3220,14 @@ function template_header()
  */
 function theme_copyright()
 {
-	global $forum_copyright, $context, $boardurl, $forum_version, $txt, $modSettings;
+	global $forum_copyright, $software_year, $context, $boardurl, $forum_version, $txt, $modSettings;
 
 	// Don't display copyright for things like SSI.
-	if (!isset($forum_version))
+	if (!isset($forum_version) || !isset($software_year))
 		return;
 
 	// Put in the version...
-	$forum_copyright = sprintf($forum_copyright, $forum_version);
+	$forum_copyright = sprintf($forum_copyright, $forum_version, $software_year);
 
 	echo '
 			<span class="smalltext" style="display: inline; visibility: visible; font-family: Verdana, Arial, sans-serif;">' . $forum_copyright . '
@@ -3394,57 +3396,9 @@ function getAttachmentFilename($filename, $attachment_id, $dir = null, $new = fa
 		$smcFunc['db_free_result']($request);
 	}
 
-	// In case of files from the old system, do a legacy call.
+	// Still no hash? mmm...
 	if (empty($file_hash))
-		return getLegacyAttachmentFilename($filename, $attachment_id, $dir, $new);
-
-	// Are we using multiple directories?
-	if (!empty($modSettings['currentAttachmentUploadDir']))
-	{
-		if (!is_array($modSettings['attachmentUploadDir']))
-			$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
-		$path = $modSettings['attachmentUploadDir'][$dir];
-	}
-	else
-		$path = $modSettings['attachmentUploadDir'];
-
-	return $path . '/' . $attachment_id . '_' . $file_hash;
-}
-
-/**
- * Older attachments may still use this function.
- *
- * @param $filename
- * @param $attachment_id
- * @param $dir
- * @param $new
- */
-function getLegacyAttachmentFilename($filename, $attachment_id, $dir = null, $new = false)
-{
-	global $modSettings, $db_character_set;
-
-	$clean_name = $filename;
-	// Remove international characters (windows-1252)
-	// These lines should never be needed again. Still, behave.
-	if (empty($db_character_set) || $db_character_set != 'utf8')
-	{
-		$clean_name = strtr($filename,
-			"\x8a\x8e\x9a\x9e\x9f\xc0\xc1\xc2\xc3\xc4\xc5\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xe0\xe1\xe2\xe3\xe4\xe5\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xff",
-			'SZszYAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
-		$clean_name = strtr($clean_name, array("\xde" => 'TH', "\xfe" =>
-			'th', "\xd0" => 'DH', "\xf0" => 'dh', "\xdf" => 'ss', "\x8c" => 'OE',
-			"\x9c" => 'oe', "\xc6" => 'AE', "\xe6" => 'ae', "\xb5" => 'u'));
-	}
-	// Sorry, no spaces, dots, or anything else but letters allowed.
-	$clean_name = preg_replace(array('/\s/', '/[^\w_\.\-]/'), array('_', ''), $clean_name);
-
-	$enc_name = $attachment_id . '_' . strtr($clean_name, '.', '_') . md5($clean_name);
-	$clean_name = preg_replace('~\.[\.]+~', '.', $clean_name);
-
-	if ($attachment_id == false || ($new && empty($modSettings['attachmentEncryptFilenames'])))
-		return $clean_name;
-	elseif ($new)
-		return $enc_name;
+		$file_hash = sha1(md5($filename . time()) . mt_rand());
 
 	// Are we using multiple directories?
 	if (!empty($modSettings['currentAttachmentUploadDir']))
@@ -3456,12 +3410,7 @@ function getLegacyAttachmentFilename($filename, $attachment_id, $dir = null, $ne
 	else
 		$path = $modSettings['attachmentUploadDir'];
 
-	if (file_exists($path . '/' . $enc_name))
-		$filename = $path . '/' . $enc_name;
-	else
-		$filename = $path . '/' . $clean_name;
-
-	return $filename;
+	return $path . '/' . $attachment_id . '_' . $file_hash .'.dat';
 }
 
 /**

+ 2 - 2
Sources/Who.php

@@ -520,7 +520,7 @@ function determineActions($urls, $preferred_prefix = false)
  */
 function Credits($in_admin = false)
 {
-	global $context, $smcFunc, $modSettings, $forum_copyright, $forum_version, $boardurl, $txt, $user_info;
+	global $context, $smcFunc, $modSettings, $forum_copyright, $forum_version, $software_year, $boardurl, $txt, $user_info;
 
 	// Don't blink. Don't even blink. Blink and you're dead.
 	loadLanguage('Who');
@@ -769,7 +769,7 @@ function Credits($in_admin = false)
 	$context['credits_modifications'] = $mods;
 
 	$context['copyrights'] = array(
-		'smf' => sprintf($forum_copyright, $forum_version),
+		'smf' => sprintf($forum_copyright, $forum_version, $software_year),
 		/* Modification Authors:  You may add a copyright statement to this array for your mods.
 			Copyright statements should be in the form of a value only without a array key.  I.E.:
 				'Some Mod by Thantos &copy; 2010',

+ 4 - 8
Sources/tasks/GroupReq-Notify.php

@@ -45,21 +45,17 @@ class GroupReq_Notify_Background extends SMF_BackgroundTask
 			$data = array('alert' => array(), 'email' => array());
 
 			require_once($sourcedir . '/Subs-Notify.php');
-			$prefs = getNotifyPrefs($moderators, 'request_group');
+			$prefs = getNotifyPrefs($moderators, 'request_group', true);
 
 			// Bitwise comparisons are fun...
 			foreach ($moderators as $mod)
 			{
-				// Do we have any defaults?
-				if (isset($prefs[0]) && !isset($prefs[$mod]))
-					$prefs[$mod] = $prefs[0];
-
-				if (!empty($prefs[$mod]))
+				if (!empty($prefs[$mod]['request_group']))
 				{
-					if ($prefs[$mod] & 0x01 == 0x01)
+					if ($prefs[$mod]['request_group'] & 0x01)
 						$data['alert'][] = $mod;
 
-					if ($prefs[$mod] & 0x02 == 0x02)
+					if ($prefs[$mod]['request_group'] & 0x02)
 						$data['email'][] = $mod;
 				}
 			}

+ 2 - 6
Sources/tasks/Likes-Notify.php

@@ -69,16 +69,12 @@ class Likes_Notify_Background extends SMF_BackgroundTask
 			return true;
 
 		require_once($sourcedir . '/Subs-Notify.php');
-		$prefs = getNotifyPrefs($author, $this->_details['content_type'] . '_like');
+		$prefs = getNotifyPrefs($author, $this->_details['content_type'] . '_like', true);
 
 		// The likes setup doesn't support email notifications because that would be too many emails.
 		// As a result, the value should really just be non empty.
 
-		// First, grab the default if there is one.
-		if (!isset($prefs[$author]) && isset($prefs[0]))
-			$prefs[$author] = $prefs[0];
-
-		// Second, check the value. If no value or it's empty, they didn't want alerts, oh well.
+		// Check the value. If no value or it's empty, they didn't want alerts, oh well.
 		if (empty($prefs[$author][$this->_details['content_type'] . '_like']))
 			return true;
 

+ 183 - 0
Sources/tasks/MsgReport-Notify.php

@@ -0,0 +1,183 @@
+<?php
+
+/**
+ * This task handles notifying users when a message gets reported.
+ *
+ * Simple Machines Forum (SMF)
+ *
+ * @package SMF
+ * @author Simple Machines http://www.simplemachines.org
+ * @copyright 2013 Simple Machines and individual contributors
+ * @license http://www.simplemachines.org/about/smf/license.php BSD
+ *
+ * @version 2.1 Alpha 1
+ */
+
+class MsgReport_Notify_Background extends SMF_BackgroundTask
+{
+	public function execute()
+	{
+		global $smcFunc, $sourcedir, $modSettings, $language, $scripturl;
+
+		// We need to know who can moderate this board - and therefore who can see this report.
+		// First up, people who have moderate_board in the board this topic was in.
+		require_once($sourcedir . '/Subs-Members.php');
+		$members = membersAllowedTo('moderate_board', $this->_details['board_id']);
+
+		// Second, anyone assigned to be a moderator of this board directly.
+		$request = $smcFunc['db_query']('', '
+			SELECT id_member
+			FROM {db_prefix}moderators
+			WHERE id_board = {int:current_board}',
+			array(
+				'current_board' => $this->_details['board_id'],
+			)
+		);
+		while ($row = $smcFunc['db_fetch_assoc']($request))
+			$members[] = $row['id_member'];
+		$smcFunc['db_free_result']($request);
+
+		// Thirdly, anyone assigned to be a moderator of this group as a group->board moderator.
+		$request = $smcFunc['db_query']('', '
+			SELECT mem.id_member
+			FROM {db_prefix}members AS mem, {db_prefix}moderator_groups AS bm
+			WHERE bm.id_board = {int:current_board}
+				AND(
+					mem.id_group = bm.id_group
+					OR FIND_IN_SET(bm.id_group, mem.additional_groups) != 0
+				)',
+			array(
+				'current_board' => $this->_details['board_id'],
+			)
+		);
+
+		while ($row = $smcFunc['db_fetch_assoc']($request))
+			$members[] = $row['id_member'];
+		$smcFunc['db_free_result']($request);
+
+		// And now weed out the duplicates.
+		$members = array_flip(array_flip($members));
+
+		// And don't send it to them if they're the one who reported it.
+		$members = array_diff($members, array($this->_details['sender_id']));
+
+		// Having successfully figured this out, now let's get the preferences of everyone.
+		require_once($sourcedir . '/Subs-Notify.php');
+		$prefs = getNotifyPrefs($members, 'msg_report', true);
+
+		// So now we find out who wants what.
+		$alert_bits = array(
+			'alert' => 0x01,
+			'email' => 0x02,
+		);
+		$notifies = array();
+
+		foreach ($prefs as $member => $pref_option)
+		{
+			foreach ($alert_bits as $type => $bitvalue)
+				if ($pref_option['msg_report'] & $bitvalue)
+					$notifies[$type][] = $member;
+		}
+
+		// Firstly, anyone who wants alerts.
+		if (!empty($notifies['alert']))
+		{
+			// Alerts are relatively easy.
+			$insert_rows = array();
+			foreach ($notifies['alert'] as $member)
+			{
+				$insert_rows[] = array(
+					'alert_time' => $this->_details['time'],
+					'id_member' => $member,
+					'id_member_started' => $this->_details['sender_id'],
+					'member_name' => $this->_details['sender_name'],
+					'content_type' => 'msg',
+					'content_id' => $this->_details['msg_id'],
+					'content_action' => 'report',
+					'is_read' => 0,
+					'extra' => serialize(
+						array(
+							'report_link' => $scripturl . '?action=moderate;area=reports;report=' . $this->_details['report_id'],
+						)
+					),
+				);
+			}
+
+			$smcFunc['db_insert']('insert',
+				'{db_prefix}user_alerts',
+				array('alert_time' => 'int', 'id_member' => 'int', 'id_member_started' => 'int',
+					'member_name' => 'string', 'content_type' => 'string', 'content_id' => 'int',
+					'content_action' => 'string', 'is_read' => 'int', 'extra' => 'string'),
+				$insert_rows,
+				array('id_alert')
+			);
+
+			// And update the count of alerts for those people.
+			updateMemberData($notifies['alert'], array('alerts' => '+'));
+		}
+
+		// Secondly, anyone who wants emails.
+		if (!empty($notifies['email']))
+		{
+			// Emails are a bit complicated. We have to do language stuff.
+			require_once($sourcedir . '/Subs-Post.php');
+			require_once($sourcedir . '/ScheduledTasks.php');
+			loadEssentialThemeData();
+
+			// First, get everyone's language and details.
+			$emails = array();
+			$request = $smcFunc['db_query']('', '
+				SELECT id_member, lngfile, email_address
+				FROM {db_prefix}members
+				WHERE id_member IN ({array_int:members})',
+				array(
+					'members' => $notifies['email'],
+				)
+			);
+			while ($row = $smcFunc['db_fetch_assoc']($request))
+			{
+				if (empty($row['lngfile']))
+					$row['lngfile'] = $language;
+				$emails[$row['lngfile']][$row['id_member']] = $row['email_address'];
+			}
+			$smcFunc['db_free_result']($request);
+
+			// Second, get some details that might be nice for the report email.
+			// We don't bother cluttering up the tasks data for this, when it's really no bother to fetch it.
+			$request = $smcFunc['db_query']('', '
+				SELECT lr.subject, lr.membername, lr.body
+				FROM {db_prefix}log_reported AS lr
+				WHERE id_report = {int:report}',
+				array(
+					'report' => $this->_details['report_id'],
+				)
+			);
+			list ($subject, $poster_name, $comment) = $smcFunc['db_fetch_row']($request);
+			$smcFunc['db_free_result']($request);
+
+			// Third, iterate through each language, load the relevant templates and set up sending.
+			foreach ($emails as $this_lang => $recipients)
+			{
+				$replacements = array(
+					'TOPICSUBJECT' => $subject,
+					'POSTERNAME' => $poster_name,
+					'REPORTERNAME' => $this->_details['sender_name'],
+					'TOPICLINK' => $scripturl . '?topic=' . $this->_details['topic_id'] . '.msg' . $this->_details['msg_id'] . '#msg' . $this->_details['msg_id'],
+					'REPORTLINK' => $scripturl . '?action=moderate;area=reports;report=' . $this->_details['report_id'],
+					'COMMENT' => $comment,
+				);
+
+				$emaildata = loadEmailTemplate('report_to_moderator', $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang);
+
+				// And do the actual sending...
+				foreach ($recipients as $id_member => $email_address)
+					sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, null, false, 2);
+			}
+		}
+
+		// And now we're all done.
+		return true;
+	}
+}
+
+?>

+ 213 - 0
Sources/tasks/MsgReportReply-Notify.php

@@ -0,0 +1,213 @@
+<?php
+
+/**
+ * This task handles notifying users when they've commented to a moderation report and
+ * someone else replies to them.
+ *
+ * Simple Machines Forum (SMF)
+ *
+ * @package SMF
+ * @author Simple Machines http://www.simplemachines.org
+ * @copyright 2013 Simple Machines and individual contributors
+ * @license http://www.simplemachines.org/about/smf/license.php BSD
+ *
+ * @version 2.1 Alpha 1
+ */
+
+class MsgReportReply_Notify_Background extends SMF_BackgroundTask
+{
+	public function execute()
+	{
+		global $smcFunc, $sourcedir, $modSettings, $language, $scripturl;
+
+		// Let's see. Let us, first of all, establish the list of possible people.
+		$possible_members = array();
+		$request = $smcFunc['db_query']('', '
+			SELECT id_member
+			FROM {db_prefix}log_comments
+			WHERE id_notice = {int:report}
+				AND comment_type = {literal:reportc}
+				AND id_comment < {int:last_comment}',
+			array(
+				'report' => $this->_details['report_id'],
+				'last_comment' => $this->_details['comment_id'],
+			)
+		);
+		while ($row = $smcFunc['db_fetch_row']($request))
+			$possible_members[] = $row[0];
+		$smcFunc['db_free_result']($request);
+
+		// Presumably, there are some people?
+		if (!empty($possible_members))
+		{
+			$possible_members = array_flip(array_flip($possible_members));
+			$possible_members = array_diff($possible_members, array($this->_details['sender_id']));
+		}
+		if (empty($possible_members))
+			return true;
+
+		// We need to know who can moderate this board - and therefore who can see this report.
+		// First up, people who have moderate_board in the board this topic was in.
+		require_once($sourcedir . '/Subs-Members.php');
+		$members = membersAllowedTo('moderate_board', $this->_details['board_id']);
+
+		// Second, anyone assigned to be a moderator of this board directly.
+		$request = $smcFunc['db_query']('', '
+			SELECT id_member
+			FROM {db_prefix}moderators
+			WHERE id_board = {int:current_board}',
+			array(
+				'current_board' => $this->_details['board_id'],
+			)
+		);
+		while ($row = $smcFunc['db_fetch_assoc']($request))
+			$members[] = $row['id_member'];
+		$smcFunc['db_free_result']($request);
+
+		// Thirdly, anyone assigned to be a moderator of this group as a group->board moderator.
+		$request = $smcFunc['db_query']('', '
+			SELECT mem.id_member
+			FROM {db_prefix}members AS mem, {db_prefix}moderator_groups AS bm
+			WHERE bm.id_board = {int:current_board}
+				AND(
+					mem.id_group = bm.id_group
+					OR FIND_IN_SET(bm.id_group, mem.additional_groups) != 0
+				)',
+			array(
+				'current_board' => $this->_details['board_id'],
+			)
+		);
+
+		while ($row = $smcFunc['db_fetch_assoc']($request))
+			$members[] = $row['id_member'];
+		$smcFunc['db_free_result']($request);
+
+		// So now we have two lists: the people who replied to a report in the past,
+		// and all the possible people who could see said report.
+		$members = array_intersect($possible_members, $members);
+
+		// Having successfully figured this out, now let's get the preferences of everyone.
+		require_once($sourcedir . '/Subs-Notify.php');
+		$prefs = getNotifyPrefs($members, 'msg_report_reply', true);
+
+		// So now we find out who wants what.
+		$alert_bits = array(
+			'alert' => 0x01,
+			'email' => 0x02,
+		);
+		$notifies = array();
+		print_r($prefs);
+
+		foreach ($prefs as $member => $pref_option)
+		{
+			foreach ($alert_bits as $type => $bitvalue)
+			{
+				if ($pref_option['msg_report_reply'] & $bitvalue)
+					$notifies[$type][] = $member;
+			}
+		}
+
+		print_r($notifies);
+
+		// Firstly, anyone who wants alerts.
+		if (!empty($notifies['alert']))
+		{
+			// Alerts are relatively easy.
+			$insert_rows = array();
+			foreach ($notifies['alert'] as $member)
+			{
+				$insert_rows[] = array(
+					'alert_time' => $this->_details['time'],
+					'id_member' => $member,
+					'id_member_started' => $this->_details['sender_id'],
+					'member_name' => $this->_details['sender_name'],
+					'content_type' => 'msg',
+					'content_id' => $this->_details['msg_id'],
+					'content_action' => 'report_reply',
+					'is_read' => 0,
+					'extra' => serialize(
+						array(
+							'report_link' => $scripturl . '?action=moderate;area=reports;report=' . $this->_details['report_id'],
+						)
+					),
+				);
+			}
+
+			$smcFunc['db_insert']('insert',
+				'{db_prefix}user_alerts',
+				array('alert_time' => 'int', 'id_member' => 'int', 'id_member_started' => 'int',
+					'member_name' => 'string', 'content_type' => 'string', 'content_id' => 'int',
+					'content_action' => 'string', 'is_read' => 'int', 'extra' => 'string'),
+				$insert_rows,
+				array('id_alert')
+			);
+
+			// And update the count of alerts for those people.
+			updateMemberData($notifies['alert'], array('alerts' => '+'));
+		}
+
+		// Secondly, anyone who wants emails.
+		if (!empty($notifies['email']))
+		{
+			// Emails are a bit complicated. We have to do language stuff.
+			require_once($sourcedir . '/Subs-Post.php');
+			require_once($sourcedir . '/ScheduledTasks.php');
+			loadEssentialThemeData();
+
+			// First, get everyone's language and details.
+			$emails = array();
+			$request = $smcFunc['db_query']('', '
+				SELECT id_member, lngfile, email_address
+				FROM {db_prefix}members
+				WHERE id_member IN ({array_int:members})',
+				array(
+					'members' => $notifies['email'],
+				)
+			);
+			while ($row = $smcFunc['db_fetch_assoc']($request))
+			{
+				if (empty($row['lngfile']))
+					$row['lngfile'] = $language;
+				$emails[$row['lngfile']][$row['id_member']] = $row['email_address'];
+			}
+			$smcFunc['db_free_result']($request);
+
+			// Second, get some details that might be nice for the report email.
+			// We don't bother cluttering up the tasks data for this, when it's really no bother to fetch it.
+			$request = $smcFunc['db_query']('', '
+				SELECT lr.subject, lr.membername, lr.body
+				FROM {db_prefix}log_reported AS lr
+				WHERE id_report = {int:report}',
+				array(
+					'report' => $this->_details['report_id'],
+				)
+			);
+			list ($subject, $poster_name, $comment) = $smcFunc['db_fetch_row']($request);
+			$smcFunc['db_free_result']($request);
+
+			// Third, iterate through each language, load the relevant templates and set up sending.
+			foreach ($emails as $this_lang => $recipients)
+			{
+				echo 'Emailing (' . $this_lang . ') to ' . print_r($recipients, true);
+				$replacements = array(
+					'TOPICSUBJECT' => $subject,
+					'POSTERNAME' => $poster_name,
+					'COMMENTERNAME' => $this->_details['sender_name'],
+					'TOPICLINK' => $scripturl . '?topic=' . $this->_details['topic_id'] . '.msg' . $this->_details['msg_id'] . '#msg' . $this->_details['msg_id'],
+					'REPORTLINK' => $scripturl . '?action=moderate;area=reports;report=' . $this->_details['report_id'],
+				);
+
+				$emaildata = loadEmailTemplate('reply_to_moderator', $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang);
+
+				// And do the actual sending...
+				foreach ($recipients as $id_member => $email_address)
+					sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, null, false, 3);
+			}
+		}
+
+		// And now we're all done.
+		return true;
+	}
+}
+
+?>

+ 3 - 13
Sources/tasks/Register-Notify.php

@@ -17,7 +17,7 @@ class Register_Notify_Background extends SMF_BackgroundTask
 {
 	public function execute()
 	{
-		global $smcFunc, $sourcedir, $language, $scripturl;
+		global $smcFunc, $sourcedir, $modSettings, $language, $scripturl;
 
 		// Get everyone who could be notified.
 		require_once($sourcedir . '/Subs-Members.php');
@@ -25,17 +25,7 @@ class Register_Notify_Background extends SMF_BackgroundTask
 
 		// Having successfully figured this out, now let's get the preferences of everyone.
 		require_once($sourcedir . '/Subs-Notify.php');
-		$prefs = getNotifyPrefs($members, 'member_register');
-
-		// Apply defaults if we got some.
-		if (isset($prefs[0]))
-		{
-			foreach ($members as $member)
-				if (!isset($prefs[$member]))
-					$prefs[$member] = $prefs[0];
-
-			unset ($prefs[0]); // Don't need this any more.
-		}
+		$prefs = getNotifyPrefs($members, 'member_register', true);
 
 		// So now we find out who wants what.
 		$alert_bits = array(
@@ -47,7 +37,7 @@ class Register_Notify_Background extends SMF_BackgroundTask
 		foreach ($prefs as $member => $pref_option)
 		{
 			foreach ($alert_bits as $type => $bitvalue)
-				if ($pref_option & $bitvalue == $bitvalue)
+				if ($pref_option['member_register'] & $bitvalue)
 					$notifies[$type][] = $member;
 		}
 

+ 5 - 5
Themes/default/Admin.template.php

@@ -306,7 +306,7 @@ function template_credits()
  */
 function template_view_versions()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 					<div id="admincenter">
@@ -534,7 +534,7 @@ function template_view_versions()
 // Form for stopping people using naughty words, etc.
 function template_edit_censored()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	if (!empty($context['saved_successful']))
 		echo '
@@ -622,7 +622,7 @@ function template_edit_censored()
 // Maintenance is a lovely thing, isn't it?
 function template_not_done()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 					<div id="admincenter">
@@ -971,7 +971,7 @@ function template_show_settings()
 // Template for showing custom profile fields.
 function template_show_custom_profile()
 {
-	global $context, $txt, $settings, $scripturl;
+	global $context, $txt, $scripturl;
 
 	if (!empty($context['saved_successful']))
 		echo '
@@ -1291,7 +1291,7 @@ function template_admin_search_results()
 // This little beauty shows questions and answer from the captcha type feature.
 function template_callback_question_answer_list()
 {
-	global $txt, $context, $settings;
+	global $txt, $context;
 
 	foreach ($context['languages'] as $lang_id => $lang)
 	{

+ 2 - 2
Themes/default/BoardIndex.template.php

@@ -367,8 +367,8 @@ function template_info_center()
 	echo '
 			<div class="title_barIC">
 				<h4 class="titlebg">
-						', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<span class="stats_icon people"></span>', $txt['online_users'], '', $context['show_who'] ? '</a>' : '', '
-					</h4>
+					', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<span class="stats_icon people"></span>', $txt['online_users'], '', $context['show_who'] ? '</a>' : '', '
+				</h4>
 			</div>
 			<p class="inline">
 				', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<strong>', $txt['online'], ': </strong>', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

+ 1 - 1
Themes/default/Compat.template.php

@@ -13,7 +13,7 @@
 // Generate a strip of buttons, out of buttons.
 function template_button_strip($button_strip, $direction = 'top', $strip_options = array())
 {
-	global $settings, $context, $txt, $scripturl;
+	global $context, $txt, $scripturl;
 
 	// Compatibility.
 	if (!is_array($strip_options))

+ 4 - 4
Themes/default/Display.template.php

@@ -636,18 +636,18 @@ function template_single_post($message, $force_alternate = null)
 			// 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'] ? '<span class="generic_icons www" title="' . $message['member']['website']['title'] . '" style="vertical-align: middle"></span>' : $txt['www']), '</a></li>';
+										<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $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')) && $context['can_send_email'])
 				echo '
-										<li><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';
+										<li><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $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'] ? '<span class="pm_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" style="vertical-align:middle"></span>' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
+										<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'] ? '<span class="pm_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span>' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
 
 				echo '
 									</ol>
@@ -668,7 +668,7 @@ function template_single_post($message, $force_alternate = null)
 	// Otherwise, show the guest's email.
 	elseif (!empty($message['member']['email']) && in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')) && $context['can_send_email'])
 		echo '
-								<li class="email"><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';
+								<li class="email"><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
 
 	// Show the IP to this user for this post - because you can moderate?
 	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))

+ 1 - 1
Themes/default/Errors.template.php

@@ -19,7 +19,7 @@
 // Show an error message.....
 function template_fatal_error()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 
 	echo '
 	<div id="fatal_error">

+ 1 - 1
Themes/default/GenericControls.template.php

@@ -216,7 +216,7 @@ function template_control_richedit_buttons($editor_id)
 // What's this, verification?!
 function template_control_verification($verify_id, $display_type = 'all', $reset = false)
 {
-	global $context, $settings, $options, $txt, $modSettings;
+	global $context, $options, $txt, $modSettings;
 
 	$verify_context = &$context['controls']['verification'][$verify_id];
 

+ 3 - 3
Themes/default/GenericList.template.php

@@ -12,7 +12,7 @@
 
 function template_show_list($list_id = null)
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	// Get a shortcut to the current list.
 	$list_id = $list_id === null ? $context['default_list'] : $list_id;
@@ -185,7 +185,7 @@ function template_show_list($list_id = null)
 
 function template_additional_rows($row_position, $cur_list)
 {
-	global $context, $settings, $options;
+	global $context, $options;
 
 	foreach ($cur_list['additional_rows'][$row_position] as $row)
 		echo '
@@ -194,7 +194,7 @@ function template_additional_rows($row_position, $cur_list)
 
 function template_create_list_menu($list_menu, $direction = 'top')
 {
-	global $context, $settings;
+	global $context;
 
 	/**
 		// This is use if you want your generic lists to have tabs.

+ 2 - 2
Themes/default/GenericMenu.template.php

@@ -13,7 +13,7 @@
 // This contains the html for the side bar of the admin center, which is used for all admin pages.
 function template_generic_menu_dropdown_above()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	// Which menu are we rendering?
 	$context['cur_menu_id'] = isset($context['cur_menu_id']) ? $context['cur_menu_id'] + 1 : 1;
@@ -97,7 +97,7 @@ function template_generic_menu_dropdown_above()
 // Part of the admin layer - used with admin_above to close the table started in it.
 function template_generic_menu_dropdown_below()
 {
-	global $context, $settings, $options;
+	global $context, $options;
 
 	echo '
 				</div>';

+ 2 - 2
Themes/default/Login.template.php

@@ -243,7 +243,7 @@ function template_admin_login()
 // Activate your account manually?
 function template_retry_activate()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	// Just ask them for their code so they can try it again...
 	echo '
@@ -272,7 +272,7 @@ function template_retry_activate()
 // Activate your account manually?
 function template_resend()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	// Just ask them for their code so they can try it again...
 	echo '

+ 1 - 1
Themes/default/ManageAttachments.template.php

@@ -190,7 +190,7 @@ function template_maintenance()
 
 function template_attachment_repair()
 {
-	global $context, $txt, $scripturl, $settings;
+	global $context, $txt, $scripturl;
 
 	// If we've completed just let them know!
 	if ($context['completed'])

+ 1 - 1
Themes/default/ManageBans.template.php

@@ -12,7 +12,7 @@
 
 function template_ban_edit()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="manage_bans">

+ 3 - 3
Themes/default/ManageBoards.template.php

@@ -110,7 +110,7 @@ function template_main()
 // Template for editing/adding a category on the forum.
 function template_modify_category()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	// Print table header.
 	echo '
@@ -199,7 +199,7 @@ function template_modify_category()
 // A template to confirm if a user wishes to delete a category - and whether they want to save the boards.
 function template_confirm_category_delete()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	// Print table header.
 	echo '
@@ -660,7 +660,7 @@ function template_modify_board()
 // A template used when a user is deleting a board with child boards in it - to see what they want to do with them.
 function template_confirm_board_delete()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	// Print table header.
 	echo '

+ 1 - 1
Themes/default/ManageCalendar.template.php

@@ -13,7 +13,7 @@
 // Editing or adding holidays.
 function template_edit_holiday()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	// Start with javascript for getting the calendar dates right.
 	echo '

+ 1 - 1
Themes/default/ManageLanguages.template.php

@@ -425,7 +425,7 @@ function template_modify_language_entries()
  */
 function template_add_language()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="admincenter">

+ 1 - 1
Themes/default/ManageMail.template.php

@@ -12,7 +12,7 @@
 
 function template_browse()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<div id="manage_mail">

+ 16 - 14
Themes/default/ManageMaintenance.template.php

@@ -13,7 +13,7 @@
 // Template for the database maintenance tasks.
 function template_maintain_database()
 {
-	global $context, $settings, $options, $txt, $scripturl, $db_type, $modSettings;
+	global $context, $options, $txt, $scripturl, $db_type, $modSettings;
 
 	// If maintenance has finished tell the user.
 	if (!empty($context['maintenance_finished']))
@@ -104,7 +104,7 @@ function template_maintain_database()
 // Template for the routine maintenance tasks.
 function template_maintain_routine()
 {
-	global $context, $settings, $options, $txt, $scripturl, $modSettings;
+	global $context, $options, $txt, $scripturl, $modSettings;
 
 	// Starts off with general maintenance procedures.
 	echo '
@@ -487,13 +487,14 @@ function template_maintain_topics()
 	foreach ($context['categories'] as $category)
 	{
 		echo '
-						<option disabled="disabled">--------------------------------------</option>
-						<option disabled="disabled">', $category['name'], '</option>
-						<option disabled="disabled">--------------------------------------</option>';
+						<optgroup label="', $category['name'], '">';
 
 		foreach ($category['boards'] as $board)
 			echo '
-						<option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=&gt;&nbsp;', $board['name'], '</option>';
+							<option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=&gt;&nbsp;', $board['name'], '</option>';
+
+		echo '
+						</optgroup>';
 	}
 
 	echo '
@@ -506,13 +507,14 @@ function template_maintain_topics()
 	foreach ($context['categories'] as $category)
 	{
 		echo '
-						<option disabled="disabled">--------------------------------------</option>
-						<option disabled="disabled">', $category['name'], '</option>
-						<option disabled="disabled">--------------------------------------</option>';
+						<optgroup label="', $category['name'], '">';
 
 		foreach ($category['boards'] as $board)
 			echo '
-						<option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=&gt;&nbsp;', $board['name'], '</option>';
+							<option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=&gt;&nbsp;', $board['name'], '</option>';
+
+		echo '
+						</optgroup>';
 	}
 	echo '
 					</select></p>
@@ -535,7 +537,7 @@ function template_maintain_topics()
 // Simple template for showing results of our optimization...
 function template_optimize()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="manage_maintenance">
@@ -567,7 +569,7 @@ function template_optimize()
 
 function template_convert_utf8()
 {
-	global $context, $txt, $settings, $scripturl;
+	global $context, $txt, $scripturl;
 
 	echo '
 	<div id="manage_maintenance">
@@ -605,7 +607,7 @@ function template_convert_utf8()
 
 function template_convert_entities()
 {
-	global $context, $txt, $settings, $scripturl;
+	global $context, $txt, $scripturl;
 
 	echo '
 	<div id="manage_maintenance">
@@ -625,7 +627,7 @@ function template_convert_entities()
 
 function template_convert_msgbody()
 {
-	global $context, $txt, $settings, $scripturl;
+	global $context, $txt, $scripturl;
 
 	echo '
 	<div id="manage_maintenance">

+ 5 - 5
Themes/default/ManageMembergroups.template.php

@@ -12,7 +12,7 @@
 
 function template_main()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	template_show_list('regular_membergroups_list');
 	echo '<br /><br />';
@@ -22,7 +22,7 @@ function template_main()
 
 function template_new_group()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">
@@ -601,7 +601,7 @@ function template_group_members()
 		if ($context['can_send_email'])
 		{
 			echo '
-						<td', $member['show_email'] == 'no_through_forum' && $settings['use_image_buttons'] ? ' align="center"' : '', '>';
+						<td', $member['show_email'] == 'no_through_forum' && $settings['use_image_buttons'] ? ' class="centertext"' : '', '>';
 
 			// Is it totally hidden?
 			if ($member['show_email'] == 'no')
@@ -614,7 +614,7 @@ function template_group_members()
 			// ... otherwise it's visible - but only via an image?
 			elseif ($member['show_email'] == 'no_through_forum')
 				echo '
-								<a href="', $scripturl, '?action=emailuser;sa=email;uid=', $member['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a>';
+								<a href="', $scripturl, '?action=emailuser;sa=email;uid=', $member['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a>';
 			// ... otherwise it must be a 'yes', show it and show it fully.
 			else
 				echo '
@@ -701,7 +701,7 @@ function template_group_members()
 // Allow the moderator to enter a reason to each user being rejected.
 function template_group_request_reason()
 {
-	global $settings, $options, $context, $txt, $scripturl;
+	global $options, $context, $txt, $scripturl;
 
 	// Show a welcome message to the user.
 	echo '

+ 2 - 2
Themes/default/ManageMembers.template.php

@@ -12,7 +12,7 @@
 
 function template_search_members()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<div id="admincenter">
@@ -239,7 +239,7 @@ function template_search_members()
 
 function template_admin_browse()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">';

+ 2 - 2
Themes/default/ManagePaid.template.php

@@ -13,7 +13,7 @@
 // The template for adding or editing a subscription.
 function template_modify_subscription()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">
@@ -197,7 +197,7 @@ function template_modify_subscription()
 
 function template_delete_subscription()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">

+ 4 - 4
Themes/default/ManagePermissions.template.php

@@ -266,7 +266,7 @@ function template_permission_index()
 
 function template_by_board()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">
@@ -362,7 +362,7 @@ function template_by_board()
 // Edit permission profiles (predefined).
 function template_edit_profiles()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admin_form_wrapper">
@@ -461,7 +461,7 @@ function template_edit_profiles()
 
 function template_modify_group()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	// Cannot be edited?
 	if (!$context['profile']['can_modify'])
@@ -711,7 +711,7 @@ function template_modify_group_display($type)
 
 function template_inline_permissions()
 {
-	global $context, $settings, $options, $txt, $modSettings;
+	global $context, $options, $txt, $modSettings;
 
 	// This looks really weird, but it keeps things nested properly...
 	echo '

+ 2 - 2
Themes/default/ManageScheduledTasks.template.php

@@ -13,7 +13,7 @@
 // Template for listing all scheduled tasks.
 function template_view_scheduled_tasks()
 {
-	global $context, $settings, $options, $txt, $scripturl, $modSettings;
+	global $context, $options, $txt, $scripturl, $modSettings;
 
 	// We completed some tasks?
 	if (!empty($context['tasks_were_run']))
@@ -53,7 +53,7 @@ function template_view_scheduled_tasks()
 // A template for, you guessed it, editing a task!
 function template_edit_scheduled_tasks()
 {
-	global $context, $settings, $options, $txt, $scripturl, $modSettings;
+	global $context, $options, $txt, $scripturl, $modSettings;
 
 	// Starts off with general maintenance procedures.
 	echo '

+ 7 - 7
Themes/default/ManageSearch.template.php

@@ -90,7 +90,7 @@ function template_modify_weights()
 
 function template_select_search_method()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">
@@ -219,7 +219,7 @@ function template_select_search_method()
 
 function template_create_index()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<div id="admincenter">
@@ -252,7 +252,7 @@ function template_create_index()
 
 function template_create_index_progress()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 	echo '
 	<div id="admincenter">
 		<form action="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;step=1" name="autoSubmit" method="post" accept-charset="', $context['character_set'], '">
@@ -300,7 +300,7 @@ function template_create_index_progress()
 
 function template_create_index_done()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 	echo '
 	<div id="admincenter">
 		<div class="cat_bar">
@@ -320,7 +320,7 @@ function template_create_index_done()
 // Add or edit a search engine spider.
 function template_spider_edit()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 	echo '
 	<div id="admincenter">
 		<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=sengines;sa=editspiders;sid=', $context['spider']['id'], '" method="post" accept-charset="', $context['character_set'], '">
@@ -368,7 +368,7 @@ function template_spider_edit()
 // Show... spider... logs...
 function template_show_spider_logs()
 {
-	global $context, $txt, $settings, $scripturl;
+	global $context, $txt, $scripturl;
 
 	echo '
 	<div id="admincenter">';
@@ -401,7 +401,7 @@ function template_show_spider_logs()
 // Show... spider... stats...
 function template_show_spider_stats()
 {
-	global $context, $txt, $settings, $scripturl;
+	global $context, $txt, $scripturl;
 
 	echo '
 	<div id="admincenter">';

+ 7 - 7
Themes/default/ManageSmileys.template.php

@@ -13,7 +13,7 @@
 // Editing the smiley sets.
 function template_editsets()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">';
@@ -69,7 +69,7 @@ function template_editsets()
 // Modifying a smiley set.
 function template_modifyset()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">
@@ -155,7 +155,7 @@ function template_modifyset()
 // Editing an individual smiley
 function template_modifysmiley()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">
@@ -248,7 +248,7 @@ function template_modifysmiley()
 // Adding a new smiley.
 function template_addsmiley()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">
@@ -384,7 +384,7 @@ function template_addsmiley()
 // Ordering smileys.
 function template_setorder()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">';
@@ -436,7 +436,7 @@ function template_setorder()
 // Editing Message Icons
 function template_editicons()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	template_show_list('message_icon_list');
 }
@@ -444,7 +444,7 @@ function template_editicons()
 // Editing an individual message icon
 function template_editicon()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">

+ 2 - 2
Themes/default/MessageIndex.template.php

@@ -125,13 +125,13 @@ function template_main()
 		', template_button_strip($context['normal_buttons'], 'right'), '
 	</div>';
 
-	if ((!empty($options['show_board_desc']) && $context['description'] != '') || !empty($context['moderators']))
+	if ($context['description'] != '' || !empty($context['moderators']))
 		{
 		echo '
 	<div id="description_board" class="generic_list_wrapper">
 		<h3 class="floatleft">', $context['name'], '&nbsp;-&nbsp;</h3>
 		<p>';
-	if (!empty($options['show_board_desc']) && $context['description'] != '')
+	if ($context['description'] != '')
 	echo '
 		', $context['description'], '&nbsp;';
 

+ 116 - 51
Themes/default/ModerationCenter.template.php

@@ -45,15 +45,16 @@ function template_moderation_center()
 // Show all the group requests the user can see.
 function template_group_requests_block()
 {
-	global $settings, $options, $context, $txt, $scripturl;
+	global $options, $context, $txt, $scripturl;
 
 	echo '
 		<div class="cat_bar">
 			<h3 class="catbg">
-				<a href="', $scripturl, '?action=groups;sa=requests">', $txt['mc_group_requests'], '</a>
+				<span id="group_requests_toggle" class="', !empty($context['admin_prefs']['mcgr']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
+				<a href="', $scripturl, '?action=groups;sa=requests" id="group_requests_link">', $txt['mc_group_requests'], '</a>
 			</h3>
 		</div>
-		<div class="windowbg">
+		<div class="windowbg" id="group_requests_panel">
 			<div class="content modbox">
 				<ul class="reset">';
 
@@ -73,21 +74,54 @@ function template_group_requests_block()
 		echo '
 				</ul>
 			</div>
-		</div>';
+		</div>
+		
+	<script type="text/javascript"><!-- // --><![CDATA[
+		var oGroupRequestsPanelToggle = new smc_Toggle({
+			bToggleEnabled: true,
+			bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcgr']) ? 'true' : 'false', ',
+			aSwappableContainers: [
+				\'group_requests_panel\'
+			],
+			aSwapImages: [
+				{
+					sId: \'group_requests_toggle\',
+					altExpanded: ', JavaScriptEscape($txt['hide']), ',
+					altCollapsed: ', JavaScriptEscape($txt['show']), '
+				}
+			],
+			aSwapLinks: [
+				{
+					sId: \'group_requests_link\',
+					msgExpanded: ', JavaScriptEscape($txt['mc_group_requests']), ',
+					msgCollapsed: ', JavaScriptEscape($txt['mc_group_requests']), '
+				}
+			],
+			oThemeOptions: {
+				bUseThemeSettings: true,
+				sOptionName: \'admin_preferences\',
+				sSessionVar: smf_session_var,
+				sSessionId: smf_session_id,
+				sThemeId: \'1\',
+				sAdditionalVars: \';admin_key=mcgr\'
+			}
+		});
+	// ]]></script>';
 }
 
 // A block to show the current top reported posts.
 function template_reported_posts_block()
 {
-	global $settings, $options, $context, $txt, $scripturl;
+	global $context, $txt, $scripturl;
 
 	echo '
 		<div class="cat_bar">
 			<h3 class="catbg">
-				<a href="', $scripturl, '?action=moderate;area=reports">', $txt['mc_recent_reports'], '</a>
+				<span id="reported_posts_toggle" class="', !empty($context['admin_prefs']['mcrp']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
+				<a href="', $scripturl, '?action=moderate;area=reports" id="reported_posts_link">', $txt['mc_recent_reports'], '</a>
 			</h3>
 		</div>
-		<div class="windowbg">
+		<div class="windowbg" id="reported_posts_panel">
 			<div class="content modbox">
 				<ul class="reset">';
 
@@ -107,20 +141,53 @@ function template_reported_posts_block()
 		echo '
 				</ul>
 			</div>
-		</div>';
+		</div>
+		
+	<script type="text/javascript"><!-- // --><![CDATA[
+		var oReportedPostsPanelToggle = new smc_Toggle({
+			bToggleEnabled: true,
+			bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcrp']) ? 'true' : 'false', ',
+			aSwappableContainers: [
+				\'reported_posts_panel\'
+			],
+			aSwapImages: [
+				{
+					sId: \'reported_posts_toggle\',
+					altExpanded: ', JavaScriptEscape($txt['hide']), ',
+					altCollapsed: ', JavaScriptEscape($txt['show']), '
+				}
+			],
+			aSwapLinks: [
+				{
+					sId: \'reported_posts_link\',
+					msgExpanded: ', JavaScriptEscape($txt['mc_recent_reports']), ',
+					msgCollapsed: ', JavaScriptEscape($txt['mc_recent_reports']), '
+				}
+			],
+			oThemeOptions: {
+				bUseThemeSettings: true,
+				sOptionName: \'admin_preferences\',
+				sSessionVar: smf_session_var,
+				sSessionId: smf_session_id,
+				sThemeId: \'1\',
+				sAdditionalVars: \';admin_key=mcrp\'
+			}
+		});
+	// ]]></script>';
 }
 
 function template_watched_users()
 {
-	global $settings, $options, $context, $txt, $scripturl;
+	global $options, $context, $txt, $scripturl;
 
 	echo '
 		<div class="cat_bar">
 			<h3 class="catbg">
-				<a href="', $scripturl, '?action=moderate;area=userwatch">', $txt['mc_watched_users'], '</a>
+				<span id="watched_users_toggle" class="', !empty($context['admin_prefs']['mcwu']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
+				<a href="', $scripturl, '?action=moderate;area=userwatch" id="watched_users_link">', $txt['mc_watched_users'], '</a>
 			</h3>
 		</div>
-		<div class="windowbg">
+		<div class="windowbg" id="watched_users_panel">
 			<div class="content modbox">
 				<ul class="reset">';
 
@@ -140,7 +207,39 @@ function template_watched_users()
 		echo '
 				</ul>
 			</div>
-		</div>';
+		</div>
+		
+	<script type="text/javascript"><!-- // --><![CDATA[
+		var oWatchedUsersToggle = new smc_Toggle({
+			bToggleEnabled: true,
+			bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcwu']) ? 'true' : 'false', ',
+			aSwappableContainers: [
+				\'watched_users_panel\'
+			],
+			aSwapImages: [
+				{
+					sId: \'watched_users_toggle\',
+					altExpanded: ', JavaScriptEscape($txt['hide']), ',
+					altCollapsed: ', JavaScriptEscape($txt['show']), '
+				}
+			],
+			aSwapLinks: [
+				{
+					sId: \'watched_users_link\',
+					msgExpanded: ', JavaScriptEscape($txt['mc_watched_users']), ',
+					msgCollapsed: ', JavaScriptEscape($txt['mc_watched_users']), '
+				}
+			],
+			oThemeOptions: {
+				bUseThemeSettings: true,
+				sOptionName: \'admin_preferences\',
+				sSessionVar: smf_session_var,
+				sSessionId: smf_session_id,
+				sThemeId: \'1\',
+				sAdditionalVars: \';admin_key=mcwu\'
+			}
+		});
+	// ]]></script>';
 }
 
 // Little section for making... notes.
@@ -188,7 +287,7 @@ function template_notes()
 
 function template_reported_posts()
 {
-	global $settings, $options, $context, $txt, $scripturl;
+	global $options, $context, $txt, $scripturl;
 
 	// Let them know the action was a success.
 	if (!empty($context['report_post_action']) && !empty($txt['report_action_'. $context['report_post_action']]))
@@ -285,7 +384,7 @@ function template_reported_posts()
 // Show a list of all the unapproved posts
 function template_unapproved_posts()
 {
-	global $settings, $options, $context, $txt, $scripturl;
+	global $options, $context, $txt, $scripturl;
 
 	// Just a big table of it all really...
 	echo '
@@ -496,48 +595,14 @@ function template_user_watch_post_callback($post)
 // Moderation settings
 function template_moderation_settings()
 {
-	global $settings, $options, $context, $txt, $scripturl;
+	global $options, $context, $txt, $scripturl;
 
 	echo '
 	<div id="modcenter">
 		<form action="', $scripturl, '?action=moderate;area=settings" method="post" accept-charset="', $context['character_set'], '">
 			<div class="windowbg2">
 				<div class="content">
-					<dl class="settings">
-						<dt>
-							<strong>', $txt['mc_prefs_homepage'], ':</strong>
-						</dt>
-						<dd>';
-
-	foreach ($context['homepage_blocks'] as $k => $v)
-		echo '
-							<label for="mod_homepage_', $k, '"><input type="checkbox" id="mod_homepage_', $k, '" name="mod_homepage[', $k, ']"', in_array($k, $context['mod_settings']['user_blocks']) ? ' checked="checked"' : '', ' class="input_check" /> ', $v, '</label><br />';
-
-	echo '
-						</dd>';
-
-	// If they can moderate boards they have more options!
-	if ($context['can_moderate_boards'])
-	{
-		echo '
-						<dt>
-							<strong><label for="mod_show_reports">', $txt['mc_prefs_show_reports'], '</label>:</strong>
-						</dt>
-						<dd>
-							<input type="checkbox" id="mod_show_reports" name="mod_show_reports" ', $context['mod_settings']['show_reports'] ? 'checked="checked"' : '', ' class="input_check" />
-						</dd>
-						<dt>
-							<strong><label for="mod_notify_report">', $txt['mc_prefs_notify_report'], '</label>:</strong>
-						</dt>
-						<dd>
-							<select id="mod_notify_report" name="mod_notify_report">
-								<option value="0" ', $context['mod_settings']['notify_report'] == 0 ? 'selected="selected"' : '', '>', $txt['mc_prefs_notify_report_never'], '</option>
-								<option value="1" ', $context['mod_settings']['notify_report'] == 1 ? 'selected="selected"' : '', '>', $txt['mc_prefs_notify_report_moderator'], '</option>
-								<option value="2" ', $context['mod_settings']['notify_report'] == 2 ? 'selected="selected"' : '', '>', $txt['mc_prefs_notify_report_always'], '</option>
-							</select>
-						</dd>';
-
-	}
+					<dl class="settings">';
 
 	if ($context['can_moderate_approvals'])
 	{
@@ -603,7 +668,7 @@ function template_show_notice()
 // Add or edit a warning template.
 function template_warn_template()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="modcenter">

+ 1 - 1
Themes/default/MoveTopic.template.php

@@ -15,7 +15,7 @@
  */
 function template_main()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="move_topic" class="lower_padding">

+ 2 - 2
Themes/default/Notify.template.php

@@ -12,7 +12,7 @@
 
 function template_main()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 		<div class="cat_bar">
@@ -30,7 +30,7 @@ function template_main()
 
 function template_notify_board()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 		<div class="cat_bar">

+ 15 - 15
Themes/default/Packages.template.php

@@ -12,7 +12,7 @@
 
 function template_main()
 {
-	global $context, $settings, $options;
+	global $context, $options;
 }
 
 function template_view_package()
@@ -394,7 +394,7 @@ function template_view_package()
 
 function template_extract_package()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	if (!empty($context['redirect_url']))
 	{
@@ -473,7 +473,7 @@ function template_extract_package()
 
 function template_list()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="admincenter">
@@ -502,7 +502,7 @@ function template_list()
 
 function template_examine()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="admincenter">
@@ -680,7 +680,7 @@ function template_browse()
 
 function template_servers()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	if (!empty($context['package_ftp']['error']))
 			echo '
@@ -831,7 +831,7 @@ function template_servers()
 
 function template_package_confirm()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="admincenter">
@@ -849,7 +849,7 @@ function template_package_confirm()
 
 function template_package_list()
 {
-	global $context, $settings, $options, $txt, $scripturl, $smcFunc;
+	global $context, $options, $txt, $scripturl, $smcFunc;
 
 	echo '
 	<div id="admincenter">
@@ -918,7 +918,7 @@ function template_package_list()
 
 					// Mark as installed and current?
 					if ($package['is_installed'] && !$package['is_newer'])
-						echo '<img src="', $settings['images_url'], '/icons/package_', $package['is_current'] ? 'installed' : 'old', '.png" width="12" height="11" class="centericon" style="margin-left: 2ex;" alt="', $package['is_current'] ? $txt['package_installed_current'] : $txt['package_installed_old'], '" />';
+						echo '<span class="generic_icons ', $package['is_current'] ? 'current' : 'old', ' centericon" style="margin-left: 2ex;" title="', $package['is_current'] ? $txt['package_installed_current'] : $txt['package_installed_old'], '"></span>';
 
 					echo '
 							</strong>
@@ -966,8 +966,8 @@ function template_package_list()
 		</div>
 		<div class="padding smalltext floatleft">
 			', $txt['package_installed_key'], '
-			<img src="', $settings['images_url'], '/icons/package_installed.png" alt="" class="centericon" style="margin-left: 1ex;" /> ', $txt['package_installed_current'], '
-			<img src="', $settings['images_url'], '/icons/package_old.png" alt="" class="centericon" style="margin-left: 2ex;" /> ', $txt['package_installed_old'], '
+			<span class="generic_icons current centericon" style="margin-left: 1ex;"></span> ', $txt['package_installed_current'], '
+			<span class="generic_icons old centericon" style="margin-left: 2ex;"></span> ', $txt['package_installed_old'], '
 		</div>
 	</div>
 
@@ -1023,7 +1023,7 @@ function template_package_list()
 
 function template_downloaded()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="admincenter">
@@ -1048,7 +1048,7 @@ function template_downloaded()
 
 function template_install_options()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	if (!empty($context['saved_successful']))
 		echo '
@@ -1109,7 +1109,7 @@ function template_install_options()
 
 function template_control_chmod()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	// Nothing to do? Brilliant!
 	if (empty($context['package_ftp']))
@@ -1257,7 +1257,7 @@ function template_control_chmod()
 
 function template_ftp_required()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 		<fieldset>
@@ -1714,7 +1714,7 @@ function template_permission_show_contents($ident, $contents, $level, $has_more
 
 function template_action_permissions()
 {
-	global $txt, $scripturl, $context, $settings;
+	global $txt, $scripturl, $context;
 
 	$countDown = 3;
 

+ 16 - 18
Themes/default/PersonalMessage.template.php

@@ -14,7 +14,7 @@
 // This is for stuff above the menu in the personal messages section.
 function template_pm_above()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 
 	echo '
 	<div id="personal_messages">';
@@ -43,15 +43,13 @@ function template_pm_above()
 // Just the end of the index bar, nothing special.
 function template_pm_below()
 {
-	global $context, $settings, $options;
-
 	echo '
 	</div>';
 }
 
 function template_pm_popup()
 {
-	global $context, $txt, $scripturl, $settings;
+	global $context, $txt, $scripturl;
 
 	// Unlike almost every other template, this is designed to be included into the HTML directly via $().load()
 	echo '
@@ -83,7 +81,7 @@ function template_pm_popup()
 				<div class="avatar floatleft">', !empty($pm_details['member']) ? $pm_details['member']['avatar']['image'] : '', '</div>
 				<div class="details floatleft">
 					<div class="subject">', $pm_details['pm_link'], '</div>
-					<div class="sender">', $pm_details['replied_to_you'] ? '<span class="pm_icons replied" style="margin-right: 4px; vertical-align: middle" title="' . $txt['pm_you_were_replied_to'] . '"></span>' : '<span class="pm_icons im_off" style="margin-right: 4px; vertical-align: middle" title="' . $txt['pm_was_sent_to_you'] . '"></span>',
+					<div class="sender">', $pm_details['replied_to_you'] ? '<span class="pm_icons replied centericon" style="margin-right: 4px" title="' . $txt['pm_you_were_replied_to'] . '"></span>' : '<span class="pm_icons im_off centericon" style="margin-right: 4px" title="' . $txt['pm_was_sent_to_you'] . '"></span>',
 					!empty($pm_details['member']) ? $pm_details['member']['link'] : $pm_details['member_from'], ' - ', $pm_details['time'], '</div>
 				</div>
 				<br class="clear" />
@@ -367,17 +365,17 @@ function template_folder()
 					// 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'] ? '<span class="generic_icons www" title="' . $message['member']['website']['title'] . '" style="vertical-align:middle"></span>' : $txt['www']), '</a></li>';
+						<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $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')) && $context['can_send_email'])
 						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.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';
+						<li><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $message['member']['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $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'] ? '<span class="pm_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" style="vertical-align:middle"></span>' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
+						<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'] ? '<span class="pm_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span>' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
 
 					echo '
 					</ol>
@@ -705,7 +703,7 @@ function template_subject_list()
 
 function template_search()
 {
-	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+	global $context, $options, $scripturl, $modSettings, $txt;
 
 	echo '
 	<form action="', $scripturl, '?action=pm;sa=search2" method="post" accept-charset="', $context['character_set'], '" name="searchform" id="searchform">
@@ -849,7 +847,7 @@ function template_search()
 
 function template_search_results()
 {
-	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+	global $context, $options, $scripturl, $modSettings, $txt;
 
 	echo '
 		<div class="cat_bar">
@@ -1353,7 +1351,7 @@ function template_send()
 // 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;
+	global $context, $options, $scripturl, $modSettings, $txt;
 
 	echo '
 		<div class="cat_bar">
@@ -1370,7 +1368,7 @@ function template_ask_delete()
 // This template asks the user what messages they want to prune.
 function template_prune()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $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'], '\');">
@@ -1390,7 +1388,7 @@ function template_prune()
 // 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;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<form action="', $scripturl, '?action=pm;sa=manlabels" method="post" accept-charset="', $context['character_set'], '">
@@ -1480,7 +1478,7 @@ function template_labels()
 // Template for reporting a personal message.
 function template_report_message()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<form action="', $scripturl, '?action=pm;sa=report;l=', $context['current_label_id'], '" method="post" accept-charset="', $context['character_set'], '">
@@ -1534,7 +1532,7 @@ function template_report_message()
 // Little template just to say "Yep, it's been submitted"
 function template_report_message_complete()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 		<div class="cat_bar">
@@ -1551,7 +1549,7 @@ function template_report_message_complete()
 // Manage rules.
 function template_rules()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<form action="', $scripturl, '?action=pm;sa=manrules" method="post" accept-charset="', $context['character_set'], '" name="manRules" id="manrules">
@@ -1626,7 +1624,7 @@ function template_rules()
 // Template for adding/editing a rule.
 function template_add_rule()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<script type="text/javascript"><!-- // --><![CDATA[
@@ -1927,7 +1925,7 @@ function template_add_rule()
 // Template for showing all the PM drafts of the user.
 function template_showPMDrafts()
 {
-	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+	global $context, $options, $scripturl, $modSettings, $txt;
 
 	echo '
 		<div class="cat_bar">

+ 1 - 1
Themes/default/Poll.template.php

@@ -12,7 +12,7 @@
 
 function template_main()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	// Some javascript for adding more options.
 	echo '

+ 2 - 2
Themes/default/Post.template.php

@@ -1041,7 +1041,7 @@ function template_quotefast()
 
 function template_announce()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="announcement">
@@ -1088,7 +1088,7 @@ function template_announce()
 
 function template_announcement_send()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="announcement">

+ 17 - 31
Themes/default/Profile.template.php

@@ -89,7 +89,7 @@ function template_profile_popup()
 
 function template_alerts_popup()
 {
-	global $context, $txt, $scripturl, $settings;
+	global $context, $txt, $scripturl;
 
 	// Unlike almost every other template, this is designed to be included into the HTML directly via $().load()
 	echo '
@@ -149,7 +149,7 @@ function template_summary()
 	// What about if we allow email only via the forum??
 	if ($context['member']['show_email'] === 'yes' || $context['member']['show_email'] === 'no_through_forum' || $context['member']['show_email'] === 'yes_permission_override' && $context['can_send_email'])
 		echo '
-					<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.png" alt="', $txt['email'], '" /></a></li>';
+					<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"><span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span></a></li>';
 
 	// Don't show an icon if they haven't specified a website.
 	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
@@ -418,7 +418,7 @@ function template_summary()
 // Template for showing all the posts of the user, in chronological order.
 function template_showPosts()
 {
-	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+	global $context, $options, $scripturl, $modSettings, $txt;
 
 	echo '
 		<div class="cat_bar">
@@ -630,7 +630,7 @@ function template_editBuddies()
 				<td align="center"><a href="', $buddy['online']['href'], '"><img src="', $buddy['online']['image_href'], '" alt="', $buddy['online']['text'], '" title="', $buddy['online']['text'], '" /></a></td>';
 		if ($context['can_send_email'])
 			echo '
-				<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.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $buddy['name'] . '" /></a>'), '</td>';
+				<td align="center">', ($buddy['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $buddy['id'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a>'), '</td>';
 
 		// If these are off, don't show them
 		foreach ($buddy_fields as $key => $column)
@@ -641,7 +641,7 @@ function template_editBuddies()
 		}
 
 		echo '
-				<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.png" alt="', $txt['buddy_remove'], '" title="', $txt['buddy_remove'], '" /></a></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'], '"><span class="generic_icons delete" title="', $txt['buddy_remove'], '"></span></a></td>
 			</tr>';
 
 		$alternate = !$alternate;
@@ -737,13 +737,13 @@ function template_editIgnoreList()
 				<td align="center"><a href="', $member['online']['href'], '"><img src="', $member['online']['image_href'], '" alt="', $member['online']['text'], '" title="', $member['online']['text'], '" /></a></td>';
 		if ($context['can_send_email'])
 			echo '
-				<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.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $member['name'] . '" /></a>'), '</td>';
+				<td align="center">', ($member['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $member['id'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a>'), '</td>';
 		echo '
 				<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['skype']['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.png" alt="', $txt['ignore_remove'], '" title="', $txt['ignore_remove'], '" /></a></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'], '"><span class="generic_icons delete" title="', $txt['ignore_remove'], '"></span></a></td>
 			</tr>';
 
 		$alternate = !$alternate;
@@ -798,7 +798,7 @@ function template_editIgnoreList()
 // 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;
+	global $context, $options, $scripturl, $txt;
 
 	// The first table shows IP information about the user.
 	echo '
@@ -857,7 +857,7 @@ function template_trackActivity()
 // 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;
+	global $context, $options, $scripturl, $txt;
 
 	// This function always defaults to the last IP used by a member but can be set to track any IP.
 	// The first table in the template gives an input box to allow the admin to enter another IP to track.
@@ -1102,7 +1102,7 @@ function template_showPermissions()
 // Template for user statistics, showing graphs and the like.
 function template_statPanel()
 {
-	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+	global $context, $options, $scripturl, $modSettings, $txt;
 
 	// First, show a few text statistics such as post/topic count.
 	echo '
@@ -1501,7 +1501,7 @@ function template_edit_options()
 // Personal Message settings.
 function template_profile_pm_settings()
 {
-	global $context, $settings, $options, $scripturl, $modSettings, $txt;
+	global $context, $options, $scripturl, $modSettings, $txt;
 
 	echo '
 								<dt>
@@ -1578,16 +1578,9 @@ function template_profile_pm_settings()
 // 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;
+	global $context, $options, $scripturl, $modSettings, $txt;
 
 	echo '
-							<dt>
-								<label for="show_board_desc">', $txt['board_desc_inside'], '</label>
-							</dt>
-							<dd>
-								<input type="hidden" name="default_options[show_board_desc]" value="0" />
-								<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" />
-							</dd>
 							<dt>
 								<label for="show_children">', $txt['show_children'], '</label>
 							</dt>
@@ -1627,13 +1620,6 @@ function template_profile_theme_settings()
 							<dd>
 								<input type="hidden" name="default_options[return_to_post]" value="0" />
 								<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" />
-							</dd>
-							<dt>
-								<label for="no_new_reply_warning">', $txt['no_new_reply_warning'], '</label>
-							</dt>
-							<dd>
-								<input type="hidden" name="default_options[no_new_reply_warning]" value="0" />
-								<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" />
 							</dd>';
 
 	if (!empty($modSettings['enable_buddylist']))
@@ -1902,7 +1888,7 @@ function template_alert_configuration()
 				<tr class="windowbg', $use_bg2 ? '2' : '', '">
 					<td>', $txt['alert_' . $alert_id], isset($alert_details['help']) ? '<a href="' . $scripturl . '?action=helpadmin;help=' . $alert_details['help'] . '" onclick="return reqOverlayDiv(this.href);" class="help floatright"><img src="' . $settings['images_url'] . '/helptopics.png" alt="' . $txt['help'] . '" title="' . $txt['help'] . '">' : '', '</td>';
 
-			foreach (array('alert', 'email') as $type)
+			foreach ($context['alert_bits'] as $type => $bitmask)
 			{
 				echo '
 					<td class="centercol">';
@@ -1915,7 +1901,7 @@ function template_alert_configuration()
 						break;
 					case 'yes':
 						echo '
-						<input type="checkbox" name="', $type, '_', $alert_id, '"', $this_value & $context['alert_bits'][$type] != 0 ? ' checked="checked"' : '', ' />';
+						<input type="checkbox" name="', $type, '_', $alert_id, '"', ($this_value & $bitmask) ? ' checked="checked"' : '', ' />';
 						break;
 					case 'never':
 						echo '
@@ -1949,7 +1935,7 @@ function template_alert_configuration()
 
 function template_alert_notifications_topics()
 {
-	global $context, $settings, $options, $txt, $scripturl, $modSettings;
+	global $context, $options, $txt, $scripturl, $modSettings;
 
 	// The main containing header.
 	echo '
@@ -1966,7 +1952,7 @@ function template_alert_notifications_topics()
 
 function template_alert_notifications_boards()
 {
-	global $context, $settings, $options, $txt, $scripturl, $modSettings;
+	global $context, $options, $txt, $scripturl, $modSettings;
 
 	echo '
 		<div class="cat_bar">
@@ -2717,7 +2703,7 @@ function template_deleteAccount()
 // Template for the password box/save button stuck at the bottom of every profile page.
 function template_profile_save()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 
 	echo '
 

+ 2 - 2
Themes/default/Recent.template.php

@@ -186,7 +186,7 @@ function template_unread()
 								', $topic['views'], ' ', $txt['views'], '
 							</td>
 							<td class="', $color_class2, ' lastpost">
-								<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.png" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" class="floatright" /></a>
+								<a href="', $topic['last_post']['href'], '"><span class="generic_icons last_post" title="', $txt['last_post'], '"></a>
 								', sprintf($txt['last_post_topic'], $topic['last_post']['time'], $topic['last_post']['member']['link']), '
 							</td>';
 
@@ -354,7 +354,7 @@ function template_replies()
 								', $topic['views'], ' ', $txt['views'], '
 							</td>
 							<td class="', $color_class2, ' lastpost">
-								<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.png" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" class="floatright" /></a>
+								<a href="', $topic['last_post']['href'], '"><span class="generic_icons last_post" title="', $txt['last_post'], '"></a>
 								', sprintf($txt['last_post_topic'], $topic['last_post']['time'], $topic['last_post']['member']['link']), '
 							</td>';
 

+ 6 - 6
Themes/default/Register.template.php

@@ -15,7 +15,7 @@
  */
 function template_registration_agreement()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 		<form action="', $scripturl, '?action=register" method="post" accept-charset="', $context['character_set'], '" id="registration">
@@ -365,7 +365,7 @@ function template_registration_form()
 // After registration... all done ;).
 function template_after()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	// Not much to see here, just a quick... "you're now registered!" or what have you.
 	echo '
@@ -382,7 +382,7 @@ function template_after()
 // Template for giving instructions about COPPA activation.
 function template_coppa()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	// Formulate a nice complicated message!
 	echo '
@@ -431,7 +431,7 @@ function template_coppa()
 // An easily printable form for giving permission to access the forum for a minor.
 function template_coppa_form()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	// Show the form (As best we can)
 	echo '
@@ -595,7 +595,7 @@ function template_admin_register()
 // Form for editing the agreement shown for people registering to the forum.
 function template_edit_agreement()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	if (!empty($context['saved_successful']))
 		echo '
@@ -671,7 +671,7 @@ function template_edit_agreement()
 
 function template_edit_reserved_words()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	if (!empty($context['saved_successful']))
 		echo '

+ 3 - 3
Themes/default/Reminder.template.php

@@ -12,7 +12,7 @@
 
 function template_main()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<br />
@@ -38,7 +38,7 @@ function template_main()
 
 function template_reminder_pick()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<br />
@@ -70,7 +70,7 @@ function template_reminder_pick()
 
 function template_sent()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context;
 
 	echo '
 		<br />

+ 3 - 5
Themes/default/Reports.template.php

@@ -13,7 +13,7 @@
 // Choose which type of report to run?
 function template_report_type()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">
@@ -52,7 +52,7 @@ function template_report_type()
 // This is the standard template for showing reports in.
 function template_main()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 	<div id="admincenter">
@@ -158,7 +158,7 @@ function template_print_above()
 
 function template_print()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	// Go through each table!
 	foreach ($context['tables'] as $table)
@@ -231,8 +231,6 @@ function template_print()
 // Footer of the print page.
 function template_print_below()
 {
-	global $context, $settings, $options;
-
 	echo '
 		<div class="copyright">', theme_copyright(), '</div>
 	</body>

+ 3 - 3
Themes/default/SendTopic.template.php

@@ -39,7 +39,7 @@
 // This is where we get information about who they want to send the topic to, etc.
 function template_main()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="send_topic">
@@ -102,7 +102,7 @@ function template_main()
 // Send an email to a user!
 function template_custom_email()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="send_topic">
@@ -195,7 +195,7 @@ function template_custom_email()
 
 function template_report()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="report_topic">

+ 2 - 12
Themes/default/Settings.template.php

@@ -12,14 +12,9 @@
 
 function template_options()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	$context['theme_options'] = array(
-		array(
-			'id' => 'show_board_desc',
-			'label' => $txt['board_desc_inside'],
-			'default' => true,
-		),
 		array(
 			'id' => 'show_children',
 			'label' => $txt['show_children'],
@@ -40,11 +35,6 @@ function template_options()
 			'label' => $txt['return_to_post'],
 			'default' => true,
 		),
-		array(
-			'id' => 'no_new_reply_warning',
-			'label' => $txt['no_new_reply_warning'],
-			'default' => true,
-		),
 		array(
 			'id' => 'view_newest_first',
 			'label' => $txt['recent_posts_at_top'],
@@ -154,7 +144,7 @@ function template_options()
 
 function template_settings()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	$context['theme_settings'] = array(
 		array(

+ 19 - 8
Themes/default/SplitTopics.template.php

@@ -12,7 +12,7 @@
 
 function template_ask()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="split_topics">
@@ -51,7 +51,7 @@ function template_ask()
 
 function template_main()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="split_topics">
@@ -229,7 +229,7 @@ function template_select()
 
 function template_merge_done()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 		<div id="merge_topics">
@@ -256,7 +256,7 @@ function template_merge_done()
 
 function template_merge()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 		<div id="merge_topics">
@@ -276,7 +276,7 @@ function template_merge()
 							', $context['origin_subject'], '
 						</dd>';
 
-	if (!empty($context['boards']) && count($context['boards']) > 1)
+	if (isset($context['merge_categories']))
 	{
 			echo '
 						<dt>
@@ -286,9 +286,20 @@ function template_merge()
 							<form action="' . $scripturl . '?action=mergetopics;from=' . $context['origin_topic'] . ';targetboard=' . $context['target_board'] . ';board=' . $context['current_board'] . '.0" method="post" accept-charset="', $context['character_set'], '">
 								<input type="hidden" name="from" value="' . $context['origin_topic'] . '" />
 								<select name="targetboard" onchange="this.form.submit();">';
-			foreach ($context['boards'] as $board)
+			foreach ($context['merge_categories'] as $cat)
+			{
 				echo '
-									<option value="', $board['id'], '"', $board['id'] == $context['target_board'] ? ' selected="selected"' : '', '>', $board['category'], ' - ', $board['name'], '</option>';
+									<optgroup label="', $cat['name'], '">';
+
+				foreach ($cat['boards'] as $board)
+				{
+					echo '
+										<option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '&nbsp;</option>';
+				}
+
+				echo '
+									</optgroup>';
+			}
 			echo '
 								</select>
 								<input type="submit" value="', $txt['go'], '" class="button_submit" />
@@ -347,7 +358,7 @@ function template_merge()
 
 function template_merge_extra_options()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<div id="merge_topics">

+ 11 - 11
Themes/default/Themes.template.php

@@ -199,7 +199,7 @@ function template_main()
 
 function template_list_themes()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 	global $modSettings;
 
 	// Show a nice confirmation message.
@@ -247,7 +247,7 @@ function template_list_themes()
 
 				// Deleting.
 				echo '
-						<a href="', $scripturl, '?action=admin;area=theme;sa=remove;th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['admin-tr_token_var'], '=', $context['admin-tr_token'], '" onclick="return confirm(\'', $txt['theme_remove_confirm'], '\');"><img src="', $settings['images_url'], '/icons/delete.png" alt="', $txt['theme_remove'], '" title="', $txt['theme_remove'], '" /></a>';
+						<a href="', $scripturl, '?action=admin;area=theme;sa=remove;th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['admin-tr_token_var'], '=', $context['admin-tr_token'], '" onclick="return confirm(\'', $txt['theme_remove_confirm'], '\');"><span class="generic_icons delete" title="', $txt['theme_remove'], '"></span></a>';
 
 				echo '
 					</span>';
@@ -302,7 +302,7 @@ function template_list_themes()
 
 function template_reset_list()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<div id="admincenter">
@@ -349,7 +349,7 @@ function template_reset_list()
 
 function template_set_options()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<div id="admincenter">
@@ -672,7 +672,7 @@ function template_set_settings()
 // This template allows for the selection of different themes ;).
 function template_pick()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<div id="pick_theme">
@@ -766,7 +766,7 @@ function template_pick()
 // Okay, that theme was installed/updated successfully!
 function template_installed()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	// The aftermath.
 	echo '
@@ -802,7 +802,7 @@ function template_installed()
 
 function template_edit_list()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<div id="admin_form_wrapper">
@@ -841,7 +841,7 @@ function template_edit_list()
 
 function template_copy_template()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<div id="admincenter">
@@ -884,7 +884,7 @@ function template_copy_template()
 
 function template_edit_browse()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<div id="admincenter">
@@ -1086,7 +1086,7 @@ function template_edit_style()
 // This edits the template...
 function template_edit_template()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	if ($context['session_error'])
 		echo '
@@ -1143,7 +1143,7 @@ function template_edit_template()
 
 function template_edit_file()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	if ($context['session_error'])
 		echo '

+ 28 - 30
Themes/default/Wireless.template.php

@@ -13,8 +13,6 @@
 // This is the header for WAP 1.1 output. You can view it with ?wap in the URL.
 function template_wap_above()
 {
-	global $context, $settings, $options;
-
 	// Show the xml declaration...
 	echo '<?xml version="1.0"?', '>
 <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
@@ -26,7 +24,7 @@ function template_wap_above()
 // This is the board index (main page) in WAP 1.1.
 function template_wap_boardindex()
 {
-	global $context, $settings, $options, $scripturl;
+	global $context, $options, $scripturl;
 
 	// This is the "main" card...
 	echo '
@@ -67,7 +65,7 @@ function template_wap_boardindex()
 // This is the message index (list of topics in a board) for WAP 1.1.
 function template_wap_messageindex()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<card id="main" title="', $context['page_title'], '">
@@ -101,7 +99,7 @@ function template_wap_messageindex()
 
 function template_wap_display()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 
 	echo '
 	<card id="main" title="', $context['page_title'], '">
@@ -181,7 +179,7 @@ function template_wap_login()
 
 function template_wap_recent()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 	<card id="recent" title="', $context['page_title'], '">
@@ -207,7 +205,7 @@ function template_wap_recent()
 
 function template_wap_error()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 	<card id="main" title="', $context['page_title'], '">
@@ -219,7 +217,7 @@ function template_wap_error()
 
 function template_wap_below()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 
 	echo '
 	<card id="switch" title="', $txt['wireless_go_to_full_version'], '">
@@ -233,7 +231,7 @@ function template_wap_below()
 // The cHTML protocol used for i-mode starts here.
 function template_imode_above()
 {
-	global $context, $settings, $options, $user_info;
+	global $context, $options, $user_info;
 
 	echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD Compact HTML 1.0 Draft//EN">
 <html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
@@ -253,7 +251,7 @@ function template_imode_above()
 
 function template_imode_boardindex()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 		<table border="0" cellspacing="0" cellpadding="0">
@@ -293,7 +291,7 @@ function template_imode_boardindex()
 
 function template_imode_messageindex()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 		<table border="0" cellspacing="0" cellpadding="0">
@@ -332,7 +330,7 @@ function template_imode_messageindex()
 
 function template_imode_display()
 {
-	global $context, $settings, $options, $scripturl, $board, $txt;
+	global $context, $options, $scripturl, $board, $txt;
 
 	echo '
 		<table border="0" cellspacing="0" cellpadding="0">
@@ -396,7 +394,7 @@ function template_imode_display()
 
 function template_imode_post()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	// @todo $modSettings['guest_post_no_email']
 	echo '
@@ -452,7 +450,7 @@ function template_imode_post()
 
 function template_imode_login()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 		<form action="', $scripturl, '?action=login2;imode" method="post">
@@ -485,7 +483,7 @@ function template_imode_login()
 
 function template_imode_pm()
 {
-	global $context, $settings, $options, $scripturl, $txt, $user_info;
+	global $context, $options, $scripturl, $txt, $user_info;
 
 	if ($_REQUEST['action'] == 'findmember')
 	{
@@ -701,7 +699,7 @@ function template_imode_pm()
 
 function template_imode_recent()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 		<table border="0" cellspacing="0" cellpadding="0">
@@ -732,7 +730,7 @@ function template_imode_recent()
 
 function template_imode_error()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 		<table border="0" cellspacing="0" cellpadding="0">
@@ -744,7 +742,7 @@ function template_imode_error()
 
 function template_imode_profile()
 {
-	global $context, $settings, $options, $scripturl, $board, $txt;
+	global $context, $options, $scripturl, $board, $txt;
 
 	echo '
 		<table border="0" cellspacing="0" cellpadding="0">
@@ -794,7 +792,7 @@ function template_imode_profile()
 
 function template_imode_ban_edit()
 {
-	global $context, $settings, $options, $scripturl, $board, $txt, $modSettings;
+	global $context, $options, $scripturl, $board, $txt, $modSettings;
 
 	echo '
 	<form action="', $scripturl, '?action=admin;area=ban;sa=add;imode" method="post">
@@ -877,7 +875,7 @@ function template_imode_ban_edit()
 
 function template_imode_below()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 
 	echo '
 		<br /><a href="', $context['linktree'][count($context['linktree']) - 1]['url'], (count($context['linktree']) > 1 ? ';' : '?'), 'nowap" rel="nofollow">', $txt['wireless_go_to_full_version'], '</a>
@@ -909,7 +907,7 @@ function template_wap2_above()
 
 function template_wap2_boardindex()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 		<p class="catbg">', $context['forum_name_html_safe'], '</p>';
@@ -948,7 +946,7 @@ function template_wap2_boardindex()
 
 function template_wap2_messageindex()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 		<p class="catbg">', $context['name'], '</p>';
@@ -986,7 +984,7 @@ function template_wap2_messageindex()
 
 function template_wap2_display()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 		<p class="titlebg">' . $context['linktree'][1]['name'] . ' > ' . $context['linktree'][count($context['linktree']) - 2]['name'] . '</p>
@@ -1081,7 +1079,7 @@ function template_wap2_login()
 
 function template_wap2_post()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 		<form action="', $scripturl, '?action=', $context['destination'], ';board=', $context['current_board'], '.0;wap2" method="post">
@@ -1143,7 +1141,7 @@ function template_wap2_post()
 
 function template_wap2_pm()
 {
-	global $context, $settings, $options, $scripturl, $txt, $user_info;
+	global $context, $options, $scripturl, $txt, $user_info;
 
 	if ($_REQUEST['action'] == 'findmember')
 	{
@@ -1349,7 +1347,7 @@ function template_wap2_pm()
 
 function template_wap2_recent()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 		<p class="catbg">', $_REQUEST['action'] == 'unread' ? $txt['wireless_recent_unread_posts'] : $txt['wireless_recent_unread_replies'], '</p>';
@@ -1378,7 +1376,7 @@ function template_wap2_recent()
 
 function template_wap2_error()
 {
-	global $context, $settings, $options, $txt, $scripturl;
+	global $context, $options, $txt, $scripturl;
 
 	echo '
 		<p class="catbg">', $context['error_title'], '</p>
@@ -1388,7 +1386,7 @@ function template_wap2_error()
 
 function template_wap2_profile()
 {
-	global $context, $settings, $options, $scripturl, $board, $txt;
+	global $context, $options, $scripturl, $board, $txt;
 
 	echo '
 		<p class="catbg">', $txt['summary'], ' - ', $context['member']['name'], '</p>
@@ -1426,7 +1424,7 @@ function template_wap2_profile()
 
 function template_wap2_ban_edit()
 {
-	global $context, $settings, $options, $scripturl, $board, $txt, $modSettings;
+	global $context, $options, $scripturl, $board, $txt, $modSettings;
 
 	echo '
 	<form action="', $scripturl, '?action=admin;area=ban;sa=add;wap2" method="post">
@@ -1508,7 +1506,7 @@ function template_wap2_ban_edit()
 
 function template_wap2_below()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $txt;
 
 	echo '
 		<a href="', $context['linktree'][count($context['linktree']) - 1]['url'], (count($context['linktree']) > 1 ? ';' : '?'), 'nowap" rel="nofollow">', $txt['wireless_go_to_full_version'], '</a>

+ 14 - 14
Themes/default/Xml.template.php

@@ -12,7 +12,7 @@
 
 function template_sendbody()
 {
-	global $context, $settings, $options, $txt;
+	global $context;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>
@@ -22,7 +22,7 @@ function template_sendbody()
 
 function template_quotefast()
 {
-	global $context, $settings, $options, $txt;
+	global $context;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>
@@ -32,7 +32,7 @@ function template_quotefast()
 
 function template_modifyfast()
 {
-	global $context, $settings, $options, $txt;
+	global $context;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>
@@ -44,7 +44,7 @@ function template_modifyfast()
 
 function template_modifydone()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>
@@ -70,7 +70,7 @@ function template_modifydone()
 
 function template_modifytopicdone()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>
@@ -97,7 +97,7 @@ function template_modifytopicdone()
 
 function template_post()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>
@@ -142,7 +142,7 @@ function template_post()
 
 function template_pm()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 
 	// @todo something could be removed...otherwise it can be merged again with template_post
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
@@ -171,7 +171,7 @@ function template_pm()
 
 function template_stats()
 {
-	global $context, $settings, $options, $txt, $modSettings;
+	global $context, $options, $txt, $modSettings;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>';
@@ -192,7 +192,7 @@ function template_stats()
 
 function template_split()
 {
-	global $context, $settings, $options;
+	global $context, $options;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>
@@ -232,7 +232,7 @@ if (!function_exists('template_button_strip'))
 
 function template_results()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt;
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>';
 
@@ -294,7 +294,7 @@ function template_results()
 
 function template_jump_to()
 {
-	global $context, $settings, $options;
+	global $context;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>';
@@ -312,7 +312,7 @@ function template_jump_to()
 
 function template_message_icons()
 {
-	global $context, $settings, $options;
+	global $context;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>';
@@ -325,7 +325,7 @@ function template_message_icons()
 
 function template_check_username()
 {
-	global $context, $settings, $options, $txt;
+	global $context;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>
@@ -336,7 +336,7 @@ function template_check_username()
 // This prints XML in it's most generic form.
 function template_generic_xml()
 {
-	global $context, $settings, $options, $txt;
+	global $context;
 
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>';
 

+ 4 - 4
Themes/default/css/admin.css

@@ -694,16 +694,16 @@ pre.file_content {
 	width: 16px;
 	height: 16px;
 	display: inline-block;
-	background: url(../images/select_spot.png) no-repeat 0 0;
+	background: url(../images/generic_icons.png) no-repeat -48px -32px;
 }
 .select_spot.above {
-	background-position: 0 0;
+	background-position: -48px -32px;
 }
 .select_spot.here {
-	background-position: -16px 0;
+	background-position: -64px -32px;
 }
 .select_spot.below {
-	background-position: -32px 0;
+	background-position: -80px -32px;
 }
 
 /* Styles for the BBC permissions

+ 23 - 14
Themes/default/css/index.css

@@ -455,12 +455,12 @@ a img {
 	width: 16px;
 	height: 16px;
 	display: inline-block;
-	background: url(../images/sort.png) no-repeat 0 0;
+	background: url(../images/generic_icons.png) no-repeat -80px 0;
 	text-indent: -100em;
 	overflow: hidden;
 }
 .sort_down {
-	background-position: 0 -16px;
+	background-position: -80px -16px;
 }
 /* Generally, those [?] icons.  This makes your cursor a help icon. */
 .help {
@@ -671,12 +671,11 @@ div.pagesection div.floatright input, div.pagesection div.floatright select {
 	width: 16px;
 	height: 16px;
 	display: inline-block;
-	background: url(../images/likes.png) no-repeat 0 0;
-	padding-right: 2px;
-	margin-bottom: -1px;
+	background: url(../images/generic_icons.png) no-repeat -64px 0;
+	margin: 0 2px -1px 0;
 }
 .like_button .unlike {
-	background-position: 0 -16px;
+	background-position: -64px -16px;
 }
 
 /* Sometimes there will be an error when you post */
@@ -1070,10 +1069,11 @@ img.sort, .sort {
 }
 /* For cases where we want to spotlight something specific to an item, e.g. an amount */
 .dropmenu li .amt, #top_info li .amt {
-	padding: 0 4px;
+	margin-left: 3px;
+	padding: 0 5px;
 	color: white;
 	background: #6d90ad;
-	border-radius: 4px;
+	border-radius: 8px;
 }
 .dropmenu li .active .amt, #top_info li .active .amt {
 	background: none;
@@ -2831,16 +2831,16 @@ fieldset.merge_options {
 	width: 16px;
 	height: 16px;
 	display: inline-block;
-	background: url(../images/field_icons.png) no-repeat 0 0;
+	background: url(../images/generic_icons.png) no-repeat 0 -32px;
 }
 .field_icons.valid {
-	background-position: 0 0;
+	background-position: 0 -32px;
 }
 .field_icons.check {
-	background-position: -16px 0;
+	background-position: -16px -32px;
 }
 .field_icons.invalid {
-	background-position: -32px 0;
+	background-position: -32px -32px;
 }
 
 /* Additional register fields */
@@ -3029,6 +3029,15 @@ tr.windowbg td, tr.windowbg2 td, tr.approvebg td, tr.highlight2 td {
 .generic_icons.mail_new {
 	background-position: -48px -16px;
 }
+.generic_icons.delete {
+	background-position: -96px 0;
+}
+.generic_icons.current {
+	background-position: -96px -16px;
+}
+.generic_icons.old {
+	background-position: -96px -32px;
+}
 
 /* Styles for (fatal) errors.
 ------------------------------------------------- */
@@ -3342,7 +3351,7 @@ dl {
 	margin: 0 0 10px 2px;
 	overflow: auto;
 }
-img.centericon {
+.centericon {
 	vertical-align: middle;
 }
 .sizefix {
@@ -4027,7 +4036,7 @@ span.hidelink {
 	display: inline-block;
 	width: 16px;
 	height: 16px;
-	background: url(../images/buttons/delete.png) center center no-repeat;
+	background: url(../images/generic_icons.png) no-repeat -96px 0;
 	float: right;
 }
 .popup_heading .icon

BIN
Themes/default/images/email_sm.png


BIN
Themes/default/images/field_icons.png


BIN
Themes/default/images/generic_icons.png


BIN
Themes/default/images/icons/package_installed.png


BIN
Themes/default/images/icons/package_old.png


BIN
Themes/default/images/im_sm_prefs.png


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است