Empty commit

This commit is contained in:
Git 2012-06-29 08:00:08 +00:00
parent de9865a4f2
commit 483730e755
3 changed files with 18 additions and 13 deletions

View File

@ -1,6 +1,7 @@
<?php <?php
$artist_id = $_GET["id"]; $artist_id = $_GET["id"];
$artist_limit = $_GET["limit"];
$DB->query(" $DB->query("
SELECT SELECT
@ -13,7 +14,7 @@
JOIN artists_group AS ag ON ag.ArtistID=s2.ArtistID JOIN artists_group AS ag ON ag.ArtistID=s2.ArtistID
WHERE s1.ArtistID=".$artist_id." WHERE s1.ArtistID=".$artist_id."
ORDER BY ass.Score DESC ORDER BY ass.Score DESC
LIMIT 14"); LIMIT $artist_limit");
while(list($ArtistID, $Name, $Score) = $DB->next_record(MYSQLI_NUM, false)){ while(list($ArtistID, $Name, $Score) = $DB->next_record(MYSQLI_NUM, false)){

View File

@ -803,7 +803,7 @@ function compare($X, $Y){
<div id="similar_artist_map" class="box"> <div id="similar_artist_map" class="box">
<div id="flipper_head" class="head"> <div id="flipper_head" class="head">
<strong id="flipper_title">Similar Artist Map</strong> <strong id="flipper_title">Similar Artist Map</strong>
<a id="flip_to" href="#null" onclick="flipView();"></a> <a id="flip_to" href="#null" onclick="flipView();"> [Switch to Cloud]</a>
</div> </div>
<div id="flip_view_1" style="display:block;width:<?=WIDTH?>px;height:<?=HEIGHT?>px;position:relative;background-image:url(static/similar/<?=$ArtistID?>.png?t=<?=time()?>)"> <div id="flip_view_1" style="display:block;width:<?=WIDTH?>px;height:<?=HEIGHT?>px;position:relative;background-image:url(static/similar/<?=$ArtistID?>.png?t=<?=time()?>)">
<? <?

View File

@ -1,5 +1,6 @@
(function($) { (function($) {
var LIMIT = 10;
var artistId, artistName; var artistId, artistName;
var artistTags; var artistTags;
$(document).ready(function() { $(document).ready(function() {
@ -17,11 +18,17 @@ function initArtistCloud() {
function loadArtists() { function loadArtists() {
$.getJSON('ajax.php?action=similar_artists&id='+artistId, function(data) { $.getJSON('ajax.php?action=similar_artists&id='+artistId+'&limit='+LIMIT, function(data) {
var items = []; var first = true;
var ratio;
$.each(data, function(key, val) { $.each(data, function(key, val) {
addArtist(val['id'], val['name'], val['score']); if(first) {
ratio = val['score'] / 300;
first = false;
}
var score = val['score'] / ratio;
score = score <= 150 ? 150 : score;
addArtist(val['id'], val['name'], score);
}); });
createCloud(); createCloud();
@ -30,8 +37,7 @@ function loadArtists() {
} }
function addArtist(id, name, score) { function addArtist(id, name, score) {
var item = $('<li><a data-weight="' + score + '">' + name + '</a></li>'); var item = $('<li><a style="color:#007DC6;" data-weight="' + score + '">' + name + '</a></li>');
// var item = $('<li><a class="green large">' + name + '</a></li>');
$(item).click(function(e) { $(item).click(function(e) {
@ -44,9 +50,7 @@ function addArtist(id, name, score) {
} }
function addArtistMain(name) { function addArtistMain(name) {
var item = $('<li><a data-weight="350">' + name + '</a></li>'); var item = $('<li><a style="color:#007DC6;" data-weight="350">' + name + '</a></li>');
// var item = $('<li><a class="red large">' + name + '</a></li>');
$("#currentArtist").attr('href', 'artist.php?id=' + artistId); $("#currentArtist").attr('href', 'artist.php?id=' + artistId);
$("#currentArtist").text(artistName); $("#currentArtist").text(artistName);