Browse Source

! Remove simple search, fixes #1331

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 10 years ago
parent
commit
d860b625a1

+ 0 - 1
Sources/ManageSearch.php

@@ -94,7 +94,6 @@ function EditSearchSettings($return_config = false)
 			// Permission...
 			array('permissions', 'search_posts'),
 			// Some simple settings.
-			array('check', 'simpleSearch'),
 			array('check', 'search_dropdown'),
 			array('int', 'search_results_per_page'),
 			array('int', 'search_max_results', 'subtext' => $txt['search_max_results_disable']),

+ 0 - 1
Sources/PersonalMessage.php

@@ -1206,7 +1206,6 @@ function MessageSearch()
 		}
 	}
 
-	$context['simple_search'] = isset($context['search_params']['advanced']) ? empty($context['search_params']['advanced']) : !empty($modSettings['simpleSearch']) && !isset($_REQUEST['advanced']);
 	$context['page_title'] = $txt['pm_search_title'];
 	$context['sub_template'] = 'search';
 	$context['linktree'][] = array(

+ 1 - 3
Sources/Search.php

@@ -27,7 +27,7 @@ $GLOBALS['search_versions'] = array(
 /**
  * Ask the user what they want to search for.
  * What it does:
- * - shows the screen to search forum posts (action=search), and uses the simple version if the simpleSearch setting is enabled.
+ * - shows the screen to search forum posts (action=search)
  * - uses the main sub template of the Search template.
  * - uses the Search language file.
  * - requires the search_posts permission.
@@ -228,8 +228,6 @@ function PlushSearch1()
 		$context['search_topic']['link'] = '<a href="' . $context['search_topic']['href'] . '">' . $context['search_topic']['subject'] . '</a>';
 	}
 
-	// Simple or not?
-	$context['simple_search'] = isset($context['search_params']['advanced']) ? empty($context['search_params']['advanced']) : !empty($modSettings['simpleSearch']) && !isset($_REQUEST['advanced']);
 	$context['page_title'] = $txt['set_parameters'];
 
 	call_integration_hook('integrate_search');

+ 13 - 32
Themes/default/PersonalMessage.template.php

@@ -718,26 +718,8 @@ function template_search()
 		</div>';
 	}
 
-	if ($context['simple_search'])
-	{
-		echo '
-		<fieldset id="simple_search">
-			<div class="roundframe">
-				<div id="search_term_input">
-					<strong>', $txt['pm_search_text'], ':</strong>
-					<input type="search" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' size="40" class="input_text">
-					<input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button_submit">
-				</div>
-				<a href="', $scripturl, '?action=pm;sa=search;advanced" onclick="this.href += \';search=\' + escape(document.forms.searchform.search.value);">', $txt['pm_search_advanced'], '</a>
-				<input type="hidden" name="advanced" value="0">
-			</div>
-		</fieldset>';
-	}
 
-	// Advanced search!
-	else
-	{
-		echo '
+	echo '
 		<fieldset id="advanced_search">
 			<div class="roundframe">
 				<input type="hidden" name="advanced" value="1">
@@ -772,18 +754,18 @@ function template_search()
 					<dt class="between">', $txt['pm_search_post_age'], ':</dt>
 					<dd>', $txt['pm_search_between'], ' <input type="number" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="5" class="input_text" min="0" max="9999">&nbsp;', $txt['pm_search_between_and'], '&nbsp;<input type="number" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="5" class="input_text" min="0" max="9999"> ', $txt['pm_search_between_days'], '</dd>
 				</dl>';
-		if (!$context['currently_using_labels'])
-			echo '
+	if (!$context['currently_using_labels'])
+		echo '
 				<input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button_submit">';
-			echo '
+		echo '
 				<br class="clear_right">
 			</div>
 		</fieldset>';
 
-		// Do we have some labels setup? If so offer to search by them!
-		if ($context['currently_using_labels'])
-		{
-			echo '
+	// Do we have some labels setup? If so offer to search by them!
+	if ($context['currently_using_labels'])
+	{
+		echo '
 		<fieldset class="labels">
 			<div class="roundframe">
 				<div class="title_bar">
@@ -794,14 +776,14 @@ function template_search()
 				<div id="advanced_panel_div">
 					<ul id="searchLabelsExpand" class="reset">';
 
-			foreach ($context['search_labels'] as $label)
-				echo '
+		foreach ($context['search_labels'] as $label)
+			echo '
 						<li>
 							<label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', ' class="input_check">
 							', $label['name'], '</label>
 						</li>';
 
-			echo '
+		echo '
 					</ul>
 				</div>
 				<p>
@@ -812,8 +794,8 @@ function template_search()
 			</div>
 		</fieldset>';
 
-			// Some javascript for the advanced toggling
-			echo '
+		// Some javascript for the advanced toggling
+		echo '
 		<script><!-- // --><![CDATA[
 			var oAdvancedPanelToggle = new smc_Toggle({
 				bToggleEnabled: true,
@@ -837,7 +819,6 @@ function template_search()
 				]
 			});
 		// ]]></script>';
-		}
 	}
 
 	echo '

+ 48 - 85
Themes/default/Search.template.php

@@ -30,41 +30,7 @@ function template_main()
 		echo '
 		<p class="noticebox">', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
 
-	// Simple Search?
-	if ($context['simple_search'])
-	{
-		echo '
-		<fieldset id="simple_search">
-			<div class="roundframe">
-				<div id="search_term_input">
-					<strong>', $txt['search_for'], ':</strong>
-					<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">
-					', $context['require_verification'] ? '' : '&nbsp;<input type="submit" name="s_search" value="' . $txt['search'] . '" class="button_submit">
-				</div>';
-
-		if (empty($modSettings['search_simple_fulltext']))
-			echo '
-				<p class="smalltext">', $txt['search_example'], '</p>';
-
-		if ($context['require_verification'])
-			echo '
-				<div class="verification>
-					<strong>', $txt['search_visual_verification_label'], ':</strong>
-					<br>', template_control_verification($context['visual_verification_id'], 'all'), '<br>
-					<input id="submit" type="submit" name="s_search" value="' . $txt['search'] . '" class="button_submit">
-				</div>';
-
-		echo '
-				<a href="', $scripturl, '?action=search;advanced" onclick="this.href += \';search=\' + escape(document.forms.searchform.search.value);">', $txt['search_advanced'], '</a>
-				<input type="hidden" name="advanced" value="0">
-			</div>
-		</fieldset>';
-	}
-
-	// Advanced search!
-	else
-	{
-		echo '
+	echo '
 		<fieldset id="advanced_search">
 			<div class="roundframe">
 				<dl class="settings" id="search_options">
@@ -74,11 +40,11 @@ function template_main()
 					<dd>
 						<input type="search" 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 '
+	if (empty($modSettings['search_simple_fulltext']))
+		echo '
 						<em class="smalltext">', $txt['search_example'], '</em>';
 
-		echo '
+	echo '
 					</dd>
 
 					<dt class="righttext"><label for="searchtype">',
@@ -132,30 +98,29 @@ function template_main()
 				// ]]></script>
 				<input type="hidden" name="advanced" value="1">';
 
-		// Require an image to be typed to save spamming?
-		if ($context['require_verification'])
-		{
-			echo '
+	// Require an image to be typed to save spamming?
+	if ($context['require_verification'])
+	{
+		echo '
 				<p>
 					<strong>', $txt['verification'], ':</strong>
 					', template_control_verification($context['visual_verification_id'], 'all'), '
 				</p>';
-		}
+	}
 
-		// If $context['search_params']['topic'] is set, that means we're searching just one topic.
-		if (!empty($context['search_params']['topic']))
-			echo '
+	// If $context['search_params']['topic'] is set, that means we're searching just one topic.
+	if (!empty($context['search_params']['topic']))
+		echo '
 				<p>', $txt['search_specific_topic'], ' &quot;', $context['search_topic']['link'], '&quot;.</p>
 				<input type="hidden" name="topic" value="', $context['search_topic']['id'], '">';
 
-		echo '
+	echo '
 			</div>
-		</fieldset>
-		';
+		</fieldset>';
 
-		if (empty($context['search_params']['topic']))
-		{
-			echo '
+	if (empty($context['search_params']['topic']))
+	{
+		echo '
 		<fieldset class="flow_hidden">
 			<div class="roundframe">
 				<div class="title_bar">
@@ -167,19 +132,19 @@ function template_main()
 				<div class="flow_auto" id="advanced_panel_div"', $context['boards_check_all'] ? ' style="display: none;"' : '', '>
 					<ul class="ignoreboards floatleft">';
 
-	$i = 0;
-	$limit = ceil($context['num_boards'] / 2);
-	foreach ($context['categories'] as $category)
-	{
-		echo '
+		$i = 0;
+		$limit = ceil($context['num_boards'] / 2);
+		foreach ($context['categories'] as $category)
+		{
+			echo '
 						<li class="category">
 							<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'searchform\'); return false;">', $category['name'], '</a>
 							<ul>';
 
-		foreach ($category['boards'] as $board)
-		{
-			if ($i == $limit)
-				echo '
+			foreach ($category['boards'] as $board)
+			{
+				if ($i == $limit)
+					echo '
 							</ul>
 						</li>
 					</ul>
@@ -187,27 +152,25 @@ function template_main()
 						<li class="category">
 							<ul>';
 
-			echo '
+				echo '
 								<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
 									<label for="brd', $board['id'], '">
 										<input type="checkbox" id="brd', $board['id'], '" name="brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked' : '', ' class="input_check"> ', $board['name'], '
 									</label>
 								</li>';
 
-			$i++;
-		}
+				$i++;
+			}
 
-		echo '
+			echo '
 							</ul>
 						</li>';
-	}
+		}
 
-	echo '
+		echo '
 					</ul>
 				</div>
-				<br class="clear">';
-
-			echo '
+				<br class="clear">
 				<div class="padding flow_auto">
 					<input type="checkbox" name="all" id="check_all" value=""', $context['boards_check_all'] ? ' checked' : '', ' onclick="invertAll(this, this.form, \'brd\');" class="input_check floatleft">
 					<label for="check_all" class="floatleft"><em>', $txt['check_all'], '</em></label>
@@ -215,8 +178,8 @@ function template_main()
 				</div>
 			</div>
 		</fieldset>';
-		}
-	echo '
+
+		echo '
 	<script><!-- // --><![CDATA[
 		var oAdvancedPanelToggle = new smc_Toggle({
 			bToggleEnabled: true,
@@ -239,22 +202,22 @@ function template_main()
 				}
 			]
 		});
-	// ]]></script>
-		<script src="', $settings['default_theme_url'], '/scripts/suggest.js?alp21"></script>
-		<script><!-- // --><![CDATA[
-			var oAddMemberSuggest = new smc_AutoSuggest({
-				sSelf: \'oAddMemberSuggest\',
-				sSessionId: smf_session_id,
-				sSessionVar: smf_session_var,
-				sControlId: \'userspec\',
-				sSearchType: \'member\',
-				bItemList: false
-			});
-		// ]]></script>';
+	// ]]></script>';
 	}
 
 	echo '
-	</form>';
+	</form>
+	<script src="', $settings['default_theme_url'], '/scripts/suggest.js?alp21"></script>
+	<script><!-- // --><![CDATA[
+		var oAddMemberSuggest = new smc_AutoSuggest({
+			sSelf: \'oAddMemberSuggest\',
+			sSessionId: smf_session_id,
+			sSessionVar: smf_session_var,
+			sControlId: \'userspec\',
+			sSearchType: \'member\',
+			bItemList: false
+		});
+	// ]]></script>';
 }
 
 function template_results()

+ 2 - 16
Themes/default/css/index.css

@@ -3947,27 +3947,13 @@ span.hidelink {
 	width: 115px;
 }
 
-/* Styles for the basic search section.
+/* Styles for the search section.
 ------------------------------------------------- */
-#simple_search p {
-	padding: 6px;
-	margin: 0;
-}
-#simple_search, #simple_search p, #advanced_search {
+#advanced_search {
 	text-align: center !important;
 	margin: 0;
 }
-#search_error {
-	font-style: italic;
-	padding: 4px 12px;
-}
-#search_term_input {
-	font-size: 1.1em;
-	margin: 0 0 12px;
-}
 
-/* Styles for the advanced search section.
-------------------------------------------------- */
 #searchform fieldset {
 	text-align: left;
 	padding: 0;

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

@@ -279,7 +279,6 @@ $helptxt['compactTopicPagesEnable'] = 'This will just show a selection of the nu
 		&quot;5&quot; to display: 1 ... 3 4 [5] 6 7 ... 9';
 $helptxt['timeLoadPageEnable'] = 'This will show the time in seconds SMF took to create that page at the bottom of the board.';
 $helptxt['removeNestedQuotes'] = 'This will strip nested quotes from a post when citing the post in question via a quote link.';
-$helptxt['simpleSearch'] = 'This will show a simple search form and a link to a more advanced form.';
 $helptxt['search_dropdown'] = 'This will show a search selection dropdown next to the quick search box.  From this you can choose to search the current site, current board (if in a board), current topic (if in a topic) or search for members.';
 $helptxt['max_image_width'] = 'This allows you to set a maximum size for posted pictures. Pictures smaller than the maximum will not be affected. This also determines how attached images are displayed when a thumbnail is clicked on.';
 $helptxt['mail_type'] = 'This setting allows you to choose either PHP\'s default settings, or to override those settings with SMTP.  PHP doesn\'t support using authentication with SMTP (which many hosts require, now) so if you want that you should select SMTP.  Please note that SMTP can be slower, and some servers will not take usernames and passwords.<br><br>You don\'t need to fill in the SMTP settings if this is set to PHP\'s default.';

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

@@ -28,7 +28,6 @@ $txt['search_specific_topic'] = 'Searching only posts in the topic';
 
 $txt['mods_cat_search'] = 'Search';
 $txt['groups_search_posts'] = 'Membergroups with access to the search function';
-$txt['simpleSearch'] = 'Enable simple search';
 $txt['search_dropdown'] = 'Enable the Quick Search dropdown';
 $txt['search_results_per_page'] = 'Number of search results per page';
 $txt['search_weight_frequency'] = 'Relative search weight for number of matching messages within a topic';

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

@@ -1769,7 +1769,6 @@ VALUES ('smfVersion', '{$smf_version}'),
 	('totalMembers', '0'),
 	('totalTopics', '1'),
 	('totalMessages', '1'),
-	('simpleSearch', '0'),
 	('censor_vulgar', ''),
 	('censor_proper', ''),
 	('enablePostHTML', '0'),

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

@@ -2280,7 +2280,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('timeLoadPageEnable',
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('totalMembers', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('totalTopics', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('totalMessages', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('simpleSearch', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('censor_vulgar', '');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('censor_proper', '');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enablePostHTML', '0');

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

@@ -1912,7 +1912,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('timeLoadPageEnable',
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('totalMembers', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('totalTopics', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('totalMessages', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('simpleSearch', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('censor_vulgar', '');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('censor_proper', '');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enablePostHTML', '0');

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

@@ -1912,7 +1912,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('timeLoadPageEnable',
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('totalMembers', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('totalTopics', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('totalMessages', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('simpleSearch', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('censor_vulgar', '');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('censor_proper', '');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enablePostHTML', '0');

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

@@ -777,7 +777,7 @@ WHERE variable = 'avatar_action_too_large'
 
 ---# Cleaning up old settings.
 DELETE FROM {$db_prefix}settings
-WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable');
+WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable', 'simpleSearch');
 ---#
 
 ---# Cleaning up old theme settings.

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

@@ -856,7 +856,7 @@ WHERE variable = 'avatar_action_too_large'
 
 ---# Cleaning up old settings.
 DELETE FROM {$db_prefix}settings
-WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable');
+WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable', 'simpleSearch');
 ---#
 
 ---# Cleaning up old theme settings.

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

@@ -847,7 +847,7 @@ WHERE variable = 'avatar_action_too_large'
 
 ---# Cleaning up old settings.
 DELETE FROM {$db_prefix}settings
-WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable');
+WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable', 'simpleSearch');
 ---#
 
 ---# Cleaning up old theme settings.