public_html/wp-content/plugins/wp-statistics/includes/classes/statistics.class.php
// This function will add some initial data if the tables are empty.
This function will add some initial data if the tables are empty.
This function will add some initial data if the tables are empty .
public function Primary_Values() {
		$this->result = $this->db->query("SELECT * FROM {$this->tb_prefix}statistics_useronline");
		if( !$this->result ) {
			$this->db->insert(
				$this->tb_prefix . "statistics_useronline",
				array(
					'ip'		=>	$this->get_IP(),
					'timestamp'	=>	$this->Current_Date('U'),
					'date'		=>	$this->Current_Date(),
					'referred'	=>	$this->get_Referred(),
					'agent'		=>	$this->agent['browser'],
					'platform'	=>	$this->agent['platform'],
					'version'	=> 	$this->agent['version']
				)
			);
		}
		$this->result = $this->db->query("SELECT * FROM {$this->tb_prefix}statistics_visit");
		if( !$this->result ) {
			$this->db->insert(
				$this->tb_prefix . "statistics_visit",
				array(
					'last_visit'	=>	$this->Current_Date(),
					'last_counter'	=>	$this->Current_date('Y-m-d'),
					'visit'			=>	1
				)
			);
		}
		$this->result = $this->db->query("SELECT * FROM {$this->tb_prefix}statistics_visitor");
		if( !$this->result ) {
			$this->db->insert(
				$this->tb_prefix . "statistics_visitor",
				array(
					'last_counter'	=>	$this->Current_date('Y-m-d'),
					'referred'		=>	$this->get_Referred(),
					'agent'			=>	$this->agent['browser'],
					'platform'		=>	$this->agent['platform'],
					'version'		=> 	$this->agent['version'],
					'ip'			=>	$this->get_IP(),
					'location'		=>	'000'
				)
			);
		}
	}
public function Primary_Values ( ) { $ this -> result = $ this -> db -> query ( " SELECT * FROM  { $ this -> tb_prefix } statistics_useronline " ) ; if ( ! $ this -> result ) { $ this -> db -> insert ( $ this -> tb_prefix . " statistics_useronline " , array ( 'ip' => $ this -> get_IP ( ) , 'timestamp' => $ this -> Current_Date ( 'U' ) , 'date' => $ this -> Current_Date ( ) , 'referred' => $ this -> get_Referred ( ) , 'agent' => $ this -> agent [ 'browser' ] , 'platform' => $ this -> agent [ 'platform' ] , 'version' => $ this -> agent [ 'version' ] ) ) ; } $ this -> result = $ this -> db -> query ( " SELECT * FROM  { $ this -> tb_prefix } statistics_visit " ) ; if ( ! $ this -> result ) { $ this -> db -> insert ( $ this -> tb_prefix . " statistics_visit " , array ( 'last_visit' => $ this -> Current_Date ( ) , 'last_counter' => $ this -> Current_date ( 'Y-m-d' ) , 'visit' => 1 ) ) ; } $ this -> result = $ this -> db -> query ( " SELECT * FROM  { $ this -> tb_prefix } statistics_visitor " ) ; if ( ! $ this -> result ) { $ this -> db -> insert ( $ this -> tb_prefix . " statistics_visitor " , array ( 'last_counter' => $ this -> Current_date ( 'Y-m-d' ) , 'referred' => $ this -> get_Referred ( ) , 'agent' => $ this -> agent [ 'browser' ] , 'platform' => $ this -> agent [ 'platform' ] , 'version' => $ this -> agent [ 'version' ] , 'ip' => $ this -> get_IP ( ) , 'location' => '000' ) ) ; } }
This function will add some initial data if the tables are empty.
This function will add some initial data if the tables are empty .