Changeset 566


Ignore:
Timestamp:
Oct 11, 2004, 8:04:46 PM (20 years ago)
Author:
gweltas
Message:

-Stat template

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/images/global_stats.img.php

    r539 r566  
    3434//------------------------------------------------ variable definition
    3535$outputFormat = "png";
    36 $legend = $lang['stats_pages_seen_graph_title'];
     36$legend = $lang['stats_global_graph_title'];
    3737$imageHeight = 256;
    3838$imageWidth = 320;
  • trunk/admin/stats.php

    r539 r566  
    3636
    3737$template->assign_vars(array(
    38   'L_STAT_TITLE'=>$lang['stats_last_days'],
    39   'L_STAT_MONTHLY_ALT'=>$lang['stats_pages_seen_graph_title'],
     38  'L_MONTH'=>$lang['w_month'],
     39  'L_PAGES_SEEN'=>$lang['stats_pages_seen'],
     40  'L_VISITORS'=>$lang['visitors'],
     41  'L_PICTURES'=>$lang['pictures'],
     42  'L_STAT_TITLE'=>$lang['stats_title'],
     43  'L_STAT_MONTH_TITLE'=>$lang['stats_month_title'],
     44  'L_STAT_MONTHLY_ALT'=>$lang['stats_global_graph_title'],
     45 
    4046  'IMG_MONTHLY_REPORT'=>add_session_id($url_img_global_report)
    4147  ));
    4248
    4349//---------------------------------------------------------------- log  history
     50$query = "SELECT DISTINCT COUNT(*) as p,
     51  MONTH(date) as m,
     52  YEAR(date) as y
     53  FROM phpwg_history
     54  GROUP BY DATE_FORMAT(date,'%Y-%m') DESC;";
     55$result = mysql_query( $query );
     56$i=0;
     57while ( $row = mysql_fetch_array( $result ) )
     58{
     59  $current_month = $row['y']."-";
     60  if ($row['m'] <10) {$current_month.='0';}
     61  $current_month .= $row['m'];
     62  // Number of pictures seen
     63  $query = "SELECT COUNT(*) as p,
     64    FILE as f
     65    FROM phpwg_history
     66    WHERE DATE_FORMAT(date,'%Y-%m') = '$current_month'
     67        AND FILE = 'picture'
     68        GROUP BY FILE;";
     69  $pictures = mysql_fetch_array(mysql_query( $query ));
     70 
     71  // Number of different visitors
     72  $query = "SELECT COUNT(*) as p, login
     73    FROM phpwg_history
     74    WHERE DATE_FORMAT(date,'%Y-%m') = '$current_month'
     75        GROUP BY login, IP;";
     76  $user_results = mysql_query( $query );
     77  $nb_visitors = 0;
     78  $auth_users = array();
     79  while ( $user_array = mysql_fetch_array( $user_results ) )
     80  {
     81    if ($user_array['login'] == 'guest')
     82          $nb_visitors += 1;
     83        else
     84          array_push($auth_users, $user_array['login']);
     85  }
     86  $nb_visitors +=count(array_unique($auth_users));
     87  $class = ($i % 2)? 'row1':'row2'; $i++;
     88 
     89  $template->assign_block_vars('month',array(
     90    'MONTH'=>$lang['month'][$row['m']].' '.$row['y'],
     91        'PAGES'=>$row['p'],
     92        'VISITORS'=>$nb_visitors,
     93        'IMAGES'=>$pictures['p'],
     94       
     95        'T_CLASS'=>$class
     96    ));
     97}
     98$nb_visitors = mysql_num_rows( $result );
    4499$days = array();
    45100$max_nb_visitors = 0;
     
    50105//for ( $i = 0; $i <= MAX_DAYS; $i++ )
    51106{
    52   /*$day = array();
    53   $template->assign_block_vars('day',array(
    54     ));
    55  
    56   // link to open the day to see details
    57   $local_expand = $page['expand_days'];
    58   if ( in_array( $i, $page['expand_days'] ) )
    59   {
    60     $vtp->addSession( $sub, 'expanded' );
    61     $vtp->closeSession( $sub, 'expanded' );
    62     $vtp->setVar( $sub, 'day.open_or_close', $lang['close'] );
    63     $local_expand = array_remove( $local_expand, $i );
    64   }
    65   else
    66   {
    67     $vtp->addSession( $sub, 'collapsed' );
    68     $vtp->closeSession( $sub, 'collapsed' );
    69     $vtp->setVar( $sub, 'day.open_or_close', $lang['open'] );
    70     array_push( $local_expand, $i );
    71   }
    72   $url = './admin.php?page=stats';
    73   if (isset($_GET['last_days']))
    74         $url.= '&amp;last_days='.$_GET['last_days'];
    75   $url.= '&amp;expand='.implode( ',', $local_expand );
    76   $vtp->setVar( $sub, 'day.url', add_session_id( $url ) );
    77   // date displayed like this (in English ) :
    78   //                     Sunday 15 June 2003
    79   $date = $lang['day'][date( 'w', $starttime )];   // Sunday
    80   $date.= date( ' j ', $starttime );               // 15
    81   $date.= $lang['month'][date( 'n', $starttime )]; // June
    82   $date.= date( ' Y', $starttime );                // 2003
    83   $day['date'] = $date;
    84   $vtp->setVar( $sub, 'day.name', $date );
    85   // number of visitors for this day
    86   $query = 'SELECT DISTINCT(IP) as nb_visitors';
    87   $query.= ' FROM '.PREFIX_TABLE.'history';
    88   $query.= ' WHERE date > '.$starttime;
    89   $query.= ' AND date < '.$endtime;
    90   $query.= ';';
    91   $result = mysql_query( $query );
    92   $nb_visitors = mysql_num_rows( $result );
    93   $day['nb_visitors'] = $nb_visitors;
    94   if ( $nb_visitors > $max_nb_visitors ) $max_nb_visitors = $nb_visitors;
    95   $vtp->setVar( $sub, 'day.nb_visitors', $nb_visitors );
     107  /*
    96108  // log lines for this day
    97109  $query = 'SELECT date,login,IP,category,file,picture';
  • trunk/language/en_UK.iso-8859-1/admin.lang.php

    r555 r566  
    4545$lang['restricted'] = 'Restricted';
    4646$lang['metadata']='Metadata';
     47$lang['visitors'] = 'Visitors';
    4748
    4849// Specific words
     
    219220$lang['update_all'] = 'update all';
    220221$lang['update_sync_metadata_question'] = 'Do you want to synchronize new elements informations with files metadata ?';
     222
     223// History
     224$lang['stats_title'] = 'Last year statistics';
     225$lang['stats_month_title'] = 'Monthly statistics';
     226$lang['stats_pages_seen'] = 'Pages seen';
     227$lang['stats_empty'] = 'empty history';
     228$lang['stats_global_graph_title'] = 'Pages seen by month';
     229$lang['stats_visitors_graph_title'] = 'Nombre de visiteurs par jour';
    221230
    222231$lang['menu_add_user'] = 'add';
  • trunk/language/en_UK.iso-8859-1/common.lang.php

    r553 r566  
    102102$lang['day'][5] = 'Friday';
    103103$lang['day'][6] = 'Saturday';
     104$lang['w_month'] = 'Month';
     105$lang['w_day'] = 'Day';
     106$lang['days'] = 'days';
    104107
    105108// Customization
     
    145148$lang['invalid_search'] = 'search must be done on 3 caracters or more';
    146149$lang['Search_author_explain'] = 'Use * as a wildcard for partial matches';
     150$lang['Look_up_user'] = 'Seek user';
     151$lang['Find_username'] = 'Find a username';
     152$lang['No_match'] = 'No match';
     153$lang['Select_username'] = 'Select a username';
     154$lang['Close'] = 'Close the window';
     155$lang['Select'] = 'Select';
    147156
    148157$lang['only_members'] = 'Only members can access this page';
     
    237246$lang['err_date'] = 'wrong date';
    238247$lang['IP'] = 'IP';
    239 $lang['close'] = 'close';
    240 $lang['open'] = 'open';
    241248
    242249$lang['errors_title'] = 'Errors';
  • trunk/language/fr_FR.iso-8859-1/admin.lang.php

    r553 r566  
    4545$lang['restricted'] = 'Restreint';
    4646$lang['metadata']='Métadonnées';
     47$lang['visitors'] = 'Visiteurs';
    4748
    4849// Specific words
     
    7273$lang['remote_site_created'] = 'created';
    7374$lang['remote_site_deleted'] = 'deleted';
     75$lang['remote_site_local_found'] = 'A local listing.xml file has been found for ';
     76$lang['remote_site_local_new'] = '(new site)';
     77$lang['remote_site_local_update'] = 'read local listing.xml and update';
    7478
    7579// Category words
     
    176180// Configuration -> session
    177181$lang['conf_session_title'] = 'Configuration des sessions';
    178 $lang['conf_auth_method'] = 'Méthode d\'authentification';
    179 $lang['conf_auth_method_info'] = 'La méthode d\'authentification par défaut peut être URI (identifiant visible dans l\'adresse) ou par cookie';
    180 $lang['URI'] = 'URI';
    181 $lang['cookie'] = 'cookie';
    182 $lang['conf_authorize_remembering'] = 'Authorize remembering';
    183 $lang['conf_authorize_remembering_info'] = 'Permits user to log for a long time. It creates a cookie on client side, with duration set in include/config.inc.php (1 year per default)';
     182$lang['conf_authorize_remembering'] = 'Connexion automatique';
     183$lang['conf_authorize_remembering_info'] = 'Les utilisateurs ne devront plus s\'identifier à chaque nouvelle visiste du site';
    184184
    185185// Configuration -> metadata
     
    223223$lang['update_nb_new_categories'] = 'catégorie(s) ajoutée(s)';
    224224$lang['update_nb_del_categories'] = 'catégorie(s) effacée(s)';
     225
     226// History
     227$lang['stats_title'] = 'Historique de l\'année écoulée';
     228$lang['stats_month_title'] = 'Historique mois par mois';
     229$lang['stats_pages_seen'] = 'Pages vues';
     230$lang['stats_empty'] = 'vider l\'historique';
     231$lang['stats_global_graph_title'] = 'Nombre de pages vues par mois';
     232$lang['stats_visitors_graph_title'] = 'Nombre de visiteurs par jour';
     233
     234//Users
     235
    225236
    226237// To be done
     
    303314$lang['permuser_only_private'] = 'Seules les catégories privées sont représentées';
    304315
    305 $lang['stats_pages_seen'] = 'pages vues';
    306 $lang['stats_visitors'] = 'visiteurs';
    307 $lang['stats_empty'] = 'vider l\'historique';
    308 $lang['stats_pages_seen_graph_title'] = 'Nombre de pages vues par jour';
    309 $lang['stats_visitors_graph_title'] = 'Nombre de visiteurs par jour';
    310316$lang['comments_last_title'] = 'Derniers commentaires';
    311317$lang['comments_non_validated_title'] = 'Commentaires non validés';
  • trunk/language/fr_FR.iso-8859-1/common.lang.php

    r553 r566  
    109109$lang['day'][5] = 'Vendredi';
    110110$lang['day'][6] = 'Samedi';
     111$lang['w_month']='Mois';
     112$lang['w_day']='Jour';
    111113
    112114
     
    156158$lang['search_return_main_page'] = 'Retour à la page des miniatures';
    157159$lang['Search_author_explain'] = 'Utilisez * comme un joker pour des recherches partielles';
     160$lang['Look_up_user'] = 'Rechercher l\'utilisateur';
     161$lang['Find_username'] = 'Trouver un nom d\'utilisateur';
     162$lang['No_match'] = 'Aucun enregistrement trouvé.';
     163$lang['Select_username'] = 'Sélectionner un Nom d\'utilisateur';
     164$lang['Close'] = 'Fermer la fenêtre';
     165$lang['Select'] = 'Sélectionner';
    158166
    159167$lang['only_members'] = 'Seuls les membres du site peuvent accéder à cette page';
     
    197205$lang['ident_guest_visit'] = 'Parcourir la galerie en tant que visiteur';
    198206
    199 // Error management
    200                
    201207$lang['previous_image'] = 'Précédent';
    202208$lang['next_image'] = 'Suivant';
     
    246252$lang['err_date'] = 'date erronée';
    247253$lang['IP'] = 'IP';
    248 $lang['close'] = 'fermer';
    249 $lang['open'] = 'ouvrir';
    250254
    251255$lang['errors_title'] = 'Erreurs';
     
    257261$lang['connected_user'] = 'utilisateur connecté';
    258262$lang['hint_comments'] = 'Voir les derniers commentaires des visiteurs';
    259 $lang['stats'] = 'statistiques';
    260263$lang['most_visited_cat_hint'] = 'affiche les images les plus visitées';
    261264$lang['most_visited_cat'] = 'plus vues';
     
    295298$lang['hello'] = 'Bonjour';
    296299
    297 $lang['Look_up_user'] = 'Rechercher l\'utilisateur';
    298 $lang['Find_username'] = 'Trouver un nom d\'utilisateur';
    299 $lang['Find'] = 'Trouver';
    300 $lang['No_match'] = 'Aucun enregistrement trouvé.';
    301 $lang['Select_username'] = 'Sélectionner un Nom d\'utilisateur';
    302 $lang['Close'] = 'Fermer la fenêtre';
    303 $lang['Select'] = 'Sélectionner';
     300
    304301
    305302$lang['picture_show_metadata'] = 'Montrer les métadonnées';
  • trunk/template/default/admin/stats.tpl

    r537 r566  
    11<div class="admin">{L_STAT_TITLE}</div>
    2 
    3 <img src="{IMG_MONTHLY_REPORT}" alt="{L_STAT_MONTHLY_ALT}" />
     2<img class="image" src="{IMG_MONTHLY_REPORT}" alt="{L_STAT_MONTHLY_ALT}" />
     3<div class="admin">{L_STAT_MONTH_TITLE}</div>
     4<table class="table2" width="60%">
     5<tr class="throw">
     6    <th>{L_MONTH}</th>
     7        <th>{L_PAGES_SEEN}</th>
     8    <th>{L_VISITORS}</th>
     9    <th>{L_PICTURES}</th>
     10</tr>
     11<!-- BEGIN month -->
     12  <tr class="{month.T_CLASS}">
     13    <td>{month.MONTH}</td>
     14    <td>{month.PAGES}</td>
     15    <td>{month.VISITORS}</td>
     16        <td>{month.IMAGES}</td>
     17  </tr>
     18<!-- END month -->
     19</table>
     20<br />
Note: See TracChangeset for help on using the changeset viewer.