Accéder au contenu.
Menu Sympa

devel - [Devel] r131 - trunk

Objet : devel-adl

Archives de la liste

[Devel] r131 - trunk


Chronologique Discussions 
  • From: thomas AT lolut.utbm.info
  • To: devel AT agendadulibre.org
  • Subject: [Devel] r131 - trunk
  • Date: Sun, 15 Jan 2006 17:24:19 +0100 (CET)
  • List-archive: <http://lolut.utbm.info/pipermail/devel>
  • List-id: Developpement de l'Agenda du Libre <devel.agendadulibre.org>

Author: thomas
Date: 2006-01-15 17:24:17 +0100 (Sun, 15 Jan 2006)
New Revision: 131

Modified:
trunk/calendar.css
trunk/funcs.inc.php
trunk/stats.php
Log:
Suite des statistiques.

Modified: trunk/calendar.css
===================================================================
--- trunk/calendar.css 2006-01-14 14:43:39 UTC (rev 130)
+++ trunk/calendar.css 2006-01-15 16:24:17 UTC (rev 131)
@@ -239,4 +239,28 @@
margin-right: 100px;
padding-left: 10px;
padding-right: 10px;
-}
\ No newline at end of file
+}
+
+/*
+ * Statistics
+ */
+
+table.stats {
+ width: 60%;
+}
+
+table.stats tr.odd {
+ background-color: #dfedff;
+}
+
+table.stats tr.even {
+ background-color: #b9d8ff;
+}
+
+table.stats td.item {
+ width: 90%;
+}
+
+table.stats td.value {
+ text-align: right;
+}

Modified: trunk/funcs.inc.php
===================================================================
--- trunk/funcs.inc.php 2006-01-14 14:43:39 UTC (rev 130)
+++ trunk/funcs.inc.php 2006-01-15 16:24:17 UTC (rev 131)
@@ -97,7 +97,7 @@
?>
</div>
<div class="footer">
-<p><a href="submit.php">Proposer un �v�nement</a> - <a
href="rsslist.php">Flux RSS</a> - <a href="icallist.php">Calendriers iCal</a>
- <a href="map.php">Carte</a> - <a href="infos.php">Informations</a> - <a
href="stats">Statistiques</a> - <a href="mailto:moderateurs CHEZ
agendadulibre POINT org">Contact</a></p>
+<p><a href="submit.php">Proposer un �v�nement</a> - <a
href="rsslist.php">Flux RSS</a> - <a href="icallist.php">Calendriers iCal</a>
- <a href="map.php">Carte</a> - <a href="infos.php">Informations</a> - <a
href="stats.php">Statistiques</a> - <a href="mailto:moderateurs CHEZ
agendadulibre POINT org">Contact</a></p>
</div>
</body>
</html>

Modified: trunk/stats.php
===================================================================
--- trunk/stats.php 2006-01-14 14:43:39 UTC (rev 130)
+++ trunk/stats.php 2006-01-15 16:24:17 UTC (rev 131)
@@ -1,9 +1,10 @@
<?php

/* Copyright 2004
- * - M�lanie Bats <melanie POINT bats CHEZ utbm POINT fr>
* - Thomas Petazzoni <thomas POINT petazzoni CHEZ enix POINT org>
*
+ * Thanks to David Anderson for the powerful SQL requests.
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
@@ -26,15 +27,83 @@
$db = new db();

put_header("Agenda du Libre - Statistiques");
+?>

-echo "<h2>Statistiques</h2>";
+<h2>Statistiques</h2>

-$moderated = $db->query ("select count(*) from events where moderated=1");
-$unmoderated = $db->query ("select count(*) from events where moderated=0");
+<h3>Statistiques g�n�rales</h3>

-print $moderated . "<br/>";
-print $unmoderated . "<br/>";
+<?php
+$moderated = mysql_result ($db->query ("select count(*) from events where
moderated=1"), 0);
+$unmoderated = mysql_result ($db->query ("select count(*) from events where
moderated=0"), 0);
+?>

-put_footer();
+<table class="stats">
+ <tr class="odd">
+ <td class="item">Nombre d'�v�nements valid�s depuis la cr�ation de
l'Agenda</td>
+ <td class="value"><?php echo $moderated ?></td>
+ </tr>
+ <tr class="even">
+ <td class="item">Nombre d'�v�nements en cours de mod�ration</td>
+ <td class="value"><?php echo $unmoderated; //'?></td>
+ </tr>
+</table>

-?>
\ No newline at end of file
+<h3>Statistiques par r�gion</h3>
+
+<?php
+
+$result = $db->query ("select regions.name,if(events.id is null,0,count(*))
as 'event_count' from regions left join events on regions.id=events.region
group by regions.name");
+
+echo "<table class=\"stats\">";
+
+$i = 0;
+while ($row = mysql_fetch_row($result))
+{
+ if ($i % 2 == 0)
+ echo "<tr class=\"odd\">";
+ else
+ echo "<tr class=\"even\">";
+
+ echo "<td class=\"item\">" . $row[0] . "</td><td class=\"value\">" .
$row[1] . "</td>";
+
+ echo "</tr>";
+
+ $i++;
+}
+
+echo "</table>";
+
+echo "<h3>Statistiques par date</h3>";
+
+$result = $db->query ("SELECT CONCAT(YEAR(start_time), '-',
MONTH(start_time)) AS 'month',COUNT(*) AS 'event_count' FROM events GROUP BY
EXTRACT(YEAR_MONTH FROM start_time)");
+
+echo "<table class=\"stats\">";
+
+$i = 0;
+while ($row = mysql_fetch_row($result))
+{
+ ereg("([0-9]{4})-([0-9]{1,2})", $row[0], $elems);
+ $date = mktime (0, 0, 0, $elems[2], 0, $elems[1]);
+ $date = ucfirst(strftime ("%B %Y\n", $date));
+
+ if ($i % 2 == 0)
+ echo "<tr class=\"odd\">";
+ else
+ echo "<tr class=\"even\">";
+
+ echo "<td class=\"item\">" . $date . "</td><td class=\"value\">" . $row[1]
. "</td>";
+
+ echo "</tr>";
+ $i++;
+}
+
+echo "</table>";
+
+?>
+
+<h3>Statistiques Web</h3>
+
+<p>Des statistiques Web g�n�r�es par Webalizer <a href="stats/">sont
disponibles</a>. Elles sont prot�g�es par le login <i>stats</i>, mot de passe
<i>Cuntipshaf6</i> pour �viter le <i>spam de referers</i>.</p>
+
+<?php put_footer(); ?>
\ No newline at end of file





  • [Devel] r131 - trunk, thomas, 15/01/2006

Archives gérées par MHonArc 2.6.16.

Haut de le page