Example #1
0
                    if ($campo) {
                        $q = $campo . ':(' . $query . ')';
                    } else {
                        $q = $query;
                    }
                }
            }
        }
    }
    header('Location: ./?lang=' . $lang . '&sort=' . $sort . '&count=' . $count . '&q=' . $q);
} else {
    if (isset($_REQUEST["clear_history"])) {
        unset($_SESSION['search_history']);
    }
    $page = new Page();
    $page->form_advanced();
}
function replace_by_history($number)
{
    $index = intval($number) - 1;
    $exp = "#{$number}";
    if ($_SESSION['search_history'][$index] != '') {
        $search_parts = explode("|", $_SESSION['search_history'][$index]);
        $exp = "(" . trim($search_parts[0]);
        if ($search_parts[1] != '') {
            $exp .= " AND (" . $search_parts[1] . ")";
        }
        $exp .= ")";
    }
    return $exp;
}