<?php
require_once "global.php";
require_once "../class/weblog.class.php";
require_once "../class/member.class.php";
require_once "../class/template.class.php";
$member = &new member($DB);
$weblog = &new weblog($DB);
$memberinfo=$member->getAdminByUid($_SESSION['uid']);
$t=new Template("../templates/blog/".$memberinfo['templates']."/");
?>
<html>
<head>
<title>管理文章</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="../css/css.css" rel="stylesheet" type="text/css">
</head>
<?php
$getdoaction = isset($_GET['doaction'])&&!empty($_GET['doaction'])?$_GET['doaction']:null;
if($getdoaction == "del")
{
$getid = isset($_GET['id'])&&!empty($_GET['id'])
?$_GET['id']:null;
$getart=$weblog->getWeblogByid($getid);
$subart=substr($getart['url'],0,24)."_sub.html";
$comarr=$weblog->getCommentList($getid,$_SESSION['uid']);
if(is_array($comarr)&&!empty($comarr))
{
$delcom = ($weblog->delWeblog($getid))&&($weblog->delComments($getid));
}else{
$delcom=$weblog->delWeblog($getid);
}
if(($delcom)&&unlink("../".$getart['url'])&&unlink("../".$subart))
{
jumpMsg("删除文章成功",2,$_SERVER["HTTP_REFERER"]);
}
else
{
showError("删除文章失败");
}
}
?>
<?php
$postaction = isset($_POST['action'])&&!empty($_POST['action'])?$_POST['action']:null;
if($postaction == "setarticle")
{
$error = array();
$postid = isset($_POST['id'])&&!empty($_POST['id'])
?$_POST['id']:null;
$postcategory = isset($_POST['category'])&&!empty($_POST['category'])
?$_POST['category']:null;
$posttitle = isset($_POST['title'])&&!empty($_POST['title'])
?$_POST['title']:null;
$postauthor = isset($_POST['author'])&&!empty($_POST['author'])
?$_POST['author']:null;
$postemail = isset($_POST['email'])&&!empty($_POST['email'])
?$_POST['email']:null;
$postcontent = isset($_POST['content'])&&!empty($_POST['content'])
?$_POST['content']:null;
$postcat = isset($_POST['cat'])&&!empty($_POST['cat'])
?$_POST['cat']:null;
$postfilename = isset($_POST['filename'])&&!empty($_POST['filename'])
?$_POST['filename']:null;
$poststatus=($_POST['status']==2)?0:$_POST['status'];
if($postcategory==null)
{
$error[] = "缺少分类";
}
if($posttitle==null)
{
$error[] = "缺少标题";
}
if($postcontent == null)
{
$error[] = "缺少内容";
}
if($postid == null)
{
$error[] = "缺少ID";
}
if(!empty($error)&&is_array($error))
{
$msg = implode("<br>",$error);
showError($msg);
}
else
{
$info = array(
"category"=>$postcategory,
"status"=>$poststatus,
"cat"=>$postcat,
"title" =>$posttitle,
"author"=>$postauthor,
"email" =>$postemail,
"content"=>htmlspecialchars($postcontent),
);
if($weblog->modWeblog($postid,$info))
{
$compurl="../../";
$uid=$_SESSION['uid'];
$getartID=$weblog->getWeblogByid($postid);
$artID= $getartID['id'];
$fileName = substr($postfilename,14,10). ".html";
$dir="../".substr($postfilename,0,13);
require_once "inc_creatpart_com.php";
require_once "inc_creatpart.php";
$t->htmlwfile($FILE,$output);
jumpMsg("修改文章成功",2,$_SERVER["HTTP_REFERER"]);
}
else
{
showError("修改文章失败");
}
}
}
?>
<table width="90%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<th scope="row">
<table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#dddddd">
<tr>
<td>管理文章</td>
</tr>
</table>
</th>
</tr>
<tr>
<td>
<table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#dddddd">
<tr>
<td> 提示: 对文章进行更改和删除</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC" style="table-layout:fixed ">
<tr align="center" bgcolor="#dfdfdf">
<td width="80">文章ID</td>
<td width="80">状态</td>
<td width="80">文章分类</td>
<td>文章标题</td>
<td width="130">时间</td>
<td width="80">操作</td>
</tr>
<?php
// 取得类型
$getaction = isset($_GET['action'])&&!empty($_GET['action'])?$_GET['action']:null;
$getcate = isset($_GET['cate'])&&!empty($_GET['cate'])?$_GET['cate']:null;
$page = !isset($_GET['page'])||$_GET['page']<=1?1:$_GET['page'];
// 分页条数
$perpage = 10;
$apage = getPageNum($perpage);
$curpage = basename($_SERVER['PHP_SELF']);
$totalcom = $weblog->getWeblogCount(null,null,$_SESSION['uid']);
$scategory = $getcate!=null?"&cate=".$getcate:null;
$mpurl = "$curpage?action=$getaction".$scategory;
$multipage = multi($totalcom, $perpage,$apage['pagenum'], $mpurl,$getuid);
$startline = $apage['startline'];
$artlist = $weblog->getWeblogListByuid($_SESSION['uid'],null,$startline,$perpage);
foreach($artlist as $val)
{
$seturl = $mpurl."&doaction=set&id=".$val['id'];
$delurl = $mpurl."&doaction=del&id=".$val['id'];
$acate = $weblog->getCategory($val['category'],$_SESSION['uid']);
$catename = "<a href=\"".$mpurl."&cate=".$val['category']."&uid=".$_SESSION['uid']."\">".$acate['name']."</a>";
$titleurl = "<a href=\"../blog.php?show=blog&id=".$val['id']."&uid=".$_SESSION['uid']."\" target=\"_blank\">".$val['title']."</a>";
$status=($val['status']==0)?"显示":"隐藏";
$artID=substr($val['url'],14,10);
?>
<tr bgcolor="#FFFFFF">
<td align="center"><?=$artID?></td>
<td align="center"><?=$status?></td>
<td align="center"><?=$catename?></td>
<td><?=$titleurl?></td>
<td align="center"><?=$val['addtime']?></td>
<td align="center">[<a href="<?=$seturl?>">修改</a>][<a href="<?=$delurl?>" onclick="return confirm('你是否确认要删除此文章?')">删除</a>]</td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
<tr>
<td align="center">
<?=$multipage?>
</td>
</tr>
<?php
if($getdoaction == 'set')
{
$getid = isset($_GET['id'])&&!empty($_GET['id'])
?$_GET['id']:null;
$aweblog = $weblog->getWeblog($getid,$_SESSION['uid']);
$content = $aweblog['content'];
?>
<tr>
<td align="center">
<script language="JavaScript">
<!--
var Format = "Normal";
var initHTML = "";
var CssFile="";
var edit;
var RangeType;
var CssFile="";
var returnValue="";
//把iframe中的数据送给表单
function posts ()
{
document.form1.content.value = Editor.document.body.innerHTML;
}
//从表单中取数据,用于修改文章时
function mr()
{
Editor.document.body.innerHTML = document.form1.content.value;
}
//初始化编辑器
function initEditor(Model)
{
Editor.document.designMode=Model;
Editor.document.open();
initHTML = "";
Editor.document.write(initHTML);
Editor.document.close();
mr();
if(CssFile!="")
{
Editor.document.createStyleSheet(CssFile);
}
Editor.document.body.style.fontFamily = "Courier New","宋体";
Editor.document.body.style.fontSize ="12px";
}
function setFocus()
{
Editor.focus();
}
function fixSize()
{
document.all.Editor.style.height = Math.max(document.body.clientHeight - document.all.Editor.offsetTop, 0);
}
//选择对象
function selectRange()
{
edit = Editor.document.selection.createRange();
RangeType = Ed
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Q-BLOG V2.0 BEAT (429个子文件)
default.css 14KB
css.css 8KB
admincss.css 8KB
styles.css 6KB
styles.css 6KB
styles.css 6KB
styles.css 6KB
css.css 6KB
main.css 2KB
css.css 2KB
css.css 1KB
style.css 1KB
styles.css 878B
blog_1188.gif 39KB
headlogo.gif 23KB
muban.gif 17KB
logo.gif 12KB
muban.gif 11KB
muban.gif 10KB
tplogo.gif 8KB
muban.gif 7KB
muban.gif 7KB
useravatar.gif 6KB
bottom.gif 5KB
logo.gif 5KB
attach.gif 3KB
baner.gif 3KB
blog_tlt.gif 2KB
bg1.gif 2KB
google.gif 2KB
skin_00.gif 2KB
blog_search_bg.gif 2KB
SideBar_Head(1).gif 2KB
SideBar_Head.gif 2KB
logo.gif 2KB
blog_nav_bg.gif 2KB
logo.gif 2KB
skin_bottom.gif 1KB
blog_l_top.gif 1KB
blog_logo.gif 1KB
bg.gif 1KB
xml.gif 1KB
rss090_logo.gif 998B
rss20_logo.gif 989B
rss2.gif 989B
rss2.gif 989B
rss2.gif 989B
rss2.gif 989B
rss2.gif 989B
rss10_logo.gif 988B
rss1.gif 988B
rss1.gif 988B
rss1.gif 988B
rss1.gif 988B
rss1.gif 988B
SideBar_Foot.gif 950B
banner.gif 949B
skin_01.gif 885B
skin_sorts.gif 864B
logo100.gif 853B
bar_footer.gif 810B
logo_red.gif 779B
logo_red.gif 779B
btn_search.gif 743B
blog_apply.gif 714B
blog_list.gif 708B
blog_help.gif 707B
blog_new.gif 703B
blog_hot.gif 702B
blog.gif 693B
newlinebg2.gif 608B
blog_tlt_top.gif 553B
html.gif 550B
normal.gif 524B
btn_login.gif 502B
ulist.gif 500B
newitem.gif 451B
top_bg.gif 444B
top_bg.gif 444B
top_bg.gif 444B
skin_mb.gif 426B
ArticleBox1_Foot.gif 413B
ArticleBox1_Head.gif 412B
help.gif 377B
blog_login_btn.gif 357B
h_review.gif 352B
blog_l2_top_l_on.gif 316B
blog_l2_top_r_on.gif 303B
skin.gif 295B
defaultlink.gif 277B
skin03_bg_bar.gif 269B
w3c_xhtml.gif 247B
blog_l2_top_l_off.gif 246B
mail.gif 235B
mail.gif 235B
mail.gif 235B
mail.gif 235B
blog_l2_top_r_off.gif 234B
blog_l2_top.gif 227B
w3c_css.gif 220B
共 429 条
- 1
- 2
- 3
- 4
- 5
资源评论
普通网友
- 粉丝: 882
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- yolov5,SSD 可能使用到的一些代码
- 介绍离散性制造行业的MES系统流程
- 基于IDEA-CCNL/Randeng-Pegasus-238M-Summary-Chines微调的中文文本摘要任务源码+数据集
- 微信小程序源码 车源宝 二手车交易平台 源码下载
- 微信小程序源码 实现 城市切换 demo 根据城市首字母排序城市 选择城市 源码下载
- 2024新版计算机编译原理期末速成全套视频教程(视频+配套资料)
- VMware7.0虚拟机硬盘无法编辑,无法连接到Profile-Driven Storage Service
- arm64内核的mongo镜像
- 基于stm32f103c单片机+MPU6050+0.96英寸OLED显示屏双柄遥控器硬件(原理图+PCB)工程文件.zip
- 整理的关于少儿编程的学习路径,以及如何在小升初,初升高和大学充分的利用起来编程经验的优势
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功