# advanced search - build a search query and redirect
    $fields = array_merge(get_advanced_search_fields(false, $hiddenfields), get_advanced_search_collection_fields(false, $hiddenfields));
    # Build a search query from the search form
    $search = search_form_to_search_query($fields);
    $search = refine_searchstring($search);
    hook("moresearchcriteria");
    if (getval("countonly", "") != "") {
        # Only show the results (this will appear in an iframe)
        if (count($search) == 0) {
            $count = 0;
        } else {
            #debug("restypes:".$restypes."=".$search.";".substr($restypes,0,11));
            if (substr($restypes, 0, 11) != "Collections") {
                $result = do_search($search, $restypes, "relevance", $archive, 1, "", false, $starsearch);
            } else {
                $result = do_collections_search($search, $restypes, $archive);
            }
            if (is_array($result)) {
                $count = count($result);
            } else {
                $count = 0;
            }
        }
        ?>
		<html>
		<script type="text/javascript">
	
		
		<?php 
        if ($count == 0) {
            ?>
Пример #2
0
}
# Initialise the results references array (used later for search suggestions)
$refs = array();
# Special query? Ignore restypes
if (strpos($search, "!") !== false) {
    $restypes = "";
}
# Do the search!
$search = refine_searchstring($search);
if (strpos($search, "!") === false) {
    setcookie("search", $search);
}
hook('searchaftersearchcookie');
$result = do_search($search, $restypes, $order_by, $archive, $per_page + $offset, $sort, false, $starsearch, false, false, $daylimit, getvalescaped("go", ""));
if ($k == "" && strpos($search, "!") === false && $archive == 0) {
    $collections = do_collections_search($search, $restypes);
}
// don't do this for external shares
# Allow results to be processed by a plugin
$hook_result = hook("process_search_results", "search", array("result" => $result, "search" => $search));
if ($hook_result !== false) {
    $result = $hook_result;
}
if (substr($search, 0, 11) == "!collection") {
    $collection = substr($search, 11);
    $collection = explode(",", $collection);
    $collection = $collection[0];
    $collectiondata = get_collection($collection);
    if ($k != "") {
        $usercollection = $collection;
    }
Пример #3
0
	}

# Initialise the results references array (used later for search suggestions)
$refs=array();

# Special query? Ignore restypes
if (strpos($search,"!")!==false) {$restypes="";}

# Do the search!
$search=refine_searchstring($search);
if (strpos($search,"!")===false) {setcookie("search",$search, 0, '', '', false, true);}
hook('searchaftersearchcookie');
if (!hook("replacesearch")) {
	$result=do_search($search,$restypes,$order_by,$archive,$per_page+$offset,$sort,false,$starsearch,false,false,$daylimit, getvalescaped("go",""));
}
if($k=="" && strpos($search,"!")===false && $archive==0){$collections=do_collections_search($search,$restypes);} // don't do this for external shares

# Allow results to be processed by a plugin
$hook_result=hook("process_search_results","search",array("result"=>$result,"search"=>$search));
if ($hook_result!==false) {$result=$hook_result;}

if ($collectionsearch)
	{
	$collection=substr($search,11);
	$collection=explode(",",$collection);
	$collection=$collection[0];
	$collectiondata=get_collection($collection);
	
	if ($k!="") {$usercollection=$collection;} # External access - set current collection.
	
	if (!$collectiondata){?>