Changeset 537


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

-First draft of history display

Location:
trunk
Files:
3 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/isadmin.inc.php

    r393 r537  
    3232{
    3333  echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />';
    34   echo '<a href="./identification.php">'.$lang['ident_title'].'</a></div>';
     34  echo '<a href="'.PHPWG_ROOT_PATH.'identification.php">'.$lang['ident_title'].'</a></div>';
    3535  exit();
    3636}
  • 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 .='&amp;last_days='.$_GET['last_days'];
    52 $url_empty.= '&amp;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.= '&amp;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    ));
  • trunk/include/functions.inc.php

    r528 r537  
    346346  if ( $conf['log'] )
    347347  {
    348     $query = 'insert into '.PREFIX_TABLE.'history';
     348    $query = 'insert into '.HISTORY_TABLE;
    349349    $query.= ' (date,login,IP,file,category,picture) values';
    350     $query.= " (".time().", '".$user['username']."'";
     350    $query.= " (NOW(), '".$user['username']."'";
    351351    $query.= ",'".$_SERVER['REMOTE_ADDR']."'";
    352352    $query.= ",'".$file."','".$category."','".$picture."');";
  • trunk/install/phpwebgallery_structure.sql

    r507 r537  
    9595DROP TABLE IF EXISTS phpwebgallery_history;
    9696CREATE TABLE phpwebgallery_history (
    97   date int(11) NOT NULL default '0',
     97  date datetime NOT NULL default '0000-00-00 00:00:00',
    9898  login varchar(15) default NULL,
    9999  IP varchar(50) NOT NULL default '',
    100100  category varchar(150) default NULL,
    101101  file varchar(50) default NULL,
    102   picture varchar(150) default NULL
     102  picture varchar(150) default NULL,
     103  PRIMARY KEY `date` (`date`)
    103104) TYPE=MyISAM;
    104105
Note: See TracChangeset for help on using the changeset viewer.