All pastes #929121 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-03-05 15:32 UTC
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']);

$result = $db->query('SELECT count(*) FROM '.$db->prefix.'accepted WHERE topic_id = '.$tid) or error('Doh', __FILE__, __LINE__, $db->error());
$count = $db->result($result);
if($count > 0)
{
echo '
        <div class="block">
            <h2><span>Box 1</span></h2>
            <div class="box">
                <div class="inbox">
				Hello
				</div>
			</div>
		</div>';
} else {

$db->query('INSERT INTO '.$db->prefix.'accepted (topic_id, accepted_by, username, time) VALUES(
	\''.$tid.'\',
	\''.$pun_user['id'].'\',
	\''.addslashes($pun_user['username']).'\',
	\''.time().'\'
)') or error('Oh no...', __FILE__, __LINE__, $db->error());
}
?>
<script type="text/javascript">
<!--
window.location = "viewtopic.php?id=<?php echo $tid ?>"
//-->
</script>
<?php
require PUN_ROOT.'footer.php';