<?php 
define('THIS_SCRIPT', 'os_review');
$loadCacheItems = array('lastFive');
include "admin/main/config.php";

$vbulletin->input->clean_array_gpc('r', array(
	'id'    => TYPE_UINT,
));

$res = $vbulletin->db->query_first("
	SELECT review.*, 
		news.threadid,
		thread.open,
		game.game_title, game.release_date, game.publisher_id, game.developer_id, 
		game.sport_id AS game_sport_id, game.console_id AS game_console_id, game.notallowed AS game_notallowed,
		game.rscorenum AS game_rscorenum, game.rscore AS game_rscore, game.hscorenum AS game_hscorenum, game.hscore AS game_hscore,
		developer.name AS developer_name,
		publisher.name AS publisher_name,
		media.id AS media_id, media.shotid AS media_shotid,
		preview.id AS preview_id, preview.title AS preview_title
	FROM cms_review AS review
	LEFT JOIN cms_news AS news ON (news.itemid = review.id AND news.newstype = 'review')
	LEFT JOIN " . TABLE_PREFIX . "thread ON (thread.threadid = news.threadid)
	LEFT JOIN cms_game AS game ON (game.id = review.game_id)
	LEFT JOIN cms_developer AS developer ON (developer.id = game.developer_id)
	LEFT JOIN cms_publisher AS publisher ON (publisher.id = game.publisher_id)
	LEFT JOIN cms_media AS media ON (media.game_id = review.game_id)
	LEFT JOIN cms_preview AS preview ON (preview.game_id = review.game_id)
	WHERE review.id = {$vbulletin->GPC['id']}
	ORDER BY media.shotid DESC
	LIMIT 1
");

checkSeoUrl('review', $res['slug'], $res['id']);

//checkUrlCorrectness('review', $res['title'], $res['id']);

if (!empty($res["console_id"]))
{
	$consolelist = explode(":", $res["console_id"]);
	if (sizeof($consolelist) > 0)
	{
		if (!isset($consolecache))
			$consolecache = @unserialize($vbulletin->consolecache);

		foreach ($consolelist as $console => $consoleid)
		{
			$resconsolename .= $consolecache[$consoleid] . ",";
		}
		$resconsolename = rtrim($resconsolename, ',');
	}
}

$sportList = explode(":", $res["game_sport_id"]);
if (sizeof($sportList) > 0)
{
	if (!isset($sportcache))
		$sportcache = @unserialize($vbulletin->sportcache);

	foreach($sportList as $sport => $sportid)
	{
		$sportname .= "{$sportcache[$sportid]["name"]},";
	}
	$sportname = rtrim($sportname, ',');
}

$keywords = array(
	'game_title' => $res['game_title'],
	'console' => $resconsolename,
	'sport' => $sportname,
	'developer' => $res['developer_name'],
	'publisher' => $res['publisher_name'],
	'title' => $res['title'],
	'author' => $res['author']
);
$extraKeywords = "{$res["game_title"]} Review, {$res["game_title"]} $resconsolename Review, {$res["game_title"]} Game Review, {$res["game_title"]} $resconsolename Game Review, {$res["game_title"]} Reviews, {$res["game_title"]} $resconsolename Reviews, {$res["game_title"]} Game Reviews, {$res["game_title"]} $resconsolename Game Reviews, {$res["game_title"]} Review, {$res["game_title"]} $resconsolename Review";
$articleUrl = getSeoUrl('review', $res['slug'], $res['id']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:fb="//www.facebook.com/2008/fbml" dir="ltr" lang="en-US">
<head>
<title><? echo $res["game_title"]; ?> Review <?php if ($resconsolename):?>(<? echo $resconsolename; ?>) <?php endif;?>- Operation Sports</title>
<?php 
/* OLD META DESCRIPTION & KEYWORDS
<meta name="description" content="Operation Sports reviews <? echo htmlspecialchars_uni($resgame["game_title"]); ?> for the <? echo htmlspecialchars_uni($resconsolename); ?>." />
<meta name="keywords" content="<? echo htmlspecialchars_uni($resgame["game_title"]); ?>,<? echo htmlspecialchars_uni($resconsolename); ?>,review,score,operationsports,reviews,sports video games" />
*/
?>
<meta name="description" content="<?php echo fetchPostExcerpt($res['content_body'])?>" />
<meta name="keywords" content="<?php echo fetchMetaKeywords($keywords)?>, <? echo $extraKeywords;?>" />
<link rel="stylesheet" type="text/css" media="screen" href="//forums.operationsports.com/css/gen_stylev3_<?=filemtime('css/gen_stylev3.css')?>.css">
	<link rel="stylesheet" type="text/css" media="screen" href="//forums.operationsports.com/css/profilev4_responsive.css">
<script type="text/javascript">
<!--
	var minchars = <?php echo $vbulletin->options['postminchars']?>;
	var SECURITYTOKEN = "<?=$vbulletin->userinfo['securitytoken']?>";
	var BBURL = '<?=$vbulletin->options['bburl2']?>';
	var IMGDIR_MISC = "<?=$stylevar['imgdir_misc']?>";
	var SESSIONURL = "<?=$session['sessionurl_js']?>";
//-->
</script>
<?php
	/*
	<script type="text/javascript" src="<?php echo $vbulletin->options['bburl2']; ?>/clientscript/yui/yahoo-dom-event/yahoo-dom-event.js?v=<?php echo $vbulletin->options['simpleversion']; ?>"></script>
	<script type="text/javascript" src="<?php echo $vbulletin->options['bburl2']; ?>/clientscript/yui/connection/connection-min.js?v=<?php echo $vbulletin->options['simpleversion']; ?>"></script>
	*/
?>
	<script type="text/javascript" src="//forums.operationsports.com/js/yahoo/yahoo-dom-event.js?v=<?php echo $vbulletin->options['simpleversion']; ?>"></script>
	<script type="text/javascript" src="//forums.operationsports.com/js/yahoo/connection-min.js?v=<?php echo $vbulletin->options['simpleversion']; ?>"></script>

<script type="text/javascript" src="//forums.operationsports.com<?php echo $vbulletin->options['bburl2']; ?>/clientscript/vbulletin_global.js?v=<?php echo $vbulletin->options['simpleversion']; ?>"></script>
<script type="text/javascript" src="//forums.operationsports.com<?php echo $vbulletin->options['bburl2']; ?>/clientscript/vbulletin_menu.js?v=<?php echo $vbulletin->options['simpleversion']; ?>"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="//cdn.jquerytools.org/1.2.5/tiny/jquery.tools.min.js"></script>
<script type="text/javascript" src="//forums.operationsports.com/js/jquery.prettyPhoto.js"></script>
<script type="text/javascript" src="//forums.operationsports.com/js/thickbox.js"></script>
<link rel="stylesheet" href="//forums.operationsports.com/css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
<link rel="stylesheet" href="//forums.operationsports.com/css/thickbox.css" type="text/css" media="screen" />
<link rel="shortcut icon" href="/favicon.ico" >
</head>	<?php
include ("include/header_intergiv3.inc.php");
include (DIR . "/include/bannerlogin_temp_test_intergi.inc.php");
?>

	<div xmlns:v="//rdf.data-vocabulary.org/#" typeof="v:Review" id="content">

	<?php if ($res['id'] > 584):?>
		<div id="title_med_score">
            <div id="title_text">
                <span style="float:right;">
                    <a id="tooltip-score" href="/MMChrisS/blog/11896-new-scoring-system-a-0-10-explanation-of-what-each-score-means/" style="vertical-align:top">OS Scores Explained</a>
                    <a id="tooltip-score" href="/MMChrisS/blog/11896-new-scoring-system-a-0-10-explanation-of-what-each-score-means/"><img border="none" title="Click to know more about the scoring system." src="//forums.operationsports.com/images/icons/help2_16.gif" style="margin:-2px 7px 0 1px;" /></a>
                </span>
                <? echo $res["game_title"]; ?> Overview <?php if ($resconsolename):?>(<? echo $resconsolename; ?>)<?php endif;?>
            </div>
		</div>
		<div id="review_score_box">
		    <div id="score_row">
		        <div id="review_score_col1">
                  <span class="review_score_row_title">Pros</span>
		            <div id="review_score_row_M">
		                <div id="review_score_rowbtm"><?php echo $res['pros']?></div>
		            </div>
                  <span class="review_score_row_title">Cons</span>
                    <div id="review_score_row_M">
                        <div id="review_score_rowbtm"><?php echo $res['cons']?></div>
                  </div>
                  <span class="review_score_row_title">Bottom Line</span>
                    <div id="review_score_row_M">
                        <div id="review_score_rowbtm"><?php echo $res['bottom_line']?></div>
                    </div>
		        </div>
		        <div id="score_col2" style="background-color:;">
		        <span rel="v:rating"> 
		            <span typeof="v:Rating">
		                <div id="score_row_score" style="text-align:center"><span property="v:value"><? echo $res["score"];?></span></div>
		                <div id="score-outof10">out of <span property="v:best">10</span></div>
		            </span>
		        </span>
		      </div>
		    </div>
		</div>
    <?php endif;?>

		<!--article content-->
      <div id="title_med_white">
		  <div id="title_text"><span property="v:itemreviewed" title="<? echo $res["game_title"]; ?> Review"><? echo $res["game_title"]; ?> REVIEW</span></div>
	   </div>
		<div id="article">
			<div id="articlewrapp">
				<div id="articletext">
					<div style="float:right;margin-top:11px">
						<g:plusone size="medium" href="//www.operationsports.com<?php echo $articleUrl?>"></g:plusone>
						<div class="fb-like" style="vertical-align:top" data-href="//www.operationsports.com<?php echo $articleUrl?>" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false"></div>
					</div>
					<h1><div class="articleheadline"><? echo $res["game_title"]; ?> Review <?php if ($resconsolename):?>(<? echo $resconsolename; ?>)<?php endif;?></div></h1>
		         <div class="articledate"><img src="//forums.operationsports.com/images/bullet.gif" align="absmiddle" />&nbsp;&nbsp;Submitted on: <span property="v:dtreviewed" content="<?php echo vbdate("Y-m-d", $res['review_date'])?>"><?php echo vbdate("M d, Y", $res["review_date"]); ?></span> by <span property="v:reviewer"><?php echo $res["author"]; ?></span></div>
		              <?php 
		              /* 5min video results (disabled due to throwing irrelevant results most of the time) 
                 <div id="titleseed" style="display:none;text-align:left;margin-bottom:-15px;margin-left:10px;"><p><strong><a href="#5min"><img border="none" src="/images/titleseed-sports.png" style="margin-bottom: -13px;"/><span style="font-size: 14px;"> Watch Videos Related to this Article</span></a></strong></p></div>
                 */?>
                    <div class="articlecontentnews" align="justify">
						<?php echo $res['content_body']?>
		            <br>
								<div style="float:right;padding-bottom: 7px;">
									<g:plusone size="medium"></g:plusone>
									<div class="fb-like" style="vertical-align:top" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false"></div>
								</div>
		         </div>	
			   </div>
		   </div>
	   </div>

      <?php if ($res['id'] < 585):?>
		<div id="title_med_score">
		    <div id="title_text"><? echo $res["game_title"]; ?> Score</div>
		</div>
		<div id="scorebox">
		    <div id="score_row">
		        <div id="score_col1">
		            <div id="score_row_M">
		                <div id="score_rowbtm"><?echo $res["positive1"];?></div>
		                <div id="score_rowbtm"><?echo $res["positive2"];?></div>
		                <div id="score_rowbtm"><?echo $res["positive3"];?></div>
		            </div>
		            <div id="score_row_M" style="margin-top:22px;">
		                <div id="score_rowbtm"><?echo $res["negative1"];?></div>
		                <div id="score_rowbtm"><?echo $res["negative2"];?></div>
		                <div id="score_rowbtm"><?echo $res["negative3"];?></div>
		            </div>          
		        </div>
		        <div id="score_col2" style="background-color:;">
		        <span rel="v:rating"> 
		            <span typeof="v:Rating">
		                <div id="score_row_score" style="text-align:center"><span property="v:value"><? echo $res["score"];?></span></div>
		                <div id="score-outof10">out of <span property="v:best">10</span></div>
		            </span>
		        </span>
		      </div>
		    </div>
		</div>
      <?php endif;?>

      <?php include('include/related_content.inc.php');?>

   	<!--/article content-->
        <?php 
        if ($res['threadid'])
        {
        	include ("include/comments.inc.php");
		  }
		  ?>
	</div>
	<div id="right">
    	<?php
    	$res['review_id'] =& $res['id'];
    	$res['review_title'] =& $res['title'];
    	$res['review_score'] =& $res['score'];

    	include ("include/gamedetails_optimized.inc.php");
    	include ("include/ad300x250.inc.php");
      include ("include/last5.inc.php");

		include ("include/poll.inc.php"); 
		?>
	</div>
<?php 

include ("include/footer.inc.php"); 
exec_shut_down();

?>