Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

get_search_title()

Description

Get a display friendly name for the given search string
Takes a full searchstring of the form 'search=restypes=archive=starsearch=' and
uses search_title_processing to autocreate a more informative title

Parameters

ColumnTypeDefaultDescription
$searchstring string Search string

Return

string Friendly name for search

Location

include/collections_functions.php lines 1797 to 1832

Definition

 
function get_search_title($searchstring)
    {    
    
$order_by="";
    
$sort="";
    
$offset="";
    
$k=getvalescaped("k","");

    
$search_titles=true;
    
$search_titles_searchcrumbs=true;
    
$use_refine_searchstring=true;
    
$search_titles_shortnames=false;

    global 
$lang,$userref,$baseurl,$collectiondata,$result,$display,$pagename,$collection,$userrequestmode,$preview_all;

    
parse_str($searchstring,$searchvars);
    if (isset(
$searchvars["archive"])){$archive=$searchvars["archive"];}else{$archive=0;}
    if (isset(
$searchvars["search"])){$search=$searchvars["search"];}else{$search="";}
    if (isset(
$searchvars["starsearch"])){$starsearch=$searchvars["starsearch"];}else{$starsearch="";}
    if (isset(
$searchvars["restypes"])){$restypes=$searchvars["restypes"];}else{$restypes="";}

    
$collection_dropdown_user_access_mode=false;
    include(
dirname(__FILE__)."/search_title_processing.php");

    if (
$starsearch!=0){$search_title.="(".$starsearch;$search_title.=($starsearch>1)?" ".$lang['stars']:" ".$lang['star'];$search_title.=")";}
    if (
$restypes!="")
        { 
        
$resource_types=get_resource_types($restypes);
        foreach(
$resource_types as $type)
            {
            
$typenames[]=$type['name'];
            }
        
$search_title.=" [".implode(', ',$typenames)."]";
        }
    
$title=str_replace(">","",strip_tags($search_title));
    return 
$title;
    }

This article was last updated 24th November 2020 06:05 Europe/London time based on the source file dated 23rd November 2020 16:00 Europe/London time.