$sorts = $CACHE->readCache('sort'); $tags = $Tag_Model->getTag(); $localtime = time() + Option::get('timezone') * 3600; $postDate = gmdate('Y-m-d H:i:s', $localtime); include View::getView('header'); require_once View::getView('add_log'); include View::getView('footer'); View::output(); } //显示编辑文章页面 if ($action == 'edit') { $Log_Model = new Log_Model(); $Tag_Model = new Tag_Model(); $Sort_Model = new Sort_Model(); $logid = isset($_GET['gid']) ? intval($_GET['gid']) : ''; $blogData = $Log_Model->getOneLogForAdmin($logid); extract($blogData); $orig_date = $date - Option::get('timezone') * 3600; $sorts = $CACHE->readCache('sort'); //log tag $tags = array(); foreach ($Tag_Model->getTag($logid) as $val) { $tags[] = $val['tagname']; } $tagStr = implode(',', $tags); //old tag $tags = $Tag_Model->getTag(); $is_top = $top == 'y' ? 'checked="checked"' : ''; $is_allow_remark = $allow_remark == 'y' ? 'checked="checked"' : ''; include View::getView('header'); require_once View::getView('edit_log');
require_once View::getView('admin_page'); include View::getView('footer'); View::output(); } //显示新建页面表单 if ($action == 'new') { include View::getView('header'); require_once View::getView('add_page'); include View::getView('footer'); View::output(); } //显示编辑页面表单 if ($action == 'mod') { $emPage = new Log_Model(); $pageId = isset($_GET['id']) ? intval($_GET['id']) : ''; $pageData = $emPage->getOneLogForAdmin($pageId); extract($pageData); $pageUrl = isset($navibar[$pageId]['url']) ? $navibar[$pageId]['url'] : ''; $blank = isset($navibar[$pageId]['is_blank']) ? $navibar[$pageId]['is_blank'] : ''; $is_allow_remark = $allow_remark == 'y' ? 'checked="checked"' : ''; $is_blank = $blank == '_blank' ? 'checked="checked"' : ''; include View::getView('header'); require_once View::getView('edit_page'); include View::getView('footer'); View::output(); } //保存页面 if ($action == 'add' || $action == 'edit' || $action == 'autosave') { $emPage = new Log_Model(); $Navi_Model = new Navi_Model(); $title = isset($_POST['title']) ? addslashes(trim($_POST['title'])) : '';
/** * 读取文章信息 */ function mw_getPost($args) { global $options_cache; escape($args); $post_ID = intval($args[0]); $username = $args[1]; $password = $args[2]; $user = login($username, $password); $Log_Model = new Log_Model(); define('UID', $user['uid']); $post = $Log_Model->getOneLogForAdmin($post_ID); if (empty($post)) { return error_message(404, '对不起,您访问的文章不存在'); } $log_cache_tags = Cache::getInstance()->readCache('logtags'); $tags = ''; if (!empty($log_cache_tags[$post['gid']])) { foreach ($log_cache_tags[$post['gid']] as $tag) { $tags[] = $tag['tagname']; } $tags = implode(',', $tags); } $Sort_Model = new Sort_Model(); $sort_name = $Sort_Model->getSortName($post['sortid']); $post['date'] = getIso($post['date']); $xml = "\n\t<struct>\n\t\t<member>\n\t\t\t<name>categories</name>\n\t\t\t\t<value>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<data>\n\t\t\t\t\t\t\t<value>{$sort_name}</value>\n\t\t\t\t\t\t</data>\n\t\t\t\t\t</array>\n\t\t\t\t</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>mt_keywords</name>\n\t\t\t<value>\n\t\t\t\t<string>{$tags}</string>\n\t\t\t</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>dateCreated</name>\n\t\t\t<value>\n\t\t\t\t<dateTime.iso8601>{$post['date']}</dateTime.iso8601>\n\t\t\t</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>description</name>\n\t\t\t<value>\n\t\t\t\t{$post['content']}\n\t\t\t</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>link</name>\n\t\t\t<value>{$options_cache['blogurl']}index.php?post={$post['gid']}</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>postid</name>\n\t\t\t<value>\n\t\t\t\t<string>{$post['gid']}</string>\n\t\t\t</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>title</name>\n\t\t\t<value>{$post['title']}</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>publish</name>\n\t\t\t<value>\n\t\t\t\t<boolean>1</boolean>\n\t\t\t</value>\n\t\t</member>\n\t</struct>\n\t"; response($xml); }
/** * 附件处理 11 * @copyright (c) Emlog All Rights Reserved */ require_once 'globals.php'; require_once "qiniu/io.php"; require_once "qiniu/rs.php"; $DB = Database::getInstance(); //上传表单显示 if ($action == 'selectFile') { $attachnum = 0; $logid = isset($_GET['logid']) ? intval($_GET['logid']) : ''; $multi = isset($_GET['multi']) ? intval($_GET['multi']) : 0; if ($logid) { $Log_Model = new Log_Model(); $row = $Log_Model->getOneLogForAdmin($logid); $attachnum = (int) $row['attnum']; } $maxsize = changeFileSize(Option::getAttMaxSize()); //允许附件类型 $att_type_str = ''; $att_type_for_muti = ''; foreach (Option::getAttType() as $val) { $att_type_str .= " {$val}"; $att_type_for_muti .= '*.' . $val . ';'; } $view_tpl = $multi ? 'upload_multi' : 'upload'; require_once View::getView($view_tpl); View::output(); } //上传附件