Browse Source

! Cleanliness is good.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 10 years ago
parent
commit
c80826f1d0
6 changed files with 15 additions and 17 deletions
  1. 1 1
      Sources/Search.php
  2. 1 1
      Sources/Subs-Sound.php
  3. 2 2
      Sources/Xml.php
  4. 10 10
      Themes/default/index.template.php
  5. 1 1
      cron.php
  6. 0 2
      ssi_examples.php

+ 1 - 1
Sources/Search.php

@@ -1865,7 +1865,7 @@ function PlushSearch2()
  */
 function prepareSearchContext($reset = false)
 {
-	global $txt, $modSettings, $scripturl, $user_info, $sourcedir;
+	global $txt, $modSettings, $scripturl, $user_info;
 	global $memberContext, $context, $settings, $options, $messages_request;
 	global $boards_can, $participants, $smcFunc;
 

+ 1 - 1
Sources/Subs-Sound.php

@@ -29,7 +29,7 @@ if (!defined('SMF'))
 
 function createWaveFile($word)
 {
-	global $settings, $user_info, $context;
+	global $settings, $user_info;
 
 	// Allow max 2 requests per 20 seconds.
 	if (($ip = cache_get_data('wave_file/' . $user_info['ip'], 20)) > 2 || ($ip2 = cache_get_data('wave_file/' . $user_info['ip2'], 20)) > 2)

+ 2 - 2
Sources/Xml.php

@@ -47,7 +47,7 @@ function XMLhttpMain()
  */
 function GetJumpTo()
 {
-	global $user_info, $context, $smcFunc, $sourcedir;
+	global $context, $sourcedir;
 
 	// Find the boards/cateogories they can see.
 	require_once($sourcedir . '/Subs-MessageIndex.php');
@@ -127,7 +127,7 @@ function newspreview()
 }
 function newsletterpreview()
 {
-	global $context, $sourcedir, $smcFunc, $txt;
+	global $context, $sourcedir, $txt;
 
 	require_once($sourcedir . '/Subs-Post.php');
 	require_once($sourcedir . '/ManageNews.php');

+ 10 - 10
Themes/default/index.template.php

@@ -40,7 +40,9 @@
  */
 function template_init()
 {
-	global $context, $settings, $options, $txt;
+	global $settings;
+
+	/* $context, $options and $txt may be available for use, but may not be fully populated yet. */
 
 	/* Use images from default theme when using templates from the default theme?
 		if this is 'always', images from the default theme will be used.
@@ -54,7 +56,7 @@ function template_init()
 	$settings['doctype'] = 'xhtml';
 
 	// The version this template/theme is for. This should probably be the version of SMF it was created for.
-	$settings['theme_version'] = '2.0';
+	$settings['theme_version'] = '2.1';
 
 	// Use plain buttons - as opposed to text buttons?
 	$settings['use_buttons'] = true;
@@ -77,7 +79,7 @@ function template_init()
  */
 function template_html_above()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $settings, $scripturl, $txt, $modSettings;
 
 	// Show right to left and the character set for ease of translating.
 	echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -176,7 +178,7 @@ function template_html_above()
 
 function template_body_above()
 {
-	global $context, $settings, $options, $scripturl, $txt, $modSettings;
+	global $context, $settings, $scripturl, $txt, $modSettings;
 
 	// Wrapper div now echoes permanently for better layout options. h1 a is now target for "Go up" links.
 	echo '
@@ -354,7 +356,7 @@ function template_body_above()
 
 function template_body_below()
 {
-	global $context, $options, $scripturl, $txt, $modSettings;
+	global $context, $txt;
 
 	echo '
 			</div>
@@ -387,8 +389,6 @@ function template_body_below()
 
 function template_html_below()
 {
-	global $context, $options, $scripturl, $txt, $modSettings;
-
 	// load in any javascipt that could be defered to the end of the page
 	template_javascript(true);
 
@@ -403,7 +403,7 @@ function template_html_below()
  */
 function theme_linktree($force_show = false)
 {
-	global $context, $settings, $options, $shown_linktree, $scripturl, $txt;
+	global $context, $settings, $shown_linktree, $scripturl, $txt;
 
 	// If linktree is empty, just return - also allow an override.
 	if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
@@ -461,7 +461,7 @@ function theme_linktree($force_show = false)
  */
 function template_menu()
 {
-	global $context, $options, $scripturl, $txt;
+	global $context;
 
 	echo '
 				<div id="main_menu">
@@ -528,7 +528,7 @@ function template_menu()
  */
 function template_button_strip($button_strip, $direction = '', $strip_options = array())
 {
-	global $context, $txt, $scripturl;
+	global $context, $txt;
 
 	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 $modSettings, $db_show_debug;
+	global $modSettings;
 
 	// 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'])))

+ 0 - 2
ssi_examples.php

@@ -529,8 +529,6 @@ function template_ssi_above()
 
 function template_ssi_below()
 {
-	global $time_start;
-
 	echo '
 						<script type="text/javascript"><!-- // --><![CDATA[
 							showSSIBlock("ssi_recentTopics");