Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

get_session_collections()

Parameters

ColumnTypeDefaultDescription
$rs_session
$userref ""
$create false

Location

include/collections_functions.php lines 3974 to 4000

Definition

 
function get_session_collections($rs_session,$userref="",$create=false)
    {
    
$extrasql="";
    
$params=array("s",$rs_session);
    if(
$userref!="")
        {
        
$extrasql="AND user=?"
        
$params[]="i";$params[]=$userref;
        }
    else
        {
        
$userref='NULL';
        }
    
$collectionrefs=ps_array("SELECT ref value FROM collection WHERE session_id=? AND type IN ('" COLLECTION_TYPE_STANDARD "','" COLLECTION_TYPE_UPLOAD "','" COLLECTION_TYPE_SHARE_UPLOAD "') " $extrasql,$params,"");
    if(
count($collectionrefs)<&& $create)
        {
        if(
upload_share_active())
            {
            
$collectionrefs[0]=create_collection($userref,"New uploads",0,1,0,false,array("type"=>5)); # Do not translate this string!
            
}
        else
            {
            
$collectionrefs[0]=create_collection($userref,"Default Collection",0,1); # Do not translate this string!    
            
}
        }       
    return 
$collectionrefs
    }

This article was last updated 19th July 2024 21:35 Europe/London time based on the source file dated 19th July 2024 16:55 Europe/London time.