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

get_mycollection_name()

Description

Fetches the next name for a new Default Collection for the given user (Default Collection 1, 2 etc.)

Parameters

ColumnTypeDefaultDescription
$userref integer

Return

void

Location

include/collections_functions.php lines 2438 to 2461

Definition

 
function get_mycollection_name($userref)
    {
    global 
$lang;
    for (
$n=1;$n<500;$n++)
        {
        
# Construct a name for this Default Collection. The name is translated when displayed!
        
if ($n==1)
            {
            
$name "Default Collection"# Do not translate this string!
            
}
        else
            {
            
$name "Default Collection " $n# Do not translate this string!
            
}
        
$ref=sql_value("select ref value from collection where user='" escape_check($userref) . "' and name='$name'",0);
        if (
$ref==0)
            {
            
# No match!
            
return $name;
            }
        }
    
# Tried nearly 500 names(!) so just return a standard name 
    
return "Default Collection";
    }

This article was last updated 7th December 2020 12:05 Europe/London time based on the source file dated 7th December 2020 11:55 Europe/London time.