phpUserTrack
[ class tree: phpUserTrack ] [ index: phpUserTrack ] [ all elements ]

Source for file libdata.php

Documentation is available at libdata.php

  1. <?php
  2. /**
  3.  * Data table manipulation class
  4.  * @author Christopher Troup <mini@chatetheory.com>
  5.  * @package phpUserTrack
  6.  * @subpackage Libraries
  7.  */
  8.  
  9. require_once 'libdb.php';
  10.  
  11.     /**
  12.      * Site index
  13.      * @var integer
  14.      */
  15.     var $_siteId = null;
  16.     
  17.     /**
  18.      * Profile index
  19.      * @var integer
  20.      */
  21.     var $_profileId = null;
  22.     
  23.     /**
  24.      * Requested path
  25.      * @var string
  26.      */
  27.     var $_path = null;
  28.     
  29.     /**
  30.      * Referring page
  31.      * @var string
  32.      */
  33.     var $_referrer = null;
  34.     
  35.     var $_timestamp = null;
  36.     
  37.     /**
  38.      * Class constructor. Set class data.
  39.      * @param integer $site_id Site index
  40.      * @param integer $profileId Profile index
  41.      * @param string $path Requested path
  42.      * @param string $referrer Referring page
  43.      * @return mixed false if site id is given as null.
  44.      */
  45.     function phpusertrack_data($site_id null$profileId null$path null$referrer null{
  46.         if ($site_id != null{
  47.             $this->_siteId = $site_id;
  48.             $this->_profileId = $profileId;
  49.             $this->_path = $path;
  50.             $this->_referrer = $referrer;
  51.             $this->_timestamp = date('Y-m-d H:i:s'time());
  52.         else {
  53.             return false;
  54.         }
  55.     }
  56.     
  57.     /**
  58.      * Record that the user requested the path.
  59.      * @global $conf
  60.      */
  61.     function insertNewPageHit({
  62.         global $conf;
  63.         if ($this->_profileId != null{
  64.             $sql 'insert into ' $conf['dataTable'' set ip_id=' $this->_profileId . 
  65.                 ', timestamp="' $this->_timestamp . '", path="' $this->_path . 
  66.                 '", site_id="' $this->_siteId . '", referrer="' $this->_referrer . '"';
  67.             $this->_insert($sql);        
  68.         }
  69.     }
  70.  
  71. }
  72. ?>

Documentation generated on Tue, 06 Nov 2007 09:21:57 -0800 by phpDocumentor 1.4.0a2