librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1815] added stats page


From: Matt Lee
Subject: [Librefm-commits] [1815] added stats page
Date: Sun, 24 May 2009 19:29:59 +0000

Revision: 1815
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1815
Author:   mattl
Date:     2009-05-24 19:29:59 +0000 (Sun, 24 May 2009)
Log Message:
-----------
added stats page

Added Paths:
-----------
    branches/stable/gnukebox/stats.php

Added: branches/stable/gnukebox/stats.php
===================================================================
--- branches/stable/gnukebox/stats.php                          (rev 0)
+++ branches/stable/gnukebox/stats.php  2009-05-24 19:29:59 UTC (rev 1815)
@@ -0,0 +1,61 @@
+<?php
+
+/* GNUkebox -- a free software server for recording your listening habits
+
+   Copyright (C) 2009 Free Software Foundation, Inc
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Affero General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Affero General Public License for more details.
+
+   You should have received a copy of the GNU Affero General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+header('Content-type: text/html; charset=utf-8');
+require_once('database.php');
+require_once('utils/human-time.php');
+require_once('temp-utils.php');
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd";>
+<html>
+<head>
+<title>Statistics</title>
+</head>
+<body>
+               <h1><a href="/">GNUkebox</a> Statistics</h1>
+
+               <p>Please note, results are cached for approximately 9 
minutes.</p>
+
+               <?php
+                       $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
+                       $total = $adodb->CacheGetOne(500, 'SELECT COUNT(*) as 
total from Scrobbles');
+                       if(!$total) {
+                               die("sql error");
+                       }
+                       echo "<p>" . stripslashes($total) . " listens.</p>";
+
+                       $total = $adodb->CacheGetOne(500, 'SELECT COUNT(*) as 
total from Track');
+                       if(!$total) {
+                               die("sql error");
+                       }
+                       echo "<p>" . stripslashes($total) . " unique 
tracks.</p>";
+
+                       $total = $adodb->CacheGetOne(500, 'SELECT COUNT(*) as 
total from Users');
+                       if(!$total) {
+                               die("sql error");
+                       }
+                       echo "<p>" . stripslashes($total) . " users.</p>";
+
+               ?>
+</body>
+</html>
\ No newline at end of file





reply via email to

[Prev in Thread] Current Thread [Next in Thread]