<?php
define('PLUGIN_SCRIPTNAV', 'index');

(!is_numeric($id) || $id <= 0) && redirect('公告ID不存在。');
$data = array();
$data = $db->get_one("SELECT * FROM {$dbpre}announcements WHERE id='$id'");
!$data && redirect('公告不存在或已删除。');
!$data['available'] && redirect('该公告已失效。');
$data['dateline'] = date('Y-m-d H:i:s', $data['dateline']);
extract($data, EXTR_OVERWRITE);
unset($data);
$pageview++;
$db->update("UPDATE {$dbpre}announcements SET pageview='$pageview' WHERE id='$id'");

$subtitle = $title.'_公告';
require_once MUDDER_ROOT.'header.php';
require_once template_plugin('index');
footer();
?>