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

is_tracking_vars_active()

Description

Check if ResourceSpace is still tracking variables for debug purposes.

Parameters

ColumnTypeDefaultDescription
$user int User ID for which we check if tracking vars is active

Return

boolean

Location

include/debug_functions.php lines 148 to 157

Definition

 
function is_tracking_vars_active(int $user)
    {
    
$duration = (int) get_sysvar("track_var_{$user}_duration"0) ?? 0;
    
$start = new DateTime(get_sysvar("track_var_{$user}_start_datetime"''));
    
$now = new DateTime();

    
$diff_in_min abs($now->getTimestamp() - $start->getTimestamp()) / 60;

    return 
$duration > (int) $diff_in_min;
    }

This article was last updated 15th June 2021 13:35 Europe/London time based on the source file dated 10th May 2021 17:30 Europe/London time.