We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 00d1f2c1 authored by mattl's avatar mattl

added zebra tables

parent a35a810d
......@@ -37,7 +37,7 @@ require_once('database.php');
$req_user = $_GET["u"];
$req_artist = $_GET["a"];
$req_track = $_GET["t"];
if ($req_user) {
......@@ -56,7 +56,7 @@ if ($req_user) {
$res = $mdb2->query("SELECT username, artist, track, time FROM Scrobbles WHERE track = '" . $req_track . "' ORDER BY time DESC LIMIT 10");
echo "<h2>Last 10 Gobbles of " . $req_track . "</h2>";
} elseif (!$res) {
$res = $mdb2->query("SELECT username, artist, track, time FROM Scrobbles ORDER BY time DESC LIMIT 10");
......@@ -76,7 +76,7 @@ if ($req_user) {
die($res->getMessage());
}
while($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC)) {
echo "<tr>";
<?php echo ($i % 2 == 0) ? "<td class=\"even\">" : "<td class=\"odd\">";?>
foreach($row as $field => $value) {
if($field == "time") {
$value = strftime("%c", $value);
......@@ -88,11 +88,11 @@ if ($req_user) {
?>
</table>
<h2>Now Playing?</h2>
<?php
$res = $mdb2->query("SELECT username, artist, track FROM Now_Playing WHERE username = '" . $req_user . "' ORDER BY expires DESC LIMIT 10 ");
$res = $mdb2->query("SELECT username, artist, track FROM Now_Playing ORDER BY expires DESC LIMIT 10");
if(PEAR::isError($res)) {
die($res->getMessage());
}
......@@ -136,7 +136,7 @@ if ($req_user) {
</div>
</div>
</div>
</div>
<div id="ft" style="contentinfo">
......
......@@ -21,3 +21,6 @@ html, body, #doc3,h1{margin: 0; padding: 0;}
}
.yui-b, #ft{padding: 1em;}
.odd { background:#F4B624; color:#000; }
.even { background:#FFFFFF; color:#000; }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment