Esempio n. 1
0
     $search_arguments['date_from'] = $_POST['date_from'];
 }
 if (isset($_POST['date_to']) && is_numeric($_POST['date_to'])) {
     $search_arguments['date_to'] = $_POST['date_to'];
 }
 if (isset($_POST['sort_by']) && is_numeric($_POST['sort_by'])) {
     $search_arguments['sort_by'] = $_POST['sort_by'];
 }
 if (isset($_POST['sort_dir']) && is_numeric($_POST['sort_dir'])) {
     $search_arguments['sort_dir'] = $_POST['sort_dir'];
 }
 if (isset($_POST['group_by_thread']) && is_numeric($_POST['group_by_thread'])) {
     $search_arguments['group_by_thread'] = $_POST['group_by_thread'];
 }
 $error = SEARCH_NO_ERROR;
 if (($search_success = search_execute($search_arguments, $error)) !== false) {
     if (isset($_GET['search_string']) || isset($_GET['logon'])) {
         $redirect_uri = "index.php?webtag={$webtag}&final_uri=discussion.php";
         $redirect_uri .= "%3Fwebtag%3D{$webtag}%26left%3Dsearch_results";
         header_redirect($redirect_uri);
         exit;
     }
 } else {
     if (isset($_GET['search_string']) || isset($_GET['logon'])) {
         $redirect_uri = "index.php?webtag={$webtag}&final_uri=discussion.php";
         $redirect_uri .= "%3Fwebtag%3D{$webtag}%26right%3Dsearch";
         $redirect_uri .= "%26search_error%3D{$error}";
         header_redirect($redirect_uri);
         exit;
     } else {
         switch ($error) {
Esempio n. 2
0
     $search_arguments['date_from'] = $_POST['date_from'];
 }
 if (isset($_POST['date_to']) && is_numeric($_POST['date_to'])) {
     $search_arguments['date_to'] = $_POST['date_to'];
 }
 if (isset($_POST['sort_by']) && is_numeric($_POST['sort_by'])) {
     $search_arguments['sort_by'] = $_POST['sort_by'];
 }
 if (isset($_POST['sort_dir']) && is_numeric($_POST['sort_dir'])) {
     $search_arguments['sort_dir'] = $_POST['sort_dir'];
 }
 if (isset($_POST['group_by_thread']) && is_numeric($_POST['group_by_thread'])) {
     $search_arguments['group_by_thread'] = $_POST['group_by_thread'];
 }
 $error = SEARCH_NO_ERROR;
 if ($search_success = search_execute($search_arguments, $error)) {
     if (isset($_GET['search_string']) || isset($_GET['logon'])) {
         $redirect_uri = "index.php?webtag={$webtag}&final_uri=discussion.php";
         $redirect_uri .= "%3Fwebtag%3D{$webtag}%26left%3Dsearch_results";
         header_redirect($redirect_uri);
         exit;
     } else {
         header_redirect("search.php?webtag={$webtag}&search_success=true&sort_by={$sort_by}&sort_dir={$sort_dir}");
         exit;
     }
 } else {
     if (isset($_GET['search_string']) || isset($_GET['logon'])) {
         $redirect_uri = "index.php?webtag={$webtag}&final_uri=discussion.php";
         $redirect_uri .= "%3Fwebtag%3D{$webtag}%26right%3Dsearch";
         $redirect_uri .= "%26search_error%3D{$error}";
         header_redirect($redirect_uri);