Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

get_config_options()

Description

Get config option from database for a specific user or system wide

this parameter which is passed by reference

Parameters

ColumnTypeDefaultDescription
$user_id integer Current user ID. Can also be null to retrieve system wide config options
&$returned_options array
$returned_options array If a value does exist it will be returned through

Return

boolean

Location

include/config_functions.php lines 244 to 264

Definition

 
function get_config_options($user_id, array &$returned_options)
    {
    
$query sprintf('
            SELECT parameter,
                   `value`
              FROM user_preferences
             WHERE %s;
        '
,
        
is_null($user_id) ? 'user IS NULL' 'user = \'' escape_check($user_id) . '\''
    
);
    
$config_options sql_query($query,"preferences");

    if(empty(
$config_options))
        {
        return 
false;
        }

    
$returned_options $config_options;

    return 
true;
    }

This article was last updated 10th July 2020 19:35 Europe/London time based on the source file dated 8th July 2020 11:40 Europe/London time.