mirror of
https://github.com/e107inc/e107.git
synced 2025-08-09 08:06:38 +02:00
Frontend scripts tests. (may break some things)
This commit is contained in:
56
search.php
56
search.php
@@ -10,7 +10,7 @@
|
||||
|
||||
require_once('class2.php');
|
||||
e107::coreLan('search');
|
||||
e107_require(e_HANDLER.'search_class.php');
|
||||
|
||||
|
||||
if (!check_class($pref['search_restrict']))
|
||||
{
|
||||
@@ -75,9 +75,9 @@ class search extends e_shortcode
|
||||
$SEARCH_TOP_TABLE = $tmp['start'];
|
||||
$SEARCH_BOT_TABLE = $tmp['end'];
|
||||
$SEARCH_CATS = $tmp['category'];
|
||||
$SEARCH_TYPE = $tmp['type'];
|
||||
$SEARCH_TYPE = varset($tmp['type']);
|
||||
$SEARCH_ADV = $tmp['advanced'];
|
||||
$SEARCH_ENHANCED = $tmp['enhanced'];
|
||||
$SEARCH_ENHANCED = varset($tmp['enhanced']);
|
||||
$SEARCH_ADV_COMBO = $tmp['advanced-combo'];
|
||||
|
||||
$this->template = $tmp;
|
||||
@@ -265,7 +265,7 @@ class search extends e_shortcode
|
||||
|
||||
$search_count = count($this->search_info);
|
||||
$google_id = $search_count + 1;
|
||||
|
||||
$checkboxes = '';
|
||||
|
||||
if ($this->search_prefs['selector'] == 2)
|
||||
{
|
||||
@@ -276,10 +276,7 @@ class search extends e_shortcode
|
||||
$dropdown .= "<option value='all'>".LAN_SEARCH_22."</option>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$checkboxes = '';
|
||||
}
|
||||
|
||||
|
||||
foreach($this->search_info as $key => $value)
|
||||
{
|
||||
@@ -354,7 +351,7 @@ class search extends e_shortcode
|
||||
{
|
||||
$var['ENHANCED_TEXT'] = $ENHANCED_TEXT;
|
||||
$var['ENHANCED_DISPLAY_ID'] = "en_".$en_id;
|
||||
$var['ENHANCED_FIELD'] = "<input class='tbox form-control' type='text' id='".$en_id."' name='".$en_id."' size='35' value='".$tp->post_toForm($_GET[$en_id])."' maxlength='50' />";
|
||||
$var['ENHANCED_FIELD'] = "<input class='tbox form-control' type='text' id='".$en_id."' name='".$en_id."' size='35' value='".$tp->post_toForm(varset($_GET[$en_id]))."' maxlength='50' />";
|
||||
|
||||
$text .= $tp->simpleParse($this->template['enhanced'], $var);
|
||||
}
|
||||
@@ -383,7 +380,7 @@ class search extends e_shortcode
|
||||
$tp = e107::getParser();
|
||||
$sql = e107::getDb();
|
||||
$sql2 = e107::getDb('search');
|
||||
|
||||
$advanced = array();
|
||||
|
||||
if(!$parm)
|
||||
{
|
||||
@@ -509,7 +506,7 @@ class search extends e_shortcode
|
||||
{
|
||||
$search_info = array();
|
||||
require_once($plug_require);
|
||||
$ret = $search_info[0];
|
||||
$ret = varset($search_info[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -605,7 +602,11 @@ class search extends e_shortcode
|
||||
}
|
||||
*/
|
||||
$e_searchList = e107::getConfig('core')->get('e_search_list');
|
||||
|
||||
|
||||
if(empty($this->search_prefs['plug_handlers']))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
//plugin search routines // plugin folder is used as the search key. ie. $_GET['t'] = 'chatbox';
|
||||
foreach ($this->search_prefs['plug_handlers'] as $plug_dir => $active)
|
||||
@@ -619,7 +620,7 @@ class search extends e_shortcode
|
||||
{
|
||||
if ($search_info[$plug_dir] = $this->search_info($plug_dir, 'plug', e_PLUGIN.$plug_dir."/e_search.php"))
|
||||
{
|
||||
$search_info[$plug_dir]['listorder'] = $active['order'];
|
||||
$search_info[$plug_dir]['listorder'] = varset($active['order']);
|
||||
// $search_id++;
|
||||
}
|
||||
else
|
||||
@@ -763,13 +764,13 @@ class search extends e_shortcode
|
||||
|
||||
$con = e107::getDateConvert(); // BC Fix
|
||||
|
||||
$sch = new e_search; // BC Fix
|
||||
$sch = e107::getSearch(); // new e_search; // BC Fix
|
||||
|
||||
$query = $this->query;
|
||||
|
||||
|
||||
$_GET['q'] = rawurlencode($_GET['q']);
|
||||
$_GET['t'] = preg_replace('/[^\w\-]/i', '', $_GET['t']);
|
||||
$_GET['q'] = rawurlencode(varset($_GET['q']));
|
||||
$_GET['t'] = preg_replace('/[^\w\-]/i', '', varset($_GET['t']));
|
||||
|
||||
$search_prefs = $this->search_prefs;
|
||||
$result_flag = $this->result_flag;
|
||||
@@ -1049,7 +1050,7 @@ $enhanced_types['ex'] = LAN_SEARCH_25.':';
|
||||
$enhanced_types['ep'] = LAN_SEARCH_26.':';
|
||||
$enhanced_types['be'] = LAN_SEARCH_27.':';
|
||||
|
||||
$SEARCH_VARS->ENHANCED_DISPLAY = $enhanced ? "" : "style='display: none'";
|
||||
$SEARCH_VARS->ENHANCED_DISPLAY = isset($enhanced) ? "" : "style='display: none'";
|
||||
|
||||
// advanced search config
|
||||
if (!vartrue($_GET['adv']) || $_GET['t'] == 'all')
|
||||
@@ -1093,7 +1094,7 @@ if ($perform_search)
|
||||
{
|
||||
$con = e107::getDate();
|
||||
|
||||
$sch = new e_search;
|
||||
$sch = e107::getSearch();
|
||||
|
||||
// omitted words message
|
||||
$stop_count = count($sch -> stop_keys);
|
||||
@@ -1132,7 +1133,7 @@ if(deftrue('BOOTSTRAP'))
|
||||
$SEARCH_TOP_TABLE = $tmp['start'];
|
||||
$SEARCH_BOT_TABLE = $tmp['end'];
|
||||
$SEARCH_CATS = $tmp['category'];
|
||||
$SEARCH_TYPE = $tmp['type'];
|
||||
$SEARCH_TYPE = varset($tmp['type']);
|
||||
$SEARCH_ADV = $tmp['advanced'];
|
||||
$SEARCH_ENHANCED = $tmp['enhanced'];
|
||||
$SEARCH_ADV_COMBO = $tmp['advanced-combo'];
|
||||
@@ -1217,14 +1218,13 @@ function parsesearch($text, $match)
|
||||
}
|
||||
|
||||
|
||||
function headerjs() {
|
||||
global $search_count, $google_id, $search_prefs, $js_adv, $search_info;
|
||||
if ($search_prefs['selector'] == 1) {
|
||||
$script= '';
|
||||
if (varset($search_prefs['selector']) == 1) {
|
||||
|
||||
$types = array_keys($search_info);
|
||||
$types = implode("', '", $types);
|
||||
|
||||
$script = "<script type='text/javascript'>
|
||||
$script = "
|
||||
<!--
|
||||
var i;
|
||||
var stypes = new Array('".$types."');
|
||||
@@ -1248,15 +1248,15 @@ function headerjs() {
|
||||
}
|
||||
|
||||
$script .= "// -->
|
||||
</script>";
|
||||
";
|
||||
|
||||
}
|
||||
|
||||
if(!empty($script))
|
||||
{
|
||||
e107::js('inline', $script);
|
||||
}
|
||||
|
||||
|
||||
return $script;
|
||||
}
|
||||
|
||||
require_once(FOOTERF);
|
||||
|
||||
?>
|
Reference in New Issue
Block a user