"Fossies" - the Fresh Open Source Software Archive

Member "betterawstats/index.php" (17 Mar 2008, 4643 Bytes) of package /linux/www/old/betterawstats-1.0.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "index.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 /**
    3  * betterawstats - an alternative display for awstats data
    4  *
    5  * @author      Oliver Spiesshofer, support at betterawstats dot com
    6  * @copyright   2008 Oliver Spiesshofer
    7  * @version     1.0
    8  * @link        http://betterawstats.com
    9  * Based on the GPL AWStats Totals script by:
   10  * Jeroen de Jong <jeroen@telartis.nl>
   11  * copyright   2004-2006 Telartis
   12  * version 1.13 (http://www.telartis.nl/xcms/awstats)
   13  *
   14  * This program is free software; you can redistribute it and/or
   15  * modify it under the terms of the GNU General Public License
   16  * as published by the Free Software Foundation; either version 2
   17  * of the License, or (at your option) any later version.
   18  *
   19  * This program is distributed in the hope that it will be useful,
   20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   22  * GNU General Public License for more details.
   23  *
   24  * You should have received a copy of the GNU General Public License
   25  * along with this program; if not, write to the Free Software
   26  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
   27  */
   28 
   29 /**
   30  * File contents:
   31  *
   32  * This file is the central gateway for all other files. It includes all required
   33  * files and handles in/output from GET /POST as well as preparation of default values
   34  */
   35 
   36 // var declaration
   37 $BAW_LOGTYPE = 'W'; // fix to weblog only for now, no email / FTP
   38 $BAW_CURR = array(); // holds all global values of the current session
   39 $BAW_CURR['thismonth'] = array('hits'=> 0);
   40 $BAW_CONF['max_percent'] = 'layout_percent';
   41 $BAW_CONF['max_bytes'] = 'layout_bytes';
   42 $BAW_D = array();
   43 $BAW_MES = array();
   44 $BAW_DFILES = array(); // data files
   45 $tmp = null; // Temp variable for all kinds of things
   46 
   47 include_once('./config.php');
   48 
   49 if ($BAW_CONF['debug']) {
   50     error_reporting(E_ALL);
   51     // ini_set('memory_limit','25M');
   52 }
   53 
   54 if (!defined ('XHTML')) {
   55     if ($BAW_CONF['xhtml']) {
   56         define('XHTML', ' /');
   57     } else {
   58         define('XHTML', '');
   59     }
   60 }
   61 if (!defined ('BR')) {
   62     define('BR', '<br'.XHTML.'>');
   63 }
   64 include_once('./core/helpers.inc.php');
   65 // define when the script was started
   66 if (!defined ('START_TIME')) {
   67     define('START_TIME', baw_mtime());
   68 }
   69 if ($BAW_CONF['online_config'] && baw_is_writable($BAW_CONF['site_path'] . '/config.php')) {
   70     include_once('./core/config.inc.php');
   71 }
   72 // start time calculation and save the first one for reference
   73 
   74 include_once('./modules/render_htmlchart.inc.php');
   75 include_once('./modules/render_table.inc.php');
   76 include_once('./modules/render_jpgraph.inc.php');
   77 include_once('./modules/render_map.inc.php');
   78 include_once('./core/data.inc.php');
   79 include_once('./core/language.inc.php');
   80 baw_language(); // this has to be b/f library & b/f baw_match_files()
   81 // find all the data, populate $BAW_DFILES
   82 $BAW_SERVERS = array(); // this will be populates with the servers for the config
   83 // editor. Since we need that in the config_default.inc.php, we need it even if online config is off
   84 
   85 
   86 include_once('./core/display_helpers.php');
   87 baw_match_files(); // we read all files here so we have the array for config and normal
   88 
   89 if (!isset($BAW_MES['e'])) {
   90     $BAW_MES['e'] = 'utf-8';
   91 }
   92 
   93 baw_check_config();
   94 include_once('./core/library.inc.php');
   95 
   96 include_once('./core/display.inc.php');
   97 include_once('./core/config_default.inc.php');
   98 include_once('./core/extras.inc.php');
   99 
  100 
  101 // get input from forms
  102 // it is questionable if this needs to be slashed or filtered since we dont write any data
  103 if (isset($_GET['year'])) {
  104     $BAW_CURR['year'] = $_GET['year'];
  105 } else {
  106     $BAW_CURR['year'] = date('Y');
  107 }
  108 if (isset($_GET['month'])) {
  109     $BAW_CURR['month'] = $_GET['month'];
  110 } else {
  111     $BAW_CURR['month'] = date('m');
  112 }
  113 $BAW_CURR['day'] = date('d');
  114 $BAW_CURR['yearmonth'] = $BAW_CURR['year'] . $BAW_CURR['month'];
  115 if (isset($_GET['site'])) {
  116     $BAW_CURR['site_name'] = $_GET['site'];
  117 }
  118 
  119 
  120 // add language-dependent library values
  121 $BAW_LIB['domains']['unknown'] = $BAW_MES[0];
  122 $BAW_LIB['domains']['ip'] = $BAW_MES[0];
  123 $BAW_LIB['os']['list']['Unknown'] = $BAW_MES[0];
  124 $BAW_LIB['browser']['names']['Unknown'] = $BAW_MES[0];
  125 $BAW_LIB['browser']['icons']['Unknown'] = 'unknown';
  126 
  127 if (isset($_REQUEST['action'])) { // used by poll and config editor
  128     $action = 'baw_action_' . $_REQUEST['action'];
  129     $out = $action();
  130 } else if (@$BAW_CURR['site_name'] == 'all_months') {
  131     $settings['section'] = "months";
  132     $out = baw_display_index($settings);
  133 } else if (@$BAW_CURR['site_name'] == 'all_days') {
  134     $settings['section'] = "days";
  135     $out = baw_display_index($settings);
  136 } else {
  137     $out = baw_display_index();
  138 }
  139 
  140 echo $out;
  141 ?>