<?php

define('IN_BANDTOPIA', "You're here!!!");

ini_set("display_errors","1");
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);

$fanslist = array(); //init as empty array			

//info for facebook, twitter
$fbuser;
$twuser;

$artist; //whose page this is
$user; //who is accessing this page

//get all the global values
function init()
{
    global $fbuser, $twuser, $artist, $user;
	$fbuser = "pages/Jason-Watson-Band/123433347782842";
	$twuser = "jasonwatsonband";
	$artist = $_GET['aID'];
	$user = SESSION_USERID;
}

/*******************************************/ 
/*                 Main                    */
/*******************************************/

init();

$template -> assign_block_vars("artistdisplay", array());

$template -> assign_var("FB_USER", $fbuser);
$template -> assign_var("TW_USER", $twuser);
$template -> assign_var("ARTISTID", $artist);
$template -> assign_var("USERID", $user);

if(isset($user)){
	$template -> assign_block_vars('artistdisplay.fav_button', array());
}
if(isset($user)){
	$template -> assign_block_vars('artistdisplay.msg_button', array());
}

$query = "SELECT UserId FROM FavArtists WHERE ArtistId = $artist AND StreetTeam = 0";
$result = mysql_query($query, $mydb) or die(mysql_error() . "<br>" . $query);
while($row = mysql_fetch_array($result))
{
	$query = "SELECT * FROM Users WHERE UserId = {$row[0]}";
	$res = mysql_query($query, $mydb) or die(mysql_error() . "<br>" . $query);
	$r = mysql_fetch_array($res);
	$fanFirstName = $r[4];
	$fanLastName = $r[5];
	$template -> assign_block_vars('artistdisplay.fan', array(
		"FIRSTNAME" => $fanFirstName,
		"LASTNAME" => $fanLastName));
}
?>
