[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1769] simplify gnukebox output, make it generic
From: |
Matt Lee |
Subject: |
[Librefm-commits] [1769] simplify gnukebox output, make it generic |
Date: |
Sun, 24 May 2009 15:49:16 +0000 |
Revision: 1769
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1769
Author: mattl
Date: 2009-05-24 15:49:16 +0000 (Sun, 24 May 2009)
Log Message:
-----------
simplify gnukebox output, make it generic
Modified Paths:
--------------
trunk/gnukebox/auth-utils.php
trunk/gnukebox/database.php
trunk/gnukebox/display.php
trunk/gnukebox/fix-album-art.php
trunk/gnukebox/index.php
trunk/gnukebox/install.php
trunk/gnukebox/musicbrainz.php
trunk/gnukebox/nowplaying/1.2/index.php
trunk/gnukebox/scrobble-utils.php
trunk/gnukebox/submissions/1.1/handshake.php
trunk/gnukebox/submissions/1.2/handshake.php
trunk/gnukebox/submissions/1.2/index.php
trunk/gnukebox/temp-utils.php
trunk/gnukebox/tests/SubmissionsTest.php
trunk/gnukebox/utils/get_absolute_url.php
trunk/gnukebox/utils/human-time.php
trunk/gnukebox/version.php
Modified: trunk/gnukebox/auth-utils.php
===================================================================
--- trunk/gnukebox/auth-utils.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/auth-utils.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,6 +1,6 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/database.php
===================================================================
--- trunk/gnukebox/database.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/database.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,6 +1,6 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/display.php
===================================================================
--- trunk/gnukebox/display.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/display.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,5 +1,5 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
@@ -28,195 +28,43 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>Libre.fm — discover new music</title>
+ <title>GNUkebox version <?php echo $version; ?></title>
<meta name="author" content="FooCorp catalogue number FOO200 and
contributors" />
<link rel="stylesheet" href="<?php echo $submissions_server
?>/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="<?php echo $submissions_server ?>/base.css"
type="text/css">
- <link rel="stylesheet" href="<?php echo $submissions_server ?>/librefm.css"
type="text/css">
</head>
<body>
-<div id="doc2" class="yui-t7">
- <div id="hd" role="navigation"><h1><a href="<?php echo $submissions_server
?>">Header</a></h1>
- <ul>
- <li><a
href="https://savannah.nongnu.org/svn/?group=librefm">Code</a></li>
- <li><a href="http://blog.libre.fm/">Blog</a></li>
- <li><a href="http://ideas.libre.fm/">Wiki</a></li>
- <li><a
href="http://lists.autonomo.us/mailman/listinfo/libre-fm">List</a></li>
- <li><a
href="https://savannah.nongnu.org/bugs/?group=librefm">Bugs</a></li>
- <li id="login"><a href="http://alpha.libre.fm/login.php">Log in</a></li>
- </ul>
+<h1><a href="<?php echo $submissions_server ?>">Header</a></h1>
- </div>
- <div id="bd" role="main">
- <div id="coolio">
- <div class="yui-g">
- <a href="http://alpha.libre.fm/"><img
src="http://alpha.libre.fm/themes/librefm/images/topblocksmall.png" alt=""
/></a>
- </div>
-<div class="yui-gc">
- <div class="yui-u first" id="content">
- <div style="padding: 10px;">
- <?php
+ <h2>Last 100 tracks received</h2>
- $req_user = urldecode($_GET["u"]);
- $req_artist = urldecode($_GET["a"]);
- $req_track = urldecode($_GET["t"]);
+ <?php
- $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
+ $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
- try {
-if ($req_user) {
-// echo "SELECT username, artist, track, time FROM
Scrobbles WHERE username = '" . $adodb->qstr($req_user) . "' ORDER BY time DESC
LIMIT 100";
- $res = $adodb->CacheGetAll(60, "SELECT username,
artist, track, time FROM Scrobbles WHERE username = " . $adodb->qstr($req_user)
. " ORDER BY time DESC LIMIT 100");
+ $res = $adodb->CacheGetAll(60, "SELECT username, artist, track, time
FROM Scrobbles ORDER BY time DESC LIMIT 100");
- echo "<h2>" . $req_user . "'s most recent listening
data</h2>";
+ catch (exception $e)
+ {
+ die($e->getMessage());
+ }
-} elseif ($req_artist) {
-
- $res = $adodb->CacheGetAll(60, "SELECT username,
artist, track, time FROM Scrobbles WHERE artist = '" .
$adodb->qstr($req_artist) ."' ORDER BY time DESC LIMIT 100");
-
- echo "<h2>Last 100 Tracks by " . $req_artist . "</h2>";
-
-} elseif ($req_track) {
-
- $res = $adodb->CacheGetAll(60, "SELECT username,
artist, track, time FROM Scrobbles WHERE track = '" . $adodb->qstr($req_track)
. "' ORDER BY time DESC LIMIT 100");
-
- echo "<h2>Last 100 plays of " . $req_track . "</h2>";
-
-} elseif (!$res) {
- $res = $adodb->CacheGetAll(60, "SELECT username,
artist, track, time FROM Scrobbles ORDER BY time DESC LIMIT 10");
-
- echo "<h2>Last 10 tracks received</h2>";
- }
-}
- catch (exception $e)
- {
- die($e->getMessage());
- }
-
?>
- <table>
<tr><th>User</th><th>Artist</th><th>Track</th><th>Time</th></tr>
<?php
- $i = 0;
foreach($res as &$row){
- $i++;
- echo ($i % 2 == 0) ? "<tr class=\"even\">" :
"<tr class=\"odd\">";
- foreach($row as $field => $value) {
- if($field == "username"){
- $value = "<a href=\"" .
$submissions_server . "/user/" . $value . "\">$value</a>";}
- if($field == "time") {
- $value = '<abbr title=\'' .
strftime('%c', $value) . '\'>' . human_timestamp($value) . '</abbr>';
- }
- echo "<td>".
strip_tags(stripslashes($value)) . "</td>";
- }
- echo "</tr>\n";
- }
- ?>
- </table>
+ echo "<li>" . $row['user'] . " listened to " .
$row['artist'] . "—" . $row['track'] . 'at <abbr title=\'' .
strftime('%c', $row['time']) . '\'>' . human_timestamp($row['time']) .
'</abbr></li>';
- </div></div>
- <div class="yui-u" id="sidebar">
- <div style="padding: 10px;">
-
- <h2>Statistics</h2>
-
- <?php
- $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
- $total = $adodb->CacheGetOne(60, 'SELECT COUNT(*) as
total from Scrobbles');
- if(!$res) {
- die("sql error");
}
- echo "<p>" . stripslashes($total) . " gobbles.</p>";
- $total = $adodb->CacheGetOne(120, 'SELECT COUNT(*) as
total from Track');
- if(!$res) {
- die("sql error");
- }
- echo "<p>" . stripslashes($total) . " tracks.</p>";
-
- $total = $adodb->CacheGetOne(720, 'SELECT COUNT(*) as
total from Users');
- if(!$res) {
- die("sql error");
- }
- echo "<p>" . stripslashes($total) . " users.</p>";
-
?>
+ </ul>
- <h2>Now Playing?</h2>
-
- <?php
- $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
- $res = $adodb->GetAll('SELECT userid, artist, track,
client, ClientCodes.name, ClientCodes.url from Now_Playing LEFT OUTER JOIN
Scrobble_Sessions ON Now_Playing.sessionid=Scrobble_Sessions.sessionid LEFT
OUTER JOIN ClientCodes ON Scrobble_Sessions.client=ClientCodes.code ORDER BY
Now_Playing.expires DESC LIMIT 10');
- if(!$res) {
- die("sql error");
- }
- foreach($res as &$row){
- if($row["name"] == "") {
- $client =
strip_tags(stripslashes($row["client"])) . "(unknown, please tell us what this
is)";
- } else {
- $client = "<a href=\"" .
strip_tags(stripslashes($row["url"])) . "\">" .
strip_tags(stripslashes($row["name"])) . "</a>";
- }
- echo "<p>" .
strip_tags(stripslashes(userid_to_username($row["userid"]))) . " is listening
to " . strip_tags(stripslashes($row["track"])) . " by " .
strip_tags(stripslashes($row["artist"])) . " with " . $client . "</p>";
- }
- ?>
-
-
-
- </div></div>
-</div></div>
-<div class="yui-g" id="artists">
-
- <strong><a href="http://libre.fm/contact/">Talk to us</a></strong> if you're
in a band, represent a
- label or music service, we'd like to talk ideas and
- possibilities. While our intention is eventually provide download
- and streaming services for freely-licensed music, we are also
- interested in linking all bands to respectable DRM-free music
- services.
-
-</div>
-<div class="yui-g">
- <div class="yui-u first" id="links">
-This site handles <em>track</em> and <em>now playing</em>
-submissions from client applications and offers access to our web
-services API. If you just want to use <a
-href="http://libre.fm">libre.fm</a> then you probably want to
-visit the <a href="http://libre.fm">main site</a>, but if you're
-a developer then here are some useful stats to help you see
-what's happening.
-</div>
- <div class="yui-u" id="moarlinks">
-<a href="http://www.gnu.org/licenses/agpl.html">GNU Affero General Public
License v3 or later</a>. Source: <a
href="http://svn.savannah.gnu.org/viewvc/trunk/gobbler/?root=librefm">http://svn.savannah.gnu.org/viewvc/trunk/gobbler/?root=librefm</a>
-</div>
-</div>
-
- </div>
- <div id="ft" role="navigation">
-
- <ul>
- <li class="copy">© 2009 Free Software Foundation, Inc</li>
- <li><a href="http://libre.fm/contributors/">Contributors</a></li>
- <li><a href="http://libre.fm/licensing/">Licensing information</a></li>
- <li><a href="http://libre.fm/developer/">Developers</a></li>
- <li><a href="http://libre.fm/api/">API</a></li>
- <li><a href="http://libre.fm/download/">Download</a></li>
- </ul>
-
- <ul>
- <li><a href="http://foocorp.org">A FooCorp thing</a></li>
- <li><a href="http://autonomo.us/">autonomo.us</a></li>
- </ul>
-
- <p><img src="http://libre.fm/i/cc-by-sa.png" alt="Attribution-ShareAlike
3.0" /></p>
-
- <p><a href="<? echo $submissions_server; ?>/data">Data dumps are
here</a></p>
-
- </div>
-</div>
</body>
</html>
Modified: trunk/gnukebox/fix-album-art.php
===================================================================
--- trunk/gnukebox/fix-album-art.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/fix-album-art.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,5 +1,5 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/index.php
===================================================================
--- trunk/gnukebox/index.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/index.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,6 +1,6 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/install.php
===================================================================
--- trunk/gnukebox/install.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/install.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,6 +1,6 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/musicbrainz.php
===================================================================
--- trunk/gnukebox/musicbrainz.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/musicbrainz.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,5 +1,5 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Libre.fm Project
Modified: trunk/gnukebox/nowplaying/1.2/index.php
===================================================================
--- trunk/gnukebox/nowplaying/1.2/index.php 2009-05-24 06:02:10 UTC (rev
1768)
+++ trunk/gnukebox/nowplaying/1.2/index.php 2009-05-24 15:49:16 UTC (rev
1769)
@@ -1,5 +1,5 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/scrobble-utils.php
===================================================================
--- trunk/gnukebox/scrobble-utils.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/scrobble-utils.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,6 +1,6 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/submissions/1.1/handshake.php
===================================================================
--- trunk/gnukebox/submissions/1.1/handshake.php 2009-05-24 06:02:10 UTC
(rev 1768)
+++ trunk/gnukebox/submissions/1.1/handshake.php 2009-05-24 15:49:16 UTC
(rev 1769)
@@ -1,5 +1,5 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/submissions/1.2/handshake.php
===================================================================
--- trunk/gnukebox/submissions/1.2/handshake.php 2009-05-24 06:02:10 UTC
(rev 1768)
+++ trunk/gnukebox/submissions/1.2/handshake.php 2009-05-24 15:49:16 UTC
(rev 1769)
@@ -1,5 +1,5 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/submissions/1.2/index.php
===================================================================
--- trunk/gnukebox/submissions/1.2/index.php 2009-05-24 06:02:10 UTC (rev
1768)
+++ trunk/gnukebox/submissions/1.2/index.php 2009-05-24 15:49:16 UTC (rev
1769)
@@ -1,5 +1,5 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/temp-utils.php
===================================================================
--- trunk/gnukebox/temp-utils.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/temp-utils.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,6 +1,6 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/tests/SubmissionsTest.php
===================================================================
--- trunk/gnukebox/tests/SubmissionsTest.php 2009-05-24 06:02:10 UTC (rev
1768)
+++ trunk/gnukebox/tests/SubmissionsTest.php 2009-05-24 15:49:16 UTC (rev
1769)
@@ -1,5 +1,5 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
Modified: trunk/gnukebox/utils/get_absolute_url.php
===================================================================
--- trunk/gnukebox/utils/get_absolute_url.php 2009-05-24 06:02:10 UTC (rev
1768)
+++ trunk/gnukebox/utils/get_absolute_url.php 2009-05-24 15:49:16 UTC (rev
1769)
@@ -1,6 +1,6 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Libre.fm Project
Modified: trunk/gnukebox/utils/human-time.php
===================================================================
--- trunk/gnukebox/utils/human-time.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/utils/human-time.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,6 +1,6 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Libre.fm Project
Modified: trunk/gnukebox/version.php
===================================================================
--- trunk/gnukebox/version.php 2009-05-24 06:02:10 UTC (rev 1768)
+++ trunk/gnukebox/version.php 2009-05-24 15:49:16 UTC (rev 1769)
@@ -1,6 +1,6 @@
<?php
-/* Libre.fm -- a free network service for sharing your music listening habits
+/* GNUkebox -- a free software server for recording your listening habits
Copyright (C) 2009 Free Software Foundation, Inc
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1769] simplify gnukebox output, make it generic,
Matt Lee <=