query( "SELECT * FROM games WHERE url='".$db->escape( $_GET["sub"] )."' LIMIT 1" );
$r = $db->fetch();
$game_id = $r["id"];
$file_type = $r["file_type"];
define( "DOC_TITLE", $r["title"] );
define( "DOC_ADS", true );
global $random;
srand(time());
$random = (rand()%3);
//print("random number between 0 and 2 is: $random");
$referer = 0;
$refer_array = split("\.",$_SERVER['HTTP_REFERER']);
echo $referer_array[1];
if (($refer_array[1] == 'heavygames') || ($refer_array[1] == 'kickingames') || ($refer_array[1] == 'gameslinks'))
{
$referer = 1;
}
if ( $is_guest && ($referer != 1) && ($game_id != '303'))
{
//if ( $is_guest )
//{
if ( !isset( $_COOKIE["credits"] ) )
{
setcookie( "credits", 5, time()+(24*3600*30), "/", str_replace( "www.", ".", $_SERVER["HTTP_HOST"] ) );
$_COOKIE["credits"] = 5;
}
if ( $_COOKIE["credits"] > 0 && $_COOKIE["credits"] <= $startup_credits )
{
setcookie( "credits", $_COOKIE["credits"], time()-9999, "/", str_replace( "www.", ".", $_SERVER["HTTP_HOST"] ) );
setcookie( "credits", $_COOKIE["credits"] - 1, time()+(24*3600*30), "/", str_replace( "www.", ".", $_SERVER["HTTP_HOST"] ) );
$_COOKIE["credits"] -= 1;
?>
= htmlentities( $r["title"] ) ?>
|
You have = $_COOKIE["credits"] ?> play credits left! To get unlimited credits,
">register or
">login!
out of credits
You must ">register or ">login
to play more games!
query( "SELECT * FROM members WHERE id='158' LIMIT 1");
$user = $db->fetch();
}
if ( $user["last_play"] < ( time() - 5 ) )
{
$plays = $user["plays"] + 1;
$plays_detailed = unserialize( $user["plays_detailed"] );
$plays_detailed[$r["id"]] = isset( $plays_detailed[$r["id"]] )? $plays_detailed[$r["id"]] + 1 : 1;
$plays_detailed = $db->escape( serialize( $plays_detailed ) );
$db->query( "UPDATE members SET plays=$plays, plays_detailed='$plays_detailed',".
" last_play=UNIX_TIMESTAMP(), last_game=".$r["id"]." WHERE id=".$user["id"]." LIMIT 1" );
$db->query( "SELECT * FROM members WHERE ( plays > ".$plays." ) OR ( plays = ".$plays." AND id <= ".$user["id"]." )" );
$rank = $db->countRows();
if ( $rank < $user["highest_rank"] )
$db->query( "UPDATE members SET highest_rank=$rank WHERE id=".$user["id"]." LIMIT 1" );
}
?>
= htmlentities( $r["title"] ) ?>
|
Find big chunky adverts annoying? To get rid of ads, get your play count up to = number_format( $plays_required_for_no_ads ) ?>!
query( "UPDATE games SET plays=plays+1, today_plays=today_plays+1 WHERE id=".$r["id"] );
?>
= htmlentities( $r["title"] ) ?>
" width="50" height="50"
style="border: 1px solid #000; float: left; margin: 0px 5px 5px 0px;" />
= htmlentities( $r["description"] ) ?>
query( "SELECT * FROM members WHERE favourite=".$r["id"] );
$favourites = $db->countRows();
?>
This game has been played
= number_format( $r["plays"] + 1 ) ?> times,
and is
= $favourites ?> peoples' favourite game.
1))
{?>