Collections functions
General functions
Render functions
Theme permission functions
Resource functions

do_collections_search()

Description

Search within available collections

Parameters

ColumnTypeDefaultDescription
$search string
$restypes string
$archive integer 0
$order_by string ''
$sort string "DESC"
$fetchrows integer -1

Return

array

Location

include/collections_functions.php lines 1163 to 1196

Definition

 
function do_collections_search($search,$restypes,$archive=0,$order_by='',$sort="DESC"$fetchrows = -1)
    {
    global 
$search_includes_themes$default_collection_sort;
    if(
$order_by=='')
        {
        
$order_by=$default_collection_sort;
        }
    
$result=array();
    
    
# Recognise a quoted search, which is a search for an exact string
    
$quoted_string=false;
    if (
substr($search,0,1)=="\"" && substr($search,-1,1)=="\""
        {
        
$quoted_string=true;
        
$search=substr($search,1,-1);
        }

    
$search_includes_themes_now=$search_includes_themes;
    if (
$restypes!=""
        {
        
$restypes_x=explode(",",$restypes);
        
$search_includes_themes_now=in_array("themes",$restypes_x);
        } 

    if (
$search_includes_themes_now)
        {
        
# Same search as when searching within public collections.
        
$collections=search_public_collections($search,"name","ASC",!$search_includes_themes_now,true,false,$fetchrows);
        
        
$condensedcollectionsresults=array();
        
$result=$collections;
        }
    return 
$result;
    }

This article was last updated 5th October 2022 12:05 Europe/London time based on the source file dated 5th October 2022 10:35 Europe/London time.