include("common.php");
if(@$_COOKIE["rating_$itemid"] != ""){
}else{
if($_POST['rateit']){
$sql = "UPDATE games SET vote=vote+1,sum=sum+".$_REQUEST['rateit']." WHERE id='".$_REQUEST['itemid']."'";
mysql_query($sql) or die( mysql_error() );
$itemid = $_REQUEST['itemid'];
setcookie("rating_$itemid", "1", time() + 3600 * 24 * 30);
}
}
mysql_query("UPDATE games SET played=played+1 WHERE id='".$_REQUEST['id']."'");
$qr1 = mysql_query("SELECT * FROM `games` WHERE id='".$_REQUEST['id']."'");
$game = mysql_fetch_object($qr1);
$seo_title = $sitename." - Play ".stripslashes($game->name);
include("header.php");
if( strstr($game->flash,".dcr") ){
?>
Play =stripslashes($game->name)?>
}else{ ?>
Play =stripslashes($game->name)?>
} ?>
if($game->sum){
$rate = round( $game->sum/$game->vote,1);
}
$stars = "";
$width=25;
if($rate <= 0){
$stars = "not yet rated";
$rate = "not yet rated";
}else{
for($x=1;$x<=$rate;$x++) {
$stars .= '
';
}
$dec = $rate - (int)$rate;
if($dec>0.49) $stars .= '
';
}
?>
Rating: =$stars?>
Description: =stripslashes($game->description)?>
Player: You are player number =$game->played?>
Play Full Screen Mode