{$photographer['name']}

"; if ($user->loggedin) { echo "Add this photographer to your favorites list"; } $query = mysql_query("SELECT * FROM city WHERE id = {$photographer['city']}"); if (mysql_num_rows($query) > 0) { $city = mysql_fetch_array($query); $query2 = mysql_query("SELECT name FROM country WHERE id = {$city['country']}"); $country = mysql_fetch_array($query2); } else { $city['name'] = "Not yet specified"; $country['name'] = "Not yet specified"; } echo "Lives in: " . $city['name'] . " - " . $country['name'] . "

" . "Favorite genres:
"; $query = mysql_query("SELECT genre.name AS name FROM user_genre JOIN (genre) ON (user_genre.genre = genre.id) WHERE user = '{$uid}'"); while ($genre = mysql_fetch_array($query)) { echo "  " . $genre['name'] . "
"; } echo "Favorite artists:
"; $query = mysql_query("SELECT artist.name AS name, artist.id AS id, country.name AS country FROM user_artist JOIN (artist, country) ON (user_artist.artist = artist.id AND artist.country = country.id) WHERE user = '{$uid}'"); while ($artist = mysql_fetch_array($query)) { echo "  " . $artist['name'] . " - " . $artist['country'] . "
"; } echo "Favorite photographers:
"; $query = mysql_query("SELECT user.name AS name, user.id AS id, country.name AS country FROM user_photographer JOIN (user,city,country) ON (user_photographer.photographer = user.id AND user.city = city.id AND city.country = country.id) WHERE user_photographer.user = '{$uid}'"); while ($photographer = mysql_fetch_array($query)) { echo "  " . $photographer['name'] . " - " . $photographer['country'] . "
"; } echo "

Photos

"; $query = mysql_query("SELECT image.thumb AS thumb, image.name as imagename, user.name as username, user.id AS userid, artist.id AS artistid, artist.name as artistname FROM image JOIN (artist, user) ON (image.user = user.id AND image.artist = artist.id) WHERE image.user = '{$uid}' ORDER BY image.date DESC"); $loop = 0; while ($image = mysql_fetch_array($query)) { if ($loop == 4) { echo "
"; $loop = 0; } echo "{$image['artistname']}, by {$image['username']}\" class='artist_album'>{$image["; $loop++; } echo "

Comments

Post a comment

"; if ($user->loggedin) { echo "


Posted comments

"; } $query = mysql_query("SELECT user_comment.comment as comment, user_comment.date AS date, user.name as username, user.id AS userid FROM user_comment, user WHERE user_comment.commented_user = '{$_GET['uid']}' AND user.id=user_comment.user ORDER BY date DESC"); while($comment=mysql_fetch_array($query)) { echo "
{$comment['username']} - {$comment['date']}
"; echo nl2br($comment['comment']); echo "
"; } echo "

Presentation

"; $query = mysql_query("SELECT presentation FROM user_pres WHERE user = '{$uid}'"); $pres = mysql_fetch_array($query); $presdarray = split("\n", $pres['presentation']); foreach($presdarray as $pres) { echo $pres . "
"; } echo "
"; } else { echo "

Error

An unexpected error ocured.
"; } #avsluta sidan show_footer(); #koppla från databas $db->Disconnect(); ?>