public_html/wp-content/plugins/wp-statistics/includes/functions/functions.php
// This function is used to calculate the number of days and thier respective unix timestamps.
This function is used to calculate the number of days and thier respective unix timestamps.
This function is used to calculate the number of days and thier respective unix timestamps .
function wp_statistics_date_range_calculator( $days, $start, $end ) {
		GLOBAL $WP_Statistics;
		$daysToDisplay = $days;
		$rangestart = $start;
		$rangeend = $end;
		if( $daysToDisplay == -1 ) {
			$rangestart_utime = $WP_Statistics->strtotimetz( $rangestart );
			$rangeend_utime = $WP_Statistics->strtotimetz( $rangeend );
			$daysToDisplay = (int)( ( $rangeend_utime - $rangestart_utime ) / 24 / 60 / 60 );
			if( $rangestart_utime == FALSE || $rangeend_utime == FALSE ) {
				$daysToDisplay = 20;
				$rangeend_utime = $WP_Statistics->timetz();
				$rangestart_utime = $rangeend_utime - ( $daysToDisplay * 24 * 60 * 60 );
			}
		}
		else {
			$rangeend_utime = $WP_Statistics->timetz();
			$rangestart_utime = $rangeend_utime - ( $daysToDisplay * 24 * 60 * 60 );
		}
		return array( $daysToDisplay, $rangestart_utime, $rangeend_utime );
	}
function wp_statistics_date_range_calculator ( $ days , $ start , $ end ) { GLOBAL $ WP_Statistics ; $ daysToDisplay = $ days ; $ rangestart = $ start ; $ rangeend = $ end ; if ( $ daysToDisplay == - 1 ) { $ rangestart_utime = $ WP_Statistics -> strtotimetz ( $ rangestart ) ; $ rangeend_utime = $ WP_Statistics -> strtotimetz ( $ rangeend ) ; $ daysToDisplay = ( int ) ( ( $ rangeend_utime - $ rangestart_utime ) / 24 / 60 / 60 ) ; if ( $ rangestart_utime == FALSE || $ rangeend_utime == FALSE ) { $ daysToDisplay = 20 ; $ rangeend_utime = $ WP_Statistics -> timetz ( ) ; $ rangestart_utime = $ rangeend_utime - ( $ daysToDisplay * 24 * 60 * 60 ) ; } } else { $ rangeend_utime = $ WP_Statistics -> timetz ( ) ; $ rangestart_utime = $ rangeend_utime - ( $ daysToDisplay * 24 * 60 * 60 ) ; } return array ( $ daysToDisplay , $ rangestart_utime , $ rangeend_utime ) ; }
This function is used to calculate the number of days and thier respective unix timestamps.
This function is used to calculate the number of days and thier respective unix timestamps .