Browse Source

Merge pull request #150 from emanuele45/master

Cosmetic changes, generic bug fixing and a bunch of fixes to pacman
emanuele45 12 years ago
parent
commit
ad850087c2

+ 33 - 7
SSI.php

@@ -1451,6 +1451,9 @@ function ssi_quickSearch($output_method = 'echo')
 {
 	global $scripturl, $txt, $context;
 
+	if (!allowedTo('search_posts'))
+		return;
+
 	if ($output_method != 'echo')
 		return $scripturl . '?action=search';
 
@@ -1476,6 +1479,9 @@ function ssi_todaysBirthdays($output_method = 'echo')
 {
 	global $scripturl, $modSettings, $user_info;
 
+	if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view'))
+		return;
+
 	$eventOptions = array(
 		'include_birthdays' => true,
 		'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],
@@ -1495,6 +1501,9 @@ function ssi_todaysHolidays($output_method = 'echo')
 {
 	global $modSettings, $user_info;
 
+	if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view'))
+		return;
+
 	$eventOptions = array(
 		'include_holidays' => true,
 		'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],
@@ -1513,6 +1522,9 @@ function ssi_todaysEvents($output_method = 'echo')
 {
 	global $modSettings, $user_info;
 
+	if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view'))
+		return;
+
 	$eventOptions = array(
 		'include_events' => true,
 		'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],
@@ -1537,6 +1549,9 @@ function ssi_todaysCalendar($output_method = 'echo')
 {
 	global $modSettings, $txt, $scripturl, $user_info;
 
+	if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view'))
+		return;
+
 	$eventOptions = array(
 		'include_birthdays' => true,
 		'include_holidays' => true,
@@ -1637,11 +1652,13 @@ function ssi_boardNews($board = null, $limit = null, $start = null, $length = nu
 
 	// Find the post ids.
 	$request = $smcFunc['db_query']('', '
-		SELECT id_first_msg
-		FROM {db_prefix}topics
-		WHERE id_board = {int:current_board}' . ($modSettings['postmod_active'] ? '
-			AND approved = {int:is_approved}' : '') . '
-		ORDER BY id_first_msg DESC
+		SELECT t.id_first_msg
+		FROM {db_prefix}topics as t
+		LEFT JOIN {db_prefix}boards as b ON (b.id_board = t.id_board)
+		WHERE t.id_board = {int:current_board}' . ($modSettings['postmod_active'] ? '
+			AND t.approved = {int:is_approved}' : '') . '
+			AND {query_see_board}
+		ORDER BY t.id_first_msg DESC
 		LIMIT ' . $start . ', ' . $limit,
 		array(
 			'current_board' => $board,
@@ -1678,9 +1695,15 @@ function ssi_boardNews($board = null, $limit = null, $start = null, $length = nu
 		if (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
 		{
 			$row['body'] = $smcFunc['substr']($row['body'], 0, $length);
+			$cutoff = false;
 
-			// The first space or line break. (<br />, etc.)
-			$cutoff = max(strrpos($row['body'], ' '), strrpos($row['body'], '<'));
+			$last_space = strrpos($row['body'], ' ');
+			$last_open = strrpos($row['body'], '<');
+			$last_close = strrpos($row['body'], '>');
+			if (empty($last_space) || ($last_space == $last_open + 3 && (empty($last_close) || (!empty($last_close) && $last_close < $last_open))) || $last_space < $last_open || $last_open == $length - 6)
+				$cutoff = $last_open;
+			elseif (empty($last_close) || $last_close < $last_open)
+				$cutoff = $last_space;
 
 			if ($cutoff !== false)
 				$row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);
@@ -1754,6 +1777,9 @@ function ssi_recentEvents($max_events = 7, $output_method = 'echo')
 {
 	global $db_prefix, $user_info, $scripturl, $modSettings, $txt, $context, $smcFunc;
 
+	if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view'))
+		return;
+
 	// Find all events which are happening in the near future that the member can see.
 	$request = $smcFunc['db_query']('', '
 		SELECT

+ 5 - 1
Sources/LogInOut.php

@@ -28,7 +28,11 @@ if (!defined('SMF'))
  */
 function Login()
 {
-	global $txt, $context, $scripturl;
+	global $txt, $context, $scripturl, $user_info;
+
+	// You are already logged in, go take a tour of the boards
+	if (!empty($user_info['id']))
+		redirectexit();
 
 	// In wireless?  If so, use the correct sub template.
 	if (WIRELESS)

+ 2 - 2
Sources/ManageAttachments.php

@@ -1082,7 +1082,7 @@ function RepairAttachments()
 	@set_time_limit(600);
 
 	$_GET['step'] = empty($_GET['step']) ? 0 : (int) $_GET['step'];
-	$_SESSION['starting_substep'] = $_GET['substep'] = empty($_GET['substep']) ? 0 : (int) $_GET['substep'];
+	$context['starting_substep'] = $_GET['substep'] = empty($_GET['substep']) ? 0 : (int) $_GET['substep'];
 
 	// Don't recall the session just in case.
 	if ($_GET['step'] == 0 && $_GET['substep'] == 0)
@@ -1647,7 +1647,7 @@ function pauseAttachmentMaintenance($to_fix, $max_substep = 0)
 		@apache_reset_timeout();
 
 	// Have we already used our maximum time?
-	if (time() - array_sum(explode(' ', $time_start)) < 3 || $_SESSION['starting_substep'] == $_GET['substep'])
+	if (time() - array_sum(explode(' ', $time_start)) < 3 || $context['starting_substep'] == $_GET['substep'])
 		return;
 
 	$context['continue_get_data'] = '?action=admin;area=manageattachments;sa=repair' . (isset($_GET['fixErrors']) ? ';fixErrors' : '') . ';step=' . $_GET['step'] . ';substep=' . $_GET['substep'] . ';' . $context['session_var'] . '=' . $context['session_id'];

+ 33 - 21
Sources/Packages.php

@@ -645,7 +645,12 @@ function PackageInstallTest()
 		if (empty($thisAction))
 			continue;
 
-		if (isset($action['filename']) && !file_exists($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename']))
+		if ($context['uninstalling'])
+			$file = in_array($action['type'], array('remove-dir', 'remove-file')) ? $action['filename'] : $boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename'];
+		else
+			$file =  $boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename'];
+
+		if (isset($action['filename']) && !file_exists($file))
 		{
 			$context['has_failure'] = true;
 
@@ -1359,11 +1364,11 @@ function PackageBrowse()
 
 	$context['page_title'] .= ' - ' . $txt['browse_packages'];
 
-	$context['forum_version'] = $forum_version;
-	$context['modification_types'] = array('modification', 'avatar', 'language', 'unknown');
-
 	$installed = $context['sub_action'] == 'installed' ? true : false;
 
+	$context['forum_version'] = $forum_version;
+	$context['modification_types'] = $installed ? array('modification') : array('modification', 'avatar', 'language', 'unknown');
+
 	require_once($sourcedir . '/Subs-List.php');
 
 	foreach ($context['modification_types'] as $type)
@@ -1377,7 +1382,7 @@ function PackageBrowse()
 				'function' => 'list_getPackages',
 				'params' => array('type' => $type, 'installed' => $installed),
 			),
-			'base_href' => $scripturl . '?action=admin;area=packages;sa=browse;type=' . $type,
+			'base_href' => $scripturl . '?action=admin;area=packages;sa=' . $context['sub_action'] . ';type=' . $type,
 			'default_sort_col' => 'id' . $type,
 			'columns' => array(
 				'id' . $type => array(
@@ -1391,11 +1396,6 @@ function PackageBrowse()
 
 							if (isset($context[\'available_' . $type . '\'][$package_md5]))
 								return $context[\'available_' . $type . '\'][$package_md5][\'sort_id\'];
-							return $context[\'sort_id\'];
-							if (empty($packageCounter))
-								$packageCounter = 1;
-
-							return $packageCounter++ . \'.\';
 						'),
 					),
 					'sort' => array(
@@ -1413,8 +1413,8 @@ function PackageBrowse()
 							global $context;
 
 							if (isset($context[\'available_' . $type . '\'][$package_md5]))
-								return $context[\'available_' . $type . '\'][$package_md5][\'name\'];'
-						),
+								return $context[\'available_' . $type . '\'][$package_md5][\'name\'];
+						'),
 					),
 					'sort' => array(
 						'default' => 'name',
@@ -1431,8 +1431,8 @@ function PackageBrowse()
 							global $context;
 
 							if (isset($context[\'available_' . $type . '\'][$package_md5]))
-								return $context[\'available_' . $type . '\'][$package_md5][\'version\'];'
-						),
+								return $context[\'available_' . $type . '\'][$package_md5][\'version\'];
+						'),
 					),
 					'sort' => array(
 						'default' => 'version',
@@ -1472,8 +1472,8 @@ function PackageBrowse()
 
 							return $return . \'
 									<a href="\' . $scripturl . \'?action=admin;area=packages;sa=list;package=\' . $package[\'filename\'] . \'">[ \' . $txt[\'list_files\'] . \' ]</a>
-									<a href="\' . $scripturl . \'?action=admin;area=packages;sa=remove;package=\' . $package[\'filename\'] . \';\' . $context[\'session_var\'] . \'=\' . $context[\'session_id\'] . \'"\' . ($package[\'is_installed\'] && $package[\'is_current\'] ? \' onclick="return confirm(\\\'\' . $txt[\'package_delete_bad\'] . \'\\\');"\' : \'\') . \'>[ \' . $txt[\'package_delete\'] . \' ]</a>\';'
-							),
+									<a href="\' . $scripturl . \'?action=admin;area=packages;sa=remove;package=\' . $package[\'filename\'] . \';\' . $context[\'session_var\'] . \'=\' . $context[\'session_id\'] . \'"\' . ($package[\'is_installed\'] && $package[\'is_current\'] ? \' onclick="return confirm(\\\'\' . $txt[\'package_delete_bad\'] . \'\\\');"\' : \'\') . \'>[ \' . $txt[\'package_delete\'] . \' ]</a>\';
+						'),
 						'style' => 'text-align: right;',
 					),
 				),
@@ -1517,7 +1517,11 @@ function list_getPackages($start, $items_per_page, $sort, $params, $installed)
 	$the_version = strtr($forum_version, array('SMF ' => ''));
 
 	// Here we have a little code to help those who class themselves as something of gods, version emulation ;)
-	if (isset($_GET['version_emulate']))
+	if (isset($_GET['version_emulate']) && strtr($_GET['version_emulate'], array('SMF ' => '')) == $the_version)
+	{
+		unset($_SESSION['version_emulate']);
+	}
+	elseif (isset($_GET['version_emulate']))
 	{
 		if (($_GET['version_emulate'] === 0 || $_GET['version_emulate'] === $forum_version) && isset($_SESSION['version_emulate']))
 			unset($_SESSION['version_emulate']);
@@ -1549,10 +1553,11 @@ function list_getPackages($start, $items_per_page, $sort, $params, $installed)
 
 	if ($installed)
 	{
+		$sort_id = 1;
 		foreach ($instmods as $installed_mod)
 		{
-			$packages['modification'][] = $installed_mod['package_id'];
 			$context['available_modification'][$installed_mod['package_id']] = array(
+				'sort_id' => $sort_id++,
 				'can_uninstall' => true,
 				'name' => $installed_mod['name'],
 				'filename' => $installed_mod['filename'],
@@ -1562,7 +1567,6 @@ function list_getPackages($start, $items_per_page, $sort, $params, $installed)
 				'is_current' => true,
 			);
 		}
-		return $packages['modification'];
 	}
 
 	if (empty($packages))
@@ -1709,8 +1713,16 @@ function list_getPackages($start, $items_per_page, $sort, $params, $installed)
 				{
 					$sort_id['modification']++;
 					$sort_id['mod']++;
-					$packages['modification'][strtolower($packageInfo[$sort])] = md5($package);
-					$context['available_modification'][md5($package)] = $packageInfo;
+					if ($installed)
+					{
+						$packages['modification'][strtolower($packageInfo[$sort])] = $packageInfo['id'];
+						$context['available_modification'][$packageInfo['id']] = array_merge($context['available_modification'][$packageInfo['id']], $packageInfo);
+					}
+					else
+					{
+						$packages['modification'][strtolower($packageInfo[$sort])] = md5($package);
+						$context['available_modification'][md5($package)] = $packageInfo;
+					}
 				}
 				// Avatar package.
 				elseif ($packageInfo['type'] == 'avatar')

+ 5 - 1
Sources/Register.php

@@ -522,7 +522,11 @@ function Register2($verifiedOpenID = false)
  */
 function Activate()
 {
-	global $context, $txt, $modSettings, $scripturl, $sourcedir, $smcFunc, $language;
+	global $context, $txt, $modSettings, $scripturl, $sourcedir, $smcFunc, $language, $user_info;
+
+	// Logged in users should not bother to activate their accounts
+	if (!empty($user_info['id']))
+		redirectexit();
 
 	loadLanguage('Login');
 	loadTemplate('Login');

+ 1 - 1
Sources/Subs-BoardIndex.php

@@ -104,7 +104,7 @@ function getBoardIndex($boardIndexOptions)
 					'boards' => array(),
 					'new' => false
 				);
-				$categories[$row_board['id_cat']]['link'] = '<a id="c' . $row_board['id_cat'] . '"></a>' . (!$context['user']['is_guest'] ? '<a href="' . $scripturl . '?action=unread;c='. $row_board['id_cat'] . '" title="New posts in ' . $row_board['cat_name'] . '">' . $row_board['cat_name'] . '</a>' : $row_board['cat_name']);
+				$categories[$row_board['id_cat']]['link'] = '<a id="c' . $row_board['id_cat'] . '"></a>' . (!$context['user']['is_guest'] ? '<a href="' . $scripturl . '?action=unread;c='. $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], strip_tags($row_board['cat_name'])) . '">' . $row_board['cat_name'] . '</a>' : $row_board['cat_name']);
 			}
 
 			// If this board has new posts in it (and isn't the recycle bin!) then the category is new.

+ 2 - 2
Sources/Subs-Editor.php

@@ -1706,7 +1706,7 @@ function create_control_richedit($editorOptions)
 		}
 
 		$bbcodes_styles = '';
-		$context['bbcodes_hanlders'] = '';
+		$context['bbcodes_handlers'] = '';
 		$context['bbc_toolbar'] = array();
 		foreach ($context['bbc_tags'] as $row => $tagRow)
 		{
@@ -1727,7 +1727,7 @@ function create_control_richedit($editorOptions)
 			}';
 						if (isset($tag['before']))
 						{
-							$context['bbcodes_hanlders'] = '
+							$context['bbcodes_handlers'] = '
 				$.sceditor.setCommand(
 					' . javaScriptEscape($tag['code']) . ',
 					function () {

+ 2 - 2
Sources/Subs-Post.php

@@ -718,7 +718,7 @@ function AddMailQueue($flush = false, $to_array = array(), $subject = '', $messa
 		$smcFunc['db_insert']('',
 			'{db_prefix}mail_queue',
 			array(
-				'time_sent' => 'int', 'recipient' => 'string-255', 'body' => 'string-65534', 'subject' => 'string-255',
+				'time_sent' => 'int', 'recipient' => 'string-255', 'body' => 'string', 'subject' => 'string-255',
 				'headers' => 'string-65534', 'send_html' => 'int', 'priority' => 'int', 'private' => 'int',
 			),
 			$cur_insert,
@@ -764,7 +764,7 @@ function AddMailQueue($flush = false, $to_array = array(), $subject = '', $messa
 			$smcFunc['db_insert']('',
 				'{db_prefix}mail_queue',
 				array(
-					'time_sent' => 'int', 'recipient' => 'string-255', 'body' => 'string-65534', 'subject' => 'string-255',
+					'time_sent' => 'int', 'recipient' => 'string-255', 'body' => 'string', 'subject' => 'string-255',
 					'headers' => 'string-65534', 'send_html' => 'int', 'priority' => 'int', 'private' => 'int',
 				),
 				$cur_insert,

+ 6 - 5
Themes/default/Display.template.php

@@ -801,8 +801,8 @@ function template_main()
 				var oDraftAutoSave = new smf_DraftAutoSave({
 					sSelf: \'oDraftAutoSave\',
 					sLastNote: \'draft_lastautosave\',
-					sLastID: \'id_draft\',
-					sSceditorID: \'', $context['post_box_name']. '\',
+					sLastID: \'id_draft\',', !empty($context['post_box_name']) ? '
+					sSceditorID: \'' . $context['post_box_name'] . '\',' : '', '
 					sType: \'', !empty($options['display_quick_reply']) && $options['display_quick_reply'] > 2 ? 'quick' : 'quick', '\',
 					iBoard: ', (empty($context['current_board']) ? 0 : $context['current_board']), ',
 					iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), '
@@ -812,10 +812,10 @@ function template_main()
 	if ($context['show_spellchecking'])
 		echo '
 			<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>
-				<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>';
+				<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/spellcheck.js"></script>';
 
 	echo '
-				<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
+				<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/topic.js"></script>
 				<script type="text/javascript"><!-- // --><![CDATA[';
 
 	if (!empty($options['display_quick_reply']))
@@ -882,7 +882,8 @@ function template_main()
 							sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
 							sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
 							sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ',
-							sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
+							sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), ($context['can_reply'] && !empty($options['display_quick_reply'])) ? ',
+							sFormRemoveAccessKeys: \'postmodify\'' : '', '
 						});
 
 						aJumpTo[aJumpTo.length] = new JumpTo({

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

@@ -29,7 +29,7 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 		<input type="hidden" name="', $editor_id, '_mode" id="', $editor_id, '_mode" value="0" />
 		<script type="text/javascript"><!-- // --><![CDATA[
 			$(document).ready(function() {
-				', !empty($context['bbcodes_hanlders']) ? $context['bbcodes_hanlders'] : '', '
+				', !empty($context['bbcodes_handlers']) ? $context['bbcodes_handlers'] : '', '
 
 				$("#', $editor_id, '").sceditorBBCodePlugin({
 					style: "', $settings['default_theme_url'], '/css/jquery.sceditor.default.css",

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

@@ -423,7 +423,7 @@ function template_main()
 
 	// Javascript for inline editing.
 	echo '
-<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
+<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/topic.js"></script>
 <script type="text/javascript"><!-- // --><![CDATA[
 
 	// Hide certain bits during topic edit.

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

@@ -184,7 +184,11 @@ function template_registration_form()
 							<strong', !empty($field['is_error']) ? ' style="color: red;"' : '', '>', $field['name'], ':</strong>
 							<span class="smalltext">', $field['desc'], '</span>
 						</dt>
-						<dd>', $field['input_html'], '</dd>';
+						<dd>', preg_replace_callback('~<(input|select|textarea) ~', create_function('$matches', '
+							global $context;
+							return \'<\' . $matches[1] . \' tabindex="\' . $context[\'tabindex\']++ . \'"\';
+						')
+					, $field['input_html']), '</dd>';
 
 		echo '
 					</dl>';

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

@@ -728,6 +728,7 @@ $txt['ajax_in_progress'] = 'Loading...';
 $txt['mod_reports_waiting'] = 'There are currently %1$d moderator reports open.';
 
 $txt['view_unread_category'] = 'Unread Posts';
+$txt['new_posts_in_category'] = 'Click to see the new posts in %1$s';
 $txt['verification'] = 'Verification';
 $txt['visual_verification_description'] = 'Type the letters shown in the picture';
 $txt['visual_verification_sound'] = 'Listen to the letters';

+ 51 - 0
Themes/default/scripts/topic.js

@@ -196,6 +196,7 @@ function QuickModify(oOptions)
 	this.sMessageBuffer = '';
 	this.sSubjectBuffer = '';
 	this.bXmlHttpCapable = this.isXmlHttpCapable();
+	this.aAccessKeys = new Array();
 
 	// Show the edit buttons
 	if (this.bXmlHttpCapable)
@@ -233,6 +234,23 @@ QuickModify.prototype.modifyMsg = function (iMessageId)
 	if (typeof(sSessionVar) == 'undefined')
 		sSessionVar = 'sesc';
 
+	// Removes the accesskeys from the quickreply inputs and saves them in an array to use them later
+	if (typeof(this.opt.sFormRemoveAccessKeys) != 'undefined')
+	{
+		if (typeof(document.forms[this.opt.sFormRemoveAccessKeys]))
+		{
+			var aInputs = document.forms[this.opt.sFormRemoveAccessKeys].getElementsByTagName('input');
+			for (var i = 0; i < aInputs.length; i++)
+			{
+				if (aInputs[i].accessKey != '')
+				{
+					this.aAccessKeys[aInputs[i].name] = aInputs[i].accessKey;
+					aInputs[i].accessKey = '';
+				}
+			}
+		}
+	}
+
 	// First cancel if there's another message still being edited.
 	if (this.bInEditMode)
 		this.modifyCancel();
@@ -295,6 +313,22 @@ QuickModify.prototype.modifyCancel = function ()
 	// No longer in edit mode, that's right.
 	this.bInEditMode = false;
 
+	// Let's put back the accesskeys to their original place
+	if (typeof(this.opt.sFormRemoveAccessKeys) != 'undefined')
+	{
+		if (typeof(document.forms[this.opt.sFormRemoveAccessKeys]))
+		{
+			var aInputs = document.forms[this.opt.sFormRemoveAccessKeys].getElementsByTagName('input');
+			for (var i = 0; i < aInputs.length; i++)
+			{
+				if (typeof(this.aAccessKeys[aInputs[i].name]) != 'undefined')
+				{
+					aInputs[i].name = this.aAccessKeys[aInputs[i].name];
+				}
+			}
+		}
+	}
+
 	return false;
 }
 
@@ -309,6 +343,23 @@ QuickModify.prototype.modifySave = function (sSessionId, sSessionVar)
 	if (typeof(sSessionVar) == 'undefined')
 		sSessionVar = 'sesc';
 
+	// Let's put back the accesskeys to their original place
+	if (typeof(this.opt.sFormRemoveAccessKeys) != 'undefined')
+	{
+		if (typeof(document.forms[this.opt.sFormRemoveAccessKeys]))
+		{
+			var aInputs = document.forms[this.opt.sFormRemoveAccessKeys].getElementsByTagName('input');
+			for (var i = 0; i < aInputs.length; i++)
+			{
+				if (typeof(this.aAccessKeys[aInputs[i].name]) != 'undefined')
+				{
+					aInputs[i].name = this.aAccessKeys[aInputs[i].name];
+				}
+			}
+		}
+	}
+
+
 	var i, x = new Array();
 	x[x.length] = 'subject=' + escape(document.forms.quickModForm['subject'].value.replace(/&#/g, "&#38;#").php_to8bit()).replace(/\+/g, "%2B");
 	x[x.length] = 'message=' + escape(document.forms.quickModForm['message'].value.replace(/&#/g, "&#38;#").php_to8bit()).replace(/\+/g, "%2B");

+ 0 - 2
index.php

@@ -271,7 +271,6 @@ function smf_main()
 		'coppa' => array('Register.php', 'CoppaForm'),
 		'credits' => array('Who.php', 'Credits'),
 		'deletemsg' => array('RemoveTopic.php', 'DeleteMessage'),
-		'display' => array('Display.php', 'Display'),
 		'dlattach' => array('Display.php', 'Download'),
 		'editpoll' => array('Poll.php', 'EditPoll'),
 		'editpoll2' => array('Poll.php', 'EditPoll2'),
@@ -280,7 +279,6 @@ function smf_main()
 		'groups' => array('Groups.php', 'Groups'),
 		'help' => array('Help.php', 'ShowHelp'),
 		'helpadmin' => array('Help.php', 'ShowAdminHelp'),
-		'im' => array('PersonalMessage.php', 'MessageMain'),
 		'jsmodify' => array('Post.php', 'JavaScriptModify'),
 		'jsoption' => array('Themes.php', 'SetJavaScript'),
 		'loadeditorlocale' => array('Subs-Editor.php', 'loadLocale'),