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

process_config_options()

Description

Process configuration options from database
either system wide or user specific by setting
the global variable

Parameters

ColumnTypeDefaultDescription
$user_id int null

Return

void

Location

include/config_functions.php lines 288 to 317

Definition

 
function process_config_options($user_id null)
    {
    global 
$user_preferences;

    
// If the user doesn't have the ability to set his/her own preferences, then don't load it either
    
if(!is_null($user_id) && !$user_preferences)
        {
        return;
        }

    
$config_options = array();

    if(
get_config_options($user_id$config_options))
        {
        foreach(
$config_options as $config_option)
            {
            
$param_value $config_option['value'];

            
// Prepare the value since everything is stored as a string
            
if((is_numeric($param_value) && '' !== $param_value))
                {
                
$param_value = (int) $param_value;
                }

            
$GLOBALS[$config_option['parameter']] = $param_value;
            }
        }

    return;
    }

This article was last updated 30th November 2020 01:05 Europe/London time based on the source file dated 6th October 2020 10:25 Europe/London time.