diff --git a/sections/ajax/index.php b/sections/ajax/index.php index 18b33040..55d11225 100644 --- a/sections/ajax/index.php +++ b/sections/ajax/index.php @@ -92,6 +92,12 @@ case 'better': require(SERVER_ROOT.'/sections/ajax/better/index.php'); break; + case 'password_validate': + require(SERVER_ROOT.'/sections/ajax/password_validate.php'); + break; + case 'similar_artists': + require(SERVER_ROOT.'/sections/ajax/similar_artists.php'); + break; default: // If they're screwing around with the query string print json_encode(array('status' => 'failure')); diff --git a/sections/ajax/similar_artists.php b/sections/ajax/similar_artists.php new file mode 100644 index 00000000..dd8a3d05 --- /dev/null +++ b/sections/ajax/similar_artists.php @@ -0,0 +1,28 @@ +query(" + SELECT + s2.ArtistID, + ag.Name, + ass.Score + FROM artists_similar AS s1 + JOIN artists_similar AS s2 ON s1.SimilarID=s2.SimilarID AND s1.ArtistID!=s2.ArtistID + JOIN artists_similar_scores AS ass ON ass.SimilarID=s1.SimilarID + JOIN artists_group AS ag ON ag.ArtistID=s2.ArtistID + WHERE s1.ArtistID=".$artist_id." + ORDER BY ass.Score DESC + LIMIT 14"); + + + while(list($ArtistID, $Name, $Score) = $DB->next_record(MYSQLI_NUM, false)){ + if($Score<0){ + continue; + } + $results[] = array('id' => (int) $ArtistID, 'name' => $Name, 'score' => (int) $Score); + } + +print json_encode($results); +exit(); +?> diff --git a/sections/artist/artist.php b/sections/artist/artist.php index 92c3d76a..67658f8c 100644 --- a/sections/artist/artist.php +++ b/sections/artist/artist.php @@ -801,14 +801,90 @@ function compare($X, $Y){ ?>