include("./library/globals.php");
include("./library/review_index.php");
include("./library/html_encode.php");
include("../zine/configuration.php");
include $_SERVER['DOCUMENT_ROOT'].'/dbconfig.php';
list($q, $a) = makequery($remove_tags, $QUERY);
function URLopen($url)
{
// Fake the browser type
ini_set('user_agent','MSIE 4\.0b2;');
$dh = fopen("$url",'r');
$result = fread($dh,8192);
return $result;
}
?>
include('../header.php');
?>
$ri = new review_index();
$pos_original = $pos;
if ($reviews = $ri->get_search($_GET['band'], $_GET['album'], $_GET['month'], $_GET['year'], $_GET['post_by_user'], $_GET['post_by'], $_GET['rating'], $_GET['letter'])) {
$cur_band = $reviews[$pos]['band'];
$cur_album = $reviews[$pos]['album'];
$pos--;
while(($reviews[($pos + 1)]['band'] == $cur_band) and ($reviews[($pos + 1)]['album'] == $cur_album)) {
$pos++;
$r = new review($reviews[$pos]['id'], false, $reviews[$pos]);
if ($r->get('cover') and is_file($r->get('cover')))
$cover = template('review_cover', array('' => $r->get('cover')));
else
$cover = '';
$r_body = ereg_replace("\n", '
', trim($r->get('review')));
if ($r->get('buy')) {
$buy = template('review_buy', array('' => $r->get('buy')));
}
else {
$buy = '';
}
// ===== Start hack: parsing the band and label's homepage URL
$band = addslashes($r->get('band'));
$label_url = $r->get('label_url'); // --- Label contact
$distributor = $r->get('distributor');
if ($label_url == "http://" || $label_url == "" || $label_url == "N/A")
$label = $distributor;
else
$label = "
$distributor";
$contact = $r->get('contact'); // --- Band contact
if (!$contact || $contact == "" || $contact == "http://")
$contact = "N/A";
$tracklist = $r->get('tracklist');
$lineup = $r->get('lineup');
if ($tracklist == "") $tracklist = "N/A";
if ($lineup == "") $lineup = "N/A";
$album = addslashes($r->get('album'));
$author = $r->get('post_by');
if (($r->get('cover') != '') && file_exists($r->get('cover'))) {
$cover = '
.')
';
}
else $cover = "";
$db = mysql_connect($dbReviews_Host, $dbReviews_User, $dbReviews_Password) or die("Could not connect to database.");
mysql_select_db($dbReviews_Database);
$rs = mysql_query("SELECT album, post_by FROM reviews WHERE band = '$band' AND (post_by <> '$author' OR album <> '$album')") or die(mysql_error());
// ===== End hack
//$count = file ("http://localhost/review/allreviews.php?band=".urlencode($band)."&author=".urlencode($author));
//$allReviews = URLOpen("http://216.69.172.23/review/allreviews.php?band=".urlencode($band)."&author=".urlencode($author));
//foreach ($count as $line_num => $line)
//{
// $allReviews = $allReviews . $line;
//}
include_once('allreviews.php');
$allReviews = allReviews($band, $author);
echo template('review_09', array(
'' => $r->get('band'),
'' => $r->get('album'),
'' => $r->get('month'),
'' => $r->get('year'),
'' => $r->get('released'),
'' => $label,
'' => $r->get('rating'),
'' => $r->get('post_by'),
'' => $cover,
'' => html_encode($r_body),
'' => $buy,
'' => $other,
'' => html_encode($contact),
'' => nl2br($tracklist),
'' => nl2br($lineup),
'' => $allReviews
));
$db = mysql_connect($mosConfig_host, $mosConfig_user, $mosConfig_password) or die('DEAD');
mysql_select_db($mosConfig_db);
$temp = $r->get('band');
$query = "SELECT id,title FROM mos_content WHERE sectionid=3 AND state=1 AND title LIKE '%$temp%'";
$rsTwo = mysql_query($query);
$query = "SELECT id,title FROM mos_content WHERE sectionid=4 AND state=1 AND title LIKE '%$temp%'";
$rsThree = mysql_query($query);
// @include("allreviews.php");
//@include("interviews.php");
$db = mysql_connect($dbReviews_Host, $dbReviews_User, $dbReviews_Password) or die("Could not connect to database.");
mysql_select_db($dbReviews_Database)
;
if (is_array($reviews[$pos + 1])) {
$next_review = $reviews[$pos + 1];
echo template('review_next_header');
list($next_r, $junk) = makequery(array(), array(
'band' => $s_band,
'album' => $s_album,
'post_by' => $s_post_by,
'rating' => $s_rating,
'month' => $s_month,
'year' => $s_year,
'letter' => $s_letter,
'pos' => ($pos + 1)
));
echo template('review_link', array(
'' => 'viewreview'.$ext.'?'.$next_r,
'' => $next_review['band'],
'' => $next_review['album']
));
}
if (is_array($reviews[$pos_original - 1])) {
$last_review = $reviews[$pos_original - 1];
echo template('review_last_header');
list($last_r, $junk) = makequery(array(), array(
'band' => $s_band,
'album' => $s_album,
'post_by' => $s_post_by,
'rating' => $s_rating,
'month' => $s_month,
'year' => $s_year,
'letter' => $s_letter,
'pos' => ($pos_original - 1)
));
echo template('review_link', array(
'' => 'viewreview'.$ext.'?'.$last_r,
'' => $last_review['band'],
'' => $last_review['album']
))."
";
}
}
}
else {
template('review_not_found');
}
?>
include('../footer.php');
?>