ソースを参照

Merge pull request #1083 from Arantor/release-2.1

Various cleanups of unused globals
Arantor 11 年 前
コミット
8013bb3013
65 ファイル変更245 行追加251 行削除
  1. 14 14
      SSI.php
  2. 1 1
      Sources/Load.php
  3. 1 1
      Sources/ManageMail.php
  4. 1 1
      Sources/ManageMaintenance.php
  5. 1 1
      Sources/ManageMembergroups.php
  6. 1 1
      Sources/ManagePosts.php
  7. 1 1
      Sources/ManageRegistration.php
  8. 3 3
      Sources/ManageServer.php
  9. 9 9
      Sources/ManageSettings.php
  10. 5 5
      Sources/ManageSmileys.php
  11. 2 2
      Sources/Memberlist.php
  12. 1 1
      Sources/ModerationCenter.php
  13. 1 1
      Sources/Modlog.php
  14. 1 1
      Sources/MoveTopic.php
  15. 2 2
      Sources/News.php
  16. 1 1
      Sources/Packages.php
  17. 1 1
      Sources/PersonalMessage.php
  18. 1 1
      Sources/Post.php
  19. 9 9
      Sources/Profile-Modify.php
  20. 2 2
      Sources/Register.php
  21. 1 1
      Sources/ScheduledTasks.php
  22. 1 1
      Sources/Subs-Editor.php
  23. 1 1
      Sources/Subs-List.php
  24. 1 1
      Sources/Subs-Members.php
  25. 1 1
      Sources/Subs-Package.php
  26. 5 5
      Themes/default/Admin.template.php
  27. 1 1
      Themes/default/Compat.template.php
  28. 1 1
      Themes/default/Errors.template.php
  29. 1 1
      Themes/default/GenericControls.template.php
  30. 3 3
      Themes/default/GenericList.template.php
  31. 2 2
      Themes/default/GenericMenu.template.php
  32. 2 2
      Themes/default/Login.template.php
  33. 1 1
      Themes/default/ManageAttachments.template.php
  34. 1 1
      Themes/default/ManageBans.template.php
  35. 3 3
      Themes/default/ManageBoards.template.php
  36. 1 1
      Themes/default/ManageCalendar.template.php
  37. 1 1
      Themes/default/ManageLanguages.template.php
  38. 1 1
      Themes/default/ManageMail.template.php
  39. 6 6
      Themes/default/ManageMaintenance.template.php
  40. 3 3
      Themes/default/ManageMembergroups.template.php
  41. 2 2
      Themes/default/ManageMembers.template.php
  42. 2 2
      Themes/default/ManagePaid.template.php
  43. 4 4
      Themes/default/ManagePermissions.template.php
  44. 2 2
      Themes/default/ManageScheduledTasks.template.php
  45. 7 7
      Themes/default/ManageSearch.template.php
  46. 7 7
      Themes/default/ManageSmileys.template.php
  47. 7 7
      Themes/default/ModerationCenter.template.php
  48. 1 1
      Themes/default/MoveTopic.template.php
  49. 2 2
      Themes/default/Notify.template.php
  50. 12 12
      Themes/default/Packages.template.php
  51. 12 14
      Themes/default/PersonalMessage.template.php
  52. 1 1
      Themes/default/Poll.template.php
  53. 2 2
      Themes/default/Post.template.php
  54. 10 10
      Themes/default/Profile.template.php
  55. 6 6
      Themes/default/Register.template.php
  56. 3 3
      Themes/default/Reminder.template.php
  57. 3 5
      Themes/default/Reports.template.php
  58. 3 3
      Themes/default/SendTopic.template.php
  59. 2 2
      Themes/default/Settings.template.php
  60. 5 5
      Themes/default/SplitTopics.template.php
  61. 10 10
      Themes/default/Themes.template.php
  62. 28 30
      Themes/default/Wireless.template.php
  63. 14 14
      Themes/default/Xml.template.php
  64. 4 4
      Themes/default/index.template.php
  65. 1 1
      cron.php

+ 14 - 14
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'));
 
@@ -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/Load.php

@@ -2443,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) === '')

+ 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');
 

+ 1 - 1
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');

+ 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']('', '

+ 1 - 1
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']))

+ 1 - 1
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;

+ 1 - 1
Sources/MoveTopic.php

@@ -30,7 +30,7 @@ if (!defined('SMF'))
  */
 function MoveTopic()
 {
-	global $txt, $board, $topic, $user_info, $context, $language, $scripturl, $settings, $smcFunc, $modSettings, $sourcedir;
+	global $txt, $board, $topic, $user_info, $context, $language, $scripturl, $smcFunc, $modSettings, $sourcedir;
 
 	if (empty($topic))
 		fatal_lang_error('no_access', false);

+ 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/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'];
 

+ 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(

+ 1 - 1
Sources/Post.php

@@ -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');

+ 9 - 9
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();
@@ -2044,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']))
@@ -2092,7 +2092,7 @@ function alert_notifications_topics($memID)
 				),
 				'data' => array(
 					'function' => create_function('$topic', '
-						global $settings, $txt;
+						global $txt;
 
 						$link = $topic[\'link\'];
 
@@ -2184,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']))
@@ -2225,7 +2225,7 @@ function alert_notifications_boards($memID)
 				),
 				'data' => array(
 					'function' => create_function('$board', '
-						global $settings, $txt;
+						global $txt;
 
 						$link = $board[\'link\'];
 
@@ -2558,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();
 

+ 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/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']('', '

+ 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-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-Package.php

@@ -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');

+ 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)
 	{

+ 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))

+ 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

@@ -192,7 +192,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">

+ 6 - 6
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 '
@@ -537,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">
@@ -569,7 +569,7 @@ function template_optimize()
 
 function template_convert_utf8()
 {
-	global $context, $txt, $settings, $scripturl;
+	global $context, $txt, $scripturl;
 
 	echo '
 	<div id="manage_maintenance">
@@ -607,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">
@@ -627,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">

+ 3 - 3
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">
@@ -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">

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

@@ -45,7 +45,7 @@ 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">
@@ -79,7 +79,7 @@ function template_group_requests_block()
 // A block to show the current top reported posts.
 function template_reported_posts_block()
 {
-	global $settings, $options, $context, $txt, $scripturl;
+	global $options, $context, $txt, $scripturl;
 
 	echo '
 		<div class="cat_bar">
@@ -112,7 +112,7 @@ function template_reported_posts_block()
 
 function template_watched_users()
 {
-	global $settings, $options, $context, $txt, $scripturl;
+	global $options, $context, $txt, $scripturl;
 
 	echo '
 		<div class="cat_bar">
@@ -188,7 +188,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 +285,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,7 +496,7 @@ 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">
@@ -597,7 +597,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">

+ 12 - 12
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">
@@ -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;
 

+ 12 - 14
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 '
@@ -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">

+ 10 - 10
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 '
@@ -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">
@@ -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,7 +1578,7 @@ 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>
@@ -1935,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 '
@@ -1952,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">
@@ -2703,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 '
 

+ 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 - 2
Themes/default/Settings.template.php

@@ -12,7 +12,7 @@
 
 function template_options()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	$context['theme_options'] = array(
 		array(
@@ -144,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(

+ 5 - 5
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">
@@ -358,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">

+ 10 - 10
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.
@@ -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/index.template.php

@@ -354,7 +354,7 @@ function template_body_above()
 
 function template_body_below()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	echo '
 			</div>
@@ -387,7 +387,7 @@ function template_body_below()
 
 function template_html_below()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $options, $scripturl, $txt, $modSettings;
 
 	// load in any javascipt that could be defered to the end of the page
 	template_javascript(true);
@@ -461,7 +461,7 @@ function theme_linktree($force_show = false)
  */
 function template_menu()
 {
-	global $context, $settings, $options, $scripturl, $txt;
+	global $context, $options, $scripturl, $txt;
 
 	echo '
 				<div id="main_menu">
@@ -528,7 +528,7 @@ function template_menu()
  */
 function template_button_strip($button_strip, $direction = '', $strip_options = array())
 {
-	global $settings, $context, $txt, $scripturl;
+	global $context, $txt, $scripturl;
 
 	if (!is_array($strip_options))
 		$strip_options = array();

+ 1 - 1
cron.php

@@ -220,7 +220,7 @@ function cleanRequest_cron()
 
 function error_handler_cron($error_level, $error_string, $file, $line)
 {
-	global $settings, $modSettings, $db_show_debug;
+	global $modSettings, $db_show_debug;
 
 	// Ignore errors if we're ignoring them or they are strict notices from PHP 5 (which cannot be solved without breaking PHP 4.)
 	if (error_reporting() == 0 || (defined('E_STRICT') && $error_level == E_STRICT && (empty($modSettings['enableErrorLogging']) || $modSettings['enableErrorLogging'] != 2)))