Main Page   File List   File Members   Related Pages  

stats.inc.php

Go to the documentation of this file.
00001 <?php
00002 function Istats_reallyIE()
00003 //{{{
00004 {
00005         /*
00006          * Detect browsers that have faked the user-agent string
00007          * to pretend to be MSIE - we don't want MSIE to appear
00008          * more popular than it really is :)
00009          *
00010          * The way we do this is look for things in the headers,
00011          * excluding user-agent, that other web-browsers send but
00012          * MSIE doesn't.
00013          */
00014         if (stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml'))
00015                 return false;   // Opera, Mozilla and derivatives
00016         if (stristr($_SERVER['HTTP_ACCEPT_ENCODING'], 'identity'))
00017                 return false;   // Konqueror and derivatives (Safari)
00018         if (stristr($_SERVER['HTTP_ACCEPT'], 'text/sgml'))
00019                 return false;   // Lynx
00020         if (stristr($_SERVER['HTTP_ACCEPT_CHARSET'], 'utf-8'))
00021                 return false;   // Links
00022         
00023         return true;
00024 }
00025 //}}}
00026 function Istats_UIRH($cell)     // UnInstall - Remove Hook
00027 //{{{
00028 {
00029         $hooks = get_entry('hooks', $cell . '_cell');
00030         ListDel('stats', $hooks);
00031         set_entry('hooks', $cell . '_cell', $hooks);
00032 }
00033 //}}}
00034 function Istats_totalCount()
00035 //{{{
00036 {
00037         $page_count = get_reccount('pages');
00038         $hits = 0;
00039         for ($i = 1; $i <= $page_count; $i++)
00040         {
00041                 $hits += get_field2('pages', 'hits', $i);
00042         }
00043         return $hits;
00044 }
00045 //}}}
00046 function Istats_getCount($id)
00047 //{{{
00048 {
00049         $config = get_entry('stats_config', $id);
00050         switch (get_option($config, 'mode'))
00051         {
00052                 case 'total':
00053                         return Istats_totalCount();
00054                 default:
00055                         die(
00056                                 'Critical error: Unknown mode (' . get_option($config, 'mode') .
00057                                 ") in Istats_getCount($id).");
00058         }
00059 }
00060 //}}}
00061 ?>

Generated on Wed Jun 9 03:38:16 2004 for modphpcms by doxygen1.2.18