$insertid = $db->inserttable(table('article'), $setsqlarr, 1); if (!$insertid) { adminmsg("添加失败!", 0); } else { baidu_submiturl(url_rewrite('QS_newsshow', array('id' => $insertid)), 'addarticle'); adminmsg("添加成功!", 2, $link); } } elseif ($act == 'article_edit') { check_permissions($_SESSION['admin_purview'], "article_edit"); $id = intval($_GET['id']); $sql = "select * from " . table('article') . " where id=" . intval($id) . " LIMIT 1"; $edit_article = $db->getone($sql); $smarty->assign('edit_article', $edit_article); $smarty->assign('upfiles_dir', $upfiles_dir); $smarty->assign('thumb_dir', $thumb_dir); $smarty->assign('article_category', get_article_category()); $smarty->assign('subsite', get_subsite_list(intval($_CFG['subsite_id']))); $smarty->assign('pageheader', "新闻资讯"); get_token(); $smarty->display('article/admin_article_edit.htm'); } elseif ($act == 'editsave') { check_permissions($_SESSION['admin_purview'], "article_edit"); check_token(); $id = intval($_POST['id']); $setsqlarr['title'] = trim($_POST['title']) ? trim($_POST['title']) : adminmsg('您没有填写标题!', 1); $setsqlarr['type_id'] = trim($_POST['type_id']) ? intval($_POST['type_id']) : 0; $setsqlarr['content'] = !empty($_POST['content']) ? tag_link($_POST['content']) : adminmsg('您没有内容!', 1); $setsqlarr['tit_color'] = trim($_POST['tit_color']); $setsqlarr['tit_b'] = intval($_POST['tit_b']); $setsqlarr['author'] = trim($_POST['author']); $setsqlarr['source'] = trim($_POST['source']);
$smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('categories', get_categories_tree(0)); // 分类树 $smarty->assign('article_categories', article_categories_tree($cat_id)); //文章分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('best_goods', get_recommend_goods('best')); $smarty->assign('new_goods', get_recommend_goods('new')); $smarty->assign('hot_goods', get_recommend_goods('hot')); $smarty->assign('promotion_goods', get_promote_goods()); $smarty->assign('promotion_info', get_promotion_info()); $smarty->assign('children_category', get_article_category(15)); //分类下的子分类 $smarty->assign('lanmu_name', $cat_id); //分类下的子分类 /* Meta */ $meta = $db->getAll("SELECT ssj_name, address,telphone,ssj_area,id FROM " . $ecs->table('ssj') . " WHERE cat_id = '{$cat_id}'"); /*if ($meta === false || empty($meta)) { /* 如果没有找到任何记录则返回首页 ecs_header("Location: ./\n"); exit; }*/ $smarty->assign('name', htmlspecialchars($meta['ssj_name'])); $smarty->assign('address', htmlspecialchars($meta['address'])); $smarty->assign('telphone', htmlspecialchars($meta['telphone'])); /* 获得文章总数 */