Commit MetaInfo

修订版a784fa95a43b05371ca11747ef3e2012f44715bd (tree)
时间2017-09-06 07:58:31
作者umorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2348 Remove limitation of Search box count

更改概述

差异

--- a/plugin/search.inc.php
+++ b/plugin/search.inc.php
@@ -16,15 +16,8 @@ define('PLUGIN_SEARCH_MAX_BASE', 16); // #search(1,2,3,...,15,16)
1616 // Show a search box on a page
1717 function plugin_search_convert()
1818 {
19- static $done;
20-
21- if (isset($done)) {
22- return '#search(): You already view a search box<br />' . "\n";
23- } else {
24- $done = TRUE;
25- $args = func_get_args();
26- return plugin_search_search_form('', '', $args);
27- }
19+ $args = func_get_args();
20+ return plugin_search_search_form('', '', $args);
2821 }
2922
3023 function plugin_search_action()
@@ -83,21 +76,18 @@ function plugin_search_search_form($s_word = '', $type = '', $bases = array())
8376 foreach($bases as $base) {
8477 ++$_num;
8578 if (PLUGIN_SEARCH_MAX_BASE < $_num) break;
86- $label_id = '_p_search_base_id_' . $_num;
8779 $s_base = htmlsc($base);
8880 $base_str = '<strong>' . $s_base . '</strong>';
8981 $base_label = str_replace('$1', $base_str, $_search_pages);
9082 $base_msg .=<<<EOD
9183 <div>
92- <input type="radio" name="base" id="$label_id" value="$s_base" $check />
93- <label for="$label_id">$base_label</label>
84+ <label><input type="radio" name="base" value="$s_base" $check /> $base_label</label>
9485 </div>
9586 EOD;
9687 $check = '';
9788 }
9889 $base_msg .=<<<EOD
99- <input type="radio" name="base" id="_p_search_base_id_all" value="" />
100- <label for="_p_search_base_id_all">$_search_all</label>
90+ <label><input type="radio" name="base" value="" /> $_search_all</label>
10191 EOD;
10292 $base_option = '<div class="small">' . $base_msg . '</div>';
10393 }
@@ -106,10 +96,8 @@ EOD;
10696 <form action="$script?cmd=search" method="post">
10797 <div>
10898 <input type="text" name="word" value="$s_word" size="20" />
109- <input type="radio" name="type" id="_p_search_AND" value="AND" $and_check />
110- <label for="_p_search_AND">$_btn_and</label>
111- <input type="radio" name="type" id="_p_search_OR" value="OR" $or_check />
112- <label for="_p_search_OR">$_btn_or</label>
99+ <label><input type="radio" name="type" value="AND" $and_check /> $_btn_and</label>
100+ <label><input type="radio" name="type" value="OR" $or_check /> $_btn_or</label>
113101 &nbsp;<input type="submit" value="$_btn_search" />
114102 </div>
115103 $base_option
Show on old repository browser