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

Commit 27878cc6 authored by mattl's avatar mattl

updated these files from ward

parents 148bedb1 6ebf1299
......@@ -66,6 +66,7 @@ function createArtistIfNew($artist) {
if(!$res) {
// Artist doesn't exist, so we create them
try {
$artist = substr($artist,0,255);
$res = $adodb->Execute('INSERT INTO Artist (name) VALUES (' . ($artist) . ')');
}
catch (exception $e) {
......@@ -78,6 +79,8 @@ function createAlbumIfNew($artist, $album) {
global $adodb;
try {
$artist = substr($artist,0,255);
$album = substr($album,0,255);
$name = $adodb->GetOne('SELECT name FROM Album WHERE lower(name) = lower(' . ($album) . ') AND lower(artist_name) = lower(' . ($artist) . ')');
}
catch (exception $e) {
......@@ -128,6 +131,9 @@ function getTrackCreateIfNew($artist, $album, $track, $mbid) {
if(!$res) {
// Create new track
try {
$track = substr($track,0,255);
$artist = substr($artist,0,255);
$album = substr($album,0,255);
$res = $adodb->Execute('INSERT INTO Track (name, artist_name, album_name, mbid) VALUES ('
. ($track) . ', '
. ($artist) . ', '
......
......@@ -40,7 +40,7 @@ if(isset($user->name)) {
$smarty->assign('geo', Server::getLocationDetails($user->location_uri));
try {
$aUserTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, $user->name);
$aUserTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, $user->uniqueid);
$smarty->assign('user_tagcloud',$aUserTagCloud);
} catch (exception $e) {}
$smarty->assign('isme', ($_SESSION['user']->name == $user->name));
......
......@@ -67,7 +67,7 @@ foreach ($index as $subject => $data)
}
try {
$aUserTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, $user->name);
$aUserTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, $user->uniqueid);
$smarty->assign('user_tagcloud',$aUserTagCloud);
} catch (exception $e) {}
$smarty->assign('isme', ($this_user->name == $user->name));
......
......@@ -47,7 +47,7 @@ if(isset($user->name)) {
$smarty->assign('scrobbles', $aUserScrobbles);
} catch (exception $e) {}
try {
$aUserTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, $user->name);
$aUserTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, $user->uniqueid);
$smarty->assign('user_tagcloud',$aUserTagCloud);
} catch (exception $e) {}
$smarty->assign('isme', ($this_user->name == $user->name));
......
......@@ -45,7 +45,7 @@ try {
if(isset($user->name)) {
# $aUserTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, $user->name);
# $aUserTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, $user->uniqueid);
# if (!PEAR::isError ($aUserTagCloud)) {
# $smarty->assign('user_tagcloud',$aUserTagCloud);
# }
......
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