Changeset 894
- Timestamp:
- Oct 17, 2005, 9:21:30 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/stats.php
r877 r894 36 36 $where_clause = "1"; 37 37 38 if (isset($_GET['month']) && isset($_GET['year']) ) 38 39 if (isset($_GET['day']) && isset($_GET['month']) && isset($_GET['year']) ) 40 { 41 $url_img .= 'dayly_stats.img.php?year='.$_GET['year'].'&month='.$_GET['month'].'&day='.$_GET['day']; 42 $nls_value_title = $lang['w_day']; 43 $group_clause = "DATE_FORMAT(date,'%Y-%m-%d') ASC"; 44 $where_clause = "(YEAR(date) = ".$_GET['year']." AND MONTH(date) = ".$_GET['month']." )"; 45 } 46 elseif (isset($_GET['month']) && isset($_GET['year']) ) 39 47 { 40 48 $url_img .= 'monthly_stats.img.php?year='.$_GET['year'].'&month='.$_GET['month']; … … 48 56 } 49 57 58 50 59 //----------------------------------------------------- template initialization 60 if (isset($_GET['day']) && isset($_GET['month']) && isset($_GET['year']) ) 61 { 62 $date_of_day=$_GET['day'].' '.$lang['month'][$_GET['month']].' '.$_GET['year']; 63 $title_page=$lang['stats_day_title'].' du '.$date_of_day; 64 $url_back = PHPWG_ROOT_PATH."admin.php?page=stats"; 65 $url_back = add_session_id($url_back); 66 $title_details='<a href='.$url_back.'>'.$lang['stats_day_title'].'</a>'; 67 $title_day=$lang['stats_day_details_title']." ".$date_of_day; 68 } 69 elseif ( isset($_GET['month']) && isset($_GET['year']) ) 70 { 71 $date_of_day=$lang['month'][$_GET['month']].' '.$_GET['year']; 72 $title_page=$lang['stats_month_title'].' : '.$date_of_day; 73 $url_back = PHPWG_ROOT_PATH."admin.php?page=stats"; 74 $url_back = add_session_id($url_back); 75 $title_details='<a href='.$url_back.'>'.$lang['stats_day_title'].'</a>'; 76 $title_day=$lang['today']; 77 } 78 else 79 { 80 $date_of_day=''; 81 $title_page=$lang['stats_title']; 82 $title_details=$lang['stats_month_title']; 83 $title_day=$lang['today']; 84 } 85 86 51 87 $template->set_filenames( array('stats'=>'admin/stats.tpl') ); 52 88 … … 59 95 'L_STAT_MONTH_TITLE'=>$lang['stats_month_title'], 60 96 'L_STAT_MONTHLY_ALT'=>$lang['stats_global_graph_title'], 97 'L_STAT_TITLE'=>$title_page, 98 'L_STAT_DETAIL_TITLE'=>$title_details, 99 'L_DATE_TITLE'=>$title_day, 100 'L_STAT_MONTHLY_ALT'=>$lang['stats_global_graph_title'], 101 'L_STAT_HOUR'=>$lang['stats_hour'], 102 'L_STAT_LOGIN'=>$lang['stats_login'], 103 'L_STAT_ADDR'=>$lang['stats_addr'], 104 'L_STAT_CATEGORY'=>$lang['stats_category'], 105 'L_STAT_FILE'=>$lang['stats_file'], 106 'L_STAT_PICTURE'=>$lang['stats_picture'], 61 107 62 108 'IMG_REPORT'=>add_session_id($url_img) … … 149 195 $max_nb_visitors = 0; 150 196 $max_pages_seen = 0; 197 198 //----------------------------------------------------------- stats / jour 199 200 if ( isset( $_GET['month'] ) && isset( $_GET['month'] ) && isset( $_GET['day'] ) ) 201 { if ($_GET['day'] <10) {$current_day='0'; 202 $current_day.= $_GET['day'];} 203 else {$current_day = $_GET['day'];} 204 if ($_GET['month'] <10) {$current_month='0'; 205 $current_month.= $_GET['month'];} 206 else {$current_month = $_GET['month'];} 207 $current_year = $_GET['year']; 208 } 209 210 else 211 { $current_date = GetDate(); 212 if ($current_date['mday'] <10) {$current_day='0'; 213 $current_day.= $current_date['mday'];} 214 else {$current_day = $current_date['mday'];} 215 if ($current_date['mon'] <10) {$current_month='0'; 216 $current_month.= $current_date['mon'];} 217 else {$current_month = $current_date['mon'];} 218 $current_year = $current_date['year']; 219 } 220 221 // Set WHERE clause 222 $where = ' WHERE DATE_FORMAT(date,\'%Y-%m-%d\') = \''.$current_year."-".$current_month."-".$current_day.'\''; 223 224 // Set LIMIT clause 225 $limit = ' LIMIT '; 226 $page['start'] = 0; 227 if (isset($_GET['start']) and is_numeric($_GET['start'])) $page['start'] = abs($_GET['start']); 228 $limit .= $page['start']; 229 $limit .= ','.$conf['nb_logs_page']; 230 231 $query = ' 232 SELECT DATE_FORMAT(date,\'%H:%i:%s\') AS hour, 233 login, 234 IP, 235 category, 236 file, 237 picture 238 FROM '.HISTORY_TABLE. 239 $where.' 240 ORDER BY date DESC'. 241 $limit. 242 ';'; 243 244 245 $result = pwg_query( $query ); 246 247 $i=0; 248 249 while ( $row = mysql_fetch_array( $result ) ) 250 { 251 $class = ($i % 2)? 'row1':'row2'; $i++; 252 $template->assign_block_vars('detail',array( 253 'HOUR'=>$row['hour'], 254 'LOGIN'=>$row['login'], 255 'IP'=>$row['IP'], 256 'CATEGORY'=>$row['category'], 257 'FILE'=>$row['file'], 258 'PICTURE'=>$row['picture'], 259 'T_CLASS'=>$class 260 )); 261 } 262 263 264 // Get total number of logs 265 $query = ' 266 SELECT COUNT(date) as nb_logs 267 FROM '.HISTORY_TABLE. 268 $where.' 269 ;'; 270 271 $result = pwg_query($query); 272 $row = mysql_fetch_array($result); 273 $page['nb_logs']=$row['nb_logs']; 274 275 //display nav bar 276 $url = $_SERVER['PHP_SELF'].'?page=stats&year='.$_GET['year']; 277 $url .= '&month='.$_GET['month'].'&day='.$_GET['day']; 278 $page['navigation_bar'] = 279 create_navigation_bar( $url, $page['nb_logs'],$page['start'],$conf['nb_logs_page'], 'admin' ); 280 $template->assign_block_vars('navigation', 281 array('NAV_BAR' => $page['navigation_bar']) 282 ); 283 151 284 //----------------------------------------------------------- sending html code 152 285 $template->assign_var_from_handle('ADMIN_CONTENT', 'stats'); 153 286 ?> 287 -
trunk/doc/ChangeLog
r889 r894 1 2005-10-17 Pierrick LE GALL 2 3 * new: history details by month,day 4 1 5 2005-10-15 Pierrick LE GALL 2 6 -
trunk/include/config_default.inc.php
r882 r894 360 360 // thumbnails 361 361 $conf['upload_maxwidth_thumbnail'] = 150; 362 363 // +-----------------------------------------------------------------------+ 364 // | history | 365 // +-----------------------------------------------------------------------+ 366 367 // nb_logs_page : how many logs to display on a page 368 $conf['nb_logs_page'] = 300; 369 370 // history__admin : history admin visits ? 371 $conf['history_admin'] = false; 372 362 373 ?> -
trunk/include/functions.inc.php
r876 r894 355 355 if ($conf['log']) 356 356 { 357 if ( ($conf['history_admin'] ) or ( (! $conf['history_admin']) and ($user['status'] != 'admin') ) ) 358 { 357 359 $login = ($user['id'] == $conf['guest_id']) 358 360 ? 'guest' : addslashes($user['username']); … … 371 373 pwg_query($query); 372 374 } 375 } 373 376 } 374 377 -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r889 r894 263 263 $lang['singly represented'] = 'singly represented'; 264 264 $lang['stats_global_graph_title'] = 'Pages seen by month'; 265 $lang['stats_dayly_graph_title'] = 'Pages seen by hour'; 266 $lang['stats_monthly_graph_title'] = 'Pages seen by day'; 265 267 $lang['stats_month_title'] = 'Monthly statistics'; 268 $lang['stats_day_title'] = 'Dayly statistics'; 266 269 $lang['stats_pages_seen'] = 'Pages seen'; 267 270 $lang['stats_title'] = 'Last year statistics'; 271 $lang['stats_hour'] = 'Hour'; 272 $lang['stats_login'] = 'Login'; 273 $lang['stats_addr'] = 'IP Address'; 274 $lang['stats_category'] = 'Category'; 275 $lang['stats_file'] = 'File'; 276 $lang['stats_picture'] = 'Picture'; 268 277 $lang['status'] = 'status'; 269 278 $lang['storage'] = 'Directory'; -
trunk/language/fr_FR.iso-8859-1/admin.lang.php
r889 r894 261 261 $lang['singly represented'] = 'représentant fixe'; 262 262 $lang['stats_global_graph_title'] = 'Pages vues par mois'; 263 $lang['stats_monthly_graph_title'] = 'Pages vues par jour'; 264 $lang['stats_dayly_graph_title'] = 'Pages vues par heure'; 263 265 $lang['stats_month_title'] = 'Statistiques mensuelles'; 266 $lang['stats_day_title'] = 'Statistiques journalières'; 264 267 $lang['stats_pages_seen'] = 'Pages vues'; 265 268 $lang['stats_title'] = 'Statistiques de la dernière année'; 269 $lang['stats_hour'] = 'Heure'; 270 $lang['stats_login'] = 'Identifiant'; 271 $lang['stats_addr'] = 'Adresse IP'; 272 $lang['stats_category'] = 'Categorie'; 273 $lang['stats_file'] = 'Fichier'; 274 $lang['stats_picture'] = 'Image'; 266 275 $lang['status'] = 'statut'; 267 276 $lang['storage'] = 'Répertoire'; -
trunk/template/yoga/admin/stats.tpl
r868 r894 5 5 <img class="image" src="{IMG_REPORT}" alt="{L_STAT_MONTHLY_ALT}" /> 6 6 7 <h3>{L_STAT_ MONTH_TITLE}</h3>7 <h3>{L_STAT_DETAIL_TITLE}</h3> 8 8 <table class="table2" width="60%"> 9 9 <tr class="throw"> … … 21 21 </tr> 22 22 <!-- END statrow --> 23 24 <table class="table2" width="98%"> 25 <tr class="throw"> 26 <th>{L_STAT_HOUR}</th> 27 <th>{L_STAT_LOGIN}</th> 28 <th>{L_STAT_ADDR}</th> 29 <th>{L_STAT_CATEGORY}</th> 30 <th>{L_STAT_FILE}</th> 31 <th>{L_STAT_PICTURE}</th> 32 </tr> 33 <h3>{L_DATE_TITLE}</h3> 34 <!-- BEGIN detail --> 35 <tr class="{detail.T_CLASS}"> 36 <td nowrap>{detail.HOUR}</td> 37 <td>{detail.LOGIN}</td> 38 <td>{detail.IP}</td> 39 <td>{detail.CATEGORY}</td> 40 <td>{detail.FILE}</td> 41 <td>{detail.PICTURE}</td> 42 </tr> 43 <!-- END detail --> 44 23 45 </table> 46 <br /> 47 <!-- BEGIN navigation --> 48 <div class="admin"> 49 {navigation.NAV_BAR} 50 </div> 51 <!-- END navigation --> 52 <br /> 53 </table>
Note: See TracChangeset
for help on using the changeset viewer.