Esempio n. 1
0
function HookFilterboxSearchSearchstringprocessing()
	{
	global $search;
	$refine=trim(getvalescaped("refine_keywords", ""));
	if ($refine != "")
		$search .= ",".$refine;

	$search=refine_searchstring($search);
	}
Esempio n. 2
0
    $archive = getvalescaped("saved_archive", 0);
    setcookie("saved_archive", $archive);
}
hook("searchparameterhandler");
# If requested, refresh the collection frame (for redirects from saves)
if (getvalescaped("refreshcollectionframe", "") != "") {
    refresh_collection_frame();
}
# 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") {
Esempio n. 3
0
<!DOCTYPE html>
<?php
include "../include/db.php";
include "../include/general.php";
include "../include/resource_functions.php";
include "../include/image_processing.php";
include "../include/search_functions.php";
include "../include/mia_functions.php";
//phpinfo();exit();
print_r(refine_searchstring("art in bloom"));
//var_dump(get_user(8));
echo(get_resource_path(473, true, "", false, $extension="mp3"));
?>
<head>
  <title>Testing</title>
  <script type="text/javascript" src="http://localhost/lib/js/jquery-1.7.2.min.js"></script>
  <script type="text/javascript" src="http://localhost/lib/js/jquery-ui-1.10.2.custom.min.js"></script>
  <style type="text/css">
    body{margin:0;padding:0;}
    #search-results > li{width: 18%; display:inline-block; vertical-align:top;  word-wrap:break-word; margin: 1%; border-bottom: 20px solid #CCC}
    .ui-datepicker{background: #FFF; border: 1px solid; padding: 10px;}
    .ui-datepicker-current-day{background:#FF0000;}
    #loader{position:fixed; text-align:center; top: 0; left:0; background: rgba(255,255,255,0.8); width: 100%; height: 50%; padding: 25% 0; z-index: 10000; display: none;}
  </style>
</head>

<body>
<div id="loader">Quering Results<br/><img src="../gfx/ajax-loader.gif"/></div>
<h1>Resourcespace Custom API Search</h1>
<form id="elastic">
<input type="submit" value="Update Results to Elastic Search">
Esempio n. 4
0
    $simple_fields[] = $fields[$n]["name"];
}
# Also strip date related fields.
$simple_fields[] = "year";
$simple_fields[] = "month";
$simple_fields[] = "day";
hook("simplesearch_stripsimplefields");
# Process all keywords, putting set fieldname/value pairs into an associative array ready for setting later.
# Also build a quicksearch string.
# Recognise a quoted search, which is a search for an exact string
$quoted_string = false;
if (substr($quicksearch, 0, 1) == "\"" && substr($quicksearch, -1, 1) == "\"") {
    $quoted_string = true;
    $quicksearch = substr($quicksearch, 1, -1);
}
$quicksearch = refine_searchstring($quicksearch);
$keywords = split_keywords($quicksearch);
$set_fields = array();
$simple = array();
for ($n = 0; $n < count($keywords); $n++) {
    if (trim($keywords[$n]) != "") {
        if (strpos($keywords[$n], ":") !== false) {
            $s = explode(":", $keywords[$n]);
            if (isset($set_fields[$s[0]])) {
                $set_fields[$s[0]] .= " " . $s[1];
            } else {
                $set_fields[$s[0]] = $s[1];
            }
            if (!in_array($s[0], $simple_fields)) {
                $simple[] = trim($keywords[$n]);
            }
Esempio n. 5
0
function HookRefineresultsSearchSearchstringprocessing()
{
    global $search, $k;
    $refine = trim(getvalescaped("refine_keywords", ""));
    if ($refine != "") {
        if ($k != "") {
            # Slightly different behaviour when searching within external shares. There is no search bar, so the provided string is the entirity of the search.
            $s = explode(" ", $search);
            $search = $s[0] . " " . $refine;
        } else {
            $search .= ", " . $refine;
        }
    }
    $search = refine_searchstring($search);
}
Esempio n. 6
0
function HookRefineresultsSearchSearchstringprocessing()
{
    global $search;
    $refine = trim(getvalescaped("refine_keywords", ""));
    if ($refine != "") {
        $search .= "," . $refine;
    }
    $search = refine_searchstring($search);
}