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

Commit 3f09c675 authored by mattl's avatar mattl

moved function

parent 1a12c9a9
......@@ -177,6 +177,19 @@ class Server {
return $result;
}
static function getUserList($alpha) {
global $adodb;
$query = "SELECT username from users where username LIKE '" . $alpha . "%'";
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$data = $adodb->CacheGetAll(7200,$query);
if (!$data) {
throw new Exception('ERROR ' . $query);
}
}
/**
* Retrieves a list of the currently playing tracks
*
......
......@@ -229,19 +229,6 @@ class User {
return Server::getRadioSession($station, $this->name);
}
function getUserList($alpha) {
global $adodb;
$query = "SELECT username from users where username LIKE '" . $alpha . "%'";
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$data = $adodb->CacheGetAll(7200,$query);
if (!$data) {
throw new Exception('ERROR ' . $query);
}
}
/**
* get user's top 20 tracks
*
......
......@@ -25,8 +25,6 @@ require_once('data/User.php');
require_once('data/TagCloud.php');
require_once('data/Server.php');
$user = new User();
if(!isset($_GET['alpha'])) {
$alpha = 'a';
......@@ -37,7 +35,7 @@ if(!isset($_GET['alpha'])) {
}
$users = $user->getUserList($alpha);
$users = getUserList($alpha);
$smarty->assign('userlist', $users);
......
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