1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- 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 SUM(scrobble_count) as total from User_Stats');
- 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>
|