GitHost.io will be shut down on June 1, 2019. At that point this instance will be unreachable and all data will be irrevocably deleted. More details at https://about.gitlab.com/gitlab-hosted/#githost-is-shutting-down-on-june-1st-2019

Commit ae7d4359 authored by Matt Lee's avatar Matt Lee

top users script for jaiden, fixes

parent 82d26d1e
...@@ -27,7 +27,7 @@ require_once('version.php'); ...@@ -27,7 +27,7 @@ require_once('version.php');
$adodb->SetFetchMode(ADODB_FETCH_ASSOC); $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
try { try {
$res = $adodb->CacheGetAll(300, 'select users.username, user_stats.scrobble_count from user_stats left join users on user_stats.userid=users.uniqueid order by user_stats.scrobble_count desc LIMIT 100;'); $res = $adodb->CacheGetAll(300, 'select users.username, user_stats.scrobble_count from user_stats left join users on user_stats.userid=users.uniqueid order by user_stats.scrobble_count desc LIMIT 1000;');
} catch (Exception $e) { } catch (Exception $e) {
die($e->getMessage()); die($e->getMessage());
} }
...@@ -40,15 +40,15 @@ try { ...@@ -40,15 +40,15 @@ try {
<body> <body>
<h2>Top users</h2> <h2>Top users</h2>
<ul> <ol>
<?php <?php
$list = []; $list = [];
foreach ($res as $row) { foreach ($res as $row) {
$list []= '<li><a href=http://libre.fm/user/' . $row['username'] . '>' . $row['username'] . '&mdash;' . $row['scrobble_count'] . '</li>'; $list []= '<li><a href=http://libre.fm/user/' . $row['username'] . '>' . $row['username'] . '</a>&mdash;' . $row['scrobble_count'] . '</li>';
} }
echo implode('', $list); echo implode('', $list);
?> ?>
</ul> </ol>
<p>This server is powered by <a href="https://gitorious.org/foocorp/gnu-fm">GNU FM</a> version <?php echo $version; ?></p> <p>This server is powered by <a href="https://gitorious.org/foocorp/gnu-fm">GNU FM</a> version <?php echo $version; ?></p>
</body> </body>
......
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