Forráskód Böngészése

! Minor bug
! We used the wrong text to add subscribers (ManagePaid.php) [Bug 4783]
+ Hide registration links when registration is disabled (Load.php, Subs.php, index Template, Login Template, index language, Login Language) [Feature 4755]
! Moved word censor option to a permission (Profile-Modify.php, Subs.php, ManagePermissions.php, Profile template, Settings template, ManagePermissions langauge) [Feature 4738]
! Some more bugs from detectBrowser changes (Many Files) [Bug 4643]
! Andriod also is webkit, so move it to the webkit checks (Enviroment.php) [Bug 4643]
+ Added a hook to log_errors allowing error type expansion (Errors.php)
+ Added isBrowser(), temp support to locate old brorwser checks and changed how we detect browsers (Many files) [Feature 4643]
+ Added latest jQuery library (1.6.4 minified)
+ This will be called from default/scripts while in development
+ Added customised superfish.js and hoverIntent.js (not minified)
+ Calls for the above added to default/index.template.php
+ default/index.css changed to give full keyboard and screen reader access with or without javascript
+ No changes made to Core theme yet, as it may be dropped for 2.1

Spuds 13 éve
szülő
commit
f8cff26430
37 módosított fájl, 166 hozzáadás és 388 törlés
  1. 2 2
      Sources/Calendar.php
  2. 3 2
      Sources/DumpDatabase.php
  3. 9 0
      Sources/Errors.php
  4. 1 1
      Sources/Karma.php
  5. 5 5
      Sources/Load.php
  6. 1 1
      Sources/ManagePaid.php
  7. 1 0
      Sources/ManagePermissions.php
  8. 1 1
      Sources/News.php
  9. 1 1
      Sources/PersonalMessage.php
  10. 13 0
      Sources/Profile-Modify.php
  11. 2 2
      Sources/QueryString.php
  12. 1 1
      Sources/Register.php
  13. 2 2
      Sources/Subs-Editor.php
  14. 15 28
      Sources/Subs.php
  15. 13 116
      Themes/default/Admin.template.php
  16. 1 6
      Themes/default/Calendar.template.php
  17. 10 10
      Themes/default/Display.template.php
  18. 8 4
      Themes/default/Login.template.php
  19. 3 3
      Themes/default/ManageBoards.template.php
  20. 5 5
      Themes/default/ManageLanguages.template.php
  21. 1 1
      Themes/default/ManageMembergroups.template.php
  22. 4 4
      Themes/default/ManageNews.template.php
  23. 2 29
      Themes/default/ManageSmileys.template.php
  24. 1 1
      Themes/default/ModerationCenter.template.php
  25. 2 2
      Themes/default/Packages.template.php
  26. 4 50
      Themes/default/PersonalMessage.template.php
  27. 4 47
      Themes/default/Post.template.php
  28. 3 3
      Themes/default/Profile.template.php
  29. 1 1
      Themes/default/Register.template.php
  30. 1 1
      Themes/default/SendTopic.template.php
  31. 0 9
      Themes/default/Settings.template.php
  32. 2 39
      Themes/default/Themes.template.php
  33. 20 5
      Themes/default/css/index.css
  34. 14 2
      Themes/default/index.template.php
  35. 3 3
      Themes/default/languages/Login.english.php
  36. 2 0
      Themes/default/languages/ManagePermissions.english.php
  37. 5 1
      Themes/default/languages/index.english.php

+ 2 - 2
Sources/Calendar.php

@@ -371,13 +371,13 @@ function iCalDownload()
 	// Send the file headers
 	header('Pragma: ');
 	header('Cache-Control: no-cache');
-	if (!$context['browser']['is_gecko'])
+	if (!isBrowser('gecko'))
 		header('Content-Transfer-Encoding: binary');
 	header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT');
 	header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . 'GMT');
 	header('Accept-Ranges: bytes');
 	header('Connection: close');
-	header('Content-Disposition: attachment; filename=' . $event['title'] . '.ics');
+	header('Content-D isposition: attachment; filename=' . $event['title'] . '.ics');
 
 	// How big is it?
 	if (empty($modSettings['enableCompressedOutput']))

+ 3 - 2
Sources/DumpDatabase.php

@@ -49,6 +49,7 @@ function DumpDatabase2()
 
 	// Start saving the output... (don't do it otherwise for memory reasons.)
 	if (isset($_REQUEST['compress']) && function_exists('gzencode'))
+	
 	{
 		// Make sure we're gzipping output, but then say we're not in the header ^_^.
 		if (empty($modSettings['enableCompressedOutput']))
@@ -66,7 +67,7 @@ function DumpDatabase2()
 		header('Content-Encoding: none');
 
 		// Gecko browsers... don't like this. (Mozilla, Firefox, etc.)
-		if (!$context['browser']['is_gecko'])
+		if (!isBrowser('gecko'))
 			header('Content-Transfer-Encoding: binary');
 
 		// The file extension will include .gz...
@@ -82,7 +83,7 @@ function DumpDatabase2()
 			ob_clean();
 
 		// Tell the client to save this file, even though it's text.
-		header('Content-Type: ' . ($context['browser']['is_ie'] || $context['browser']['is_opera'] ? 'application/octetstream' : 'application/octet-stream'));
+		header('Content-Type: ' . (isBrowser('ie') || isBrowser('opera') ? 'application/octetstream' : 'application/octet-stream'));
 		header('Content-Encoding: none');
 
 		// This time the extension should just be .sql.

+ 9 - 0
Sources/Errors.php

@@ -32,6 +32,7 @@ if (!defined('SMF'))
 function log_error($error_message, $error_type = 'general', $file = null, $line = null)
 {
 	global $txt, $modSettings, $sc, $user_info, $smcFunc, $scripturl, $last_error;
+	static $tried_hook = false;
 
 	// Check if error logging is actually on.
 	if (empty($modSettings['enableErrorLogging']))
@@ -81,6 +82,14 @@ function log_error($error_message, $error_type = 'general', $file = null, $line
 		'debug',
 	);
 
+	// This prevents us from infinite looping if the hook or call produces an error.
+	$other_error_types = array();
+	if (empty($tried_hook))
+	{
+		$tried_hook = true;
+		call_integration_hook('integrate_error_types', array(&$other_error_types));
+		$known_error_types += $other_error_types;
+	}
 	// Make sure the category that was specified is a valid one
 	$error_type = in_array($error_type, $known_error_types) && $error_type !== true ? $error_type : 'general';
 

+ 1 - 1
Sources/Karma.php

@@ -156,7 +156,7 @@ function BookOfUnknown()
 {
 	global $context;
 
-	if (strpos($_GET['action'], 'mozilla') !== false && !$context['browser']['is_gecko'])
+	if (strpos($_GET['action'], 'mozilla') !== false && !isBrowser('gecko'))
 		redirectexit('http://www.getfirefox.com/');
 	elseif (strpos($_GET['action'], 'mozilla') !== false)
 		redirectexit('about:mozilla');

+ 5 - 5
Sources/Load.php

@@ -1661,7 +1661,7 @@ function loadTheme($id_theme = 0, $initialize = true)
 
 	// Fix font size with HTML 4.01, etc.
 	if (isset($settings['doctype']))
-		$context['browser']['needs_size_fix'] |= $settings['doctype'] == 'html' && $context['browser']['is_ie6'];
+		$context['browser']['needs_size_fix'] |= $settings['doctype'] == 'html' && isBrowser('ie6');
 
 	// Compatibility.
 	if (!isset($settings['theme_version']))
@@ -1673,7 +1673,7 @@ function loadTheme($id_theme = 0, $initialize = true)
 	// If we think we have mail to send, let's offer up some possibilities... robots get pain (Now with scheduled task support!)
 	if ((!empty($modSettings['mail_next_send']) && $modSettings['mail_next_send'] < time() && empty($modSettings['mail_queue_use_cron'])) || empty($modSettings['next_task_time']) || $modSettings['next_task_time'] < time())
 	{
-		if ($context['browser']['possibly_robot'])
+		if (isBrowser('possibly_robot'))
 		{
 			/**
 			 * @todo Maybe move this somewhere better?!
@@ -1696,7 +1696,7 @@ function loadTheme($id_theme = 0, $initialize = true)
 		function smfAutoTask()
 		{
 			var tempImage = new Image();
-			tempImage.src = "' . $scripturl . '?scheduled=' . $type . ';ts=' . $ts . '";
+			tempImage.src = smf_scripturl + "?scheduled=' . $type . ';ts=' . $ts . '";
 		}
 		window.setTimeout("smfAutoTask();", 1);
 	</script>';
@@ -2269,9 +2269,9 @@ function template_include($filename, $once = false)
 				$data2 = preg_split('~\<br( /)?\>~', $data2);
 
 				// Fix the PHP code stuff...
-				if ($context['browser']['is_ie4'] || $context['browser']['is_ie5'] || $context['browser']['is_ie5.5'])
+				if (isBrowser('ie4') || isBrowser('ie5') || isBrowser('ie5.5'))
 					$data2 = str_replace("\t", '<pre style="display: inline;">' . "\t" . '</pre>', $data2);
-				elseif (!$context['browser']['is_gecko'])
+				elseif (!isBrowser('gecko'))
 					$data2 = str_replace("\t", '<span style="white-space: pre;">' . "\t" . '</span>', $data2);
 				else
 					$data2 = str_replace('<pre style="display: inline;">' . "\t" . '</pre>', "\t", $data2);

+ 1 - 1
Sources/ManagePaid.php

@@ -757,7 +757,7 @@ function ViewSubscribedUsers()
 				'position' => 'below_table_data',
 				'value' => '
 					<div class="floatleft">
-						<input type="submit" name="add" value="' . $txt['paid_add_subscription'] . '" class="button_submit" />
+						<input type="submit" name="add" value="' . $txt['add_subscriber'] . '" class="button_submit" />
 					</div>
 					<div class="floatright">
 						<input type="submit" name="finished" value="' . $txt['complete_selected'] . '" onclick="return confirm(\'' . $txt['complete_are_sure'] . '\');" class="button_submit" />

+ 1 - 0
Sources/ManagePermissions.php

@@ -1441,6 +1441,7 @@ function loadAllPermissions($loadType = 'classic')
 			'who_view' => array(false, 'general', 'view_basic_info'),
 			'search_posts' => array(false, 'general', 'view_basic_info'),
 			'karma_edit' => array(false, 'general', 'moderate_general'),
+			'disable_censor' => array(false, 'general', 'disable_censor'),
 			'pm_read' => array(false, 'pm', 'use_pm_system'),
 			'pm_send' => array(false, 'pm', 'use_pm_system'),
 			'calendar_view' => array(false, 'calendar', 'view_basic_info'),

+ 1 - 1
Sources/News.php

@@ -233,7 +233,7 @@ function ShowXmlFeed()
 	elseif ($xml_format == 'atom')
 		header('Content-Type: application/atom+xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
 	elseif ($xml_format == 'rdf')
-		header('Content-Type: ' . ($context['browser']['is_ie'] ? 'text/xml' : 'application/rdf+xml') . '; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
+		header('Content-Type: ' . (isBrowser('ie') ? 'text/xml' : 'application/rdf+xml') . '; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
 
 	// First, output the xml header.
 	echo '<?xml version="1.0" encoding="', $context['character_set'], '"?' . '>';

+ 1 - 1
Sources/PersonalMessage.php

@@ -2444,7 +2444,7 @@ function MessageActionsApply()
 
 	// Back to the folder.
 	$_SESSION['pm_selected'] = array_keys($to_label);
-	redirectexit($context['current_label_redirect'] . (count($to_label) == 1 ? '#msg' . $_SESSION['pm_selected'][0] : ''), count($to_label) == 1 && $context['browser']['is_ie']);
+	redirectexit($context['current_label_redirect'] . (count($to_label) == 1 ? '#msg' . $_SESSION['pm_selected'][0] : ''), count($to_label) == 1 && isBrowser('ie'));
 }
 
 /**

+ 13 - 0
Sources/Profile-Modify.php

@@ -571,7 +571,14 @@ function loadProfileFields($force_reload = false)
 			'permission' => 'profile_extra',
 			'is_dummy' => true,
 			'preload' => create_function('', '
+				global $context, $user_info;
+
 				loadLanguage(\'Settings\');
+
+				$context[\'allow_no_censored\'] = false;
+				if ($user_info[\'is_admin\'] || $context[\'user\'][\'is_owner\'])
+					$context[\'allow_no_censored\'] = allowedTo(\'disable_censor\');
+
 				return true;
 			'),
 		),
@@ -1048,6 +1055,9 @@ function makeThemeChanges($memID, $id_theme)
 			// These need to be controlled.
 			if ($opt == 'topics_per_page' || $opt == 'messages_per_page')
 				$val = max(0, min($val, 50));
+			// We don't set this per theme anymore.
+			elseif ($opt == 'allow_no_censored')
+				continue;
 
 			$themeSetArray[] = array($memID, $id_theme, $opt, is_array($val) ? implode(',', $val) : $val);
 		}
@@ -1063,6 +1073,9 @@ function makeThemeChanges($memID, $id_theme)
 			// These need to be controlled.
 			if ($opt == 'topics_per_page' || $opt == 'messages_per_page')
 				$val = max(0, min($val, 50));
+			// Only let admins and owners change the censor.
+			elseif ($opt == 'allow_no_censored' && !$user_info['is_admin'] && !$context['user']['is_owner'])
+					continue;
 
 			$themeSetArray[] = array($memID, 1, $opt, is_array($val) ? implode(',', $val) : $val);
 			$erase_options[] = $opt;

+ 2 - 2
Sources/QueryString.php

@@ -319,7 +319,7 @@ function convertIPv6toInts($ip)
 		return $expanded[$ip];
 
 	// Expand the IP out.
-	$ip = explode(':', smf_ipv6_expand($ip));
+	$ip = explode(':', expandIPv6($ip));
 
 	$new_ip = array();
 	foreach ($ip as $int)
@@ -601,7 +601,7 @@ function ob_sessrewrite($buffer)
 
 	// Do nothing if the session is cookied, or they are a crawler - guests are caught by redirectexit().  This doesn't work below PHP 4.3.0, because it makes the output buffer bigger.
 	// @todo smflib
-	if (empty($_COOKIE) && SID != '' && empty($context['browser']['possibly_robot']) && version_compare(PHP_VERSION, '4.3.0', '>='))
+	if (empty($_COOKIE) && SID != '' && isBrowser('possibly_robot') && version_compare(PHP_VERSION, '4.3.0', '>='))
 		$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')\\??/', '"' . $scripturl . '?' . SID . '&amp;', $buffer);
 	// Debugging templates, are we?
 	elseif (isset($_GET['debug']))

+ 1 - 1
Sources/Register.php

@@ -725,7 +725,7 @@ function CoppaForm()
 			// Send the headers.
 			header('Connection: close');
 			header('Content-Disposition: attachment; filename="approval.txt"');
-			header('Content-Type: ' . ($context['browser']['is_ie'] || $context['browser']['is_opera'] ? 'application/octetstream' : 'application/octet-stream'));
+			header('Content-Type: ' . (isBrowser('ie') || isBrowser('opera') ? 'application/octetstream' : 'application/octet-stream'));
 			header('Content-Length: ' . count($data));
 
 			echo $data;

+ 2 - 2
Sources/Subs-Editor.php

@@ -125,7 +125,7 @@ function html_to_bbc($text)
 	$text = preg_replace('~</p>\s*(?!<)~i', '</p><br />', $text);
 
 	// Safari/webkit wraps lines in Wysiwyg in <div>'s.
-	if ($context['browser']['is_webkit'])
+	if (isBrowser('webkit'))
 		$text = preg_replace(array('~<div(?:\s(?:[^<>]*?))?' . '>~i', '</div>'), array('<br />', ''), $text);
 
 	// If there's a trailing break get rid of it - Firefox tends to add one.
@@ -1439,7 +1439,7 @@ function create_control_richedit($editorOptions)
 		$settings['smileys_url'] = $modSettings['smileys_url'] . '/' . $user_info['smiley_set'];
 
 		// This really has some WYSIWYG stuff.
-		loadTemplate('GenericControls', $context['browser']['is_ie'] ? 'editor_ie' : 'editor');
+		loadTemplate('GenericControls', isBrowser('ie') ? 'editor_ie' : 'editor');
 		$context['html_headers'] .= '
 		<script type="text/javascript"><!-- // --><![CDATA[
 			var smf_smileys_url = \'' . $settings['smileys_url'] . '\';

+ 15 - 28
Sources/Subs.php

@@ -41,22 +41,9 @@ if (!defined('SMF'))
  * returns seconds since the unix epoch.
 
 	array permute(array input)
- * calculates all the possible permutations (orders) of array.
- * should not be called on huge arrays (bigger than like 10 elements.)
- * returns an array containing each permutation.
+ * 
 
-	string parse_bbc(string message, bool smileys = true, string cache_id = '', array parse_tags = null)
- * this very hefty function parses bbc in message.
- * only parses bbc tags which are not disabled in disabledBBC.
- * also handles basic HTML, if enablePostHTML is on.
- * caches the from/to replace regular expressions so as not to reload
- *  them every time a string is parsed.
- * only parses smileys if smileys is true.
- * does nothing if the enableBBC setting is off.
- * applies the fixLongWords magic if the setting is set to on.
- * uses the cache_id as a unique identifier to facilitate any caching
- *  it may do.
- * returns the modified message.
+	
 
 	void parsesmileys(string &message)
  * the smiley parsing function which makes pretty faces appear :).
@@ -1120,7 +1107,7 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 			array(
 				'tag' => 'code',
 				'type' => 'unparsed_content',
-				'content' => '<div class="codeheader">' . $txt['code'] . ': <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code">$1</code>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '</pre>' : ''),
+				'content' => '<div class="codeheader">' . $txt['code'] . ': <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . (isBrowser('gecko') || isBrowser('opera') ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code">$1</code>' . (isBrowser('gecko') || isBrowser('opera') ? '</pre>' : ''),
 				// @todo Maybe this can be simplified?
 				'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
 					global $context;
@@ -1162,7 +1149,7 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 			array(
 				'tag' => 'code',
 				'type' => 'unparsed_equals_content',
-				'content' => '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code">$1</code>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '</pre>' : ''),
+				'content' => '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . (isBrowser('gecko') || isBrowser('opera') ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code">$1</code>' . (isBrowser('gecko') || isBrowser('opera') ? '</pre>' : ''),
 				// @todo Maybe this can be simplified?
 				'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
 					global $context;
@@ -1228,7 +1215,7 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 				'tag' => 'flash',
 				'type' => 'unparsed_commas_content',
 				'test' => '\d+,\d+\]',
-				'content' => ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="$2" height="$3"><param name="movie" value="$1" /><param name="play" value="true" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed></object>' : '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed>'),
+				'content' => (isBrowser('ie') && !isBrowser('mac_ie') ? '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="$2" height="$3"><param name="movie" value="$1" /><param name="play" value="true" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed></object>' : '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed>'),
 				'validate' => create_function('&$tag, &$data, $disabled', '
 					if (isset($disabled[\'url\']))
 						$tag[\'content\'] = \'$1\';
@@ -1270,8 +1257,8 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 				'tag' => 'glow',
 				'type' => 'unparsed_commas',
 				'test' => '[#0-9a-zA-Z\-]{3,12},([012]\d{1,2}|\d{1,2})(,[^]]+)?\]',
-				'before' => $context['browser']['is_ie'] ? '<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Glow(color=$1, strength=$2); font: inherit;">' : '<span style="text-shadow: $1 1px 1px 1px">',
-				'after' => $context['browser']['is_ie'] ? '</td></tr></table> ' : '</span>',
+				'before' => isBrowser('ie') ? '<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Glow(color=$1, strength=$2); font: inherit;">' : '<span style="text-shadow: $1 1px 1px 1px">',
+				'after' => isBrowser('ie') ? '</td></tr></table> ' : '</span>',
 			),
 			array(
 				'tag' => 'green',
@@ -1501,9 +1488,9 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 				'tag' => 'shadow',
 				'type' => 'unparsed_commas',
 				'test' => '[#0-9a-zA-Z\-]{3,12},(left|right|top|bottom|[0123]\d{0,2})\]',
-				'before' => $context['browser']['is_ie'] ? '<span style="display: inline-block; filter: Shadow(color=$1, direction=$2); height: 1.2em;">' : '<span style="text-shadow: $1 $2">',
+				'before' => isBrowser('ie') ? '<span style="display: inline-block; filter: Shadow(color=$1, direction=$2); height: 1.2em;">' : '<span style="text-shadow: $1 $2">',
 				'after' => '</span>',
-				'validate' => $context['browser']['is_ie'] ? create_function('&$tag, &$data, $disabled', '
+				'validate' => isBrowser('ie') ? create_function('&$tag, &$data, $disabled', '
 					if ($data[1] == \'left\')
 						$data[1] = 270;
 					elseif ($data[1] == \'right\')
@@ -1745,10 +1732,10 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 	// This saves time by doing our break long words checks here.
 	if (!empty($modSettings['fixLongWords']) && $modSettings['fixLongWords'] > 5)
 	{
-		if ($context['browser']['is_gecko'] || $context['browser']['is_konqueror'])
+		if (isBrowser('gecko') || isBrowser('konqueror'))
 			$breaker = '<span style="margin: 0 -0.5ex 0 0;"> </span>';
 		// Opera...
-		elseif ($context['browser']['is_opera'])
+		elseif (isBrowser('opera'))
 			$breaker = '<span style="margin: 0 -0.65ex 0 -1px;"> </span>';
 		// Internet Explorer...
 		else
@@ -2904,7 +2891,7 @@ function setupThemeContext($forceload = false)
 		// If we've upgraded recently, go easy on the passwords.
 		if (!empty($modSettings['disableHashTime']) && ($modSettings['disableHashTime'] == 1 || time() < $modSettings['disableHashTime']))
 			$context['disable_login_hashing'] = true;
-		elseif ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'])
+		elseif (isBrowser('ie5') || isBrowser('ie5.5'))
 			$context['disable_login_hashing'] = true;
 	}
 
@@ -2928,7 +2915,7 @@ function setupThemeContext($forceload = false)
 		var smf_avatarMaxWidth = ' . (int) $modSettings['avatar_max_width_external'] . ';
 		var smf_avatarMaxHeight = ' . (int) $modSettings['avatar_max_height_external'] . ';';
 
-		if (!$context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])
+		if (!isBrowser('ie') && !isBrowser('mac_ie'))
 			$context['html_headers'] .= '
 	window.addEventListener("load", smf_avatarResize, false);';
 		else
@@ -2995,7 +2982,7 @@ function template_header()
 		header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
 
 		// Are we debugging the template/html content?
-		if (!isset($_REQUEST['xml']) && isset($_GET['debug']) && !$context['browser']['is_ie'] && !WIRELESS)
+		if (!isset($_REQUEST['xml']) && isset($_GET['debug']) && !isBrowser('ie') && !WIRELESS)
 			header('Content-Type: application/xhtml+xml');
 		elseif (!isset($_REQUEST['xml']) && !WIRELESS)
 			header('Content-Type: text/html; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
@@ -3653,7 +3640,7 @@ function setupMenuContext()
 			'register' => array(
 				'title' => $txt['register'],
 				'href' => $scripturl . '?action=register',
-				'show' => $user_info['is_guest'],
+				'show' => $user_info['is_guest'] && $context['can_register'],
 				'sub_buttons' => array(
 				),
 				'is_last' => !$context['right_to_left'],

+ 13 - 116
Themes/default/Admin.template.php

@@ -10,7 +10,9 @@
  * @version 2.1 Alpha 1
  */
 
-// This is the administration center home.
+/**
+ * This is the administration center home.
+ */
 function template_admin()
 {
 	global $context, $settings, $options, $scripturl, $txt, $modSettings;
@@ -185,13 +187,15 @@ function template_admin()
 						<span class="botslice"><span></span></span>
 					</div>
 				'), ',
-				sUpdateNotificationLink: ', JavaScriptEscape($scripturl . '?action=admin;area=packages;pgdownload;auto;package=%package%;' . $context['session_var'] . '=' . $context['session_id']), '
+				sUpdateNotificationLink: smf_scripturl + ', JavaScriptEscape('?action=admin;area=packages;pgdownload;auto;package=%package%;' . $context['session_var'] . '=' . $context['session_id']), '
 
 			});
 		// ]]></script>';
 }
 
-// Show some support information and credits to those who helped make this.
+/**
+ * Show some support information and credits to those who helped make this.
+ */
 function template_credits()
 {
 	global $context, $settings, $options, $scripturl, $txt;
@@ -360,7 +364,9 @@ function template_credits()
 		// ]]></script>';
 }
 
-// Displays information about file versions installed, and compares them to current version.
+/**
+ * Displays information about file versions installed, and compares them to current version.
+ */
 function template_view_versions()
 {
 	global $context, $settings, $options, $scripturl, $txt;
@@ -620,11 +626,6 @@ function template_edit_censored()
 					<div id="moreCensoredWords"></div><div style="margin-top: 1ex; display: none;" id="moreCensoredWords_link"><a href="#;" onclick="addNewWord(); return false;">', $txt['censor_clickadd'], '</a></div>
 					<script type="text/javascript"><!-- // --><![CDATA[
 						document.getElementById("moreCensoredWords_link").style.display = "";
-
-						function addNewWord()
-						{
-							setOuterHTML(document.getElementById("moreCensoredWords"), \'<div style="margin-top: 1ex;"><input type="text" name="censor_vulgar[]" size="20" class="input_text" /> => <input type="text" name="censor_proper[]" size="20" class="input_text" /><\' + \'/div><div id="moreCensoredWords"><\' + \'/div>\');
-						}
 					// ]]></script>
 					<hr width="100%" size="1" class="hrcolor clear" />
 					<dl class="settings">
@@ -692,7 +693,7 @@ function template_not_done()
 		echo '
 				<div style="padding-left: 20%; padding-right: 20%; margin-top: 1ex;">
 					<div style="font-size: 8pt; height: 12pt; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
-						<div style="padding-top: ', $context['browser']['is_webkit'] || $context['browser']['is_konqueror'] ? '2pt' : '1pt', '; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['continue_percent'], '%</div>
+						<div style="padding-top: ', isBrowser('is_webkit') || isBrowser('is_konqueror') ? '2pt' : '1pt', '; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['continue_percent'], '%</div>
 						<div style="width: ', $context['continue_percent'], '%; height: 12pt; z-index: 1; background-color: red;">&nbsp;</div>
 					</div>
 				</div>';
@@ -702,7 +703,7 @@ function template_not_done()
 				<div style="padding-left: 20%; padding-right: 20%; margin-top: 1ex;">
 					<span class="smalltext">', $context['substep_title'], '</span>
 					<div style="font-size: 8pt; height: 12pt; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
-						<div style="padding-top: ', $context['browser']['is_webkit'] || $context['browser']['is_konqueror'] ? '2pt' : '1pt', '; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['substep_continue_percent'], '%</div>
+						<div style="padding-top: ', isBrowser('is_webkit') || isBrowser('is_konqueror') ? '2pt' : '1pt', '; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['substep_continue_percent'], '%</div>
 						<div style="width: ', $context['substep_continue_percent'], '%; height: 12pt; z-index: 1; background-color: blue;">&nbsp;</div>
 					</div>
 				</div>';
@@ -741,30 +742,9 @@ function template_show_settings()
 {
 	global $context, $txt, $settings, $scripturl;
 
-	echo '
-	<script type="text/javascript"><!-- // --><![CDATA[';
-
 	if (!empty($context['settings_pre_javascript']))
-		echo $context['settings_pre_javascript'];
-
-	// If we have BBC selection we have a bit of JS.
-	if (!empty($context['bbc_sections']))
-	{
 		echo '
-		function toggleBBCDisabled(section, disable)
-		{
-			for (var i = 0; i < document.forms.bbcForm.length; i++)
-			{
-				if (typeof(document.forms.bbcForm[i].name) == "undefined" || (document.forms.bbcForm[i].name.substr(0, 11) != "enabledTags") || (document.forms.bbcForm[i].name.indexOf(section) != 11))
-					continue;
-
-				document.forms.bbcForm[i].disabled = disable;
-			}
-			document.getElementById("bbc_" + section + "_select_all").disabled = disable;
-		}';
-	}
-	echo '
-	// ]]></script>';
+	<script type="text/javascript"><!-- // --><![CDATA[', $context['settings_pre_javascript'], '// ]]></script>';
 
 	if (!empty($context['settings_insert_above']))
 		echo $context['settings_insert_above'];
@@ -1032,40 +1012,7 @@ function template_edit_profile_field()
 	// All the javascript for this page - quite a bit!
 	echo '
 	<script type="text/javascript"><!-- // --><![CDATA[
-		function updateInputBoxes()
-		{
-			curType = document.getElementById("field_type").value;
-			privStatus = document.getElementById("private").value;
-			document.getElementById("max_length_dt").style.display = curType == "text" || curType == "textarea" ? "" : "none";
-			document.getElementById("max_length_dd").style.display = curType == "text" || curType == "textarea" ? "" : "none";
-			document.getElementById("dimension_dt").style.display = curType == "textarea" ? "" : "none";
-			document.getElementById("dimension_dd").style.display = curType == "textarea" ? "" : "none";
-			document.getElementById("bbc_dt").style.display = curType == "text" || curType == "textarea" ? "" : "none";
-			document.getElementById("bbc_dd").style.display = curType == "text" || curType == "textarea" ? "" : "none";
-			document.getElementById("options_dt").style.display = curType == "select" || curType == "radio" ? "" : "none";
-			document.getElementById("options_dd").style.display = curType == "select" || curType == "radio" ? "" : "none";
-			document.getElementById("default_dt").style.display = curType == "check" ? "" : "none";
-			document.getElementById("default_dd").style.display = curType == "check" ? "" : "none";
-			document.getElementById("mask_dt").style.display = curType == "text" ? "" : "none";
-			document.getElementById("mask").style.display = curType == "text" ? "" : "none";
-			document.getElementById("can_search_dt").style.display = curType == "text" || curType == "textarea" ? "" : "none";
-			document.getElementById("can_search_dd").style.display = curType == "text" || curType == "textarea" ? "" : "none";
-			document.getElementById("regex_div").style.display = curType == "text" && document.getElementById("mask").value == "regex" ? "" : "none";
-			document.getElementById("display").disabled = false;
-			// Cannot show this on the topic
-			if (curType == "textarea" || privStatus >= 2)
-			{
-				document.getElementById("display").checked = false;
-				document.getElementById("display").disabled = true;
-			}
-		}
-
 		var startOptID = ', count($context['field']['options']), ';
-		function addOption()
-		{
-			setOuterHTML(document.getElementById("addopt"), \'<br /><input type="radio" name="default_select" value="\' + startOptID + \'" id="\' + startOptID + \'" class="input_radio" /><input type="text" name="select_option[\' + startOptID + \']" value="" class="input_text" /><span id="addopt"></span>\');
-			startOptID++;
-		}
 	// ]]></script>';
 
 	echo '
@@ -1488,57 +1435,7 @@ function template_callback_question_answer_list()
 
 	// The javascript needs to go at the end but we'll put it in this template for looks.
 	$context['settings_post_javascript'] .= '
-		// Create a named element dynamically - thanks to: http://www.thunderguy.com/semicolon/2005/05/23/setting-the-name-attribute-in-internet-explorer/
-		function createNamedElement(type, name, customFields)
-		{
-			var element = null;
-
-			if (!customFields)
-				customFields = "";
-
-			// Try the IE way; this fails on standards-compliant browsers
-			try
-			{
-				element = document.createElement("<" + type + \' name="\' + name + \'" \' + customFields + ">");
-			}
-			catch (e)
-			{
-			}
-			if (!element || element.nodeName != type.toUpperCase())
-			{
-				// Non-IE browser; use canonical method to create named element
-				element = document.createElement(type);
-				element.name = name;
-			}
-
-			return element;
-		}
-
 		var placeHolder = document.getElementById(\'add_more_question_placeholder\');
-
-		function addAnotherQuestion()
-		{
-			var newDT = document.createElement("dt");
-
-			var newInput = createNamedElement("input", "question[]");
-			newInput.type = "text";
-			newInput.className = "input_text";
-			newInput.size = "50";
-			newInput.setAttribute("class", "verification_question");
-			newDT.appendChild(newInput);
-
-			newDD = document.createElement("dd");
-
-			newInput = createNamedElement("input", "answer[]");
-			newInput.type = "text";
-			newInput.className = "input_text";
-			newInput.size = "50";
-			newInput.setAttribute("class", "verification_answer");
-			newDD.appendChild(newInput);
-
-			placeHolder.parentNode.insertBefore(newDT, placeHolder);
-			placeHolder.parentNode.insertBefore(newDD, placeHolder);
-		}
 		document.getElementById(\'add_more_link_div\').style.display = \'\';
 	';
 }

+ 1 - 6
Themes/default/Calendar.template.php

@@ -22,7 +22,7 @@ function template_main()
 				', template_show_month_grid('current'), '
 				', template_show_month_grid('next'), '
 			</div>
-			<div id="main_grid" style="', $context['browser']['is_ie'] && !$context['browser']['is_ie8'] ? 'float: ' . ($context['right_to_left'] ? 'right; padding-right' : 'left; padding-left') . ': 20px;' : 'margin-' . ($context['right_to_left'] ? 'right' : 'left') . ': 220px; ', '">
+			<div id="main_grid" style="', isBrowser('is_ie') && !isBrowser('is_ie8') ? 'float: ' . ($context['right_to_left'] ? 'right; padding-right' : 'left; padding-left') . ': 20px;' : 'margin-' . ($context['right_to_left'] ? 'right' : 'left') . ': 220px; ', '">
 				', $context['view_week'] ? template_show_week_grid('main') : template_show_month_grid('main');
 
 	// Build the calendar button array.
@@ -91,11 +91,6 @@ function template_event_post()
 				if (selected < days)
 					dayElement.selectedIndex = selected;
 			}
-
-			function toggleLinked(form)
-			{
-				form.board.disabled = !form.link_to_board.checked;
-			}
 		// ]]></script>
 
 		<form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);smc_saveEntities(\'postevent\', [\'evtitle\']);" style="margin: 0;">';

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

@@ -492,14 +492,14 @@ function template_main()
 		// Can the user modify the contents of this post?  Show the modify inline image.
 		if ($message['can_modify'])
 			echo '
-							<img src="', $settings['images_url'], '/icons/modify_inline.gif" alt="', $txt['modify_msg'], '" title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" style="cursor: ', ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] ? 'hand' : 'pointer'), '; display: none;" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" />';
+							<img src="', $settings['images_url'], '/icons/modify_inline.gif" alt="', $txt['modify_msg'], '" title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" style="cursor: ', (isBrowser('is_ie5') || isBrowser('is_ie5.5') ? 'hand' : 'pointer'), '; display: none;" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" />';
 
 		// Assuming there are attachments...
 		if (!empty($message['attachment']))
 		{
 			echo '
 							<div id="msg_', $message['id'], '_footer" class="attachments smalltext">
-								<div style="overflow: ', $context['browser']['is_firefox'] ? 'visible' : 'auto', ';">';
+								<div style="overflow: ', isBrowser('is_firefox') ? 'visible' : 'auto', ';">';
 
 			$last_approved_state = 1;
 			foreach ($message['attachment'] as $attachment)
@@ -574,7 +574,7 @@ function template_main()
 								<img src="', $settings['images_url'], '/ip.gif" alt="" />';
 
 		// Show the IP to this user for this post - because you can moderate?
-		if ($context['can_moderate_forum'] && !empty($message['member']['ip']))
+		if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
 			echo '
 								<a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>';
 		// Or, should we show it because this is you?
@@ -754,7 +754,7 @@ function template_main()
 						iTopicId: ', $context['current_topic'], ',
 						iStart: ', $context['start'], ',
 						sScriptUrl: smf_scripturl,
-						sImagesUrl: "', $settings['images_url'], '",
+						sImagesUrl: smf_images_url,
 						sContainerId: "quickReplyOptions",
 						sImageId: "quickReplyExpand",
 						sImageCollapsed: "collapse.gif",
@@ -768,8 +768,8 @@ function template_main()
 						sSelf: \'oInTopicModeration\',
 						sCheckboxContainerMask: \'in_topic_mod_check_\',
 						aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'],
-						sSessionId: \'', $context['session_id'], '\',
-						sSessionVar: \'', $context['session_var'], '\',
+						sSessionId: smf_session_id,
+						sSessionVar: smf_session_var,
 						sButtonStrip: \'moderationbuttons\',
 						sButtonStripDisplay: \'moderationbuttons_strip\',
 						bUseImageButton: false,
@@ -794,8 +794,8 @@ function template_main()
 							sTemplateBodyEdit: ', JavaScriptEscape('
 								<div id="quick_edit_body_container" style="width: 90%">
 									<div id="error_box" style="padding: 4px;" class="error"></div>
-									<textarea class="editor" name="message" rows="12" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br />
-									<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
+									<textarea class="editor" name="message" rows="12" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br />
+									<input type="hidden" name="\' + smf_session_var + \'" value="\' + smf_session_id + \'" />
 									<input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
 									<input type="hidden" name="msg" value="%msg_id%" />
 									<div class="righttext">
@@ -829,8 +829,8 @@ function template_main()
 							bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
 							iBoardId: ', $context['current_board'], ',
 							iTopicId: ', $context['current_topic'], ',
-							sSessionId: "', $context['session_id'], '",
-							sSessionVar: "', $context['session_var'], '",
+							sSessionId: smf_session_id,
+							sSessionVar: smf_session_var,
 							sLabelIconList: "', $txt['message_icon'], '",
 							sBoxBackground: "transparent",
 							sBoxBackgroundHover: "#ffffff",

+ 8 - 4
Themes/default/Login.template.php

@@ -101,9 +101,13 @@ function template_kick_guest()
 	// Show the message or default message.
 	echo '
 			<p class="information centertext">
-				', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br />
-				', $txt['login_below'], ' <a href="', $scripturl, '?action=register">', $txt['register_an_account'], '</a> ', sprintf($txt['login_with_forum'], $context['forum_name_html_safe']), '
-			</p>';
+				', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br />';
+
+
+	if ($context['can_register'])
+		echo sprintf($txt['login_below_or_register'], $scripturl . '?action=register', $context['forum_name_html_safe']);
+	else
+		echo $txt['login_below'];
 
 	// And now the login information.
 	echo '
@@ -238,7 +242,7 @@ function template_admin_login()
 	// Focus on the password box.
 	echo '
 <script type="text/javascript"><!-- // --><![CDATA[
-	document.forms.frmLogin.admin_pass.focus();
+	document.forms.frmLogin.', $context['sessionCheckType'], '_pass.focus();
 // ]]></script>';
 }
 

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

@@ -329,7 +329,7 @@ function template_modify_board()
 							<span class="smalltext">', $txt['mboards_description_desc'], '</span>
 						</dt>
 						<dd>
-							<textarea name="desc" rows="3" cols="35" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 99%; min-width: 99%' : 'width: 99%') . ';">', $context['board']['description'], '</textarea>
+							<textarea name="desc" rows="3" cols="35" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 99%; min-width: 99%' : 'width: 99%') . ';">', $context['board']['description'], '</textarea>
 						</dd>
 						<dt>
 							<strong>', $txt['permission_profile'], ':</strong><br />
@@ -517,8 +517,8 @@ function template_modify_board()
 <script type="text/javascript"><!-- // --><![CDATA[
 	var oModeratorSuggest = new smc_AutoSuggest({
 		sSelf: \'oModeratorSuggest\',
-		sSessionId: \'', $context['session_id'], '\',
-		sSessionVar: \'', $context['session_var'], '\',
+		sSessionId: smf_session_id,
+		sSessionVar: smf_session_var,
 		sSuggestId: \'moderators\',
 		sControlId: \'moderators\',
 		sSearchType: \'member\',

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

@@ -307,6 +307,7 @@ function template_modify_language_entries()
 					</fieldset>
 					<div class="righttext">
 						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+						<input type="hidden" name="', $context['admin-mlang_token_var'], '" value="', $context['admin-mlang_token'], '" />
 						<input type="submit" name="save_main" value="', $txt['save'], '"', $context['lang_file_not_writable_message'] || !empty($context['file_entries']) ? ' disabled="disabled"' : '', ' class="button_submit" />';
 
 	// Allow deleting entries.
@@ -388,11 +389,11 @@ function template_modify_language_entries()
 						</dd>
 						<dt>
 							<input type="hidden" name="comp[', $cached['key'], ']" value="', $cached['value'], '" />
-							<textarea name="entry[', $cached['key'], ']" cols="40" rows="', $cached['rows'] < 2 ? 2 : $cached['rows'], '" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $cached['value'], '</textarea>
+							<textarea name="entry[', $cached['key'], ']" cols="40" rows="', $cached['rows'] < 2 ? 2 : $cached['rows'], '" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $cached['value'], '</textarea>
 						</dt>
 						<dd>
 							<input type="hidden" name="comp[', $entry['key'], ']" value="', $entry['value'], '" />
-							<textarea name="entry[', $entry['key'], ']" cols="40" rows="', $entry['rows'] < 2 ? 2 : $entry['rows'], '" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $entry['value'], '</textarea>
+							<textarea name="entry[', $entry['key'], ']" cols="40" rows="', $entry['rows'] < 2 ? 2 : $entry['rows'], '" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $entry['value'], '</textarea>
 						</dd>';
 			$cached = array();
 		}
@@ -410,7 +411,7 @@ function template_modify_language_entries()
 						</dd>
 						<dt>
 							<input type="hidden" name="comp[', $cached['key'], ']" value="', $cached['value'], '" />
-							<textarea name="entry[', $cached['key'], ']" cols="40" rows="2" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $cached['value'], '</textarea>
+							<textarea name="entry[', $cached['key'], ']" cols="40" rows="2" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $cached['value'], '</textarea>
 						</dt>
 						<dd>
 						</dd>';
@@ -467,7 +468,7 @@ function template_add_language()
 
 					</fieldset>
 					<div class="righttext">
-						', $context['browser']['is_ie'] ? '<input type="text" name="ie_fix" style="display: none;" class="input_text" /> ' : '', '
+						', isBrowser('is_ie') ? '<input type="text" name="ie_fix" style="display: none;" class="input_text" /> ' : '', '
 						<input type="submit" name="smf_add_sub" value="', $txt['search'], '" class="button_submit" />
 					</div>
 				</div>
@@ -517,5 +518,4 @@ function template_add_language()
 	<br class="clear" />';
 }
 
-
 ?>

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

@@ -594,7 +594,7 @@ function template_group_request_reason()
 						</dt>
 						<dd>
 							<input type="hidden" name="groupr[]" value="', $request['id'], '" />
-							<textarea name="groupreason[', $request['id'], ']" rows="3" cols="40" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';"></textarea>
+							<textarea name="groupreason[', $request['id'], ']" rows="3" cols="40" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';"></textarea>
 						</dd>';
 
 	echo '

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

@@ -34,7 +34,7 @@ function template_edit_news()
 					<tr class="windowbg2">
 						<td align="center">
 
-							<div style="margin-bottom: 2ex;"><textarea rows="3" cols="65" name="news[]" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 85%; min-width: 85%' : 'width: 85%') . ';">', $admin_news['unparsed'], '</textarea></div>
+							<div style="margin-bottom: 2ex;"><textarea rows="3" cols="65" name="news[]" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 85%; min-width: 85%' : 'width: 85%') . ';">', $admin_news['unparsed'], '</textarea></div>
 						</td><td align="left" valign="top">
 							<div style="overflow: auto; width: 100%; height: 10ex;">', $admin_news['parsed'], '</div>
 						</td><td align="center">
@@ -62,11 +62,11 @@ function template_edit_news()
 					function addNewsItem()
 					{
 						document.getElementById("moreNews").style.display = "";
-						setOuterHTML(document.getElementById("moreNewsItems"), \'<div style="margin-bottom: 2ex;"><textarea rows="3" cols="65" name="news[]" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 85%; min-width: 85%' : 'width: 85%') . ';"><\' + \'/textarea><\' + \'/div><div id="moreNewsItems"><\' + \'/div>\');
+						setOuterHTML(document.getElementById("moreNewsItems"), \'<div style="margin-bottom: 2ex;"><textarea rows="3" cols="65" name="news[]" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 85%; min-width: 85%' : 'width: 85%') . ';"><\' + \'/textarea><\' + \'/div><div id="moreNewsItems"><\' + \'/div>\');
 					}
 				// ]]></script>
 				<noscript>
-					<div style="margin-bottom: 2ex;"><textarea rows="3" cols="65" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 85%; min-width: 85%' : 'width: 85%') . ';" name="news[]"></textarea></div>
+					<div style="margin-bottom: 2ex;"><textarea rows="3" cols="65" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 85%; min-width: 85%' : 'width: 85%') . ';" name="news[]"></textarea></div>
 				</noscript>
 			</div>
 			<div class="floatrightpadding">
@@ -149,7 +149,7 @@ function template_email_members()
 							<span class="smalltext">', $txt['admin_news_select_email_desc'], '</span>
 						</dt>
 						<dd>
-							<textarea name="emails" rows="5" cols="30" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 98%; min-width: 98%' : 'width: 98%') . ';"></textarea>
+							<textarea name="emails" rows="5" cols="30" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 98%; min-width: 98%' : 'width: 98%') . ';"></textarea>
 						</dd>
 						<dt>
 							<strong>', $txt['admin_news_select_members'], ':</strong><br />

+ 2 - 29
Themes/default/ManageSmileys.template.php

@@ -63,7 +63,7 @@ function template_editsets()
 		}';
 
 		// Oh well, could be worse - at least it's only IE4.
-		if ($context['browser']['is_ie4'])
+		if (isBrowser('is_ie4'))
 			echo '
 			addLoadEvent(smfSetLatestSmileys);';
 		else
@@ -263,25 +263,6 @@ function template_addsmiley()
 	global $context, $settings, $options, $scripturl, $txt, $modSettings;
 
 	echo '
-	<script type="text/javascript"><!-- // --><![CDATA[
-		function switchType()
-		{
-			document.getElementById("ul_settings").style.display = document.getElementById("method-existing").checked ? "none" : "";
-			document.getElementById("ex_settings").style.display = document.getElementById("method-upload").checked ? "none" : "";
-		}
-
-		function swapUploads()
-		{
-			document.getElementById("uploadMore").style.display = document.getElementById("uploadSmiley").disabled ? "none" : "";
-			document.getElementById("uploadSmiley").disabled = !document.getElementById("uploadSmiley").disabled;
-		}
-
-		function selectMethod(element)
-		{
-			document.getElementById("method-existing").checked = element != "upload";
-			document.getElementById("method-upload").checked = element == "upload";
-		}
-	// ]]></script>
 	<div id="admincenter">
 		<form action="', $scripturl, '?action=admin;area=smileys;sa=addsmiley" method="post" accept-charset="', $context['character_set'], '" name="smileyForm" id="smileyForm" enctype="multipart/form-data">
 			<div class="cat_bar">
@@ -414,15 +395,7 @@ function template_addsmiley()
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
 		</form>
 	</div>
-	<br class="clear" />
-	<script type="text/javascript"><!-- // --><![CDATA[
-
-		function updatePreview()
-		{
-			var currentImage = document.getElementById("preview");
-			currentImage.src = "', $modSettings['smileys_url'], '/" + document.forms.smileyForm.set.value + "/" + document.forms.smileyForm.smiley_filename.value;
-		}
-	// ]]></script>';
+	<br class="clear" />';
 }
 
 // Ordering smileys.

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

@@ -589,7 +589,7 @@ function template_viewmodreport()
 					'<p>', $comment['member']['link'], ': ', $comment['message'], ' <em class="smalltext">(', $comment['time'], ')</em></p>';
 
 	echo '
-					<textarea rows="2" cols="60" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 60%; min-width: 60%' : 'width: 60%') . ';" name="mod_comment"></textarea>
+					<textarea rows="2" cols="60" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 60%; min-width: 60%' : 'width: 60%') . ';" name="mod_comment"></textarea>
 					<div>
 						<input type="submit" name="add_comment" value="', $txt['mc_modreport_add_mod_comment'], '" class="button_submit" />
 					</div>

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

@@ -1952,7 +1952,7 @@ function template_action_permissions()
 					<div style="padding-left: 20%; padding-right: 20%; margin-top: 1ex;">
 						<strong>', $progress_message, '</strong>
 						<div style="font-size: 8pt; height: 12pt; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
-							<div style="padding-top: ', $context['browser']['is_webkit'] || $context['browser']['is_konqueror'] ? '2pt' : '1pt', '; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $progress_percent, '%</div>
+							<div style="padding-top: ', isBrowser('is_webkit') || isBrowser('is_konqueror') ? '2pt' : '1pt', '; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $progress_percent, '%</div>
 							<div style="width: ', $progress_percent, '%; height: 12pt; z-index: 1; background-color: #98b8f4;">&nbsp;</div>
 						</div>
 					</div>';
@@ -1968,7 +1968,7 @@ function template_action_permissions()
 					<div style="padding-left: 20%; padding-right: 20%; margin-top: 1ex;">
 						<strong>', $file_progress_message, '</strong>
 						<div style="font-size: 8pt; height: 12pt; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
-							<div style="padding-top: ', $context['browser']['is_webkit'] || $context['browser']['is_konqueror'] ? '2pt' : '1pt', '; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $file_progress_percent, '%</div>
+							<div style="padding-top: ', isBrowser('is_webkit') || isBrowser('is_konqueror') ? '2pt' : '1pt', '; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $file_progress_percent, '%</div>
 							<div style="width: ', $file_progress_percent, '%; height: 12pt; z-index: 1; background-color: #c1ffc1;">&nbsp;</div>
 						</div>
 					</div>';

+ 4 - 50
Themes/default/PersonalMessage.template.php

@@ -64,10 +64,9 @@ function template_folder()
 			var add, remove, toAdd = {length: 0}, toRemove = {length: 0};
 
 			if (theSelect.childNodes.length == 0)
-				return;';
+				return;
 
-	// This is done this way for internationalization reasons.
-	echo '
+			// This is done this way for internationalization reasons.
 			if (!(\'-1\' in allLabels))
 			{
 				for (var o = 0; o < theSelect.options.length; o++)
@@ -644,15 +643,6 @@ function template_search()
 	global $context, $settings, $options, $scripturl, $modSettings, $txt;
 
 	echo '
-	<script type="text/javascript"><!-- // --><![CDATA[
-		function expandCollapseLabels()
-		{
-			var current = document.getElementById("searchLabelsExpand").style.display != "none";
-
-			document.getElementById("searchLabelsExpand").style.display = current ? "none" : "";
-			document.getElementById("expandLabelsIcon").src = smf_images_url + (current ? "/expand.gif" : "/collapse.gif");
-		}
-	// ]]></script>
 	<form action="', $scripturl, '?action=pm;sa=search2" method="post" accept-charset="', $context['character_set'], '" name="searchform" id="searchform">
 		<div class="cat_bar">
 			<h3 class="catbg">', $txt['pm_search_title'], '</h3>
@@ -696,11 +686,6 @@ function template_search()
 					<strong>', $txt['pm_search_text'], ':</strong>
 					<input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' size="40" class="input_text" />
 					<script type="text/javascript"><!-- // --><![CDATA[
-						function initSearch()
-						{
-							if (document.forms.searchform.search.value.indexOf("%u") != -1)
-								document.forms.searchform.search.value = unescape(document.forms.searchform.search.value);
-						}
 						createEventListener(window);
 						window.addEventListener("load", initSearch, false);
 					// ]]></script>
@@ -1041,7 +1026,7 @@ function template_send()
 	echo '
 				<p><label for="outbox"><input type="checkbox" name="outbox" id="outbox" value="1" tabindex="', $context['tabindex']++, '"', $context['copy_to_outbox'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['pm_save_outbox'], '</label></p>
 				<p id="shortcuts" class="smalltext">
-					', $context['browser']['is_firefox'] ? $txt['shortcuts_firefox'] : $txt['shortcuts'], '
+					', isBrowser('is_firefox') ? $txt['shortcuts_firefox'] : $txt['shortcuts'], '
 				</p>
 				<p id="post_confirm_strip" class="righttext">
 					', template_control_richedit_buttons($context['post_box_name']), '
@@ -1303,7 +1288,7 @@ function template_report_message()
 						<strong>', $txt['pm_report_reason'], ':</strong>
 					</dt>
 					<dd>
-						<textarea name="reason" rows="4" cols="70" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 80%; min-width: 80%' : 'width: 80%') . ';"></textarea>
+						<textarea name="reason" rows="4" cols="70" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 80%; min-width: 80%' : 'width: 80%') . ';"></textarea>
 					</dd>
 				</dl>
 				<div class="righttext">
@@ -1469,37 +1454,6 @@ function template_add_rule()
 	echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\');
 			}
 
-			function updateRuleDef(optNum)
-			{
-				if (document.getElementById("ruletype" + optNum).value == "gid")
-				{
-					document.getElementById("defdiv" + optNum).style.display = "none";
-					document.getElementById("defseldiv" + optNum).style.display = "";
-				}
-				else if (document.getElementById("ruletype" + optNum).value == "bud" || document.getElementById("ruletype" + optNum).value == "")
-				{
-					document.getElementById("defdiv" + optNum).style.display = "none";
-					document.getElementById("defseldiv" + optNum).style.display = "none";
-				}
-				else
-				{
-					document.getElementById("defdiv" + optNum).style.display = "";
-					document.getElementById("defseldiv" + optNum).style.display = "none";
-				}
-			}
-
-			function updateActionDef(optNum)
-			{
-				if (document.getElementById("acttype" + optNum).value == "lab")
-				{
-					document.getElementById("labdiv" + optNum).style.display = "";
-				}
-				else
-				{
-					document.getElementById("labdiv" + optNum).style.display = "none";
-				}
-			}
-
 			// Rebuild the rule description!
 			function rebuildRuleDesc()
 			{

+ 4 - 47
Themes/default/Post.template.php

@@ -20,12 +20,8 @@ function template_main()
 		<script type="text/javascript"><!-- // --><![CDATA[';
 
 	// When using Go Back due to fatal_error, allow the form to be re-submitted with changes.
-	if ($context['browser']['is_firefox'])
+	if (isBrowser('is_firefox'))
 		echo '
-			function reActivate()
-			{
-				document.forms.postmodify.message.readOnly = false;
-			}
 			window.addEventListener("pageshow", reActivate, false);';
 
 	// Start with message icons - and any missing from this theme.
@@ -37,30 +33,9 @@ function template_main()
 	echo '
 			};';
 
-	// The actual message icon selector.
-	echo '
-			function showimage()
-			{
-				document.images.icons.src = icon_urls[document.forms.postmodify.icon.options[document.forms.postmodify.icon.selectedIndex].value];
-			}';
-
 	// If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations.
 	if ($context['make_poll'])
 		echo '
-			function pollOptions()
-			{
-				var expire_time = document.getElementById(\'poll_expire\');
-
-				if (isEmptyText(expire_time) || expire_time.value == 0)
-				{
-					document.forms.postmodify.poll_hide[2].disabled = true;
-					if (document.forms.postmodify.poll_hide[2].checked)
-						document.forms.postmodify.poll_hide[1].checked = true;
-				}
-				else
-					document.forms.postmodify.poll_hide[2].disabled = false;
-			}
-
 			var pollOptionNum = 0, pollTabIndex;
 			function addPollOption()
 			{
@@ -81,25 +56,7 @@ function template_main()
 	// If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here.
 	if ($context['make_event'])
 		echo '
-			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
-
-			function generateDays()
-			{
-				var dayElement = document.getElementById(\'day\'), yearElement = document.getElementById(\'year\'), monthElement = document.getElementById(\'month\');
-				var days, selected = dayElement.selectedIndex;
-
-				monthLength[1] = yearElement.options[yearElement.selectedIndex].value % 4 == 0 ? 29 : 28;
-				days = monthLength[monthElement.value - 1];
-
-				while (dayElement.options.length)
-					dayElement.options[0] = null;
-
-				for (i = 1; i <= days; i++)
-					dayElement.options[dayElement.length] = new Option(i, i);
-
-				if (selected < days)
-					dayElement.selectedIndex = selected;
-			}';
+			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];';
 
 	// End of the javascript, start the form and display the link tree.
 	echo '
@@ -523,7 +480,7 @@ function template_main()
 	// Finally, the submit buttons.
 	echo '
 					<p class="smalltext" id="shortcuts">
-						', $context['browser']['is_firefox'] ? $txt['shortcuts_firefox'] : $txt['shortcuts'], '
+						', isBrowser('is_firefox') ? $txt['shortcuts_firefox'] : $txt['shortcuts'], '
 					</p>
 					<p id="post_confirm_buttons" class="righttext">
 						', template_control_richedit_buttons($context['post_box_name']);
@@ -564,7 +521,7 @@ function template_main()
 			var reply_counter = ', empty($counter) ? 0 : $counter, ';
 			function previewPost()
 			{';
-	if ($context['browser']['is_firefox'])
+	if (isBrowser('is_firefox'))
 		echo '
 				// Firefox doesn\'t render <marquee> that have been put it using javascript
 				if (document.forms.postmodify.elements[', JavaScriptEscape($context['post_box_name']), '].value.indexOf(\'[move]\') != -1)

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

@@ -19,7 +19,7 @@ function template_profile_above()
 	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/profile.js"></script>';
 
 	// Prevent Chrome from auto completing fields when viewing/editing other members profiles
-	if ($context['browser']['is_chrome'] && !$context['user']['is_owner'])
+	if (isBrowser('is_chrome') && !$context['user']['is_owner'])
 		echo '
 	<script type="text/javascript"><!-- // --><![CDATA[
 		disableAutoComplete();
@@ -1505,7 +1505,7 @@ function template_profile_theme_settings()
 								<label for="show_no_signatures"><input type="checkbox" name="default_options[show_no_signatures]" id="show_no_signatures" value="1"', !empty($context['member']['options']['show_no_signatures']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['show_no_signatures'], '</label>
 							</li>';
 
-	if ($settings['allow_no_censored'])
+	if ($context['allow_no_censored'])
 		echo '
 							<li>
 								<input type="hidden" name="default_options[show_no_censored]" value="0" />
@@ -1711,7 +1711,7 @@ function template_groupMembership()
 				<span class="upperframe"><span></span></span>
 				<div class="roundframe"><div class="innerframe">
 					', $txt['request_group_membership_desc'], ':
-					<textarea name="reason" rows="4" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 99%; min-width: 99%' : 'width: 99%') . ';"></textarea>
+					<textarea name="reason" rows="4" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 99%; min-width: 99%' : 'width: 99%') . ';"></textarea>
 					<div class="righttext" style="margin: 0.5em 0.5% 0 0.5%;">
 						<input type="hidden" name="gid" value="', $context['group_request']['id'], '" />
 						<input type="submit" name="req" value="', $txt['submit_request'], '" class="button_submit" />

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

@@ -465,7 +465,7 @@ function template_verification_sound()
 	</head>
 	<body style="margin: 1ex;">
 		<div class="popuptext" style="text-align: center;">';
-	if ($context['browser']['is_ie'])
+	if (isBrowser('is_ie'))
 		echo '
 			<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
 				<param name="AutoStart" value="1" />

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

@@ -177,7 +177,7 @@ function template_custom_email()
 							<label for="email_body"><strong>', $txt['message'], ':</strong></label>
 						</dt>
 						<dd>
-							<textarea id="email_body" name="email_body" rows="10" cols="20" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 90%; min-width: 90%' : 'width: 90%') . ';"></textarea>
+							<textarea id="email_body" name="email_body" rows="10" cols="20" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 90%; min-width: 90%' : 'width: 90%') . ';"></textarea>
 						</dd>
 					</dl>
 					<div class="righttext">

+ 0 - 9
Themes/default/Settings.template.php

@@ -40,11 +40,6 @@ function template_options()
 			'label' => $txt['show_no_signatures'],
 			'default' => true,
 		),
-		array(
-			'id' => 'show_no_censored',
-			'label' => $txt['show_no_censored'],
-			'default' => true,
-		),
 		array(
 			'id' => 'return_to_post',
 			'label' => $txt['return_to_post'],
@@ -191,10 +186,6 @@ function template_settings()
 			'id' => 'show_mark_read',
 			'label' => $txt['enable_mark_as_read'],
 		),
-		array(
-			'id' => 'allow_no_censored',
-			'label' => $txt['allow_no_censored'],
-		),
 		array(
 			'id' => 'enable_news',
 			'label' => $txt['enable_random_news'],

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

@@ -191,26 +191,6 @@ function template_main()
 	echo '
 		<script type="text/javascript"><!-- // --><![CDATA[
 			var tempOldOnload;
-
-			function smfSetLatestThemes()
-			{
-				if (typeof(window.smfLatestThemes) != "undefined")
-					setInnerHTML(document.getElementById("themeLatest"), window.smfLatestThemes);
-
-				if (tempOldOnload)
-					tempOldOnload();
-			}
-		// ]]></script>';
-
-	// Gotta love IE4, and its hatefulness...
-	if ($context['browser']['is_ie4'])
-		echo '
-		<script type="text/javascript"><!-- // --><![CDATA[
-			addLoadEvent(smfSetLatestThemes);
-		// ]]></script>';
-	else
-		echo '
-		<script type="text/javascript"><!-- // --><![CDATA[
 			smfSetLatestThemes();
 		// ]]></script>';
 }
@@ -652,11 +632,6 @@ function template_set_settings()
 
 		echo '
 		}
-
-		function changeVariant(sVariant)
-		{
-			document.getElementById(\'variant_preview\').src = oThumbnails[sVariant];
-		}
 		// ]]></script>';
 	}
 }
@@ -993,7 +968,7 @@ function template_edit_style()
 					try
 					{
 					';
-	if ($context['browser']['is_ie'])
+	if (isBrowser('is_ie'))
 		echo '
 						var sheets = frames["css_preview_box"].document.styleSheets;
 						for (var j = 0; j < sheets.length; j++)
@@ -1044,18 +1019,6 @@ function template_edit_style()
 					};
 				}
 			}
-
-			// The idea here is simple: don\'t refresh the preview on every keypress, but do refresh after they type.
-			function setPreviewTimeout()
-			{
-				if (previewTimeout)
-				{
-					window.clearTimeout(previewTimeout);
-					previewTimeout = null;
-				}
-
-				previewTimeout = window.setTimeout("refreshPreview(true); previewTimeout = null;", 500);
-			}
 		// ]]></script>
 		<iframe id="css_preview_box" name="css_preview_box" src="about:blank" width="99%" height="300" frameborder="0" style="display: none; margin-bottom: 2ex; border: 1px solid black;"></iframe>';
 
@@ -1074,7 +1037,7 @@ function template_edit_style()
 					', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br />';
 
 	echo '
-					<textarea name="entire_file" cols="80" rows="20" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . '; font-family: monospace; margin-top: 1ex; white-space: pre;" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea><br />
+					<textarea name="entire_file" cols="80" rows="20" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . '; font-family: monospace; margin-top: 1ex; white-space: pre;" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea><br />
 					<div class="padding righttext">
 						<input type="submit" name="submit" value="', $txt['theme_edit_save'], '"', $context['allow_save'] ? '' : ' disabled="disabled"', ' style="margin-top: 1ex;" class="button_submit" />
 						<input type="button" value="', $txt['themeadmin_edit_preview'], '" onclick="refreshPreview(false);" class="button_submit" />

+ 20 - 5
Themes/default/css/index.css

@@ -1154,8 +1154,8 @@ span.lowerframe span
 .dropmenu li ul
 {
 	z-index: 90;
-	display: none;
 	position: absolute;
+	left: -9999px;
 	width: 19.2em;
 	font-weight: normal;
 	border-bottom: 1px solid #999;
@@ -1209,21 +1209,36 @@ span.lowerframe span
 	color: #000;
 	text-decoration: none;
 }
-.dropmenu li:hover ul ul, .dropmenu li:hover ul ul ul
+.dropmenu li:hover ul ul, .dropmenu li.sfhover ul ul, .dropmenu li:hover ul ul ul, .dropmenu li.sfhover ul ul ul
 {
 	top: -999em;
 }
-.dropmenu li li:hover ul
+.dropmenu li li:hover ul, .dropmenu li li.sfhover ul
 {
 	top: auto;
 }
-.dropmenu li:hover ul
+.dropmenu li:hover ul, .dropmenu li.sfhover ul, .dropmenu ul ul
 {
 	display: block;
+	top: 21px;
+	left: -5px;
+}
+/* These two declarations are necessary for keyboard access with js disabled. */ 
+.dropmenu ul a:focus {
+	margin-left: 9999px;
+}
+.dropmenu ul a:focus span {
+	width: 19em;
+	white-space: pre;
+	background: #d4dbe4;
+}
+/* This declaration is necessary to reset the margin when js is active. */
+.dropmenu ul li.sfhover a:focus {
+	margin-left: 0;
 }
 .dropmenu li li.additional_items
 {
-	background-color: #fff;
+	background: #fff;
 }
 
 /* The dropdown menu toggle image */

+ 14 - 2
Themes/default/index.template.php

@@ -90,7 +90,7 @@ function template_html_above()
 
 	// Some browsers need an extra stylesheet due to bugs/compatibility issues.
 	foreach (array('ie7', 'ie6', 'webkit') as $cssfix)
-		if ($context['browser']['is_' . $cssfix])
+		if (isBrowser('is_' . $cssfix))
 			echo '
 	<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/', $cssfix, '.css" />';
 
@@ -100,7 +100,19 @@ function template_html_above()
 	<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/rtl.css" />';
 
 	// Here comes the JavaScript bits!
+	// Note that the Superfish function seems to like being called by the full syntax.
+	// It doesn't appear to like being called by short syntax. Please test if contemplating changes.
 	echo '
+	<script type="text/javascript" src="', $settings['theme_url'], '/scripts/jquery-1.6.4.min.js"></script>
+	<script type="text/javascript" src="', $settings['theme_url'], '/scripts/hoverIntent.js"></script>
+	<script type="text/javascript" src="', $settings['theme_url'], '/scripts/superfish.js"></script>
+	<script type="text/javascript">
+
+			$(document).ready(function() { 
+				$("ul.dropmenu").superfish(); 
+			});
+
+	</script>
 	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js?fin20"></script>
 	<script type="text/javascript" src="', $settings['theme_url'], '/scripts/theme.js?fin20"></script>
 	<script type="text/javascript"><!-- // --><![CDATA[
@@ -231,7 +243,7 @@ function template_body_above()
 		echo '
 				<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
 				<form id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
-					<div class="info">', sprintf($txt['welcome_guest'], $txt['guest_title']), '</div>
+					<div class="info">', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $scripturl . '?action=login'), '</div>
 					<input type="text" name="user" size="10" class="input_text" />
 					<input type="password" name="passwrd" size="10" class="input_password" />
 					<select name="cookielength">

+ 3 - 3
Themes/default/languages/Login.english.php

@@ -28,9 +28,9 @@ $txt['identification_by_smf'] = 'Used to identify you on the forum.';
 $txt['additional_information'] = 'Additional Information';
 $txt['warning'] = 'Warning!';
 $txt['only_members_can_access'] = 'Only registered members are allowed to access this section.';
-$txt['login_below'] = 'Please login below or';
-$txt['register_an_account'] = 'register an account';
-$txt['login_with_forum'] = 'with %1$s.';
+$txt['login_below'] = 'Please login below.';
+$txt['login_below_or_register'] = 'Please login below or <a href="%1$s">register an account</a> with %2$s';
+
 // Use numeric entities in the below two strings.
 $txt['may_change_in_profile'] = 'You may change it after you login by going to the profile page, or by visiting this page after you login:';
 $txt['your_username_is'] = 'Your username is: ';

+ 2 - 0
Themes/default/languages/ManagePermissions.english.php

@@ -86,6 +86,8 @@ $txt['permissionname_search_posts'] = 'Search for posts and topics';
 $txt['permissionhelp_search_posts'] = 'The Search permission allows the user to search all boards he or she is allowed to access. When the search permission is enabled, a \'Search\' button will be added to the forum button bar.';
 $txt['permissionname_karma_edit'] = 'Change other people\'s karma';
 $txt['permissionhelp_karma_edit'] = 'Karma is a feature that shows the popularity of a member. In order to use this feature, you need to have it enabled in \'Features and Options\'. This permission will allow a membergroup to cast a vote. This permission has no effect on guests.';
+$txt['permissionname_disable_censor'] = 'Disable word censor';
+$txt['permissionhelp_disable_censor'] = 'Allows members the option to disable the word censor.';
 
 $txt['permissiongroup_pm'] = 'Personal Messaging';
 $txt['permissionname_pm_read'] = 'Read personal messages';

+ 5 - 1
Themes/default/languages/index.english.php

@@ -171,7 +171,11 @@ $txt['female'] = 'Female';
 
 $txt['error_invalid_characters_username'] = 'Invalid character used in Username.';
 
-$txt['welcome_guest'] = 'Welcome, <strong>%1$s</strong>. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
+$txt['welcome_guest'] = 'Welcome, <strong>%1$s</strong>. Please <a href="%2$s">login</a>.';
+
+$txt['welcome_guest_register'] = 'Welcome, <strong>%1$s</strong>. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
+
+$txt['please_login'] = 'Please <a href="' . $scripturl . '?action=login">login</a>.';
 $txt['login_or_register'] = 'Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
 $txt['welcome_guest_activate'] = '<br />Did you miss your <a href="' . $scripturl . '?action=activate">activation email</a>?';
 $txt['hello_member'] = 'Hey,';