\n"; echo "\n"; echo "\n"; echo "$meta_title - Noisehub.com\n"; echo "\n"; echo "\n"; } function page_contents($logged_in, $user_name, $user_id) { $var_array = explode("/",$_SERVER['PHP_SELF']); $myPage = $var_array[3]; $myVar = $var_array[4]; $secVar = $var_array[5]; echo "".$user_name."\n"; echo " Music"; $result = mysql_query("SELECT * FROM recordsOwned WHERE memID = '".$user_id."' ORDER BY added"); echo " ".mysql_num_rows($result)."\n"; if (mysql_num_rows($result)<10) echo " You need to rate at least 10 records!\n"; $tempScore = 0; While ($i = mysql_fetch_object($result)) { $tempScore += $i->rating; $latestID = $i->recID; } echo "
 Average rating"; if (mysql_num_rows($result)>0) { echo " ".round($tempScore / mysql_num_rows($result),2)." / 10\n"; } else { echo " \n"; } mysql_free_result($result); echo "
 Latest"; $sql = "SELECT name FROM records WHERE id = '".$latestID."' LIMIT 1"; $result = mysql_query($sql); While ($i = mysql_fetch_object($result)) echo " {$i->name}
\n"; mysql_free_result($result); echo "
 \n"; echo "\n"; echo " Music I will like |\n"; echo " My music |\n"; echo " Preferences\n"; echo "\n"; // echo "Recommended  [Help]"; if ($myPage=="") { if ($myVar=="") { $result = mysql_query("SELECT * FROM memrecScore WHERE memID = '".$user_id."' AND owned = '0' AND recID <> '' ORDER BY score DESC LIMIT 10"); } else { $result = mysql_query("SELECT * FROM memrecScore WHERE memID = '".$user_id."' AND artID = '".$myVar."' AND owned = '0' AND recID <> '' ORDER BY score DESC LIMIT 10"); } $count = 1; While ($i = mysql_fetch_object($result)) { $result1 = mysql_query("SELECT * FROM records WHERE id = '".$i->recID."' LIMIT 1"); echo "$count\n"; While ($j = mysql_fetch_object($result1)) { echo ""; if ($j->imageSmall!="") { echo "imageSmall.".jpg\" style=\"width:50px;\" alt=\"".$j->name."\">\n"; } else { echo " \n"; } echo "id}\" target=\"_top\">{$j->name}\n"; $result2 = mysql_query("SELECT id, name FROM artists WHERE id = '".$j->artID."' LIMIT 1"); While ($k = mysql_fetch_object($result2)) { echo "
id."\" target=\"_top\">".$k->name.""; if ($myVar=="") echo " id}\">Filter\n"; } mysql_free_result($result2); } $count++; mysql_free_result($result1); } if (mysql_num_rows($result)==0) { echo "We have no recommendations for you. Please rate more records you own and keep checking back."; echo " ?"; echo "
 \n"; echo " \n"; echo " 
\n"; } mysql_free_result($result); } if ($myPage=="1") { echo "\n"; if ($myVar=="2") { echo " By title\n"; echo " By artist\n"; echo " By rating\n"; } elseif ($myVar=="3") { echo " By title\n"; echo " By artist\n"; echo " By rating\n"; } else { echo " By title\n"; echo " By artist\n"; echo " By rating\n"; } if ($myVar=="2") { echo "

Coming soon\n"; } elseif ($myVar=="3") { echo "Browse by my rating [Distribution]\n"; $myLetters=array("0","1","2","3","4","5","6","7","8","9","10"); echo ""; for ($i=0;$i<11;$i++) echo "[{$myLetters[$i]}] \n"; if ((strlen($secVar)==1) OR ($secVar=="10")) { settype($secVar,"integer"); $sql = "SELECT * FROM recordsOwned WHERE memID = '".$user_id."' AND rating = ".$secVar; $result = mysql_query($sql); $sql = "SELECT * FROM records WHERE (id = 'xx'"; While ($i = mysql_fetch_object($result)) $sql .= " OR id = '".$i->recID."'"; $sql .= ") AND status = '1' ORDER BY name"; mysql_free_result($result); $result = mysql_query($sql); if (mysql_num_rows($result)>0) { While ($i = mysql_fetch_object($result)) { echo "$secVar"; echo ""; if ($i->imageSmall!="") { echo "imageSmall.".jpg\" style=\"width:50px;\" alt=\"".$i->name."\">"; } else { echo " "; } echo "id}\">{$i->name}\n"; $sql = "SELECT id, name FROM artists WHERE id = '".$i->artID."' LIMIT 1"; $result1 = mysql_query($sql); While ($j = mysql_fetch_object($result1)) echo "
id."\">".$j->name.""; mysql_free_result($result1); } echo "".mysql_num_rows($result)." records (".round((mysql_num_rows($result) / mysql_num_rows(mysql_query("SELECT memID FROM recordsOwned WHERE memID = '".$user_id."'")))*100)."%)"; } else { echo "You have not given any music a rating of $secVar yet."; } mysql_free_result($result); } elseif ($secVar=="xx") { $numRecords = mysql_num_rows(mysql_query("SELECT memID FROM recordsOwned WHERE memID = '".$user_id."'")); if ($numRecords>0) { for ($i=0;$i<11;$i++) { $thisRecords = mysql_num_rows(mysql_query("SELECT memID FROM recordsOwned WHERE memID = '".$user_id."' AND rating = ".$i."")); echo "$i"; echo ""; echo round(($thisRecords / $numRecords) * 100)."%"; echo "


"; } echo " "; echo "Tip: Try and keep this distribution as even as possible."; } else { echo "You have not rated any records yet."; } } } else { echo "Browse by title\n"; $myLetters=array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"); echo ""; for ($i=0;$i<26;$i++) echo "[{$myLetters[$i]}] \n"; echo "[#] \n"; if (strlen($secVar)==1) { $sql = "SELECT * FROM recordsOwned WHERE memID = '".$user_id."'"; $result = mysql_query($sql); if ($secVar!="1") { $sql = "SELECT * FROM records WHERE nameNH LIKE '".$secVar."%' AND ("; } else { $sql = "SELECT * FROM records WHERE nameNH NOT LIKE 'A%' "; for ($i=0;$i<26;$i++) $sql .= "AND nameNH NOT LIKE '".$myLetters[$i]."%' "; $sql .= "AND ("; } While ($i = mysql_fetch_object($result)) $sql .= "id = '".$i->recID."' OR "; mysql_free_result($result); $sql .= " id = 'XX') AND status = '1' ORDER BY name"; $result = mysql_query($sql); if ($secVar=="1") { $showVar = "#"; } else { $showVar = $secVar; } While ($i = mysql_fetch_object($result)) { echo "$showVar"; echo ""; if ($i->imageSmall!="") { echo "imageSmall.".jpg\" style=\"width:50px;\" alt=\"".$i->name."\">"; } else { echo " "; } echo "id}\">{$i->name}\n"; $sql = "SELECT id, name FROM artists WHERE id = '".$i->artID."' LIMIT 1"; $result1 = mysql_query($sql); While ($j = mysql_fetch_object($result1)) echo "
id."\">".$j->name.""; mysql_free_result($result1); } mysql_free_result($result); } } } if ($myPage=="2") { } } include 'sheet.php'; ?>