| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- //decode by http://dezend.qiling.org QQ 2859470
- define('CURSCRIPT', 'announce');
- require_once dirname(__FILE__) . '/global.php';
- require_once MYMPS_INC . '/db.class.php';
- $part = $part ? $part : 'all';
- if ($part == 'add' || $part == 'edit') {
- require_once dirname(__FILE__) . '/include/color.inc.php';
- $mymps_title_color = $color;
- }
- if ($part == 'add') {
- chk_admin_purview('purview_发布公告');
- $acontent = get_editor('content', 'Normal');
- $here = '发布网站公告';
- include mymps_tpl('announce_add');
- } else {
- if ($part == 'insert') {
- $db->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;
|