Ignore:
Timestamp:
03/30/06 01:23:12 (8 years ago)
Author:
benjamin
Message:

replacing stats class by webalizer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bureau/class/m_webalizer.php

    r1506 r1520  
    3838*  
    3939*/ 
    40 class m_stats { 
     40class m_webalizer { 
    4141 
    4242  /** Emplacement des fichiers de conf webalizer 
     
    7575   * Constructeur 
    7676   */ 
    77   function m_stats() { 
     77  function m_webalizer() { 
    7878  } 
    7979 
     
    9191   */ 
    9292  function alternc_module_description() { 
    93     return array("stats"=>_("The stats module allows any user to ask for statistics about his web site. Statistics are web pages generated daily based on the visits of the day before. Webalizer is the soft used to produce those stats. The statistics can be produced in many languages.")); 
     93    return array("webalizer"=>_("The stats module allows any user to ask for statistics about his web site. Statistics are web pages generated daily based on the visits of the day before. Webalizer is the soft used to produce those stats. The statistics can be produced in many languages.")); 
    9494  }  
    9595 
     
    107107  function get_list() { 
    108108    global $db,$err,$cuid; 
    109     $err->log("stats","get_list"); 
     109    $err->log("webalizer","get_list"); 
    110110    $r=array(); 
    111111    $db->query("SELECT id, hostname, dir, lang FROM stats WHERE uid='$cuid' ORDER BY hostname;"); 
     
    123123      return $r; 
    124124    } else { 
    125       $err->raise("stats",1); 
     125      $err->raise("webalizer",1); 
    126126      return false; 
    127127    } 
     
    142142  function get_stats_details($id) { 
    143143    global $db,$err,$cuid; 
    144     $err->log("stats","get_stats_details",$id); 
     144    $err->log("webalizer","get_stats_details",$id); 
    145145    $r=array(); 
    146146    $db->query("SELECT id, hostname, dir, lang FROM stats WHERE uid='$cuid' AND id='$id';"); 
     
    156156                   ); 
    157157    } else { 
    158       $err->raise("stats",2); 
     158      $err->raise("webalizer",2); 
    159159      return false; 
    160160    } 
     
    219219  function put_stats_details($id,$dir,$stlang) { 
    220220    global $db,$err,$bro,$mem,$cuid; 
    221     $err->log("stats","put_stats_details",$id); 
     221    $err->log("webalizer","put_stats_details",$id); 
    222222    $db->query("SELECT count(*) AS cnt FROM stats WHERE id='$id' and uid='$cuid';"); 
    223223    $db->next_record(); 
    224224    if (!$db->f("cnt")) { 
    225       $err->raise("stats",2); 
     225      $err->raise("webalizer",2); 
    226226      return false; 
    227227    } 
     
    232232    // On a épuré $dir des problèmes eventuels ... On est en DESSOUS du dossier de l'utilisateur. 
    233233    if (!$this->langname[$stlang]) { 
    234       $err->raise("stats",6); 
     234      $err->raise("webalizer",6); 
    235235      return false; 
    236236    } 
     
    250250  function delete_stats($id) { 
    251251    global $db,$err,$cuid; 
    252     $err->log("stats","delete_stats",$id); 
     252    $err->log("webalizer","delete_stats",$id); 
    253253    $db->query("SELECT hostname FROM stats WHERE id='$id' and uid='$cuid';"); 
    254254    if (!$db->num_rows()) { 
    255       $err->raise("stats",2); 
     255      $err->raise("webalizer",2); 
    256256      return false; 
    257257    } 
     
    272272  function add_stats($hostname,$dir,$lang) { 
    273273    global $db,$err,$quota,$bro,$mem,$cuid; 
    274     $err->log("stats","add_stats",$hostname); 
     274    $err->log("webalizer","add_stats",$hostname); 
    275275    $dir=$bro->convertabsolute($dir); 
    276276    if (substr($dir,0,1)=="/") { 
     
    280280    $r=$this->host_list(); 
    281281    if (!in_array($hostname,$r) || $hostname=="") { 
    282       $err->raise("stats",3); 
     282      $err->raise("webalizer",3); 
    283283      return false; 
    284284    } 
    285285    if (!$this->langname[$lang]) { 
    286       $err->raise("stats",6); 
     286      $err->raise("webalizer",6); 
    287287      return false; 
    288288    } 
     
    295295      return true; 
    296296    } else { 
    297       $err->raise("stats",5); 
     297      $err->raise("webalizer",5); 
    298298      return false; 
    299299    } 
     
    302302  function alternc_del_member() { 
    303303    global $db,$err,$cuid; 
    304     $err->log("stats","del_member"); 
     304    $err->log("webalizer","del_member"); 
    305305    $db->query("SELECT * FROM stats WHERE uid='$cuid';"); 
    306306    $cnt=0; 
     
    324324  function alternc_del_domain($dom) { 
    325325    global $db,$err,$cuid; 
    326     $err->log("stats","del_dom",$dom); 
     326    $err->log("webalizer","del_dom",$dom); 
    327327    $db=new DB_System(); 
    328328    $db->query("SELECT * FROM stats WHERE uid='$cuid' AND hostname like '%$dom'"); 
     
    377377    } 
    378378    if (!$db->num_rows()) { 
    379       $err->raise("stats",2); 
     379      $err->raise("webalizer",2); 
    380380      return false; 
    381381    } 
     
    388388  } 
    389389 
    390 } /* CLASSE m_stats */ 
     390} /* CLASSE m_webalizer */ 
    391391 
    392392?> 
Note: See TracChangeset for help on using the changeset viewer.