1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Theme options and fixes. Load Theme JS in the footer by default. New blockquote alt. style added to TinyMce. Updated news shortcodes. Option to hide search form from results page.

This commit is contained in:
Cameron
2016-06-01 18:36:16 -07:00
parent 9080291661
commit cd8ea61bd9
11 changed files with 98 additions and 96 deletions

View File

@@ -143,6 +143,8 @@ class search extends e_shortcode
{
$tp = e107::getParser();
$value = isset($_GET['q']) ? $tp->post_toForm($_GET['q']) : "";
$text = "<div class='input-group'>
<input class='tbox form-control m_search' type='text' id='q' name='q' size='35' value='".$value."' maxlength='50' />
@@ -822,7 +824,9 @@ class search extends e_shortcode
$ns->tablerender(LAN_SEARCH_11." ".$res_display." ".LAN_SEARCH_13." ".(isset($_GET[$advanced_caption['id']]) ? $advanced_caption['title'][$_GET[$advanced_caption['id']]] : $this->search_info[$key]['qtype']), $text, 'search_result');
}
}
}
}
@@ -1286,93 +1290,17 @@ $text .= $SEARCH_VARS->SEARCH_MESSAGE ? $tp->simpleParse($SEARCH_TABLE_MSG, $SEA
//$text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_BOT_TABLE);
$text .= $tp->simpleParse($SEARCH_BOT_TABLE, $SEARCH_VARS);
e107::getRender()->tablerender(PAGE_NAME." ".SITENAME, $text, 'search_head');
if(!isset($_GET['nf'])) // no form flag.
{
e107::getRender()->tablerender(PAGE_NAME." ".SITENAME, $text, 'search_head');
}
// parse search
$SEARCH_VARS = new e_vars();
if ($perform_search)
{
$srchObj->renderResults();
/*
$_GET['q'] = rawurlencode($_GET['q']);
$_GET['t'] = preg_replace('/[^\w\-]/i', '', $_GET['t']);
foreach ($search_info as $key => $a)
{
if (isset($searchtype[$key]) || isset($searchtype['all']))
{
unset($text);
//if (file_exists($search_info[$key]['sfile']))
{
$pre_title = ($search_info[$key]['pre_title'] == 2) ? $search_info[$key]['pre_title_alt'] : $search_info[$key]['pre_title'];
$search_chars = $search_info[$key]['chars'];
$search_res = $search_info[$key]['results'];
e107::getAddon();
if(vartrue($search_info[$key]['sfile']) && file_exists($search_info[$key]['sfile'])) // Legacy
{
$text .= '<div class="search-block">';
@require_once($search_info[$key]['sfile']);
$text .= '</div>';
}
else// New v2 standard. @see chatbox_menu/e_search.php
{
$className = $key."_search";
$obj = new $className;
$where = (method_exists($obj,'where')) ? $obj->where($_GET) : "";
$ps = $obj->parsesearch($search_info[$key]['table'], $search_info[$key]['return_fields'], $search_info[$key]['search_fields'], $search_info[$key]['weights'], 'self', varset($search_info[$key]['no_results'],LAN_198), $where , $search_info[$key]['order']);
$text .= '<div class="search-block">';
$text .= $ps['text'];
$text .= '</div>';
$results = $ps['results'];
}
$parms = $results.",".$search_res.",".$_GET['r'].",".e_REQUEST_SELF."?q=".$_GET['q']."&t=".$key."&r=[FROM]";
$core_parms = array('r' => '', 'q' => '', 't' => '', 's' => '');
foreach ($_GET as $pparm_key => $pparm_value)
{
$temp = preg_replace('/[^\w_]/i','',$pparm_key);
$temp1 = preg_replace('/[^\w_ +]/i','',$pparm_value); // Filter 'non-word' charcters in search term
if (($temp == $pparm_key) && !isset($core_parms[$pparm_key]))
{
$parms .= "&".$pparm_key."=".$temp1;
}
}
if ($results > $search_res)
{
$nextprev = ($results > $search_res) ? $tp -> parseTemplate("{NEXTPREV={$parms}}") : "";
$text .= "<div class='nextprev search form-inline'>".$nextprev."</div>";
}
if ($results > 0)
{
$res_from = $_GET['r'] + 1;
$res_to = ($_GET['r'] + $search_res) > $results ? $results : ($_GET['r'] + $search_res);
$res_display = $res_from." - ".$res_to." ".LAN_SEARCH_12." ".$results;
}
else
{
$res_display = "";
}
$ns->tablerender(LAN_SEARCH_11." ".$res_display." ".LAN_SEARCH_13." ".(isset($_GET[$advanced_caption['id']]) ? $advanced_caption['title'][$_GET[$advanced_caption['id']]] : $search_info[$key]['qtype']), $text, 'search_result');
}
}
}*/
}