Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

get_config_option()

Description

Get config option from database

this parameter which is passed by reference
global setting e.g. for checking admin resource preferences

Parameters

ColumnTypeDefaultDescription
$user_id integer Current user ID
$name string Parameter name
&$returned_value
$default mixed null Optionally used to set a default that may not be the current
$returned_value string If a value does exist it will be returned through

Return

boolean

Location

include/config_functions.php lines 188 to 219

Definition

 
function get_config_option($user_id$name, &$returned_value$default null)
    {
    if(
trim($name) === '')
        {
        return 
false;
        }

    
$query sprintf('
            SELECT `value`
              FROM user_preferences
             WHERE user %s
               AND parameter = "%s";
        '
,
        
is_null($user_id) ? 'IS NULL' '= \'' escape_check($user_id) . '\'',
        
$name
    
);
    
$config_option sql_value($querynull);

    if(
is_null($default) && isset($GLOBALS['system_wide_config_options'][$name]))
        {
        
$default $GLOBALS['system_wide_config_options'][$name];
        }

     if(
is_null($config_option))
        {
        
$returned_value = isset($default) ? $default null;
        return 
false;
        }

    
$returned_value unescape($config_option);
    return 
true;
    }

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