Browse Source

Merge branch 'master' of https://github.com/Spuds/playpen

emanuele 13 years ago
parent
commit
2b8a80c045

+ 99 - 77
Sources/Memberlist.php

@@ -19,11 +19,11 @@ if (!defined('SMF'))
 
 /**
  * Shows a listing of registered members.
- * If a subaction is not specified, lists all registered members.
- * It allows searching for members with the 'search' sub action.
- * It calls MLAll or MLSearch depending on the sub action.
- * Requires the view_mlist permission.
- * Accessed via ?action=mlist.
+ * - If a subaction is not specified, lists all registered members.
+ * - It allows searching for members with the 'search' sub action.
+ * - It calls MLAll or MLSearch depending on the sub action.
+ * - Requires the view_mlist permission.
+ * - Accessed via ?action=mlist.
  *
  * @uses Memberlist template, main sub template.
  */
@@ -48,11 +48,13 @@ function Memberlist()
 	// Set up the sort links.
 	$context['sort_links'] = array();
 	foreach ($subActions as $act => $text)
+	{
 		$context['sort_links'][] = array(
 			'label' => $text[0],
 			'action' => $act,
 			'selected' => $text[2],
 		);
+	}
 
 	$context['num_members'] = $modSettings['totalMembers'];
 
@@ -60,51 +62,95 @@ function Memberlist()
 	$context['columns'] = array(
 		'is_online' => array(
 			'label' => $txt['status'],
-			'width' => '60',
+			'width' => 60,
 			'class' => 'first_th',
+			'sort' => array(
+				'down' => allowedTo('moderate_forum') ? 'IFNULL(lo.log_time, 1) ASC, real_name ASC' : 'CASE WHEN mem.show_online THEN IFNULL(lo.log_time, 1) ELSE 1 END ASC, real_name ASC',
+				'up' => allowedTo('moderate_forum') ? 'IFNULL(lo.log_time, 1) DESC, real_name DESC' : 'CASE WHEN mem.show_online THEN IFNULL(lo.log_time, 1) ELSE 1 END DESC, real_name DESC'
+			),
 		),
 		'real_name' => array(
-			'label' => $txt['username']
+			'label' => $txt['username'],
+			'sort' => array(
+				'down' => 'mem.real_name DESC',
+				'up' => 'mem.real_name ASC'
+			),
 		),
 		'email_address' => array(
 			'label' => $txt['email'],
-			'width' => '25'
+			'width' => 25,
+			'sort' => array(
+				'down' => allowedTo('moderate_forum') ? 'mem.email_address DESC' : 'mem.hide_email DESC, mem.email_address DESC',
+				'up' => allowedTo('moderate_forum') ? 'mem.email_address ASC' : 'mem.hide_email ASC, mem.email_address ASC'
+			),
 		),
 		'website_url' => array(
 			'label' => $txt['website'],
-			'width' => '70',
+			'width' => 70,
 			'link_with' => 'website',
+			'sort' => array(
+				'down' => 'LENGTH(mem.website_url) > 0 ASC, IFNULL(mem.website_url, 1=1) DESC, mem.website_url DESC',
+				'up' => 'LENGTH(mem.website_url) > 0 DESC, IFNULL(mem.website_url, 1=1) ASC, mem.website_url ASC'
+			),
 		),
 		'icq' => array(
 			'label' => $txt['icq'],
-			'width' => '30'
+			'width' => 30,
+			'sort' => array(
+				'down' => 'LENGTH(mem.icq) > 0 ASC, mem.icq = 0 DESC, mem.icq DESC',
+				'up' => 'LENGTH(mem.icq) > 0 DESC, mem.icq = 0 ASC, mem.icq ASC'
+			),
 		),
 		'aim' => array(
 			'label' => $txt['aim'],
-			'width' => '30'
+			'width' => 30,
+			'sort' => array(
+				'down' => 'LENGTH(mem.aim) > 0 ASC, IFNULL(mem.aim, 1=1) DESC, mem.aim DESC',
+				'up' => 'LENGTH(mem.aim) > 0 DESC, IFNULL(mem.aim, 1=1) ASC, mem.aim ASC'
+			),
 		),
 		'yim' => array(
 			'label' => $txt['yim'],
-			'width' => '30'
+			'width' => 30,
+			'sort' => array(
+				'down' => 'LENGTH(mem.yim) > 0 ASC, IFNULL(mem.yim, 1=1) DESC, mem.yim DESC',
+				'up' => 'LENGTH(mem.yim) > 0 DESC, IFNULL(mem.yim, 1=1) ASC, mem.yim ASC'
+			),
 		),
 		'msn' => array(
 			'label' => $txt['msn'],
-			'width' => '30'
+			'width' => 30,
+			'sort' => array(
+				'down' => 'LENGTH(mem.msn) > 0 ASC, IFNULL(mem.msn, 1=1) DESC, mem.msn DESC',
+				'up' => 'LENGTH(mem.msn) > 0 DESC, IFNULL(mem.msn, 1=1) ASC, mem.msn ASC'
+			),
 		),
 		'id_group' => array(
-			'label' => $txt['position']
+			'label' => $txt['position'],
+			'sort' => array(
+				'down' => 'IFNULL(mg.group_name, 1=1) DESC, mg.group_name DESC',
+				'up' => 'IFNULL(mg.group_name, 1=1) ASC, mg.group_name ASC'
+			),
 		),
 		'registered' => array(
-			'label' => $txt['date_registered']
+			'label' => $txt['date_registered'],
+			'sort' => array(
+				'down' => 'mem.date_registered DESC',
+				'up' => 'mem.date_registered ASC'
+			),
 		),
 		'posts' => array(
 			'label' => $txt['posts'],
-			'width' => '115',
-			'colspan' => '2',
+			'width' => 115,
+			'colspan' => 2,
 			'default_sort_rev' => true,
+			'sort' => array(
+				'down' => 'mem.posts DESC',
+				'up' => 'mem.posts ASC'
+			),
 		)
 	);
-
+	
 	$context['colspan'] = 0;
 	$context['disabled_fields'] = isset($modSettings['disabled_profile_fields']) ? array_flip(explode(',', $modSettings['disabled_profile_fields'])) : array();
 	foreach ($context['columns'] as $key => $column)
@@ -256,6 +302,7 @@ function MLAll()
 		$context['columns'][$col]['selected'] = $_REQUEST['sort'] == $col;
 	}
 
+	// Are we sorting the results
 	$context['sort_by'] = $_REQUEST['sort'];
 	$context['sort_direction'] = !isset($_REQUEST['desc']) ? 'up' : 'down';
 
@@ -274,59 +321,11 @@ function MLAll()
 		'extra_after' => ' (' . sprintf($txt['of_total_members'], $context['num_members']) . ')'
 	);
 
-	// List out the different sorting methods...
-	$sort_methods = array(
-		'is_online' => array(
-			'down' => allowedTo('moderate_forum') ? 'IFNULL(lo.log_time, 1) ASC, real_name ASC' : 'CASE WHEN mem.show_online THEN IFNULL(lo.log_time, 1) ELSE 1 END ASC, real_name ASC',
-			'up' => allowedTo('moderate_forum') ? 'IFNULL(lo.log_time, 1) DESC, real_name DESC' : 'CASE WHEN mem.show_online THEN IFNULL(lo.log_time, 1) ELSE 1 END DESC, real_name DESC'
-		),
-		'real_name' => array(
-			'down' => 'mem.real_name DESC',
-			'up' => 'mem.real_name ASC'
-		),
-		'email_address' => array(
-			'down' => allowedTo('moderate_forum') ? 'mem.email_address DESC' : 'mem.hide_email DESC, mem.email_address DESC',
-			'up' => allowedTo('moderate_forum') ? 'mem.email_address ASC' : 'mem.hide_email ASC, mem.email_address ASC'
-		),
-		'website_url' => array(
-			'down' => 'LENGTH(mem.website_url) > 0 ASC, IFNULL(mem.website_url, 1=1) DESC, mem.website_url DESC',
-			'up' => 'LENGTH(mem.website_url) > 0 DESC, IFNULL(mem.website_url, 1=1) ASC, mem.website_url ASC'
-		),
-		'icq' => array(
-			'down' => 'LENGTH(mem.icq) > 0 ASC, mem.icq = 0 DESC, mem.icq DESC',
-			'up' => 'LENGTH(mem.icq) > 0 DESC, mem.icq = 0 ASC, mem.icq ASC'
-		),
-		'aim' => array(
-			'down' => 'LENGTH(mem.aim) > 0 ASC, IFNULL(mem.aim, 1=1) DESC, mem.aim DESC',
-			'up' => 'LENGTH(mem.aim) > 0 DESC, IFNULL(mem.aim, 1=1) ASC, mem.aim ASC'
-		),
-		'yim' => array(
-			'down' => 'LENGTH(mem.yim) > 0 ASC, IFNULL(mem.yim, 1=1) DESC, mem.yim DESC',
-			'up' => 'LENGTH(mem.yim) > 0 DESC, IFNULL(mem.yim, 1=1) ASC, mem.yim ASC'
-		),
-		'msn' => array(
-			'down' => 'LENGTH(mem.msn) > 0 ASC, IFNULL(mem.msn, 1=1) DESC, mem.msn DESC',
-			'up' => 'LENGTH(mem.msn) > 0 DESC, IFNULL(mem.msn, 1=1) ASC, mem.msn ASC'
-		),
-		'registered' => array(
-			'down' => 'mem.date_registered DESC',
-			'up' => 'mem.date_registered ASC'
-		),
-		'id_group' => array(
-			'down' => 'IFNULL(mg.group_name, 1=1) DESC, mg.group_name DESC',
-			'up' => 'IFNULL(mg.group_name, 1=1) ASC, mg.group_name ASC'
-		),
-		'posts' => array(
-			'down' => 'mem.posts DESC',
-			'up' => 'mem.posts ASC'
-		)
-	);
-
 	$limit = $_REQUEST['start'];
 	$query_parameters = array(
 		'regular_id_group' => 0,
 		'is_activated' => 1,
-		'sort' => $sort_methods[$_REQUEST['sort']][$context['sort_direction']],
+		'sort' => $context['columns'][$_REQUEST['sort']]['sort'][$context['sort_direction']],
 	);
 
 	// Using cache allows to narrow down the list to be retrieved.
@@ -389,18 +388,14 @@ function MLAll()
 
 /**
  * Search for members, or display search results.
- * Called by MemberList().
- * If variable 'search' is empty displays search dialog box, using the
- * search sub template.
- * Calls printMemberListRows to retrieve the results of the query.
+ * - Called by MemberList().
+ * - If variable 'search' is empty displays search dialog box, using the search sub template.
+ * - Calls printMemberListRows to retrieve the results of the query.
  */
 function MLSearch()
 {
 	global $txt, $scripturl, $context, $user_info, $modSettings, $smcFunc;
 
-	$context['page_title'] = $txt['mlist_search'];
-	$context['can_moderate_forum'] = allowedTo('moderate_forum');
-
 	// Can they search custom fields?
 	$request = $smcFunc['db_query']('', '
 		SELECT col_name, field_name, field_desc
@@ -438,17 +433,43 @@ function MLSearch()
 		// No fields?  Use default...
 		if (empty($_POST['fields']))
 			$_POST['fields'] = array('name');
+			
+		// Set defaults for how the results are sorted
+		if (!isset($_REQUEST['sort']) || !isset($context['columns'][$_REQUEST['sort']]))
+			$_REQUEST['sort'] = 'real_name';
+
+		// Build the column link / sort information.
+		foreach ($context['columns'] as $col => $column_details)
+		{
+			$context['columns'][$col]['href'] = $scripturl . '?action=mlist;sa=search;start=0;sort=' . $col;
+
+			if ((!isset($_REQUEST['desc']) && $col == $_REQUEST['sort']) || ($col != $_REQUEST['sort'] && !empty($column_details['default_sort_rev'])))
+				$context['columns'][$col]['href'] .= ';desc';
+				
+			if (isset($_POST['search']) && isset($_POST['fields']))
+				$context['columns'][$col]['href'] .= ';search=' . $_POST['search'] . ';fields=' . implode(',', $_POST['fields']);
+
+			$context['columns'][$col]['link'] = '<a href="' . $context['columns'][$col]['href'] . '" rel="nofollow">' . $context['columns'][$col]['label'] . '</a>';
+			$context['columns'][$col]['selected'] = $_REQUEST['sort'] == $col;
+		}
+	
+		// set up some things for use in the template
+		$context['page_title'] = $txt['mlist_search'];
+		$context['can_moderate_forum'] = allowedTo('moderate_forum');
+		$context['sort_direction'] = !isset($_REQUEST['desc']) ? 'up' : 'down';	
+		$context['sort_by'] = $_REQUEST['sort'];
 
 		$query_parameters = array(
 			'regular_id_group' => 0,
 			'is_activated' => 1,
 			'blank_string' => '',
 			'search' => '%' . strtr($smcFunc['htmlspecialchars']($_POST['search'], ENT_QUOTES), array('_' => '\\_', '%' => '\\%', '*' => '%')) . '%',
+			'sort' => $context['columns'][$_REQUEST['sort']]['sort'][$context['sort_direction']],
 		);
 
-		// Search for a name?
+		// Search for a name
 		if (in_array('name', $_POST['fields']))
-			$fields = array('member_name', 'real_name');
+			$fields = allowedTo('moderate_forum') ? array('member_name', 'real_name') : array('real_name');
 		else
 			$fields = array();
 		// Search for messengers...
@@ -471,6 +492,7 @@ function MLSearch()
 
 		$customJoin = array();
 		$customCount = 10;
+		
 		// Any custom fields to search for - these being tricky?
 		foreach ($_POST['fields'] as $field)
 		{
@@ -501,7 +523,6 @@ function MLSearch()
 		$context['page_index'] = constructPageIndex($scripturl . '?action=mlist;sa=search;search=' . $_POST['search'] . ';fields=' . implode(',', $_POST['fields']), $_REQUEST['start'], $numResults, $modSettings['defaultMaxMembers']);
 
 		// Find the members from the database.
-		// @todo SLOW This query is slow.
 		$request = $smcFunc['db_query']('', '
 			SELECT mem.id_member
 			FROM {db_prefix}members AS mem
@@ -511,6 +532,7 @@ function MLSearch()
 				', $customJoin)) . '
 			WHERE (' . implode( ' ' . $query . ' OR ', $fields) . ' ' . $query . $condition . ')
 				AND mem.is_activated = {int:is_activated}
+			ORDER BY {raw:sort}
 			LIMIT ' . $_REQUEST['start'] . ', ' . $modSettings['defaultMaxMembers'],
 			$query_parameters
 		);

+ 1 - 0
Sources/PackageGet.php

@@ -662,6 +662,7 @@ function PackageUpload()
 	{
 		@unlink($destination);
 		loadLanguage('Errors');
+		$txt[$context['package']] = str_replace('{MANAGETHEMEURL}', $scripturl . '?action=admin;area=theme;sa=admin;' . $context['session_var'] . '=' . $context['session_id'], $txt[$context['package']]);
 		fatal_lang_error('package_upload_error_broken', false, $txt[$context['package']]);
 	}
 	// Is it already uploaded, maybe?

+ 1 - 1
Sources/Packages.php

@@ -2159,7 +2159,7 @@ function fetchPerms__recursive($path, &$data, $level)
 	while ($entry = readdir($dh))
 	{
 		// Some kind of file?
-		if (!is_dir($path . '/' . $entry))
+		if (is_file($path . '/' . $entry))
 		{
 			// Are we listing PHP files in this directory?
 			if ($save_data && !empty($data['list_contents']) && substr($entry, -4) == '.php')

+ 4 - 1
Sources/Profile-Modify.php

@@ -467,7 +467,10 @@ function loadProfileFields($force_reload = false)
 			'size' => 7,
 			'permission' => 'moderate_forum',
 			'input_validate' => create_function('&$value', '
-				$value = $value != \'\' ? strtr($value, array(\',\' => \'\', \'.\' => \'\', \' \' => \'\')) : 0;
+				if (!is_numeric($value))
+					return \'digits_only\';
+				else
+					$value = $value != \'\' ? strtr($value, array(\',\' => \'\', \'.\' => \'\', \' \' => \'\')) : 0;
 				return true;
 			'),
 		),

+ 1 - 1
Sources/Profile.php

@@ -739,7 +739,7 @@ function loadCustomFields($memID, $area = 'summary')
 			foreach ($options as $k => $v)
 			{
 				$true = (!$exists && $row['default_value'] == $v) || $value == $v;
-				$input_html .= '<label for="customfield_' . $row['col_name'] . '_' . $k . '"><input type="radio" name="customfield[' . $row['col_name'] . ']" class="input_radio" id="customfield_' . $row['col_name'] . '_' . $k . '" value="' . $k . '" ' . ($true ? 'checked="checked"' : '') . '>' . $v . '</label><br />';
+				$input_html .= '<label for="customfield_' . $row['col_name'] . '_' . $k . '"><input type="radio" name="customfield[' . $row['col_name'] . ']" class="input_radio" id="customfield_' . $row['col_name'] . '_' . $k . '" value="' . $k . '" ' . ($true ? 'checked="checked"' : '') . ' />' . $v . '</label><br />';
 				if ($true)
 					$output_html = $v;
 			}

+ 8 - 1
Sources/Subs-Package.php

@@ -457,7 +457,14 @@ function getPackageInfo($gzfilename)
 
 	// Nothing?
 	if (empty($packageInfo))
-		return 'package_get_error_is_zero';
+	{
+		// Perhaps they are trying to install a theme, lets tell them nicely this is the wrong function
+		$packageInfo = read_tgz_file($boarddir . '/Packages/' . $gzfilename, '*/theme_info.xml', true);
+		if (!empty($packageInfo))
+			return 'package_get_error_is_theme';
+		else
+			return 'package_get_error_is_zero';
+	}
 
 	// Parse package-info.xml into an xmlArray.
 	require_once($sourcedir . '/Class-Package.php');

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

@@ -1053,23 +1053,23 @@ function template_edit_profile_field()
 
 						<dl class="settings">
 							<dt>
-								<strong>', $txt['custom_edit_name'], ':</strong>
+								<strong><label for="field_name">', $txt['custom_edit_name'], ':</label></strong>
 							</dt>
 							<dd>
-								<input type="text" name="field_name" value="', $context['field']['name'], '" size="20" maxlength="40" class="input_text" />
+								<input type="text" name="field_name" id="field_name" value="', $context['field']['name'], '" size="20" maxlength="40" class="input_text" />
 							</dd>
 							<dt>
-								<strong>', $txt['custom_edit_desc'], ':</strong>
+								<strong><label for="field_desc">', $txt['custom_edit_desc'], ':</label></strong>
 							</dt>
 							<dd>
-								<textarea name="field_desc" rows="3" cols="40">', $context['field']['desc'], '</textarea>
+								<textarea name="field_desc" id="field_desc" rows="3" cols="40">', $context['field']['desc'], '</textarea>
 							</dd>
 							<dt>
-								<strong>', $txt['custom_edit_profile'], ':</strong><br />
+								<strong><label for="profile_area">', $txt['custom_edit_profile'], ':</label></strong><br />
 								<span class="smalltext">', $txt['custom_edit_profile_desc'], '</span>
 							</dt>
 							<dd>
-								<select name="profile_area">
+								<select name="profile_area" id="profile_area">
 									<option value="none"', $context['field']['profile_area'] == 'none' ? ' selected="selected"' : '', '>', $txt['custom_edit_profile_none'], '</option>
 									<option value="account"', $context['field']['profile_area'] == 'account' ? ' selected="selected"' : '', '>', $txt['account'], '</option>
 									<option value="forumprofile"', $context['field']['profile_area'] == 'forumprofile' ? ' selected="selected"' : '', '>', $txt['forumprofile'], '</option>
@@ -1077,7 +1077,7 @@ function template_edit_profile_field()
 								</select>
 							</dd>
 							<dt>
-								<strong>', $txt['custom_edit_registration'], ':</strong>
+								<strong><label for="reg">', $txt['custom_edit_registration'], ':</label></strong>
 							</dt>
 							<dd>
 								<select name="reg" id="reg">
@@ -1087,14 +1087,14 @@ function template_edit_profile_field()
 								</select>
 							</dd>
 							<dt>
-								<strong>', $txt['custom_edit_display'], ':</strong>
+								<strong><label for="display">', $txt['custom_edit_display'], ':</label></strong>
 							</dt>
 							<dd>
 								<input type="checkbox" name="display" id="display"', $context['field']['display'] ? ' checked="checked"' : '', ' class="input_check" />
 							</dd>
 
 							<dt>
-								<strong>', $txt['custom_edit_placement'], ':</strong>
+								<strong><label for="placement">', $txt['custom_edit_placement'], ':</label></strong>
 							</dt>
 							<dd>
 								<select name="placement" id="placement">
@@ -1105,11 +1105,11 @@ function template_edit_profile_field()
 							</dd>
 							<dt>
 								<a id="field_show_enclosed" href="', $scripturl, '?action=helpadmin;help=field_show_enclosed" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" class="icon" alt="', $txt['help'], '" align="top" /></a>
-								<strong>', $txt['custom_edit_enclose'], ':</strong><br />
+								<strong><label for="enclose">', $txt['custom_edit_enclose'], ':</label></strong><br />
 								<span class="smalltext">', $txt['custom_edit_enclose_desc'], '</span>
 							</dt>
 							<dd>
-								<textarea name="enclose" rows="10" cols="50">', @$context['field']['enclose'], '</textarea>
+								<textarea name="enclose" id="enclose" rows="10" cols="50">', @$context['field']['enclose'], '</textarea>
 							</dd>
 						</dl>
 					</fieldset>
@@ -1117,7 +1117,7 @@ function template_edit_profile_field()
 						<legend>', $txt['custom_edit_input'], '</legend>
 						<dl class="settings">
 							<dt>
-								<strong>', $txt['custom_edit_picktype'], ':</strong>
+								<strong><label for="field_type">', $txt['custom_edit_picktype'], ':</label></strong>
 							</dt>
 							<dd>
 								<select name="field_type" id="field_type" onchange="updateInputBoxes();">
@@ -1129,28 +1129,28 @@ function template_edit_profile_field()
 								</select>
 							</dd>
 							<dt id="max_length_dt">
-								<strong>', $txt['custom_edit_max_length'], ':</strong><br />
+								<strong><label for="max_length_dd">', $txt['custom_edit_max_length'], ':</label></strong><br />
 								<span class="smalltext">', $txt['custom_edit_max_length_desc'], '</span>
 							</dt>
-							<dd id="max_length_dd">
-								<input type="text" name="max_length" value="', $context['field']['max_length'], '" size="7" maxlength="6" class="input_text" />
+							<dd>
+								<input type="text" name="max_length" id="max_length_dd" value="', $context['field']['max_length'], '" size="7" maxlength="6" class="input_text" />
 							</dd>
 							<dt id="dimension_dt">
-								<strong>', $txt['custom_edit_dimension'], ':</strong>
+								<strong><label for="dimension_dd">', $txt['custom_edit_dimension'], ':</label></strong>
 							</dt>
 							<dd id="dimension_dd">
 								<strong>', $txt['custom_edit_dimension_row'], ':</strong> <input type="text" name="rows" value="', $context['field']['rows'], '" size="5" maxlength="3" class="input_text" />
 								<strong>', $txt['custom_edit_dimension_col'], ':</strong> <input type="text" name="cols" value="', $context['field']['cols'], '" size="5" maxlength="3" class="input_text" />
 							</dd>
 							<dt id="bbc_dt">
-								<strong>', $txt['custom_edit_bbc'], '</strong>
+								<strong><label for="bbc_dd">', $txt['custom_edit_bbc'], '</label></strong>
 							</dt>
-							<dd id="bbc_dd">
-								<input type="checkbox" name="bbc"', $context['field']['bbc'] ? ' checked="checked"' : '', ' class="input_check" />
+							<dd >
+								<input type="checkbox" name="bbc" id="bbc_dd"', $context['field']['bbc'] ? ' checked="checked"' : '', ' class="input_check" />
 							</dd>
 							<dt id="options_dt">
 								<a href="', $scripturl, '?action=helpadmin;help=customoptions" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" class="icon" alt="', $txt['help'], '" /></a>
-								<strong>', $txt['custom_edit_options'], ':</strong><br />
+								<strong><label for="options_dd">', $txt['custom_edit_options'], ':</label></strong><br />
 								<span class="smalltext">', $txt['custom_edit_options_desc'], '</span>
 							</dt>
 							<dd id="options_dd">
@@ -1167,10 +1167,10 @@ function template_edit_profile_field()
 								</div>
 							</dd>
 							<dt id="default_dt">
-								<strong>', $txt['custom_edit_default'], ':</strong>
+								<strong><label for="default_dd">', $txt['custom_edit_default'], ':</label></strong>
 							</dt>
-							<dd id="default_dd">
-								<input type="checkbox" name="default_check"', $context['field']['default_check'] ? ' checked="checked"' : '', ' class="input_check" />
+							<dd>
+								<input type="checkbox" name="default_check" id="default_dd"', $context['field']['default_check'] ? ' checked="checked"' : '', ' class="input_check" />
 							</dd>
 						</dl>
 					</fieldset>
@@ -1179,7 +1179,7 @@ function template_edit_profile_field()
 						<dl class="settings">
 							<dt id="mask_dt">
 								<a id="custom_mask" href="', $scripturl, '?action=helpadmin;help=custom_mask" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" class="icon" alt="', $txt['help'], '" align="top" /></a>
-								<strong>', $txt['custom_edit_mask'], ':</strong><br />
+								<strong><label for="mask">', $txt['custom_edit_mask'], ':</label></strong><br />
 								<span class="smalltext">', $txt['custom_edit_mask_desc'], '</span>
 							</dt>
 							<dd>
@@ -1195,7 +1195,7 @@ function template_edit_profile_field()
 								</span>
 							</dd>
 							<dt>
-								<strong>', $txt['custom_edit_privacy'], ':</strong>
+								<strong><label for="private">', $txt['custom_edit_privacy'], ':</label></strong>
 								<span class="smalltext">', $txt['custom_edit_privacy_desc'], '</span>
 							</dt>
 							<dd>
@@ -1207,18 +1207,18 @@ function template_edit_profile_field()
 								</select>
 							</dd>
 							<dt id="can_search_dt">
-								<strong>', $txt['custom_edit_can_search'], ':</strong><br />
+								<strong><label for="can_search_dd">', $txt['custom_edit_can_search'], ':</label></strong><br />
 								<span class="smalltext">', $txt['custom_edit_can_search_desc'], '</span>
 							</dt>
-							<dd id="can_search_dd">
-								<input type="checkbox" name="can_search"', $context['field']['can_search'] ? ' checked="checked"' : '', ' class="input_check" />
+							<dd>
+								<input type="checkbox" name="can_search" id="can_search_dd"', $context['field']['can_search'] ? ' checked="checked"' : '', ' class="input_check" />
 							</dd>
 							<dt>
-								<strong>', $txt['custom_edit_active'], ':</strong><br />
+								<strong><label for="can_search_check">', $txt['custom_edit_active'], ':</label></strong><br />
 								<span class="smalltext">', $txt['custom_edit_active_desc'], '</span>
 							</dt>
 							<dd>
-								<input type="checkbox" name="active"', $context['field']['active'] ? ' checked="checked"' : '', ' class="input_check" />
+								<input type="checkbox" name="active" id="can_search_check"', $context['field']['active'] ? ' checked="checked"' : '', ' class="input_check" />
 							</dd>
 						</dl>
 					</fieldset>

+ 6 - 7
Themes/default/GenericMenu.template.php

@@ -127,11 +127,11 @@ function template_generic_menu_dropdown_above()
 	foreach ($menu_context['sections'] as $section)
 	{
 		echo '
-			<li><a class="', !empty($section['selected']) ? 'active ' : '', 'firstlevel" href="', $section['url'], $menu_context['extra_parameters'], '"><span class="firstlevel">', $section['title'] , '</span></a>
+			<li><a class="', !empty($section['selected']) ? 'active ' : '', '" href="', $section['url'], $menu_context['extra_parameters'], '">', $section['title'] , '</a>
 				<ul>';
 
 		// For every area of this section show a link to that area (bold if it's currently selected.)
-		$additional_items = 0;
+		// Note: Code for additional_items class was deprecated and has been removed. Suggest following up in Sources if required.
 		foreach ($section['areas'] as $i => $area)
 		{
 			// Not supposed to be printed?
@@ -139,17 +139,16 @@ function template_generic_menu_dropdown_above()
 				continue;
 
 			echo '
-					<li', (++$additional_items > 6 && !empty($area['subsections'])) ? ' class="additional_items subsections"' : (($additional_items > 6) ? ' class="additional_items"' : ((!empty($area['subsections'])) ? ' class="subsections"' : '')), '>';
+					<li ', !empty($area['subsections']) ? ' class="subsections"' : '', '>';
 
 			echo '
-						<a ', !empty($area['selected']) ? 'class="chosen" ' : '', 'href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '"><span>', $area['icon'], $area['label'], !empty($area['subsections']) ? '...' : '', '</span></a>';
+						<a ', !empty($area['selected']) ? 'class="chosen" ' : '', 'href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>';
 
 			// Is this the current area, or just some area?
 			if (!empty($area['selected']) && empty($context['tabs']))
 					$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
 
 			// Is there any subsections?
-			$additional_items_sub = 0;
 			if (!empty($area['subsections']))
 			{
 				echo '
@@ -163,8 +162,8 @@ function template_generic_menu_dropdown_above()
 					$url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa;
 
 					echo '
-							<li', (++$additional_items_sub > 6) ? ' class="additional_items"' : '' ,'>
-								<a ', !empty($sub['selected']) ? 'class="chosen" ' : '', 'href="', $url, $menu_context['extra_parameters'], '"><span>', $sub['label'], '</span></a>
+							<li ', !empty($area['subsections']) ? ' class="subsections"' : '', '>
+								<a ', !empty($sub['selected']) ? 'class="chosen" ' : '', 'href="', $url, $menu_context['extra_parameters'], '">', $sub['label'], '</a>
 							</li>';
 				}
 

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

@@ -34,24 +34,24 @@ function template_ban_edit()
 				<form action="', $scripturl, '?action=admin;area=ban;sa=edit" method="post" accept-charset="', $context['character_set'], '" onsubmit="if (this.ban_name.value == \'\') {alert(\'', $txt['ban_name_empty'], '\'); return false;} if (this.partial_ban.checked &amp;&amp; !(this.cannot_post.checked || this.cannot_register.checked || this.cannot_login.checked)) {alert(\'', $txt['ban_restriction_empty'], '\'); return false;}">
 					<dl class="settings">
 						<dt>
-							<strong>', $txt['ban_name'], ':</strong>
+							<strong><label for="ban_name">', $txt['ban_name'], ':</label></strong>
 						</dt>
 						<dd>
-							<input type="text" name="ban_name" value="', $context['ban']['name'], '" size="47" maxlength="60" class="input_text" />
+							<input type="text" name="ban_name" id="ban_name" value="', $context['ban']['name'], '" size="47" maxlength="60" class="input_text" />
 						</dd>
 						<dt>
-							<strong>', $txt['ban_reason'], ':</strong><br />
+							<strong><label for="reason">', $txt['ban_reason'], ':<label></strong><br />
 							<span class="smalltext">', $txt['ban_reason_desc'], '</span>
 						</dt>
 						<dd>
-							<textarea name="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea>
+							<textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea>
 						</dd>
 						<dt>
-							<strong>', $txt['ban_notes'], ':</strong><br />
+							<strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br />
 							<span class="smalltext">', $txt['ban_notes_desc'], '</span>
 						</dt>
 						<dd>
-							<textarea name="notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea>
+							<textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea>
 						</dd>
 					</dl>
 					<fieldset class="ban_settings floatleft">

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

@@ -275,34 +275,34 @@ function template_modify_language_entries()
 						<legend>', $context['primary_settings']['name'], '</legend>
 					<dl class="settings">
 						<dt>
-							', $txt['languages_character_set'], ':
+							<label for="character_set">', $txt['languages_character_set'], ':</label>
 						</dt>
 						<dd>
-							<input type="text" name="character_set" size="20" value="', $context['primary_settings']['character_set'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
+							<input type="text" name="character_set" id="character_set" size="20" value="', $context['primary_settings']['character_set'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
 						</dd>
 						<dt>
-							', $txt['languages_locale'], ':
+							<label for="locale>', $txt['languages_locale'], ':</label>
 						</dt>
 						<dd>
-							<input type="text" name="locale" size="20" value="', $context['primary_settings']['locale'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
+							<input type="text" name="locale" id="locale" size="20" value="', $context['primary_settings']['locale'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
 						</dd>
 						<dt>
-							', $txt['languages_dictionary'], ':
+							<label for="dictionary">', $txt['languages_dictionary'], ':</label>
 						</dt>
 						<dd>
-							<input type="text" name="dictionary" size="20" value="', $context['primary_settings']['dictionary'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
+							<input type="text" name="dictionary" id="dictionary" size="20" value="', $context['primary_settings']['dictionary'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
 						</dd>
 						<dt>
-							', $txt['languages_spelling'], ':
+							<label for="spelling">', $txt['languages_spelling'], ':</label>
 						</dt>
 						<dd>
-							<input type="text" name="spelling" size="20" value="', $context['primary_settings']['spelling'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
+							<input type="text" name="spelling" id="spelling" size="20" value="', $context['primary_settings']['spelling'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
 						</dd>
 						<dt>
-							', $txt['languages_rtl'], ':
+							<label for="rtl">', $txt['languages_rtl'], ':</label>
 						</dt>
 						<dd>
-							<input type="checkbox" name="rtl"', $context['primary_settings']['rtl'] ? ' checked="checked"' : '', ' class="input_check"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' />
+							<input type="checkbox" name="rtl" id="rtl" ', $context['primary_settings']['rtl'] ? ' checked="checked"' : '', ' class="input_check"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' />
 						</dd>
 					</dl>
 					</fieldset>

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

@@ -584,7 +584,7 @@ function template_group_members()
 				<div class="content">
 					<dl class="settings">
 						<dt>
-							<strong>', $txt['membergroups_members_add_desc'], ':</strong>
+							<strong><label for="toAdd">', $txt['membergroups_members_add_desc'], ':</strong></label>
 						</dt>
 						<dd>
 							<input type="text" name="toAdd" id="toAdd" value="" class="input_text" />

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

@@ -31,7 +31,7 @@ function template_search_members()
 						<div class="msearch_details floatleft">
 							<dl class="settings right">
 								<dt class="righttext">
-									<strong>', $txt['member_id'], ':</strong>
+									<strong><label for="mem_id">', $txt['member_id'], ':</label></strong>
 									<select name="types[mem_id]">
 										<option value="--">&lt;</option>
 										<option value="-">&lt;=</option>
@@ -41,10 +41,10 @@ function template_search_members()
 									</select>
 								</dt>
 								<dd>
-									<input type="text" name="mem_id" value="" size="6" class="input_text" />
+									<input type="text" name="mem_id" id="mem_id" value="" size="6" class="input_text" />
 								</dd>
 								<dt class="righttext">
-									<strong>', $txt['age'], ':</strong>
+									<strong><label for="age">', $txt['age'], ':</label></strong>
 									<select name="types[age]">
 										<option value="--">&lt;</option>
 										<option value="-">&lt;=</option>
@@ -54,10 +54,10 @@ function template_search_members()
 									</select>
 								</dt>
 								<dd>
-									<input type="text" name="age" value="" size="6" class="input_text" />
+									<input type="text" name="age" id="age" value="" size="6" class="input_text" />
 								</dd>
 								<dt class="righttext">
-									<strong>', $txt['member_postcount'], ':</strong>
+									<strong><label for="posts">', $txt['member_postcount'], ':</label></strong>
 									<select name="types[posts]">
 										<option value="--">&lt;</option>
 										<option value="-">&lt;=</option>
@@ -67,10 +67,10 @@ function template_search_members()
 									</select>
 								</dt>
 								<dd>
-									<input type="text" name="posts" value="" size="6" class="input_text" />
+									<input type="text" name="posts" id="posts" value="" size="6" class="input_text" />
 								</dd>
 								<dt class="righttext">
-									<strong>', $txt['date_registered'], ':</strong>
+									<strong><label for="reg_date">', $txt['date_registered'], ':</label></strong>
 									<select name="types[reg_date]">
 										<option value="--">&lt;</option>
 										<option value="-">&lt;=</option>
@@ -80,10 +80,10 @@ function template_search_members()
 									</select>
 								</dt>
 								<dd>
-									<input type="text" name="reg_date" value="" size="10" class="input_text" /><span class="smalltext">', $txt['date_format'], '</span>
+									<input type="text" name="reg_date" id="reg_date" value="" size="10" class="input_text" /><span class="smalltext">', $txt['date_format'], '</span>
 								</dd>
 								<dt class="righttext">
-									<strong>', $txt['viewmembers_online'], ':</strong>
+									<strong><label for="last_online">', $txt['viewmembers_online'], ':</label></strong>
 									<select name="types[last_online]">
 										<option value="--">&lt;</option>
 										<option value="-">&lt;=</option>
@@ -93,47 +93,47 @@ function template_search_members()
 									</select>
 								</dt>
 								<dd>
-									<input type="text" name="last_online" value="" size="10" class="input_text" /><span class="smalltext">', $txt['date_format'], '</span>
+									<input type="text" name="last_online" id="last_online" value="" size="10" class="input_text" /><span class="smalltext">', $txt['date_format'], '</span>
 								</dd>
 							</dl>
 						</div>
 						<div class="msearch_details floatright">
 							<dl class="settings right">
 								<dt class="righttext">
-									<strong>', $txt['username'], ':</strong>
+									<strong><label for="membername">', $txt['username'], ':</label></strong>
 								</dt>
 								<dd>
-									<input type="text" name="membername" value="" class="input_text" />
+									<input type="text" name="membername" id="membername" value="" class="input_text" />
 								</dd>
 								<dt class="righttext">
-									<strong>', $txt['email_address'], ':</strong>
+									<strong><label for="email">', $txt['email_address'], ':</label></strong>
 								</dt>
 								<dd>
-									<input type="text" name="email" value="" class="input_text" />
+									<input type="text" name="email" id="email" value="" class="input_text" />
 								</dd>
 								<dt class="righttext">
-									<strong>', $txt['website'], ':</strong>
+									<strong><label for="website">', $txt['website'], ':</label></strong>
 								</dt>
 								<dd>
-									<input type="text" name="website" value="" class="input_text" />
+									<input type="text" name="website" id="website" value="" class="input_text" />
 								</dd>
 								<dt class="righttext">
-									<strong>', $txt['location'], ':</strong>
+									<strong><label for="location">', $txt['location'], ':</label></strong>
 								</dt>
 								<dd>
-									<input type="text" name="location" value="" class="input_text" />
+									<input type="text" name="location" id="location" value="" class="input_text" />
 								</dd>
 								<dt class="righttext">
-									<strong>', $txt['ip_address'], ':</strong>
+									<strong><label for="ip">', $txt['ip_address'], ':</label></strong>
 								</dt>
 								<dd>
-									<input type="text" name="ip" value="" class="input_text" />
+									<input type="text" name="ip" id="ip" value="" class="input_text" />
 								</dd>
 								<dt class="righttext">
-									<strong>', $txt['messenger_address'], ':</strong>
+									<strong><label for="messenger">', $txt['messenger_address'], ':</label></strong>
 								</dt>
 								<dd>
-									<input type="text" name="messenger" value="" class="input_text" />
+									<input type="text" name="messenger" id="messenger" value="" class="input_text" />
 								</dd>
 							</dl>
 						</div>
@@ -209,7 +209,7 @@ function template_search_members()
 							<th class="last_th">&nbsp;</th>
 						</tr>
 					</thead>
-					</tbody>';
+					<tbody>';
 
 			foreach ($context['postgroups'] as $postgroup)
 				echo '

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

@@ -52,11 +52,11 @@ function template_edit_scheduled_tasks()
 							<span class="smalltext">', $context['task']['desc'], '</span>
 						</dd>
 						<dt>
-							<strong>', $txt['scheduled_task_edit_interval'], ':</strong>
+							<strong><label for="regularity">', $txt['scheduled_task_edit_interval'], ':</label></strong>
 						</dt>
 						<dd>
 							', $txt['scheduled_task_edit_repeat'], '
-							<input type="text" name="regularity" value="', empty($context['task']['regularity']) ? 1 : $context['task']['regularity'], '" onchange="if (this.value < 1) this.value = 1;" size="2" maxlength="2" class="input_text" />
+							<input type="text" name="regularity" id="regularity" value="', empty($context['task']['regularity']) ? 1 : $context['task']['regularity'], '" onchange="if (this.value < 1) this.value = 1;" size="2" maxlength="2" class="input_text" />
 							<select name="unit">
 								<option value="0">', $txt['scheduled_task_edit_pick_unit'], '</option>
 								<option value="0">---------------------</option>
@@ -67,14 +67,14 @@ function template_edit_scheduled_tasks()
 							</select>
 						</dd>
 						<dt>
-							<strong>', $txt['scheduled_task_edit_start_time'], ':</strong><br />
+							<strong><label for="start_time">', $txt['scheduled_task_edit_start_time'], ':</label></strong><br />
 							<span class="smalltext">', $txt['scheduled_task_edit_start_time_desc'], '</span>
 						</dt>
 						<dd>
-							<input type="text" name="offset" value="', $context['task']['offset_formatted'], '" size="6" maxlength="5" class="input_text" />
+							<input type="text" name="offset" id="start_time" value="', $context['task']['offset_formatted'], '" size="6" maxlength="5" class="input_text" />
 						</dd>
 						<dt>
-							<strong>', $txt['scheduled_tasks_enabled'], ':</strong>
+							<strong><label for="enabled">', $txt['scheduled_tasks_enabled'], ':</label></strong>
 						</dt>
 						<dd>
 							<input type="checkbox" name="enabled" id="enabled" ', !$context['task']['disabled'] ? 'checked="checked"' : '', ' class="input_check" />

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

@@ -25,48 +25,48 @@ function template_modify_weights()
 				<div class="content">
 					<dl class="settings">
 						<dt class="large_caption">
-							<a href="', $scripturl, '?action=helpadmin;help=search_weight_frequency" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a>
-							', $txt['search_weight_frequency'], ':
+							<a href="', $scripturl, '?action=helpadmin;help=search_weight_frequency" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a><label for="weight1_val">
+							', $txt['search_weight_frequency'], ':</label>
 						</dt>
 						<dd class="large_caption">
 							<span class="search_weight"><input type="text" name="search_weight_frequency" id="weight1_val" value="', empty($modSettings['search_weight_frequency']) ? '0' : $modSettings['search_weight_frequency'], '" onchange="calculateNewValues()" size="3" class="input_text" /></span>
 							<span id="weight1" class="search_weight">', $context['relative_weights']['search_weight_frequency'], '%</span>
 						</dd>
 						<dt class="large_caption">
-							<a href="', $scripturl, '?action=helpadmin;help=search_weight_age" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a>
-							', $txt['search_weight_age'], ':
+							<a href="', $scripturl, '?action=helpadmin;help=search_weight_age" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a><label for="weight2_val">
+							', $txt['search_weight_age'], ':</label>
 						</dt>
 						<dd class="large_caption">
 							<span class="search_weight"><input type="text" name="search_weight_age" id="weight2_val" value="', empty($modSettings['search_weight_age']) ? '0' : $modSettings['search_weight_age'], '" onchange="calculateNewValues()" size="3" class="input_text" /></span>
 							<span id="weight2" class="search_weight">', $context['relative_weights']['search_weight_age'], '%</span>
 						</dd>
 						<dt class="large_caption">
-							<a href="', $scripturl, '?action=helpadmin;help=search_weight_length" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a>
-							', $txt['search_weight_length'], ':
+							<a href="', $scripturl, '?action=helpadmin;help=search_weight_length" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a><label for="weight3_val">
+							', $txt['search_weight_length'], ':</label>
 						</dt>
 						<dd class="large_caption">
 							<span class="search_weight"><input type="text" name="search_weight_length" id="weight3_val" value="', empty($modSettings['search_weight_length']) ? '0' : $modSettings['search_weight_length'], '" onchange="calculateNewValues()" size="3" class="input_text" /></span>
 							<span id="weight3" class="search_weight">', $context['relative_weights']['search_weight_length'], '%</span>
 						</dd>
 						<dt class="large_caption">
-							<a href="', $scripturl, '?action=helpadmin;help=search_weight_subject" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a>
-							', $txt['search_weight_subject'], ':
+							<a href="', $scripturl, '?action=helpadmin;help=search_weight_subject" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a><label for="weight4_val">
+							', $txt['search_weight_subject'], ':</label>
 						</dt>
 						<dd class="large_caption">
 							<span class="search_weight"><input type="text" name="search_weight_subject" id="weight4_val" value="', empty($modSettings['search_weight_subject']) ? '0' : $modSettings['search_weight_subject'], '" onchange="calculateNewValues()" size="3" class="input_text" /></span>
 							<span id="weight4" class="search_weight">', $context['relative_weights']['search_weight_subject'], '%</span>
 						</dd>
 						<dt class="large_caption">
-							<a href="', $scripturl, '?action=helpadmin;help=search_weight_first_message" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a>
-							', $txt['search_weight_first_message'], ':
+							<a href="', $scripturl, '?action=helpadmin;help=search_weight_first_message" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a><label for="weight5_val">
+							', $txt['search_weight_first_message'], ':</label>
 						</dt>
 						<dd class="large_caption">
 							<span class="search_weight"><input type="text" name="search_weight_first_message" id="weight5_val" value="', empty($modSettings['search_weight_first_message']) ? '0' : $modSettings['search_weight_first_message'], '" onchange="calculateNewValues()" size="3" class="input_text" /></span>
 							<span id="weight5" class="search_weight">', $context['relative_weights']['search_weight_first_message'], '%</span>
 						</dd>
 						<dt class="large_caption">
-							<a href="', $scripturl, '?action=helpadmin;help=search_weight_frequency" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a>
-							', $txt['search_weight_sticky'], ':
+							<a href="', $scripturl, '?action=helpadmin;help=search_weight_frequency" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" align="top" /></a><label for="weight6_val">
+							', $txt['search_weight_sticky'], ':</label>
 						</dt>
 						<dd class="large_caption">
 							<span class="search_weight"><input type="text" name="search_weight_sticky" id="weight6_val" value="', empty($modSettings['search_weight_sticky']) ? '0' : $modSettings['search_weight_sticky'], '" onchange="calculateNewValues()" size="3" class="input_text" /></span>
@@ -348,25 +348,25 @@ function template_spider_edit()
 				<div class="content">
 					<dl class="settings">
 						<dt>
-							<strong>', $txt['spider_name'], ':</strong><br />
+							<strong><label for="spider_name">', $txt['spider_name'], ':</label></strong><br />
 							<span class="smalltext">', $txt['spider_name_desc'], '</span>
 						</dt>
 						<dd>
-							<input type="text" name="spider_name" value="', $context['spider']['name'], '" class="input_text" />
+							<input type="text" name="spider_name" id="spider_name" value="', $context['spider']['name'], '" class="input_text" />
 						</dd>
 						<dt>
-							<strong>', $txt['spider_agent'], ':</strong><br />
+							<strong><label for="spider_agent">', $txt['spider_agent'], ':</label></strong><br />
 							<span class="smalltext">', $txt['spider_agent_desc'], '</span>
 						</dt>
 						<dd>
-							<input type="text" name="spider_agent" value="', $context['spider']['agent'], '" class="input_text" />
+							<input type="text" name="spider_agent" id="spider_agent" value="', $context['spider']['agent'], '" class="input_text" />
 						</dd>
 						<dt>
-							<strong>', $txt['spider_ip_info'], ':</strong><br />
+							<strong><label for="spider_ip">', $txt['spider_ip_info'], ':</label></strong><br />
 							<span class="smalltext">', $txt['spider_ip_info_desc'], '</span>
 						</dt>
 						<dd>
-							<textarea name="spider_ip" rows="4" cols="20">', $context['spider']['ip_info'], '</textarea>
+							<textarea name="spider_ip" id="spider_ip" rows="4" cols="20">', $context['spider']['ip_info'], '</textarea>
 						</dd>
 					</dl>
 					<hr class="hrcolor" />

+ 2 - 7
Themes/default/Memberlist.template.php

@@ -46,13 +46,8 @@ function template_main()
 	// Display each of the column headers of the table.
 	foreach ($context['columns'] as $column)
 	{
-		// We're not able (through the template) to sort the search results right now...
-		if (isset($context['old_search']))
-			echo '
-					<th scope="col" class="', isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' width="' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '>
-						', $column['label'], '</th>';
 		// This is a selected column, so underline it or some such.
-		elseif ($column['selected'])
+		if ($column['selected'])
 			echo '
 					<th scope="col" class="', isset($column['class']) ? ' ' . $column['class'] : '', '" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . ' nowrap="nowrap">
 						<a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.png" alt="" /></a></th>';
@@ -194,7 +189,7 @@ function template_search()
 							<label><strong>', $txt['search_for'], ':</strong></label>
 						</dt>
 						<dd>
-							<input type="text" name="search" value="', $context['old_search'], '" size="42" class="input_text" />
+							<input type="text" name="search" value="', $context['old_search'], '" size="40" class="input_text" />
 						</dd>
 						<dt>
 							<label><strong>', $txt['mlist_search_filter'], ':</strong></label>

+ 9 - 1
Themes/default/PersonalMessage.template.php

@@ -612,16 +612,24 @@ function template_subject_list()
 					<option value="" disabled="disabled">---------------</option>';
 
 			echo '
-									<option value="" disabled="disabled">', $txt['pm_msg_label_apply'], ':</option>';
+					<option value="" disabled="disabled">', $txt['pm_msg_label_apply'], ':</option>';
+					
 			foreach ($context['labels'] as $label)
+			{
 				if ($label['id'] != $context['current_label_id'])
 					echo '
 					<option value="add_', $label['id'], '">&nbsp;', $label['name'], '</option>';
+			}
+			
 			echo '
 					<option value="" disabled="disabled">', $txt['pm_msg_label_remove'], ':</option>';
+					
 			foreach ($context['labels'] as $label)
+			{
 				echo '
 					<option value="rem_', $label['id'], '">&nbsp;', $label['name'], '</option>';
+			}
+			
 			echo '
 				</select>
 				<noscript>

+ 19 - 168
Themes/default/Profile.template.php

@@ -1246,7 +1246,7 @@ function template_edit_options()
 		{
 			echo '
 						<dt>
-							<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['label'], '</strong>';
+							<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
 
 			// Does it have any subtext to show?
 			if (!empty($field['subtext']))
@@ -1351,16 +1351,16 @@ function template_edit_options()
 		echo '
 					<dl>
 						<dt>
-							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br />
+							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br />
 							<span class="smalltext">', $txt['required_security_reasons'], '</span>
 						</dt>
 						<dd>
-							<input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
+							<input type="password" name="oldpasswrd" id="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
 						</dd>
 					</dl>';
 
 	echo '
-					<hr class="hrcolor">';
+					<hr class="hrcolor" />';
 
 	// The button shouldn't say "Change profile" unless we're changing the profile...
 	if (!empty($context['submit_button_text']))
@@ -2305,19 +2305,19 @@ function template_issueWarning()
 				<hr />
 				<dl class="settings">
 					<dt>
-						<strong>', $txt['profile_warning_notify'], ':</strong>
+						<strong><label for="warn_notify">', $txt['profile_warning_notify'], ':</label></strong>
 					</dt>
 					<dd>
 						<input type="checkbox" name="warn_notify" id="warn_notify" onclick="modifyWarnNotify();" ', $context['warning_data']['notify'] ? 'checked="checked"' : '', ' class="input_check" />
 					</dd>
 					<dt>
-						<strong>', $txt['profile_warning_notify_subject'], ':</strong>
+						<strong><label for="warn_sub">', $txt['profile_warning_notify_subject'], ':</label></strong>
 					</dt>
 					<dd>
 						<input type="text" name="warn_sub" id="warn_sub" value="', empty($context['warning_data']['notify_subject']) ? $txt['profile_warning_notify_template_subject'] : $context['warning_data']['notify_subject'], '" size="50" style="width: 80%;" class="input_text" />
 					</dd>
 					<dt>
-						<strong>', $txt['profile_warning_notify_body'], ':</strong>
+						<strong><label for="warn_temp">', $txt['profile_warning_notify_body'], ':</label></strong>
 					</dt>
 					<dd>
 						<select name="warn_temp" id="warn_temp" disabled="disabled" onchange="populateNotifyTemplate();" style="font-size: x-small;">
@@ -2664,37 +2664,7 @@ function template_profile_signature_modify()
 	// Some javascript used to count how many characters have been used so far in the signature.
 	echo '
 								<script type="text/javascript"><!-- // --><![CDATA[
-									function tick()
-									{
-										if (typeof(document.forms.creator) != "undefined")
-										{
-											calcCharLeft();
-											setTimeout("tick()", 1000);
-										}
-										else
-											setTimeout("tick()", 800);
-									}
-
-									function calcCharLeft()
-									{
-										var maxLength = ', $context['signature_limits']['max_length'], ';
-										var oldSignature = "", currentSignature = document.forms.creator.signature.value;
-
-										if (!document.getElementById("signatureLeft"))
-											return;
-
-										if (oldSignature != currentSignature)
-										{
-											oldSignature = currentSignature;
-
-											if (currentSignature.replace(/\r/, "").length > maxLength)
-												document.forms.creator.signature.value = currentSignature.replace(/\r/, "").substring(0, maxLength);
-											currentSignature = document.forms.creator.signature.value.replace(/\r/, "");
-										}
-
-										setInnerHTML(document.getElementById("signatureLeft"), maxLength - currentSignature.length);
-									}
-
+									var maxLength = ', $context['signature_limits']['max_length'], ';
 									addLoadEvent(tick);
 								// ]]></script>
 							</dd>';
@@ -2707,7 +2677,7 @@ function template_profile_avatar_select()
 	// Start with the upper menu
 	echo '
 							<dt>
-								<strong id="personal_picture">', $txt['personal_picture'], '</strong>
+								<strong id="personal_picture"><label for="avatar_upload_box">', $txt['personal_picture'], '</label></strong>
 								<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_none" value="none"' . ($context['member']['avatar']['choice'] == 'none' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_none"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['no_avatar'] . '</label><br />
 								', !empty($context['member']['avatar']['allow_server_stored']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_server_stored" value="server_stored"' . ($context['member']['avatar']['choice'] == 'server_stored' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_server_stored"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['choose_avatar_gallery'] . '</label><br />' : '', '
 								', !empty($context['member']['avatar']['allow_external']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_external" value="external"' . ($context['member']['avatar']['choice'] == 'external' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_external"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['my_own_pic'] . '</label><br />' : '', '
@@ -2741,97 +2711,14 @@ function template_profile_avatar_select()
 										var avatardir = "' . $modSettings['avatar_url'] . '/";
 										var size = avatar.alt.substr(3, 2) + " " + avatar.alt.substr(0, 2) + String.fromCharCode(117, 98, 116);
 										var file = document.getElementById("file");
+										var maxHeight = ', !empty($modSettings['avatar_max_height_external']) ? $modSettings['avatar_max_height_external'] : 0, ';
+										var maxWidth = ', !empty($modSettings['avatar_max_width_external']) ? $modSettings['avatar_max_width_external'] : 0, ';
 
 										if (avatar.src.indexOf("blank.png") > -1)
 											changeSel(selavatar);
 										else
 											previewExternalAvatar(avatar.src)
 
-										function changeSel(selected)
-										{
-											if (cat.selectedIndex == -1)
-												return;
-
-											if (cat.options[cat.selectedIndex].value.indexOf("/") > 0)
-											{
-												var i;
-												var count = 0;
-
-												file.style.display = "inline";
-												file.disabled = false;
-
-												for (i = file.length; i >= 0; i = i - 1)
-													file.options[i] = null;
-
-												for (i = 0; i < files.length; i++)
-													if (files[i].indexOf(cat.options[cat.selectedIndex].value) == 0)
-													{
-														var filename = files[i].substr(files[i].indexOf("/") + 1);
-														var showFilename = filename.substr(0, filename.lastIndexOf("."));
-														showFilename = showFilename.replace(/[_]/g, " ");
-
-														file.options[count] = new Option(showFilename, files[i]);
-
-														if (filename == selected)
-														{
-															if (file.options.defaultSelected)
-																file.options[count].defaultSelected = true;
-															else
-																file.options[count].selected = true;
-														}
-
-														count++;
-													}
-
-												if (file.selectedIndex == -1 && file.options[0])
-													file.options[0].selected = true;
-
-												showAvatar();
-											}
-											else
-											{
-												file.style.display = "none";
-												file.disabled = true;
-												document.getElementById("avatar").src = avatardir + cat.options[cat.selectedIndex].value;
-												document.getElementById("avatar").style.width = "";
-												document.getElementById("avatar").style.height = "";
-											}
-										}
-
-										function showAvatar()
-										{
-											if (file.selectedIndex == -1)
-												return;
-
-											document.getElementById("avatar").src = avatardir + file.options[file.selectedIndex].value;
-											document.getElementById("avatar").alt = file.options[file.selectedIndex].text;
-											document.getElementById("avatar").alt += file.options[file.selectedIndex].text == size ? "!" : "";
-											document.getElementById("avatar").style.width = "";
-											document.getElementById("avatar").style.height = "";
-										}
-
-										function previewExternalAvatar(src)
-										{
-											if (!document.getElementById("avatar"))
-												return;
-
-											var maxHeight = ', !empty($modSettings['avatar_max_height_external']) ? $modSettings['avatar_max_height_external'] : 0, ';
-											var maxWidth = ', !empty($modSettings['avatar_max_width_external']) ? $modSettings['avatar_max_width_external'] : 0, ';
-											var tempImage = new Image();
-
-											tempImage.src = src;
-											if (maxWidth != 0 && tempImage.width > maxWidth)
-											{
-												document.getElementById("avatar").style.height = parseInt((maxWidth * tempImage.height) / tempImage.width) + "px";
-												document.getElementById("avatar").style.width = maxWidth + "px";
-											}
-											else if (maxHeight != 0 && tempImage.height > maxHeight)
-											{
-												document.getElementById("avatar").style.width = parseInt((maxHeight * tempImage.width) / tempImage.height) + "px";
-												document.getElementById("avatar").style.height = maxHeight + "px";
-											}
-											document.getElementById("avatar").src = src;
-										}
 									// ]]></script>
 								</div>';
 	}
@@ -2851,7 +2738,7 @@ function template_profile_avatar_select()
 	{
 		echo '
 								<div id="avatar_upload">
-									<input type="file" size="44" name="attachment" value="" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'upload\');" class="input_file" />
+									<input type="file" size="44" name="attachment" id="avatar_upload_box" value="" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'upload\');" class="input_file" />
 									', ($context['member']['avatar']['id_attach'] > 0 ? '<br /><br /><img src="' . $context['member']['avatar']['href'] . (strpos($context['member']['avatar']['href'], '?') === false ? '?' : '&amp;') . 'time=' . time() . '" alt="" /><input type="hidden" name="id_attach" value="' . $context['member']['avatar']['id_attach'] . '" />' : ''), '
 								</div>';
 	}
@@ -2915,19 +2802,19 @@ function template_profile_timeformat_modify()
 
 	echo '
 							<dt>
-								<strong>', $txt['time_format'], ':</strong><br />
+								<strong><label for="easyformat">', $txt['time_format'], ':</label></strong><br />
 								<a href="', $scripturl, '?action=helpadmin;help=time_format" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" class="floatleft" /></a>
-								<span class="smalltext">&nbsp;', $txt['date_format'], '</span>
+								<span class="smalltext">&nbsp;<label for="time_format">', $txt['date_format'], '</label></span>
 							</dt>
 							<dd>
-								<select name="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">';
+								<select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">';
 	// Help the user by showing a list of common time formats.
 	foreach ($context['easy_timeformats'] as $time_format)
 		echo '
 									<option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected="selected"' : '', '>', $time_format['title'], '</option>';
 	echo '
 								</select><br />
-								<input type="text" name="time_format" value="', $context['member']['time_format'], '" size="30" class="input_text" />
+								<input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30" class="input_text" />
 							</dd>';
 }
 
@@ -2938,7 +2825,7 @@ function template_profile_timeoffset_modify()
 
 	echo '
 							<dt>
-								<strong', (isset($context['modify_error']['bad_offset']) ? ' class="error"' : ''), '>', $txt['time_offset'], ':</strong><br />
+								<strong', (isset($context['modify_error']['bad_offset']) ? ' class="error"' : ''), '><label for="time_offset">', $txt['time_offset'], ':</label></strong><br />
 								<span class="smalltext">', $txt['personal_time_offset'], '</span>
 							</dt>
 							<dd>
@@ -2967,10 +2854,10 @@ function template_profile_smiley_pick()
 
 	echo '
 							<dt>
-								<strong>', $txt['smileys_current'], ':</strong>
+								<strong><label for="smiley_set">', $txt['smileys_current'], ':</label></strong>
 							</dt>
 							<dd>
-								<select name="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.png\';">';
+								<select name="smiley_set" id="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.png\';">';
 	foreach ($context['smiley_sets'] as $set)
 		echo '
 									<option value="', $set['id'], '"', $set['selected'] ? ' selected="selected"' : '', '>', $set['name'], '</option>';
@@ -3073,44 +2960,8 @@ function template_authentication_method()
 	};
 	var verificationHandle = new smfRegister("creator", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
 	var currentAuthMethod = \'passwd\';
-	function updateAuthMethod()
-	{
-		// What authentication method is being used?
-		if (!document.getElementById(\'auth_openid\') || !document.getElementById(\'auth_openid\').checked)
-			currentAuthMethod = \'passwd\';
-		else
-			currentAuthMethod = \'openid\';
-
-		// No openID?
-		if (!document.getElementById(\'auth_openid\'))
-			return true;
-
-		document.forms.creator.openid_url.disabled = currentAuthMethod == \'openid\' ? false : true;
-		document.forms.creator.smf_autov_pwmain.disabled = currentAuthMethod == \'passwd\' ? false : true;
-		document.forms.creator.smf_autov_pwverify.disabled = currentAuthMethod == \'passwd\' ? false : true;
-		document.getElementById(\'smf_autov_pwmain_div\').style.display = currentAuthMethod == \'passwd\' ? \'\' : \'none\';
-		document.getElementById(\'smf_autov_pwverify_div\').style.display = currentAuthMethod == \'passwd\' ? \'\' : \'none\';
-
-		if (currentAuthMethod == \'passwd\')
-		{
-			verificationHandle.refreshMainPassword();
-			verificationHandle.refreshVerifyPassword();
-			document.forms.creator.openid_url.style.backgroundColor = \'\';
-			document.getElementById("auth_openid_div").style.display = "none";
-			document.getElementById("auth_pass_div").style.display = "";
-		}
-		else
-		{
-			document.forms.creator.smf_autov_pwmain.style.backgroundColor = \'\';
-			document.forms.creator.smf_autov_pwverify.style.backgroundColor = \'\';
-			document.forms.creator.openid_url.style.backgroundColor = \'#FCE184\';
-			document.getElementById("auth_openid_div").style.display = "";
-			document.getElementById("auth_pass_div").style.display = "none";
-		}
-	}
 	updateAuthMethod();
 	// ]]></script>';
 }
 
-
 ?>

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

@@ -67,10 +67,10 @@ function template_main()
 			<div class="roundframe">
 				<dl class="settings" id="search_options">
 					<dt class="righttext">
-						<strong>', $txt['search_for'], ':</strong>
+						<strong><label for="searchfor">', $txt['search_for'], ':</label></strong>
 					</dt>
 					<dd>
-						<input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text" />';
+						<input type="text" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text" />';
 		
 		if (empty($modSettings['search_simple_fulltext']))
 			echo '
@@ -79,23 +79,23 @@ function template_main()
 		echo '
 					</dd>
 
-					<dt class="righttext">',
-						$txt['search_match'], ':
+					<dt class="righttext"><label for="searchtype">',
+						$txt['search_match'], ':</label>
 					</dt>
 					<dd>
-						<select name="searchtype">
+						<select name="searchtype" id="searchtype">
 							<option value="1"', empty($context['search_params']['searchtype']) ? ' selected="selected"' : '', '>', $txt['all_words'], '</option>
 							<option value="2"', !empty($context['search_params']['searchtype']) ? ' selected="selected"' : '', '>', $txt['any_words'], '</option>
 						</select>
 					</dd>
-					<dt class="righttext">',
-						$txt['by_user'], ':
+					<dt class="righttext"><label for="userspec">',
+						$txt['by_user'], ':</label>
 					</dt>
 					<dd>
 						<input id="userspec" type="text" name="userspec" value="', empty($context['search_params']['userspec']) ? '*' : $context['search_params']['userspec'], '" size="40" class="input_text" />
 					</dd>
-					<dt class="righttext">', 
-						$txt['search_order'], ':
+					<dt class="righttext"><label for="sort">', 
+						$txt['search_order'], ':</label>
 					</dt>
 					<dd>
 						<select id="sort" name="sort">
@@ -120,8 +120,8 @@ function template_main()
 					<dt class="righttext between">', 
 						$txt['search_post_age'], ':
 					</dt>
-					<dd>', 
-						$txt['search_between'], ' <input type="text" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="4" class="input_text" />&nbsp;', $txt['search_and'], '&nbsp;<input type="text" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="4" class="input_text" /> ', $txt['days_word'], '
+					<dd><label for="minage">', 
+						$txt['search_between'], '</label><input type="text" name="minage" id="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="4" class="input_text" />&nbsp;<label for="maxage">', $txt['search_and'], '&nbsp;</label><input type="text" name="maxage" id="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="4" class="input_text" /> ', $txt['days_word'], '
 					</dd>
 				</dl>
 				</fieldset>

+ 130 - 112
Themes/default/css/index.css

@@ -131,6 +131,32 @@ input:focus, textarea:focus, button:focus, select:focus
 {
 	border: 1px solid #454545;
 }
+/* Lotsa new stuff innit */
+/* Nifty input focus styling from Mollyhawk pages. */
+
+input, select, textarea, textarea.editor {
+	background: #fff;
+	outline:none !important;
+	border: 1px solid #bbb;
+	vertical-align: top;
+	border-radius: 3px;
+	box-shadow: 0 2px 5px rgba(0,0,0,0.05) inset;
+}
+input:hover, select:hover, textarea:hover, textarea.editor:hover {
+	outline:none !important;
+	border: 1px solid #999;
+}
+textarea:hover, textarea.editor:hover {
+	background: #fbfbfb;
+}
+input:focus, select:focus, textarea:focus, textarea.editor:focus {
+	outline:none !important;
+	border: 1px solid #999;
+	box-shadow: 0 2px 5px rgba(0,0,0,0.1) inset;
+}
+select option {padding: 0.1em 0.3em 0.1em 0.3em;}
+/* End lotsa new stuff */
+
 .button_link
 {
 	background: #cde7ff url(../images/theme/submit_bg.png) no-repeat;
@@ -154,19 +180,20 @@ a.button_link
 }
 
 /* the new "button" */
-a.new_posts:hover
-{
-	text-decoration: none;
-}
-span.new_posts
+a.new_posts
 {
 	padding: 0 4px 1px 4px;
-	background-color: #ff8300;
+	background: orange;
 	color: #fff;
 	font-size: .7em;
 	font-weight: bold;
+	line-height: 1.1em;
 	border-radius: 2px;
 }
+a.new_posts:hover
+{
+	text-decoration: none;
+}
 
 /* All input elements that are checkboxes or radio buttons shouldn't have a border around them. */
 input.input_check, input.input_radio
@@ -1145,157 +1172,148 @@ span.lowerframe span
 ------------------------------------------------------- */
 #main_menu
 {
-	padding: 0 0.5em;
+	margin: 0 0 0 0;
+	padding: 0 0 0 0;
 	float: left;
-	margin: 0;
-	width: 98%;
-}
-
-.dropmenu, .dropmenu ul
-{
-	list-style: none;
-	line-height: 1em;
-	padding: 0;
-	margin: 0;
+	width: 100%;
 }
 .dropmenu
 {
-	padding: 0 0.5em;
-}
-.dropmenu a
-{
-	display: block;
-	color: #000;
-	text-decoration: none;
-}
-.dropmenu a span
-{
-	display: block;
-	padding: 0 0 0 5px;
-	font-size: 0.9em;
-}
-/* the background's first level only */
-.dropmenu li a.firstlevel
-{
-	margin-right: 8px;
-}
-.dropmenu li a.firstlevel span.firstlevel
-{
-	display: block;
-	position: relative;
-	left: -5px;
-	padding-left: 5px;
-	height: 22px;
-	line-height: 19px;
-	white-space: pre;
+	margin: 0 0 0 0;
+	padding: 0 0 0 0;
+	float: left;
 }
+/* Level 1 button background. */
 .dropmenu li
 {
+	margin: 0 2px 0 2px;
+	padding: 0 0 0.4em 0;
+	list-style: none;
 	float: left;
-	padding: 0;
-	margin: 0;
+	font-size: 0.9em;
+	line-height: 2em;
 	position: relative;
 }
-.dropmenu li ul
-{
-    z-index: 90;
-    display: none;
-    position: absolute;
-    left: -6px;
-    width: 17em;
-    font-weight: normal;
-    background: #fff url(../images/theme/menu_gfx.png) -30px -137px repeat-x;
-    border: solid 1px #999;
-    border-radius: 4px;
-    box-shadow: 1px 2px 2px 1px #999;
-    padding: 6px 0px 2px 0;
-}
-.dropmenu li li
-{
-	width: 17em;
-	margin: 0;	
-}
-.dropmenu li li a span
+.dropmenu li a
 {
+	padding: 0 5px 0 5px;
+	margin: 0 0 0 0;
 	display: block;
-	padding: 8px;		
-}
-.dropmenu li ul ul
-{
-    margin: -2.2em 0 0 15em;
-    padding: 2px 0;
+	border-radius: 4px;
 }
-
-/* the active button */
+/* Level 1 active button. */
 .dropmenu li a.active
 {
-	background: url(../images/theme/menu_gfx.png) no-repeat 100% 0;
+	background: orange;
 	color: #fff;
 	font-weight: bold;
 }
-.dropmenu li a.active span.firstlevel
-{
-	background: url(../images/theme/menu_gfx.png) no-repeat 0 0;
-}
-/* the hover effects */
-.dropmenu li a.firstlevel:hover, .dropmenu li:hover a.firstlevel
+/* Level 1 hover effects. */
+.dropmenu li a:hover, .dropmenu li:hover a, .dropmenu li a:focus
 {
-	background: url(../images/theme/menu_gfx.png) no-repeat 100% -30px;
+	background: #597b9f;
 	color: #fff;
 	cursor: pointer;
 	text-decoration: none;
 }
-.dropmenu li a.firstlevel:hover span.firstlevel, .dropmenu li:hover a.firstlevel span.firstlevel
+/* If we feel like styling the active state separately. */
+.dropmenu li a:active {}
+/* Levels 2 and 3 submenu wrapper. */
+.dropmenu li ul
 {
-	background: url(../images/theme/menu_gfx.png) no-repeat 0 -30px;
-}
-/* the hover effects on level2 and 3 */
-.dropmenu li li a:hover, .dropmenu li li:hover>a
+	z-index: 90;
+	position: absolute;
+	top: 2.2em;
+	left: -999em;
+	width: 17em;
+	font-weight: normal;
+	font-size: 1.1em;
+	background: #fff url(../images/theme/menu_gfx.png) -30px -137px repeat-x;
+	border: solid 1px #999;
+	border-radius: 4px;
+	/* Note: Using a black rgba box-shadow with suitable
+	alpha value gives the best effect on any background. */
+	box-shadow: 1px 2px 2px rgba(0,0,0,0.3);
+	padding: 6px 0 4px 0;
+}
+/* Level 2 link background. */
+.dropmenu li li
 {
-	background: #d4dbe4;
-	color: #000;
-	text-decoration: none;
+	margin: 0 0 0 0;
+	padding: 0 0 0 0;
+	position: relative;
+	float: none;
 }
-.dropmenu li:hover ul ul, .dropmenu li.sfhover ul ul, .dropmenu li:hover ul ul ul, .dropmenu li.sfhover ul ul ul
+/* Note: The next two declarations are for keyboard access with js disabled. */
+.dropmenu ul a:focus
 {
-	top: -999em;
+	margin-left: 1109.5em;
+	width: 17.8em;
 }
-.dropmenu li li:hover ul, .dropmenu li li.sfhover ul
+.dropmenu ul ul a:focus
 {
-	top: auto;
+	margin-left: 2228em;
 }
-.dropmenu li:hover ul, .dropmenu li.sfhover ul, .dropmenu ul ul
+.dropmenu li:hover li a, .dropmenu li.sfhover li a
 {
+	margin: 0 0 0 0;
+	padding: 0 0.5em 0 0.5em;
 	display: block;
-	top: 21px;
-	left: -5px;
+	border-radius: 0;
+	/* Necessary to allow highlighting of 1st level while hovering over submenu. */
+	background: none;
+	color: #346;
 }
-/* These two declarations are necessary for keyboard access with js disabled. */ 
-.dropmenu ul a:focus {
-	margin-left: 9999px;
+/* Level 3 submenu wrapper positioning. */
+.dropmenu li ul ul
+{
+	margin: -2.2em 0 0 15em;
 }
-.dropmenu ul a:focus span 
+/* Levels 2 and 3 hover effects. */
+.dropmenu li li:hover, .dropmenu li li:hover>a, .dropmenu li li a:focus, .dropmenu li li.subsections a:focus
 {
-	width: 17em;
-	white-space: pre;
 	background: #d4dbe4;
+	color: #333;
+	text-decoration: none;
 }
-/* This declaration is necessary to reset the margin when js is active. */
-.dropmenu ul li.sfhover a:focus 
+/* If we feel like styling the active state separately. */
+.dropmenu li li a:active, .dropmenu li li:hover>a:active {}
+/* Reposition Level 2 submenu as visible on hover. */
+.dropmenu li:hover ul, .dropmenu li.sfhover ul
 {
-	margin-left: 0;
+	left: -4px;
 }
-.dropmenu li li.additional_items
+/* Hiding Level 3 submenu off hover. */
+.dropmenu li:hover ul ul, .dropmenu li.sfhover ul ul, .dropmenu li:hover ul ul ul, .dropmenu li.sfhover ul ul ul
+{
+	left: -999em;
+}
+/* Reposition as visible on hover. */
+.dropmenu li li:hover ul, .dropmenu li li.sfhover ul
+{
+	left: auto;
+}
+/* Note: The additonal_items class was only added due to menu_gfx.png being the only background of the submenu and having limited height. */
+/* Can probably be removed as we wont be relying solely on the image in 2.1, and therefore height is effectively unlimited. */
+/* Code for additional items styling has been removed from GenericMenu.template.php with no obvious ill effects. */
+/*.dropmenu li li.additional_items
 {
 	background: #fff;
+}*/
+/* Indicator for additonal levels. Best in the anchor so it stays visible on hover. */
+.dropmenu li li.subsections a
+{
+	background: url(../images/admin/subsection.png) no-repeat 99% 40%;
 }
-.dropmenu li li.subsections
-{    
-	background: url(../images/admin/subsection.png) no-repeat 98% center;
+/* Stops inheritance of indicator icon if there is no fourth level. */
+.dropmenu li li.subsections li a
+{
+	background: none;
 }
+/* Highlighting of current section */
 .dropmenu li li a.chosen
 {
-    font-weight: bold;
+	font-weight: bold;
 }
 
 /* The dropdown menu toggle image */

+ 36 - 7
Themes/default/css/rtl.css

@@ -129,23 +129,52 @@ tr.titlebg th.last_th
 ------------------------------------------------------- */
 #main_menu
 {
-	padding: 0 0.5em;
 	float: right;
-	text-align: right;
+}
+.dropmenu
+{
+	float: right;
 }
 .dropmenu li
 {
 	float: right;
-	margin: 0 0 0 8px;
 }
+.dropmenu li ul
+{
+	right: -999em;
+	background: #fff url(../images/theme/menu_gfx.png) -30px -137px repeat-x;
+	/* Note: Using a black rgba box-shadow with suitable
+	alpha value gives the best effect on any background. */
+	box-shadow: -1px 2px 2px rgba(0,0,0,0.3);
+}
+/* Note: The next two declarations are for keyboard access with js disabled. */
+.dropmenu ul a:focus
+{
+	margin-right: 1109.5em;
+}
+.dropmenu ul ul a:focus
+{
+	margin-right: 2228em;
+}
+/* Level 3 submenu wrapper positioning. */
 .dropmenu li ul ul
 {
-	right: 15em;
+	margin: -2.2em 15em 0 0;
 }
-.dropmenu li ul
+/* Reposition Level 2 submenu as visible on hover. */
+.dropmenu li:hover ul, .dropmenu li.sfhover ul
+{
+	right: -4px;
+}
+/* Hiding Level 3 submenu off hover. */
+.dropmenu li:hover ul ul, .dropmenu li.sfhover ul ul, .dropmenu li:hover ul ul ul, .dropmenu li.sfhover ul ul ul
+{
+	right: -999em;
+}
+/* Reposition as visible on hover. */
+.dropmenu li li:hover ul, .dropmenu li li.sfhover ul
 {
-	background: url(../images/theme/menu_gfx.png) 100% -130px no-repeat;
-	right: 5px;
+	right: auto;
 }
 
 /* The dropdown menu toggle image */

+ 8 - 7
Themes/default/index.template.php

@@ -118,7 +118,7 @@ function template_html_above()
 	<script type="text/javascript"><!-- // --><![CDATA[
 		window.jQuery || document.write(\'<script src="', $settings['theme_url'], '/scripts/jquery-1.7.1.min.js"><\/script>\');
 	// ]]></script>';
-    
+
 	// 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 '
@@ -471,12 +471,13 @@ function template_menu()
 		<div id="main_menu">
 			<ul class="dropmenu" id="menu_nav">';
 
+	// Note: Menu markup has been cleaned up to remove unnecessary spans and classes. 
 	foreach ($context['menu_buttons'] as $act => $button)
 	{
 		echo '
 				<li id="button_', $act, '">
-					<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
-						<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
+					<a class="', $button['active_button'] ? 'active' : '', isset($button['is_last']) ? ' last' : '', '" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
+						', $button['title'], '
 					</a>';
 		if (!empty($button['sub_buttons']))
 		{
@@ -487,8 +488,8 @@ function template_menu()
 			{
 				echo '
 						<li>
-							<a href="', $childbutton['href'], '"', isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>
-								<span', isset($childbutton['is_last']) ? ' class="last"' : '', '>', $childbutton['title'], !empty($childbutton['sub_buttons']) ? '...' : '', '</span>
+							<a href="', $childbutton['href'], '" ', isset($childbutton['is_last']) ? 'class="last"' : '' , isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>
+								', $childbutton['title'], '
 							</a>';
 				// 3rd level menus :)
 				if (!empty($childbutton['sub_buttons']))
@@ -499,8 +500,8 @@ function template_menu()
 					foreach ($childbutton['sub_buttons'] as $grandchildbutton)
 						echo '
 								<li>
-									<a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
-										<span', isset($grandchildbutton['is_last']) ? ' class="last"' : '', '>', $grandchildbutton['title'], '</span>
+									<a href="', $grandchildbutton['href'], '" ', isset($grandchildbutton['is_last']) ? ' class="last"' : '' , isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
+										', $grandchildbutton['title'], '
 									</a>
 								</li>';
 

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

@@ -367,6 +367,8 @@ $txt['attachment_thumb_memory_note2'] = 'If the system can not get the memory no
 $txt['attachment_thumb_memory_note1'] = 'Leave this unchecked to always attempt to create a thumbnail';
 $txt['attachmentThumbWidth'] = 'Maximum width of thumbnails';
 $txt['attachmentThumbHeight'] = 'Maximum height of thumbnails';
+$txt['attachment_thumbnail_settings'] = 'Thumbnail Settings';
+$txt['attachment_security_settings'] = 'Attachment Security Settings';
 
 $txt['attach_dir_does_not_exist'] = 'Does Not Exist';
 $txt['attach_dir_not_writable'] = 'Not Writable';

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

@@ -285,6 +285,7 @@ $txt['package_get_error_not_found'] = 'The package you are trying to install can
 $txt['package_get_error_missing_xml'] = 'The package you are attempting to install is missing the package-info.xml that must be in the root package directory.';
 $txt['package_get_error_is_zero'] = 'Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the &quot;temp&quot; sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:<br />1) Download the package to your local PC and extract it into files.<br />2) Using an FTP client create a new directory in your &quot;Packages&quot; folder, in this example you may call it "shout".<br />3) Upload all the files from the extracted package to this directory.<br />4) Go back to the package manager browse page and the package will be automatically found by SMF.';
 $txt['package_get_error_packageinfo_corrupt'] = 'SMF was unable to find any valid information within the package-info.xml file included within the Package. There may be an error with the modification, or the package may be corrupt.';
+$txt['package_get_error_is_theme'] = 'You can\'t install a Theme from this section, please use the <a href="{MANAGETHEMEURL}">Themes and Layout</a> management page to upload it';
 
 $txt['no_membergroup_selected'] = 'No membergroup selected';
 $txt['membergroup_does_not_exist'] = 'The membergroup doesn\'t exist or is invalid.';
@@ -308,6 +309,7 @@ $txt['error_no_search_daemon'] = 'Unable to access the search daemon';
 $txt['profile_errors_occurred'] = 'The following errors occurred when trying to save your profile';
 $txt['profile_error_bad_offset'] = 'The time offset is out of range';
 $txt['profile_error_no_name'] = 'The name field was left blank';
+$txt['profile_error_digits_only'] = 'The \'number of posts\' box can only contain digits.';
 $txt['profile_error_name_taken'] = 'The selected username/display name has already been taken';
 $txt['profile_error_name_too_long'] = 'The selected name is too long. It should be no greater than 60 characters long';
 $txt['profile_error_no_email'] = 'The email field was left blank';

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

@@ -43,7 +43,6 @@ $txt['max_sig_characters'] = 'Max characters: %1$d; characters remaining: ';
 $txt['send_member_pm'] = 'Send this member a personal message';
 $txt['hidden'] = 'hidden';
 $txt['current_time'] = 'Current forum time';
-$txt['digits_only'] = 'The \'number of posts\' box can only contain digits.';
 
 $txt['language'] = 'Language';
 $txt['avatar_too_big'] = 'Avatar image is too big, please resize it and try again (max';

+ 150 - 0
Themes/default/scripts/script.js

@@ -1561,3 +1561,153 @@ function smfSetLatestPackages()
 	if (tempOldOnload)
 	tempOldOnload();
 }
+
+function tick()
+{
+	if (typeof(document.forms.creator) != "undefined")
+	{
+		calcCharLeft();
+		setTimeout("tick()", 1000);
+	}
+	else
+		setTimeout("tick()", 800);
+}
+
+function calcCharLeft()
+{
+	var oldSignature = "", currentSignature = document.forms.creator.signature.value;
+
+	if (!document.getElementById("signatureLeft"))
+		return;
+
+	if (oldSignature != currentSignature)
+	{
+		oldSignature = currentSignature;
+
+		if (currentSignature.replace(/\r/, "").length > maxLength)
+			document.forms.creator.signature.value = currentSignature.replace(/\r/, "").substring(0, maxLength);
+		currentSignature = document.forms.creator.signature.value.replace(/\r/, "");
+	}
+
+	setInnerHTML(document.getElementById("signatureLeft"), maxLength - currentSignature.length);
+}
+
+function changeSel(selected)
+{
+	if (cat.selectedIndex == -1)
+		return;
+
+	if (cat.options[cat.selectedIndex].value.indexOf("/") > 0)
+	{
+		var i;
+		var count = 0;
+
+		file.style.display = "inline";
+		file.disabled = false;
+
+		for (i = file.length; i >= 0; i = i - 1)
+			file.options[i] = null;
+
+		for (i = 0; i < files.length; i++)
+			if (files[i].indexOf(cat.options[cat.selectedIndex].value) == 0)
+			{
+				var filename = files[i].substr(files[i].indexOf("/") + 1);
+				var showFilename = filename.substr(0, filename.lastIndexOf("."));
+				showFilename = showFilename.replace(/[_]/g, " ");
+
+				file.options[count] = new Option(showFilename, files[i]);
+
+				if (filename == selected)
+				{
+					if (file.options.defaultSelected)
+						file.options[count].defaultSelected = true;
+					else
+						file.options[count].selected = true;
+				}
+
+				count++;
+			}
+
+		if (file.selectedIndex == -1 && file.options[0])
+			file.options[0].selected = true;
+
+		showAvatar();
+	}
+	else
+	{
+		file.style.display = "none";
+		file.disabled = true;
+		document.getElementById("avatar").src = avatardir + cat.options[cat.selectedIndex].value;
+		document.getElementById("avatar").style.width = "";
+		document.getElementById("avatar").style.height = "";
+	}
+}
+
+function showAvatar()
+{
+	if (file.selectedIndex == -1)
+		return;
+
+	document.getElementById("avatar").src = avatardir + file.options[file.selectedIndex].value;
+	document.getElementById("avatar").alt = file.options[file.selectedIndex].text;
+	document.getElementById("avatar").alt += file.options[file.selectedIndex].text == size ? "!" : "";
+	document.getElementById("avatar").style.width = "";
+	document.getElementById("avatar").style.height = "";
+}
+
+function previewExternalAvatar(src)
+{
+	if (!document.getElementById("avatar"))
+		return;
+
+	var tempImage = new Image();
+
+	tempImage.src = src;
+	if (maxWidth != 0 && tempImage.width > maxWidth)
+	{
+		document.getElementById("avatar").style.height = parseInt((maxWidth * tempImage.height) / tempImage.width) + "px";
+		document.getElementById("avatar").style.width = maxWidth + "px";
+	}
+	else if (maxHeight != 0 && tempImage.height > maxHeight)
+	{
+		document.getElementById("avatar").style.width = parseInt((maxHeight * tempImage.width) / tempImage.height) + "px";
+		document.getElementById("avatar").style.height = maxHeight + "px";
+	}
+	document.getElementById("avatar").src = src;
+}
+
+function updateAuthMethod()
+{
+	// What authentication method is being used?
+	if (!document.getElementById(\'auth_openid\') || !document.getElementById(\'auth_openid\').checked)
+		currentAuthMethod = \'passwd\';
+	else
+		currentAuthMethod = \'openid\';
+
+	// No openID?
+	if (!document.getElementById(\'auth_openid\'))
+		return true;
+
+	document.forms.creator.openid_url.disabled = currentAuthMethod == \'openid\' ? false : true;
+	document.forms.creator.smf_autov_pwmain.disabled = currentAuthMethod == \'passwd\' ? false : true;
+	document.forms.creator.smf_autov_pwverify.disabled = currentAuthMethod == \'passwd\' ? false : true;
+	document.getElementById(\'smf_autov_pwmain_div\').style.display = currentAuthMethod == \'passwd\' ? \'\' : \'none\';
+	document.getElementById(\'smf_autov_pwverify_div\').style.display = currentAuthMethod == \'passwd\' ? \'\' : \'none\';
+
+	if (currentAuthMethod == \'passwd\')
+	{
+		verificationHandle.refreshMainPassword();
+		verificationHandle.refreshVerifyPassword();
+		document.forms.creator.openid_url.style.backgroundColor = \'\';
+		document.getElementById("auth_openid_div").style.display = "none";
+		document.getElementById("auth_pass_div").style.display = "";
+	}
+	else
+	{
+		document.forms.creator.smf_autov_pwmain.style.backgroundColor = \'\';
+		document.forms.creator.smf_autov_pwverify.style.backgroundColor = \'\';
+		document.forms.creator.openid_url.style.backgroundColor = \'#FCE184\';
+		document.getElementById("auth_openid_div").style.display = "";
+		document.getElementById("auth_pass_div").style.display = "none";
+	}
+}

BIN
avatars/blank.gif


BIN
avatars/blank.png


+ 1 - 1
other/install.php

@@ -14,7 +14,7 @@
 $GLOBALS['current_smf_version'] = '2.1 Alpha 1';
 $GLOBALS['db_script_version'] = '2-1';
 
-$GLOBALS['required_php_version'] = '5.0.0';
+$GLOBALS['required_php_version'] = '5.1.0';
 
 // Don't have PHP support, do you?
 // ><html dir="ltr"><head><title>Error!</title></head><body>Sorry, this installer requires PHP!<div style="display: none;">

+ 1 - 0
other/install_2-1_mysql.sql

@@ -960,6 +960,7 @@ CREATE TABLE {$db_prefix}log_packages (
   failed_steps text NOT NULL,
   themes_installed varchar(255) NOT NULL default '',
   db_changes text NOT NULL,
+  credits varchar(255) NOT NULL default '',
   PRIMARY KEY (id_install),
   KEY filename (filename(15))
 ) ENGINE=MyISAM;

+ 1 - 0
other/install_2-1_postgresql.sql

@@ -1261,6 +1261,7 @@ CREATE TABLE {$db_prefix}log_packages (
   failed_steps text NOT NULL,
   themes_installed varchar(255) NOT NULL,
   db_changes text NOT NULL,
+  credits varchar(255) NOT NULL,
   PRIMARY KEY (id_install)
 );
 

+ 1 - 0
other/install_2-1_sqlite.sql

@@ -1020,6 +1020,7 @@ CREATE TABLE {$db_prefix}log_packages (
   install_state smallint NOT NULL default '1',
   failed_steps text NOT NULL,
   db_changes text NOT NULL,
+  credits varchar(255) NOT NULL,
   themes_installed varchar(255) NOT NULL
 );
 

+ 1 - 1
other/upgrade.php

@@ -15,7 +15,7 @@
 define('SMF_VERSION', '2.1 Alpha 1');
 define('SMF_LANG_VERSION', '2.0');
 
-$GLOBALS['required_php_version'] = '5.0.0';
+$GLOBALS['required_php_version'] = '5.1.0';
 $GLOBALS['required_mysql_version'] = '4.0.18';
 
 $databases = array(

+ 8 - 16
other/upgrade_2-1_mysql.sql

@@ -17,22 +17,6 @@ CREATE TABLE IF NOT EXISTS {$db_prefix}member_logins (
 ) ENGINE=MyISAM{$db_collation};
 ---#
 
----# Moving the cookie name to the database...
----{
-if (!isset($modSettings['cookie_name']))
-{
-	if (empty($cookiename))
-		$cookiename = 'SMFCookie11';
-
-	upgrade_query("
-		INSERT INTO {$db_prefix}settings
-			(variable, value)
-		VALUES
-			('cookie_name', '$cookiename')");
-}
----}
----#
-
 ---# Copying the current package backup setting...
 ---{
 if (!isset($modSettings['package_make_full_backups']) && isset($modSettings['package_make_backups']))
@@ -136,4 +120,12 @@ CHANGE ip_low3 ip_low3 tinyint(3) unsigned NOT NULL DEFAULT '0',
 CHANGE ip_high3 ip_high3 tinyint(3) unsigned NOT NULL DEFAULT '0',
 CHANGE ip_low4 ip_low4 tinyint(3) unsigned NOT NULL DEFAULT '0',
 CHANGE ip_high4 ip_high4 tinyint(3) unsigned NOT NULL DEFAULT '0';
+---#
+
+/******************************************************************************/
+--- Adding support for <credits> tag in package manager
+/******************************************************************************/
+---# Adding new columns to log_packages ..
+ALTER TABLE {$db_prefix}log_packages
+ADD COLUMN credits varchar(255) NOT NULL DEFAULT '';
 ---#

+ 8 - 16
other/upgrade_2-1_postgresql.sql

@@ -21,22 +21,6 @@ CREATE TABLE {$db_prefix}member_logins (
 );
 ---#
 
----# Moving the cookie name to the database...
----{
-if (!isset($modSettings['cookie_name']))
-{
-	if (empty($cookiename))
-		$cookiename = 'SMFCookie11';
-
-	upgrade_query("
-		INSERT INTO {$db_prefix}settings
-			(variable, value)
-		VALUES
-			('cookie_name', '$cookiename')");
-}
----}
----#
-
 ---# Copying the current package backup setting...
 ---{
 if (!isset($modSettings['package_make_full_backups']) && isset($modSettings['package_make_backups']))
@@ -140,4 +124,12 @@ CHANGE ip_low3 ip_low3 tinyint(3) unsigned NOT NULL DEFAULT '0',
 CHANGE ip_high3 ip_high3 tinyint(3) unsigned NOT NULL DEFAULT '0',
 CHANGE ip_low4 ip_low4 tinyint(3) unsigned NOT NULL DEFAULT '0',
 CHANGE ip_high4 ip_high4 tinyint(3) unsigned NOT NULL DEFAULT '0';
+---#
+
+/******************************************************************************/
+--- Adding support for <credits> tag in package manager
+/******************************************************************************/
+---# Adding new columns to log_packages ..
+ALTER TABLE {$db_prefix}log_packages
+ADD COLUMN credits varchar(255) NOT NULL DEFAULT '';
 ---#

+ 8 - 16
other/upgrade_2-1_sqlite.sql

@@ -17,22 +17,6 @@ CREATE TABLE IF NOT EXISTS {$db_prefix}member_logins (
 );
 ---#
 
----# Moving the cookie name to the database...
----{
-if (!isset($modSettings['cookie_name']))
-{
-	if (empty($cookiename))
-		$cookiename = 'SMFCookie11';
-
-	upgrade_query("
-		INSERT INTO {$db_prefix}settings
-			(variable, value)
-		VALUES
-			('cookie_name', '$cookiename')");
-}
----}
----#
-
 ---# Copying the current package backup setting...
 ---{
 if (!isset($modSettings['package_make_full_backups']) && isset($modSettings['package_make_backups']))
@@ -136,4 +120,12 @@ CHANGE ip_low3 ip_low3 tinyint(3) unsigned NOT NULL DEFAULT '0',
 CHANGE ip_high3 ip_high3 tinyint(3) unsigned NOT NULL DEFAULT '0',
 CHANGE ip_low4 ip_low4 tinyint(3) unsigned NOT NULL DEFAULT '0',
 CHANGE ip_high4 ip_high4 tinyint(3) unsigned NOT NULL DEFAULT '0';
+---#
+
+/******************************************************************************/
+--- Adding support for <credits> tag in package manager
+/******************************************************************************/
+---# Adding new columns to log_packages ..
+ALTER TABLE {$db_prefix}log_packages
+ADD COLUMN credits varchar(255) NOT NULL DEFAULT '';
 ---#