query('Insert Into `' . $db_mymps . 'announce` (id,title,titlecolor,content,pubdate,begintime,endtime,author,redirecturl) Values (\'\',\'' . $title . '\',\'' . $titlecolor . '\',\'' . $content . '\',\'' . $timestamp . '\',\'' . strtotime($begintime) . '\',\'' . strtotime($endtime) . '\',\'' . $author . '\',\'' . $redirecturl . '\')'); $inid = $db->insert_id(); $message = '成功增加一篇公告'; write_msg($message, 'announce.php'); } else { if ($part == 'edit') { if (trim($action) == 'dopost') { $sql = 'UPDATE `' . $db_mymps . 'announce` SET title=\'' . $title . '\',titlecolor =\'' . $titlecolor . '\',content=\'' . $content . '\',author=\'' . $author . '\',pubdate=\'' . $timestamp . '\',begintime=\'' . strtotime($begintime) . '\',endtime=\'' . strtotime($endtime) . '\',redirecturl=\'' . $redirecturl . '\' WHERE id = \'' . $id . '\''; $res = $db->query($sql); $message = '成功修改公告。'; write_msg($message, 'announce.php?part=edit&id=' . $id); } else { $id = intval($id); $here = '修改网站公告'; $edit = $db->getRow('SELECT * FROM ' . $db_mymps . 'announce WHERE id = \'' . $id . '\''); $acontent = get_editor('content', 'Normal', $edit['content']); include mymps_tpl('announce_edit'); } } else { if ($part == 'delete') { $id = intval($id); if (empty($id)) { write_msg('没有选择记录'); } else { mymps_delete('announce', 'WHERE id = \'' . $id . '\''); write_msg('删除公告 ' . $id . ' 成功', $url, 'Mymps_record'); } } else { if ($part == 'all') { chk_admin_purview('purview_已发布公告'); $page = empty($page) ? 1 : intval($page); $where = 'WHERE title like \'%' . $title . '%\' and author like \'%' . $author . '%\''; $sql = 'SELECT * FROM ' . $db_mymps . 'announce ' . $where . ' ORDER BY id DESC'; $rows_num = mymps_count('announce', $where); $param = setParam(array('id', 'title', 'author')); $announce = page1($sql); $here = '公告列表'; include mymps_tpl('announce_all'); } else { if ($part == 'delall') { write_msg('删除公告 ' . mymps_del_all('announce', $_POST[id]) . ' 成功', $url, 'Mymps_record'); } } } } } } is_object($db) && $db->Close(); $db = $mymps_global = $part = $action = $here = NULL;