rendered paste body<?php
/**
* play.php - game start page
*
*/
include('includes/env.inc.php');
// begin_cache();
$sql = "
SELECT g_title, g_custom, g_path
FROM games_games
WHERE g_id={$en['g_id']}
";
$game_info = $localdb->get_assoc($sql);
$key = encrypt_key(time());
$pattern = '|\/games|is';
$replace = '/' . $key . '/games';
$new_custom = preg_replace($pattern, $replace, $game_info['g_custom']);
$tpl->set('title', 'You are now playing '.$game_info['g_title'].' - '.$titlekeywords);
$tpl->set('g_custom', $new_custom);
$tpl->set('g_id', $en['g_id']);
if (empty($game_info['g_custom']))
$tpl->set('g_custom', '<p>There was an error displaying this game </p>');
echo $tpl->fetch('header.tpl');
echo $tpl->fetch('play.tpl');
echo $tpl->fetch('footer.tpl');
?>