git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 97cbf6f7 authored by Mike Sheldon's avatar Mike Sheldon

Merge commit 'refs/merge-requests/11' of gitorious.org:foocorp/gnu-fm into merge11

parents 4ad51b1d 78b3e486
......@@ -383,7 +383,7 @@ if (isset($_POST['install'])) {
// $adodb->Execute("CREATE UNIQE INDEX groups_groupname_idx ON Groups(lower(groupname))");
// uncomment these if you're using postgresql and want to run the software as www-data
// $adodb->Execute("GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE Album, Artist, Auth, Clientcodes, Delete_Request Error, Invitation_Request, Invitations, Now_Playing, Places, Radio_Sessions, Scrobble_Sessions, Scrobbles, Scrobble_Track, Similar_Artist, Tags, Track, Users, User_Relationships, User_Relationship_Flags to \"www-data\"");
// $adodb->Execute("GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE Album, Artist, Auth, ClientCodes, Delete_Request, Error, Invitation_Request, Invitations, Now_Playing, Places, Radio_Sessions, Scrobble_Sessions, Scrobbles, Scrobble_Track, Similar_Artist, Tags, Track, Users, User_Relationships, User_Relationship_Flags to \"www-data\"");
// $adodb->Execute("GRANT SELECT ON Free_Scrobbles, Relationship_Flags to \"www-data\"");
// $adodb->Execute("GRANT SELECT, UPDATE ON users_uniqueid_seq, scrobble_track_id_seq, groups_id_seq, artist_id_seq, album_id_seq to \"www-data\"");
......
......@@ -27,7 +27,7 @@ require_once('database.php');
require_once('utils/human-time.php');
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$res = $adodb->GetAll('SELECT artist, track from scrobbles where Album is null LIMIT 20;');
$res = $adodb->GetAll('SELECT artist, track from Scrobbles where album is null LIMIT 20;');
echo '<ul>';
......@@ -65,7 +65,7 @@ function doABunchOfShit($artist, $track) {
function ScrobbleLookup($artist, $track) {
global $adodb;
$sql = 'SELECT album from scrobbles where artist = ' . $adodb->qstr($artist) . ' and track = ' . $adodb->qstr($track) . ' LIMIT 1;';
$sql = 'SELECT album from Scrobbles where artist = ' . $adodb->qstr($artist) . ' and track = ' . $adodb->qstr($track) . ' LIMIT 1;';
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$album = $adodb->GetOne($sql);
......
......@@ -34,7 +34,7 @@ class TrackXML {
continue;
}
try {
$adodb->Execute('INSERT INTO tags VALUES ('
$adodb->Execute('INSERT INTO Tags VALUES ('
. $adodb->qstr($tag) . ', '
. $adodb->qstr($artist) . ', '
. $adodb->qstr($album) . ', '
......@@ -92,7 +92,7 @@ class TrackXML {
global $adodb;
try {
$res = $adodb->Execute('INSERT INTO banned_tracks VALUES ('
$res = $adodb->Execute('INSERT INTO Banned_Tracks VALUES ('
. $userid . ', '
. $adodb->qstr($name) . ', '
. $adodb->qstr($artist) . ', '
......@@ -108,7 +108,7 @@ class TrackXML {
global $adodb;
try {
$res = $adodb->Execute('INSERT INTO loved_tracks VALUES ('
$res = $adodb->Execute('INSERT INTO Loved_Tracks VALUES ('
. $userid . ', '
. $adodb->qstr($name) . ', '
. $adodb->qstr($artist) . ', '
......@@ -124,7 +124,7 @@ class TrackXML {
global $adodb;
try {
$res = $adodb->Execute('DELETE FROM banned_tracks WHERE userid=' . $userid . ' AND track=' . $adodb->qstr($name) . ' AND artist=' . $adodb->qstr($artist));
$res = $adodb->Execute('DELETE FROM Banned_Tracks WHERE userid=' . $userid . ' AND track=' . $adodb->qstr($name) . ' AND artist=' . $adodb->qstr($artist));
} catch (Exception $e) {}
$xml = new SimpleXMLElement('<lfm status="ok"></lfm>');
......@@ -137,7 +137,7 @@ class TrackXML {
global $adodb;
try {
$res = $adodb->Execute('DELETE FROM loved_tracks WHERE userid=' . $userid . ' AND track=' . $adodb->qstr($name) . ' AND artist=' . $adodb->qstr($artist));
$res = $adodb->Execute('DELETE FROM Loved_Tracks WHERE userid=' . $userid . ' AND track=' . $adodb->qstr($name) . ' AND artist=' . $adodb->qstr($artist));
} catch (Exception $e) {}
$xml = new SimpleXMLElement('<lfm status="ok"></lfm>');
......
......@@ -50,7 +50,7 @@ $smarty->assign('name', $artist->name);
$smarty->assign('pagetitle', $artist->name);
try {
$tagCloud = TagCloud::generateTagCloud('tags', 'tag', 10, $artist->name, 'artist');
$tagCloud = TagCloud::generateTagCloud('Tags', 'tag', 10, $artist->name, 'artist');
$smarty->assign('tagcloud', $tagCloud);
} catch (Exception $e) {
$tagCloud = array();
......
......@@ -67,7 +67,7 @@ if (isset($this_user) && $this_user->manages($artist->name)) {
}
try {
$tagCloud = TagCloud::generateTagCloud('tags', 'tag', 10, $artist->name, 'artist');
$tagCloud = TagCloud::generateTagCloud('Tags', 'tag', 10, $artist->name, 'artist');
$smarty->assign('tagcloud', $tagCloud);
} catch (Exception $ex) {
$tagCloud = array();
......
......@@ -169,7 +169,7 @@ class Album {
function getTopTags($limit = 10) {
global $adodb;
$res = $adodb->CacheGetAll(600, 'SELECT tag, COUNT(tag) AS freq FROM tags WHERE '
$res = $adodb->CacheGetAll(600, 'SELECT tag, COUNT(tag) AS freq FROM Tags WHERE '
. ' artist = ' . $adodb->qstr($this->artist_name)
. ' AND album = ' . $adodb->qstr($this->name)
. ' GROUP BY tag ORDER BY freq DESC '
......
......@@ -185,7 +185,7 @@ class Artist {
continue;
}
try {
$adodb->Execute('INSERT INTO tags (tag, artist, userid) VALUES ('
$adodb->Execute('INSERT INTO Tags (tag, artist, userid) VALUES ('
. $adodb->qstr($tag) . ', '
. $adodb->qstr($this->name) . ', '
. $userid . ')');
......@@ -202,7 +202,7 @@ class Artist {
function getTopTags($limit = 10) {
global $adodb;
$res = $adodb->CacheGetAll(600, 'SELECT tag, COUNT(tag) AS freq FROM tags WHERE '
$res = $adodb->CacheGetAll(600, 'SELECT tag, COUNT(tag) AS freq FROM Tags WHERE '
. ' artist = ' . $adodb->qstr($this->name)
. ' GROUP BY tag ORDER BY freq DESC '
. ' LIMIT ' . $limit);
......
......@@ -184,7 +184,7 @@ class Server {
static function getUserList($alpha) {
global $adodb;
$query = 'SELECT username from users where username LIKE \'' . $alpha . '%\'';
$query = 'SELECT username from Users where username LIKE \'' . $alpha . '%\'';
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$data = $adodb->CacheGetAll(7200, $query);
......
......@@ -41,8 +41,8 @@ class TagCloud {
}
$sizes = array('xx-large', 'x-large', 'large', 'medium', 'small', 'x-small', 'xx-small');
if ($field == 'artist') {
$query = 'SELECT ' . $field . ', count(*) AS count FROM ' . $table . ' INNER JOIN artist ON ' . $table . '.' . $field . ' = artist.name '
. ' WHERE artist.streamable = 1';
$query = 'SELECT ' . $field . ', count(*) AS count FROM ' . $table . ' INNER JOIN Artist ON ' . $table . '.' . $field . ' = Artist.name '
. ' WHERE Artist.streamable = 1';
$query .= (!is_null($constraint)) ? ' AND ' : null;
} else {
$query = 'SELECT ' . $field . ', count(*) AS count FROM ' . $table;
......
......@@ -260,7 +260,7 @@ class Track {
global $adodb;
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$res = $adodb->CacheGetAll(600, 'SELECT COUNT(tag) AS freq, tag FROM tags WHERE'
$res = $adodb->CacheGetAll(600, 'SELECT COUNT(tag) AS freq, tag FROM Tags WHERE'
. ' artist = ' . $adodb->qstr($this->artist_name)
. ' AND track = ' . $adodb->qstr($this->name)
. ' GROUP BY tag ORDER BY freq DESC');
......@@ -277,7 +277,7 @@ class Track {
global $adodb;
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$res = $adodb->GetAll('SELECT tag FROM tags WHERE'
$res = $adodb->GetAll('SELECT tag FROM Tags WHERE'
. ' artist = ' . $adodb->qstr($this->artist_name)
. ' AND track = ' . $adodb->qstr($this->name)
. ' AND userid = ' . $userid);
......
......@@ -308,7 +308,7 @@ class User {
function getTopTags($limit = 10) {
global $adodb;
$res = $adodb->CacheGetAll(600, 'SELECT tag, COUNT(tag) AS freq FROM tags WHERE '
$res = $adodb->CacheGetAll(600, 'SELECT tag, COUNT(tag) AS freq FROM Tags WHERE '
. ' userid = ' . $this->uniqueid
. ' GROUP BY tag '
. ' LIMIT ' . $limit);
......@@ -325,7 +325,7 @@ class User {
function getTagsForArtist($artist) {
global $adodb;
$res = $adodb->GetAll('SELECT tag, COUNT(tag) AS freq FROM tags WHERE '
$res = $adodb->GetAll('SELECT tag, COUNT(tag) AS freq FROM Tags WHERE '
. ' userid = ' . $this->uniqueid
. ' AND artist = ' . $adodb->qstr($artist)
. ' GROUP BY tag ');
......
......@@ -26,7 +26,7 @@ require_once('data/Server.php');
require_once('data/TagCloud.php');
try {
$aTagCloud = TagCloud::GenerateTagCloud('loved_tracks', 'artist');
$aTagCloud = TagCloud::GenerateTagCloud('Loved_Tracks', 'artist');
$smarty->assign('tagcloud', $aTagCloud);
} catch(Exception $e) {
// Installation doesn't have any loved tracks yet
......
......@@ -26,7 +26,7 @@ require_once('data/Server.php');
require_once('data/TagCloud.php');
try {
$aTagCloud = TagCloud::GenerateTagCloud('loved_tracks', 'artist');
$aTagCloud = TagCloud::GenerateTagCloud('Loved_Tracks', 'artist');
$smarty->assign('tagcloud', $aTagCloud);
} catch (Exception $e) {}
......
......@@ -36,7 +36,7 @@ $tag = $_GET['tag'];
$smarty->assign('tag', $tag);
try {
$tagCloud = TagCloud::generateTagCloud('tags', 'artist', 40, $tag, 'tag');
$tagCloud = TagCloud::generateTagCloud('Tags', 'artist', 40, $tag, 'tag');
$smarty->assign('tagcloud', $tagCloud);
} catch (Exception $e) {
$smarty->assign('pageheading', 'No artists found');
......
......@@ -15,7 +15,7 @@ if ($n < 1) {
}
try {
$aTagCloud = TagCloud::GenerateTagCloud('free_scrobbles', 'artist', $n);
$aTagCloud = TagCloud::GenerateTagCloud('Free_Scrobbles', 'artist', $n);
$smarty->assign('tagcloud', $aTagCloud);
} catch (Exception $e) {
$smarty->assign('errors', $errors);
......
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