mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-20 00:23:40 +02:00
-Stat template
git-svn-id: http://piwigo.org/svn/trunk@566 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -33,7 +33,7 @@ include_once( 'phpBarGraph.php' );
|
||||
|
||||
//------------------------------------------------ variable definition
|
||||
$outputFormat = "png";
|
||||
$legend = $lang['stats_pages_seen_graph_title'];
|
||||
$legend = $lang['stats_global_graph_title'];
|
||||
$imageHeight = 256;
|
||||
$imageWidth = 320;
|
||||
$sql = "SELECT DISTINCT COUNT(*), MONTH(date)
|
||||
|
||||
+58
-46
@@ -35,12 +35,67 @@ $url_img_global_report = PHPWG_ROOT_PATH.'admin/images/global_stats.img.php';
|
||||
$template->set_filenames( array('stats'=>'admin/stats.tpl') );
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_STAT_TITLE'=>$lang['stats_last_days'],
|
||||
'L_STAT_MONTHLY_ALT'=>$lang['stats_pages_seen_graph_title'],
|
||||
'L_MONTH'=>$lang['w_month'],
|
||||
'L_PAGES_SEEN'=>$lang['stats_pages_seen'],
|
||||
'L_VISITORS'=>$lang['visitors'],
|
||||
'L_PICTURES'=>$lang['pictures'],
|
||||
'L_STAT_TITLE'=>$lang['stats_title'],
|
||||
'L_STAT_MONTH_TITLE'=>$lang['stats_month_title'],
|
||||
'L_STAT_MONTHLY_ALT'=>$lang['stats_global_graph_title'],
|
||||
|
||||
'IMG_MONTHLY_REPORT'=>add_session_id($url_img_global_report)
|
||||
));
|
||||
|
||||
//---------------------------------------------------------------- log history
|
||||
$query = "SELECT DISTINCT COUNT(*) as p,
|
||||
MONTH(date) as m,
|
||||
YEAR(date) as y
|
||||
FROM phpwg_history
|
||||
GROUP BY DATE_FORMAT(date,'%Y-%m') DESC;";
|
||||
$result = mysql_query( $query );
|
||||
$i=0;
|
||||
while ( $row = mysql_fetch_array( $result ) )
|
||||
{
|
||||
$current_month = $row['y']."-";
|
||||
if ($row['m'] <10) {$current_month.='0';}
|
||||
$current_month .= $row['m'];
|
||||
// Number of pictures seen
|
||||
$query = "SELECT COUNT(*) as p,
|
||||
FILE as f
|
||||
FROM phpwg_history
|
||||
WHERE DATE_FORMAT(date,'%Y-%m') = '$current_month'
|
||||
AND FILE = 'picture'
|
||||
GROUP BY FILE;";
|
||||
$pictures = mysql_fetch_array(mysql_query( $query ));
|
||||
|
||||
// Number of different visitors
|
||||
$query = "SELECT COUNT(*) as p, login
|
||||
FROM phpwg_history
|
||||
WHERE DATE_FORMAT(date,'%Y-%m') = '$current_month'
|
||||
GROUP BY login, IP;";
|
||||
$user_results = mysql_query( $query );
|
||||
$nb_visitors = 0;
|
||||
$auth_users = array();
|
||||
while ( $user_array = mysql_fetch_array( $user_results ) )
|
||||
{
|
||||
if ($user_array['login'] == 'guest')
|
||||
$nb_visitors += 1;
|
||||
else
|
||||
array_push($auth_users, $user_array['login']);
|
||||
}
|
||||
$nb_visitors +=count(array_unique($auth_users));
|
||||
$class = ($i % 2)? 'row1':'row2'; $i++;
|
||||
|
||||
$template->assign_block_vars('month',array(
|
||||
'MONTH'=>$lang['month'][$row['m']].' '.$row['y'],
|
||||
'PAGES'=>$row['p'],
|
||||
'VISITORS'=>$nb_visitors,
|
||||
'IMAGES'=>$pictures['p'],
|
||||
|
||||
'T_CLASS'=>$class
|
||||
));
|
||||
}
|
||||
$nb_visitors = mysql_num_rows( $result );
|
||||
$days = array();
|
||||
$max_nb_visitors = 0;
|
||||
$max_pages_seen = 0;
|
||||
@@ -49,50 +104,7 @@ $starttime = mktime( 0, 0, 0,date('n'),date('j'),date('Y') );
|
||||
$endtime = mktime( 23,59,59,date('n'),date('j'),date('Y') );
|
||||
//for ( $i = 0; $i <= MAX_DAYS; $i++ )
|
||||
{
|
||||
/*$day = array();
|
||||
$template->assign_block_vars('day',array(
|
||||
));
|
||||
|
||||
// link to open the day to see details
|
||||
$local_expand = $page['expand_days'];
|
||||
if ( in_array( $i, $page['expand_days'] ) )
|
||||
{
|
||||
$vtp->addSession( $sub, 'expanded' );
|
||||
$vtp->closeSession( $sub, 'expanded' );
|
||||
$vtp->setVar( $sub, 'day.open_or_close', $lang['close'] );
|
||||
$local_expand = array_remove( $local_expand, $i );
|
||||
}
|
||||
else
|
||||
{
|
||||
$vtp->addSession( $sub, 'collapsed' );
|
||||
$vtp->closeSession( $sub, 'collapsed' );
|
||||
$vtp->setVar( $sub, 'day.open_or_close', $lang['open'] );
|
||||
array_push( $local_expand, $i );
|
||||
}
|
||||
$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 ) :
|
||||
// Sunday 15 June 2003
|
||||
$date = $lang['day'][date( 'w', $starttime )]; // Sunday
|
||||
$date.= date( ' j ', $starttime ); // 15
|
||||
$date.= $lang['month'][date( 'n', $starttime )]; // June
|
||||
$date.= date( ' Y', $starttime ); // 2003
|
||||
$day['date'] = $date;
|
||||
$vtp->setVar( $sub, 'day.name', $date );
|
||||
// number of visitors for this day
|
||||
$query = 'SELECT DISTINCT(IP) as nb_visitors';
|
||||
$query.= ' FROM '.PREFIX_TABLE.'history';
|
||||
$query.= ' WHERE date > '.$starttime;
|
||||
$query.= ' AND date < '.$endtime;
|
||||
$query.= ';';
|
||||
$result = mysql_query( $query );
|
||||
$nb_visitors = mysql_num_rows( $result );
|
||||
$day['nb_visitors'] = $nb_visitors;
|
||||
if ( $nb_visitors > $max_nb_visitors ) $max_nb_visitors = $nb_visitors;
|
||||
$vtp->setVar( $sub, 'day.nb_visitors', $nb_visitors );
|
||||
/*
|
||||
// log lines for this day
|
||||
$query = 'SELECT date,login,IP,category,file,picture';
|
||||
$query.= ' FROM '.PREFIX_TABLE.'history';
|
||||
|
||||
@@ -44,6 +44,7 @@ $lang['forbidden'] = 'Forbidden';
|
||||
$lang['free'] = 'Free';
|
||||
$lang['restricted'] = 'Restricted';
|
||||
$lang['metadata']='Metadata';
|
||||
$lang['visitors'] = 'Visitors';
|
||||
|
||||
// Specific words
|
||||
$lang['phpinfos'] = 'PHP Information';
|
||||
@@ -219,6 +220,14 @@ $lang['update_only_cat'] = 'update categories, not pictures';
|
||||
$lang['update_all'] = 'update all';
|
||||
$lang['update_sync_metadata_question'] = 'Do you want to synchronize new elements informations with files metadata ?';
|
||||
|
||||
// History
|
||||
$lang['stats_title'] = 'Last year statistics';
|
||||
$lang['stats_month_title'] = 'Monthly statistics';
|
||||
$lang['stats_pages_seen'] = 'Pages seen';
|
||||
$lang['stats_empty'] = 'empty history';
|
||||
$lang['stats_global_graph_title'] = 'Pages seen by month';
|
||||
$lang['stats_visitors_graph_title'] = 'Nombre de visiteurs par jour';
|
||||
|
||||
$lang['menu_add_user'] = 'add';
|
||||
$lang['menu_list_user'] = 'list';
|
||||
$lang['user_err_modify'] = 'This user can\'t be modified or deleted';
|
||||
|
||||
@@ -101,6 +101,9 @@ $lang['day'][3] = 'Wednesday';
|
||||
$lang['day'][4] = 'Thursday';
|
||||
$lang['day'][5] = 'Friday';
|
||||
$lang['day'][6] = 'Saturday';
|
||||
$lang['w_month'] = 'Month';
|
||||
$lang['w_day'] = 'Day';
|
||||
$lang['days'] = 'days';
|
||||
|
||||
// Customization
|
||||
$lang['customize_page_title'] = 'Customization';
|
||||
@@ -144,6 +147,12 @@ $lang['search_mode_and'] = 'all the words';
|
||||
$lang['search_comments'] = 'separate different words with spaces';
|
||||
$lang['invalid_search'] = 'search must be done on 3 caracters or more';
|
||||
$lang['Search_author_explain'] = 'Use * as a wildcard for partial matches';
|
||||
$lang['Look_up_user'] = 'Seek user';
|
||||
$lang['Find_username'] = 'Find a username';
|
||||
$lang['No_match'] = 'No match';
|
||||
$lang['Select_username'] = 'Select a username';
|
||||
$lang['Close'] = 'Close the window';
|
||||
$lang['Select'] = 'Select';
|
||||
|
||||
$lang['only_members'] = 'Only members can access this page';
|
||||
$lang['invalid_pwd'] = 'Invalid password!';
|
||||
@@ -236,8 +245,6 @@ $lang['dissociate'] = 'dissociate';
|
||||
$lang['mandatory'] = 'obligatory';
|
||||
$lang['err_date'] = 'wrong date';
|
||||
$lang['IP'] = 'IP';
|
||||
$lang['close'] = 'close';
|
||||
$lang['open'] = 'open';
|
||||
|
||||
$lang['errors_title'] = 'Errors';
|
||||
$lang['infos_title'] = 'Informations';
|
||||
|
||||
@@ -44,6 +44,7 @@ $lang['forbidden'] = 'Interdit';
|
||||
$lang['free'] = 'Libre';
|
||||
$lang['restricted'] = 'Restreint';
|
||||
$lang['metadata']='Métadonnées';
|
||||
$lang['visitors'] = 'Visiteurs';
|
||||
|
||||
// Specific words
|
||||
$lang['phpinfos'] = 'Informations PHP';
|
||||
@@ -71,6 +72,9 @@ $lang['remote_site_removed'] = 'was removed on remote site';
|
||||
$lang['remote_site_removed_title'] = 'Removed elements';
|
||||
$lang['remote_site_created'] = 'created';
|
||||
$lang['remote_site_deleted'] = 'deleted';
|
||||
$lang['remote_site_local_found'] = 'A local listing.xml file has been found for ';
|
||||
$lang['remote_site_local_new'] = '(new site)';
|
||||
$lang['remote_site_local_update'] = 'read local listing.xml and update';
|
||||
|
||||
// Category words
|
||||
$lang['storage'] = 'Répertoire';
|
||||
@@ -175,12 +179,8 @@ $lang['conf_upload_maxheight_thumbnail_error'] = 'La hauteur maximum des miniatu
|
||||
|
||||
// Configuration -> session
|
||||
$lang['conf_session_title'] = 'Configuration des sessions';
|
||||
$lang['conf_auth_method'] = 'Méthode d\'authentification';
|
||||
$lang['conf_auth_method_info'] = 'La méthode d\'authentification par défaut peut être URI (identifiant visible dans l\'adresse) ou par cookie';
|
||||
$lang['URI'] = 'URI';
|
||||
$lang['cookie'] = 'cookie';
|
||||
$lang['conf_authorize_remembering'] = 'Authorize remembering';
|
||||
$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)';
|
||||
$lang['conf_authorize_remembering'] = 'Connexion automatique';
|
||||
$lang['conf_authorize_remembering_info'] = 'Les utilisateurs ne devront plus s\'identifier à chaque nouvelle visiste du site';
|
||||
|
||||
// Configuration -> metadata
|
||||
$lang['conf_metadata_title'] = 'Configuration des métadonnées des images';
|
||||
@@ -223,6 +223,17 @@ $lang['update_nb_del_elements'] = '
|
||||
$lang['update_nb_new_categories'] = 'catégorie(s) ajoutée(s)';
|
||||
$lang['update_nb_del_categories'] = 'catégorie(s) effacée(s)';
|
||||
|
||||
// History
|
||||
$lang['stats_title'] = 'Historique de l\'année écoulée';
|
||||
$lang['stats_month_title'] = 'Historique mois par mois';
|
||||
$lang['stats_pages_seen'] = 'Pages vues';
|
||||
$lang['stats_empty'] = 'vider l\'historique';
|
||||
$lang['stats_global_graph_title'] = 'Nombre de pages vues par mois';
|
||||
$lang['stats_visitors_graph_title'] = 'Nombre de visiteurs par jour';
|
||||
|
||||
//Users
|
||||
|
||||
|
||||
// To be done
|
||||
$lang['menu_add_user'] = 'ajout';
|
||||
$lang['menu_list_user'] = 'liste';
|
||||
@@ -302,11 +313,6 @@ $lang['group_list_title'] = 'Liste des groupes existants';
|
||||
$lang['group_err_unknown'] = 'Ce groupe n\'existe pas dans la base de données';
|
||||
$lang['permuser_only_private'] = 'Seules les catégories privées sont représentées';
|
||||
|
||||
$lang['stats_pages_seen'] = 'pages vues';
|
||||
$lang['stats_visitors'] = 'visiteurs';
|
||||
$lang['stats_empty'] = 'vider l\'historique';
|
||||
$lang['stats_pages_seen_graph_title'] = 'Nombre de pages vues par jour';
|
||||
$lang['stats_visitors_graph_title'] = 'Nombre de visiteurs par jour';
|
||||
$lang['comments_last_title'] = 'Derniers commentaires';
|
||||
$lang['comments_non_validated_title'] = 'Commentaires non validés';
|
||||
$lang['cat_unknown_id'] = 'Cette catégorie n\'existe pas dans la base de données';
|
||||
|
||||
@@ -108,6 +108,8 @@ $lang['day'][3] = 'Mercredi';
|
||||
$lang['day'][4] = 'Jeudi';
|
||||
$lang['day'][5] = 'Vendredi';
|
||||
$lang['day'][6] = 'Samedi';
|
||||
$lang['w_month']='Mois';
|
||||
$lang['w_day']='Jour';
|
||||
|
||||
|
||||
// Customization
|
||||
@@ -155,6 +157,12 @@ $lang['search_title'] = 'Recherche';
|
||||
$lang['search_field_search'] = 'Rechercher';
|
||||
$lang['search_return_main_page'] = 'Retour à la page des miniatures';
|
||||
$lang['Search_author_explain'] = 'Utilisez * comme un joker pour des recherches partielles';
|
||||
$lang['Look_up_user'] = 'Rechercher l\'utilisateur';
|
||||
$lang['Find_username'] = 'Trouver un nom d\'utilisateur';
|
||||
$lang['No_match'] = 'Aucun enregistrement trouvé.';
|
||||
$lang['Select_username'] = 'Sélectionner un Nom d\'utilisateur';
|
||||
$lang['Close'] = 'Fermer la fenêtre';
|
||||
$lang['Select'] = 'Sélectionner';
|
||||
|
||||
$lang['only_members'] = 'Seuls les membres du site peuvent accéder à cette page';
|
||||
$lang['invalid_pwd'] = 'Le mot de passe rentré n\'est pas valide';
|
||||
@@ -196,8 +204,6 @@ $lang['ident_register'] = 'S\'enregistrer';
|
||||
$lang['ident_forgotten_password'] = 'Mot de passe oublié ?';
|
||||
$lang['ident_guest_visit'] = 'Parcourir la galerie en tant que visiteur';
|
||||
|
||||
// Error management
|
||||
|
||||
$lang['previous_image'] = 'Précédent';
|
||||
$lang['next_image'] = 'Suivant';
|
||||
$lang['info_image_title'] = 'Informations';
|
||||
@@ -245,8 +251,6 @@ $lang['dissociate'] = 'dissocier';
|
||||
$lang['mandatory'] = 'obligatoire';
|
||||
$lang['err_date'] = 'date erronée';
|
||||
$lang['IP'] = 'IP';
|
||||
$lang['close'] = 'fermer';
|
||||
$lang['open'] = 'ouvrir';
|
||||
|
||||
$lang['errors_title'] = 'Erreurs';
|
||||
$lang['infos_title'] = 'Informations';
|
||||
@@ -256,7 +260,6 @@ $lang['stats_last_days'] = 'derniers jours';
|
||||
$lang['menu_login'] = 'Connexion';
|
||||
$lang['connected_user'] = 'utilisateur connecté';
|
||||
$lang['hint_comments'] = 'Voir les derniers commentaires des visiteurs';
|
||||
$lang['stats'] = 'statistiques';
|
||||
$lang['most_visited_cat_hint'] = 'affiche les images les plus visitées';
|
||||
$lang['most_visited_cat'] = 'plus vues';
|
||||
$lang['best_rated_cat_hint'] = 'affiche les images les mieux notées';
|
||||
@@ -294,13 +297,7 @@ $lang['about_message'] = '<div style="text-align:center;font-weigh:bold;">Inform
|
||||
$lang['update_wrong_dirname'] = 'Le nom des fichiers et répertoires ne doivent être composé que de lettres, de chiffres et "-", "_" ou ".".';
|
||||
$lang['hello'] = 'Bonjour';
|
||||
|
||||
$lang['Look_up_user'] = 'Rechercher l\'utilisateur';
|
||||
$lang['Find_username'] = 'Trouver un nom d\'utilisateur';
|
||||
$lang['Find'] = 'Trouver';
|
||||
$lang['No_match'] = 'Aucun enregistrement trouvé.';
|
||||
$lang['Select_username'] = 'Sélectionner un Nom d\'utilisateur';
|
||||
$lang['Close'] = 'Fermer la fenêtre';
|
||||
$lang['Select'] = 'Sélectionner';
|
||||
|
||||
|
||||
$lang['picture_show_metadata'] = 'Montrer les métadonnées';
|
||||
$lang['picture_hide_metadata'] = 'Cacher les métadonnées';
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
<div class="admin">{L_STAT_TITLE}</div>
|
||||
|
||||
<img src="{IMG_MONTHLY_REPORT}" alt="{L_STAT_MONTHLY_ALT}" />
|
||||
<img class="image" src="{IMG_MONTHLY_REPORT}" alt="{L_STAT_MONTHLY_ALT}" />
|
||||
<div class="admin">{L_STAT_MONTH_TITLE}</div>
|
||||
<table class="table2" width="60%">
|
||||
<tr class="throw">
|
||||
<th>{L_MONTH}</th>
|
||||
<th>{L_PAGES_SEEN}</th>
|
||||
<th>{L_VISITORS}</th>
|
||||
<th>{L_PICTURES}</th>
|
||||
</tr>
|
||||
<!-- BEGIN month -->
|
||||
<tr class="{month.T_CLASS}">
|
||||
<td>{month.MONTH}</td>
|
||||
<td>{month.PAGES}</td>
|
||||
<td>{month.VISITORS}</td>
|
||||
<td>{month.IMAGES}</td>
|
||||
</tr>
|
||||
<!-- END month -->
|
||||
</table>
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user