Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 1231 to 1259

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
    
if (substr($search,0,1)=="\"" && substr($search,-1,1)=="\""
        {
        
$search=substr($search,1,-1);
        }

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

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

This article was last updated 19th March 2024 08:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.