article_list(); break; case "create": article_edit(); break; case "publish": article_post(); break; case "edit": article_edit(); break; case "save": article_save(); break; case "delete": article_delete(); } } //-------------------------------------------------------------- function article_post() { global $txp_user, $vars, $txpcfg; extract(get_prefs()); $incoming = psa($vars); $message = ''; include_once $txpcfg['txpath'] . '/lib/classTextile.php'; $textile = new Textile(); if ($use_textile == 0 or !$incoming['textile_body']) { $incoming['Body_html'] = trim($incoming['Body']); } else { if ($use_textile == 1) {
} if ($action == "add") { if (!empty($_POST)) { article_new($link, $_POST['title'], $_POST['date'], $_POST['content']); header("Location: index.php"); } $article = ['date' => '', 'title' => '', 'content' => '']; include "../views/article_admin.php"; } else { if ($action == "edit") { if (!isset($_GET['id'])) { header("Location: index.php"); } $id = (int) $_GET['id']; if (!empty($_POST) && $id > 0) { article_edit($link, $id, $_POST['title'], $_POST['date'], $_POST['content']); header("Location: index.php"); } $article = article_get($link, $id); include "../views/article_admin.php"; } else { if ($action == "delete") { $id = (int) $_GET['id']; $article = article_delete($link, $id); header("Location: index.php"); } else { $articles = articles_all($link); include "../views/articles_admin.php"; } } }
<?php if ($access != 'VALID') { header('location:../../index.php'); } if (!isset($_SESSION['admin'])) { header('location:../../index.php'); } include_once 'model/blog/fonctions_blog.php'; $retour = ""; if (isset($_GET['a'])) { if (article_delete($_GET['a'])) { $retour = "L'article a bien été supprimé"; } else { $retour = "Il y a eu une erreur lors de la suppression de l'article, veuillez réessayer"; } } $articles = afficher_articles(); $title = 'Gestion des articles'; include_once 'view/blog/articles.php';
<?php include 'model.php'; $connect = connect(); include 'header.php'; $delete = article_delete($connect);
<?php /** * User: Khupchenko Oleksander */ require_once "../content/controllers/models/connect/connect.php"; require_once "models/select_articles.php"; if (isset($_GET['action'])) { $action = $_GET['action']; } else { $action = ""; } if ($action == "delete_article") { $id = $_GET['id']; $article = article_delete($conn, $id); header("Location: views/articles_admin.php"); } else { $articles = articles_all($conn); include "views/articles_admin.php"; }
} } if ($a_info['content'] || $a_info['title']) { if ($a_info['content'] == 'list') { $a_info['content'] = milu_lang('article_too_many_link'); } $html = '<h3><strong>' . milu_lang('article_link') . ':</strong></h3><a target="_blank" href="' . $url . '">' . $url . '</a><br><br><h3><strong>' . milu_lang('article_title') . ':</strong></h3>' . $a_info['title'] . '<br><br><h3><strong>' . milu_lang('article_body') . ':</strong><br></h3>' . $a_info['content'] . '<br>'; } else { $html = milu_lang('no_get_content'); } show_pick_window(milu_lang('get_content_test'), $html, array('w' => 750, 'h' => '460', 'f' => 1)); case 'article_delete': $aid = intval($_GET['aid']); $url_str = '&pid=' . $_GET['pid'] . '&status=' . $_GET['status'] . '&p=' . $_GET['p'] . '&s=' . $_GET['s'] . '&orderby=' . $_GET['orderby'] . '&ordersc=' . $_GET['ordersc'] . '&perpage=' . $perpage . '&page=' . $page; if ($aid && $submit) { article_delete(array($aid)); cpmsg(milu_lang('del_finsh'), PICK_GO . "picker_manage&myac=article_manage" . $url_str, 'succeed'); } else { cpmsg(milu_lang('del_confirm'), PICK_GO . 'picker_manage&myaction=article_delete&aid=' . $aid . '&submit=1' . $url_str, 'form'); } break; } function article_manage() { global $head_url, $header_config; $data = article_get_args(); $info = $data['info']; $args = $data['args']; $data = get_pick_info(); $info['public_class'] = unserialize($data['public_class']); $info['status'] = $args['status'] ? $args['status'] : intval($_GET['status']);
$seo_title = param('seo_title'); $seo_keywords = param('seo_keywords'); $seo_description = param('seo_description'); !$cateid and message(1, '请指定文章分类'); !$subject and message(2, '请填写标题'); !$message and message(3, '请填写内容'); $arr = array('cateid' => $cateid, 'subject' => $subject, 'brief' => $brief, 'message' => $message, 'cover' => $cover, 'update_date' => $time, 'seo_title' => $seo_title, 'seo_keywords' => $seo_keywords, 'seo_description' => $seo_description); $r = article_update($articleid, $arr); $r !== FALSE ? message(0, '更新成功') : message(11, '更新失败'); } } elseif ($action == 'delete') { if ($method != 'POST') { message(-1, 'Method Error.'); } $articleid = param('articleid', 0); $state = article_delete($articleid); $state ? message(0, '删除成功') : message(11, '删除失败'); } elseif ($action == 'read') { $articleid = param(2, 0); $article = article_read($articleid); include "./admin/view/article_read.htm"; } elseif ($action == 'upload') { $upfile = param('upfile', '', FALSE); empty($upfile) and message(-1, 'upfile 数据为空'); $json = xn_json_decode($upfile); empty($json) and message(-1, '数据有问题: json 为空'); $name = $json['name']; $width = $json['width']; $height = $json['height']; $data = base64_decode($json['data']); $size = strlen($data);
function article_import($action, $args) { global $_G; $pick_common_set = get_pick_set(); $is_timing = $pick_common_set['is_timing']; //if(!VIP) $is_timing = 0; pload('F:spider'); $aid_arr = $args['aid'] ? $args['aid'] : $_GET['aid']; $op = 'article_' . $action; $type_arr = explode('_', $action); $type = $type_arr[1]; $pid = $args['pid'] ? $args['pid'] : intval($_GET['pid']); $p_arr = get_pick_info($pid); $view_arr = format_wrap($p_arr['view_num'], ','); $public_type = 1; if ($type == 'blog') { $public_type = 3; $type = 'album'; } if ($type == 'forums') { $public_type = 2; $type = 'forum'; } $today_public_num = 0; foreach ($aid_arr as $k => $aid) { $arr = $old_arr = article_info($aid); if (!$arr) { continue; } $arr['p_arr'] = $p_arr; $arr['public_start_time'] = $_GET['public_start_time'] ? $_GET['public_start_time'] : $p_arr['public_start_time']; $arr['public_end_time'] = $_GET['public_end_time'] ? $_GET['public_end_time'] : $p_arr['public_end_time']; $arr['public_time'] = 0; $time_arr = create_public_time($arr, 1); $arr['public_time'] = array_pop($time_arr); if ($args['cron_run'] && $args['public_time']) { $arr['public_time'] = $args['public_time'][$aid]; } $arr['title'] = htmlspecialchars_decode($arr['title'], ENT_QUOTES); $arr['content'] = htmlspecialchars_decode($arr['content'], ENT_QUOTES); $arr['title'] = format_html($arr['title']); $arr['content'] = format_html($arr['content']); unset($arr['pic']); $arr['view_num'] = rand($view_arr[0], $view_arr[1]); $rand_arr = get_rand_uid($p_arr); $arr['uid'] = $setarr['uid'] = $rand_arr[0]['uid'] ? $rand_arr[0]['uid'] : $_G['uid']; $arr['username'] = $setarr['username'] = $rand_arr[0]['username']; $arr['portal_cid'] = $timing_public_arr['portal'] = $args['portal'] ? $args['portal'] : $_GET['portal']; $arr['forum_fid'] = $timing_public_arr['forums'] = $args['forums'] ? $args['forums'] : $_GET['forums']; $arr['forum_typeid'] = $timing_public_arr['threadtypeid'] = $args['threadtypeid'] ? $args['threadtypeid'] : $_GET['threadtypeid']; $arr['blog_big_cid'] = $timing_public_arr['blog'] = $args['blog'] ? $args['blog'] : $_GET['blog']; $arr['blog_small_cid'] = $timing_public_arr['classid'] = $args['classid'] ? $args['classid'] : $_GET['classid']; $arr['is_download_img'] = $p_arr['is_download_img']; $arr['is_water_img'] = $p_arr['is_water_img']; $arr['content'] = clear_ad_html($arr['content']); $arr['summary'] = addslashes($arr['summary']); $arr['public_reply_seq'] = $p_arr['public_reply_seq']; $arr['is_public_reply'] = $p_arr['is_public_reply']; $arr['public_uid'] = $p_arr['public_uid']; $arr['reply_uid'] = $p_arr['reply_uid']; $arr['is_page_public'] = $p_arr['is_page_public']; $arr['page_url'] = $arr['url']; //发布时间大于当前时间,放入定时发布中 if ($arr['public_time'] > $_G['timestamp'] && $is_timing == 1) { $timing_setarr = array('public_type' => $public_type, 'data_id' => $aid, 'content_type' => 1, 'public_dateline' => $arr['public_time'], 'pid' => $pid, 'public_info' => serialize($timing_public_arr)); article_timing_add($timing_setarr); DB::update('strayer_article_title', array('status' => 4), array('aid' => $aid)); continue; } $arr['article_tag'] = $pick_common_set['open_tag'] == 1 && ($type == 'album' || $type == 'forum') && empty($arr['article_tag']) ? implode(',', dz_get_tag($arr['title'], $arr['content'], 1)) : $arr['article_tag']; $arr['cookie'] = $p_arr['login_cookie']; $arr['is_download_file'] = $p_arr['is_download_file']; $arr['content_filter_html'] = unserialize(dstripslashes($p_arr['content_filter_html'])); if ($arr['contents'] > 1 && $arr['is_bbs'] == 0 && $type == 'forum' && $p_arr['is_page_public'] == 2) { $arr['is_public_reply'] = 1; $arr['public_reply_seq'] = 0; $arr['is_content_reply'] = 1; $arr['is_bbs'] = 1; } else { if ($arr['is_bbs'] != 1) { $arr['reply'] = array(); } } if ($p_arr['is_word_replace'] == 1) { //同义词替换 if ($p_arr['is_bbs'] != 1 && $arr['contents'] > 1) { //有几页的文章 $arr['content_arr'] = article_words_replace($arr['content_arr']); } $arr['content'] = article_words_replace($arr['content']); if ($arr['reply']) { $arr['reply'] = article_words_replace($arr['reply']); } $arr['title'] = article_words_replace($arr['title']); } $arr['content'] = clear_ad_html($arr['content']); unset($arr['url']); //跟门户的跳转url重名 unset($arr['aid']); if ($type == 'forum') { $arr = $op($arr, $old_arr); $insert_aid = $setarr['forum_id'] = $arr['tid']; } else { $insert_aid = $op($arr, $old_arr); if ($type == 'portal') { $setarr['portal_id'] = $insert_aid; } else { $setarr['blog_id'] = $insert_aid; } } if ($insert_aid) { $arr['aid'] = $insert_aid; $arr['cookie'] = $p_arr['login_cookie']; if ($type == 'forum') { if ($arr['is_download_img'] == 1 || $arr['is_download_file'] == 1) { forum_downremotefile($arr, $old_arr); } } else { downremotefile($arr, $type, $old_arr); } if ($type == 'portal') { article_thumb($insert_aid); } } $p_arr['is_public_del'] = $p_arr['is_public_del'] ? $p_arr['is_public_del'] : intval($_GET['is_public_del']); $setarr['status'] = 2; $setarr['article_tag'] = $arr['article_tag']; $today_public_num++; if ($p_arr['is_public_del'] != 1 && $insert_aid) { DB::update('strayer_article_title', $setarr, array('aid' => $aid)); } } if (VIP) { $today_arr = dunserialize(pick_common_get('', 'pick_today')); $c_set['pick_today']['day'] = date('md', $_G['timestamp']); $c_set['pick_today']['article_public_num'] = $today_public_num + $today_arr['article_public_num']; pick_common_set($c_set); } if ($p_arr['is_public_del'] == 1) { article_delete($aid_arr); } //导入之后删除 return $insert_aid; }