1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Fixes #2008 - Search Form URL

This commit is contained in:
Cameron
2016-11-08 10:14:27 -08:00
parent 1c156cd8fb
commit 9eba6b5a23
3 changed files with 20 additions and 6 deletions

View File

@@ -27,7 +27,7 @@ if(!isset($SEARCH_SHORTCODE))
if(!isset($SEARCH_TOP_TABLE)) if(!isset($SEARCH_TOP_TABLE))
{ {
$SEARCH_TOP_TABLE = "<div> $SEARCH_TOP_TABLE = "<div>
<form id='searchform' method='get' action='".e_SELF."'> <form id='searchform' method='get' action='{SEARCH_FORM_URL}'>
<table style='".USER_WIDTH."' class='table fborder'><tr> <table style='".USER_WIDTH."' class='table fborder'><tr>
<td class='forumheader3' style='width: 40%'>".LAN_199."</td> <td class='forumheader3' style='width: 40%'>".LAN_199."</td>
<td class='forumheader3' style='width: 60%; white-space: nowrap'> <td class='forumheader3' style='width: 60%; white-space: nowrap'>
@@ -135,7 +135,7 @@ if(!isset($POST_CHECKBOXES))
$SEARCH_TEMPLATE['form']['start'] = ' $SEARCH_TEMPLATE['form']['start'] = '
<form class="form-horizontal" role="form" id="searchform" method="get" action="'.e_SELF.'"> <form class="form-horizontal" role="form" id="searchform" method="get" action="{SEARCH_FORM_URL}">
<div class="form-group"> <div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">'.LAN_199.'</label> <label for="inputEmail3" class="col-sm-3 control-label">'.LAN_199.'</label>
<div class="col-sm-9">{SEARCH_MAIN} <div class="col-sm-9">{SEARCH_MAIN}

View File

@@ -61,12 +61,12 @@ if (isset($custom_query[5]) && $custom_query[5]) {
$value_text = "value=''"; $value_text = "value=''";
} }
$search_form_url = e107::getUrl()->create('search');
if(deftrue('BOOTSTRAP')) if(deftrue('BOOTSTRAP'))
{ {
$text = ' $text = '
<form class="form-inline" method="get" action="'.e_HTTP.'search.php"> <form class="form-inline" method="get" action="'.$search_form_url.'">
<div class="input-group"> <div class="input-group">
<input class="form-control search" type="text" name="q" size="20" maxlength="50" '.$value_text.' /> <input class="form-control search" type="text" name="q" size="20" maxlength="50" '.$value_text.' />
<input type="hidden" name="r" value="0" />'; <input type="hidden" name="r" value="0" />';
@@ -85,7 +85,7 @@ if(deftrue('BOOTSTRAP'))
} }
else // Legacy v1 code. else // Legacy v1 code.
{ {
$text = "<form class='form-inline' method='get' action='".e_HTTP."search.php'>"; $text = "<form class='form-inline' method='get' action='".$search_form_url."'>";
$text .= " $text .= "
<div> <div>
@@ -109,7 +109,10 @@ else // Legacy v1 code.
if (isset($searchflat) && $searchflat) if (isset($searchflat) && $searchflat)
{ {
echo $text; echo $text;
} else { }
else
{
$ns->tablerender(LAN_SEARCH." ".SITENAME, "<div style='text-align:center'>".$text."</div>", 'search'); $ns->tablerender(LAN_SEARCH." ".SITENAME, "<div style='text-align:center'>".$text."</div>", 'search');
} }
?> ?>

View File

@@ -238,6 +238,17 @@ class search extends e_shortcode
return $this->message; return $this->message;
} }
function sc_search_form_url($parm='')
{
return e107::getUrl()->create('search');
}
// -----------------------
private function selectElement($parm) private function selectElement($parm)
{ {
// standard search config // standard search config