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

Source for file libsite.php

Documentation is available at libsite.php

  1. <?php
  2. /**
  3.  * Site class library
  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.      * Class constructor
  19.      * @param integer $id Site index
  20.      */
  21.     function phpusertrack_site($id null{
  22.         if ($id != null{
  23.             $this->_siteId = $id;
  24.         else {
  25.             // TODO What to do if site Id not passed?
  26.         }
  27.         $this->_connect();
  28.     }
  29.  
  30.     /**
  31.      * Select and return list of all sites registered in phpUserTrack
  32.      * @return array List of sites
  33.      */
  34.     function selectSites({
  35.         return $this->_query('select * from phpusertrack_sites');
  36.     }
  37.     
  38.     function addSite($name$url$desc null{
  39.         $sql "insert into phpusertrack_sites set url='$url', name='$name', phpusertrack_sites.desc='$desc'";
  40.         return $this->_insert($sql);
  41.     }
  42.     
  43.     function getInfo($id null{
  44.         if ($id null{
  45.             $this->_siteId = $id;
  46.         }
  47.         $sql "select * from phpusertrack_sites where id=" $this->_siteId;
  48.         return $this->_query($sql);
  49.     }
  50.  
  51. }
  52. ?>

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