Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 1232 to 1260

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 17th November 2024 15:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.