diff options
author | gweltas <gweltas@piwigo.org> | 2004-02-02 00:55:18 +0000 |
---|---|---|
committer | gweltas <gweltas@piwigo.org> | 2004-02-02 00:55:18 +0000 |
commit | bef4b3e3aa8e3d54cbf8b4962b9b5d4a89b55429 (patch) | |
tree | 647b2cf07ee8451a9314e1e8aebd11d9396cb32b /admin/stats.php | |
parent | eea989f019f21fbd7ae4aa8e2f4a1503992c23bf (diff) |
Merge of the 1.3.1 release
Creation of an unique include file (common.php)
Creation of an unique define file (include/constants.php)
Modification of the installation procedure
git-svn-id: http://piwigo.org/svn/trunk@345 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/stats.php | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/admin/stats.php b/admin/stats.php index 01780a95e..ba33a1582 100644 --- a/admin/stats.php +++ b/admin/stats.php @@ -42,13 +42,15 @@ $tpl = array( 'stats_last_days','date','login', templatize_array( $tpl, 'lang', $sub ); $vtp->setGlobalVar( $sub, 'user_template', $user['template'] ); //--------------------------------------------------- number of days to display -if ( isset( $_GET['last_days'] ) ) define( "MAX_DAYS", $_GET['last_days'] ); -else define( "MAX_DAYS", 0 ); +if ( isset( $_GET['last_days'] ) ) define( 'MAX_DAYS', $_GET['last_days'] ); +else define( 'MAX_DAYS', 0 ); foreach ( $conf['last_days'] as $option ) { $vtp->addSession( $sub, 'last_day_option' ); $vtp->setVar( $sub, 'last_day_option.option', $option ); - $url = './admin.php?page=stats&expand='.$_GET['expand']; + $url = './admin.php?page=stats'; + if (isset($_GET['expand'])) + $url .='&expand='.$_GET['expand']; $url.= '&last_days='.($option - 1); $vtp->setVar( $sub, 'last_day_option.link', add_session_id( $url ) ); if ( $option == MAX_DAYS + 1 ) @@ -59,12 +61,18 @@ foreach ( $conf['last_days'] as $option ) { } //---------------------------------------------------------------- log history // empty link -$url = './admin.php?page=stats&last_days='.$_GET['last_days']; -$url.= '&expand='.$_GET['expand']; +$url = './admin.php?page=stats'; +if (isset($_GET['last_days'])) + $url .='&last_days='.$_GET['last_days']; +// expand array management +$expand_days = array(); +if (isset($_GET['expand'])) +{ + $url.= '&expand='.$_GET['expand']; + $expand_days = explode( ',', $_GET['expand'] ); +} $url.= '&act=empty'; $vtp->setVar( $sub, 'emply_url', add_session_id( $url ) ); -// expand array management -$expand_days = explode( ',', $_GET['expand'] ); $page['expand_days'] = array(); foreach ( $expand_days as $expand_day ) { if ( is_numeric( $expand_day ) ) @@ -99,7 +107,9 @@ for ( $i = 0; $i <= MAX_DAYS; $i++ ) $vtp->setVar( $sub, 'day.open_or_close', $lang['open'] ); array_push( $local_expand, $i ); } - $url = './admin.php?page=stats&last_days='.$_GET['last_days']; + $url = './admin.php?page=stats'; + if (isset($_GET['last_days'])) + $url.= '&last_days='.$_GET['last_days']; $url.= '&expand='.implode( ',', $local_expand ); $vtp->setVar( $sub, 'day.url', add_session_id( $url ) ); // date displayed like this (in English ) : |