Changeset 537 for trunk/admin/stats.php


Ignore:
Timestamp:
Sep 26, 2004, 11:24:49 PM (20 years ago)
Author:
gweltas
Message:

-First draft of history display

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/stats.php

    r527 r537  
    3030}
    3131include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' );
    32 $max_pixels = 500;
    33 //------------------------------------------------------------ comment deletion
    34 if ( isset( $_GET['del'] ) and is_numeric( $_GET['del'] ) )
    35 {
    36   $query = 'DELETE FROM '.COMMENTS_TABLE;
    37   $query.= ' WHERE id = '.$_GET['del'];
    38   $query.= ';';
    39   mysql_query( $query );
    40 }
    41 //--------------------------------------------------------- history table empty
    42 if ( isset( $_GET['act'] ) and $_GET['act'] == 'empty' )
    43 {
    44   $query = 'DELETE FROM '.HISTORY_TABLE.';';
    45   mysql_query( $query );
    46 }
    4732
    48 // empty link
    49 $url_empty = PHPWG_ROOT_PATH.'admin.php?page=stats';
    50 if (isset($_GET['last_days']))
    51         $url_empty .='&last_days='.$_GET['last_days'];
    52 $url_empty.= '&act=empty';
     33$url_img_monthly_report = PHPWG_ROOT_PATH.'/admin/images/monthly_visits.img.php';
    5334//----------------------------------------------------- template initialization
    5435$template->set_filenames( array('stats'=>'admin/stats.tpl') );
    5536
    56 if ( isset( $_GET['last_days'] ) ) define( 'MAX_DAYS', $_GET['last_days'] );
    57 else                               define( 'MAX_DAYS', 0 );
    58 
    59 foreach ( $conf['last_days'] as $option ) {
    60   $url = $_SERVER['PHP_SELF'].'?last_days='.($option - 1);
    61   $url.= '&page=stats';
    62   $template->assign_block_vars(
    63     'last_day_option',
    64     array(
    65       'OPTION'=>$option,
    66       'T_STYLE'=>(( $option == MAX_DAYS + 1 )?'text-decoration:underline;':''),
    67       'U_OPTION'=>add_session_id( $url )
    68       )
    69     );
    70 }
    71 
    7237$template->assign_vars(array(
    73   'L_STAT_LASTDAYS'=>$lang['stats_last_days'],
    74   'L_STAT_DATE'=>$lang['date'],
    75   'L_STAT_LOGIN'=>$lang['login'],
    76   'L_STAT_IP'=>$lang['IP'],
    77   'L_STAT_FILE'=>$lang['file'],
    78   'L_STAT_CATEGORY'=>$lang['category'],
    79   'L_STAT_PICTURE'=>$lang['picture'],
    80   'L_STAT_EMPTY'=>$lang['stats_empty'],
    81   'L_STAT_SEEN'=>$lang['stats_pages_seen'],
    82   'L_STAT_VISITOR'=>$lang['stats_visitors'],
    83  
    84   'STAT_EMPTY_URL'=>$url_empty
     38  'L_STAT_TITLE'=>$lang['stats_last_days'],
     39  'L_STAT_MONTHLY_ALT'=>$lang['stats_pages_seen_graph_title'],
     40  'IMG_MONTHLY_REPORT'=>add_session_id($url_img_monthly_report)
    8541  ));
    86 
    87 $tpl = array( 'stats_pages_seen_graph_title', 'stats_visitors_graph_title');
    8842
    8943//---------------------------------------------------------------- log  history
     
    9448$starttime = mktime(  0, 0, 0,date('n'),date('j'),date('Y') );
    9549$endtime   = mktime( 23,59,59,date('n'),date('j'),date('Y') );
    96 for ( $i = 0; $i <= MAX_DAYS; $i++ )
     50//for ( $i = 0; $i <= MAX_DAYS; $i++ )
    9751{
    98   $day = array();
     52  /*$day = array();
    9953  $template->assign_block_vars('day',array(
    10054    ));
Note: See TracChangeset for help on using the changeset viewer.