rendered paste body<?php
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
//Set the page title here
$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
if ($pun_user['g_read_board'] == '0')
message($lang_common['No view']);
$tid = isset($_GET['tid']) ? intval($_GET['tid']) : 0;
$fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
if ($tid < 1 && $fid <> 9 || $tid > 0 && $fid > 0)
message($lang_common['Bad request']);
$now = time();
$result = $db->query('SELECT count(*) FROM '.$db->prefix.'accepted WHERE topic_id = '.$fid) or error('Doh', __FILE__, __LINE__, $db->error());
$count = $db->result($result);
if($count < 0)
{
?>
<script type="text/javascript">
<!--
window.location = "http://google.com"
//-->
</script>
<?php
} else {
$db->query('INSERT INTO '.$db->prefix.'accepted SET topic_id='.$tid.', accepted_by='.$pun_user['id'].', time='.$now) or error('Opps', __FILE__, __LINE__, $db->error());
}
?>
<script type="text/javascript">
<!--
window.location = "viewtopic.php?id=<?php echo $tid ?>"
//-->
</script>
<?php
require PUN_ROOT.'footer.php';