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

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.