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

get_user_selection_collection()

Description

Get a users' collection of type SELECTION.

There can only be one collection of this type per user. If more, the first one found will be used instead.

Parameters

ColumnTypeDefaultDescription
$user integer User ID

Return

null|integer Returns NULL if none found or the collection ID

Location

include/collections_functions.php lines 4307 to 4321

Definition

 
function get_user_selection_collection($user)
    {
    global 
$rs_session;
    if(!
is_numeric($user))
        {
        return 
null;
        }
    
$sql sprintf("SELECT ref AS `value` FROM collection WHERE `user` = '%s' AND `type` = '%s' %s ORDER BY ref ASC",
        
escape_check($user),
        
COLLECTION_TYPE_SELECTION,
        ((isset(
$rs_session) && $rs_session != "") ? " AND session_id='" $rs_session "'"  "")
    );

    return 
sql_value($sqlnull);
    }

This article was last updated 3rd December 2020 13:05 Europe/London time based on the source file dated 2nd December 2020 12:10 Europe/London time.