1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-19 05:28:10 +01:00
2006-12-02 04:36:16 +00:00

48 lines
1.2 KiB
Python

global $sql,$sysprefs,$SEARCH_SHORTCODE;
include_lan(e_PLUGIN."search_menu/languages/".e_LANGUAGE.".php");
$text = "";
if (!isset($SEARCH_SHORTCODE)) {
if (file_exists(THEME."search_template.php")) {
include(THEME."search_template.php");
} else {
include(e_THEME."templates/search_template.php");
}
}
$ref['all'] = 'all';
$ref['news'] = '0';
$ref['comments'] = 1;
$ref['users'] = 2;
$ref['downloads'] = 3;
$ref['pages'] = 4;
$search_prefs = $sysprefs -> getArray('search_prefs');
foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) {
if (is_readable(e_PLUGIN.$plug_dir."/e_search.php")) {
$ref[$plug_dir] = $plug_dir;
}
}
if($ref[$parm]!= ''){
$page = $ref[$parm];
}elseif($parm='all' && $ref[e_PAGE] != ''){
$page = $ref[e_PAGE];
}else{
$page = 'all';
}
$text .= "<form method='get' action='".e_HTTP."search.php'><div>\n";
$text .= "<input type='hidden' name='t' value='$page' />\n";
$text .= "<input type='hidden' name='r' value='0' />\n";
if (defined('SEARCH_SHORTCODE_REF') && SEARCH_SHORTCODE_REF != '') {
$text .= "<input type='hidden' name='ref' value=\"".SEARCH_SHORTCODE_REF."\" />\n";
}
$text .= $SEARCH_SHORTCODE;
$text .="\n</div></form>";
return $text;