CATEGORIES SET F_CATEGORIES_POSTS = F_CATEGORIES_POSTS $type 1";
$sql .= " WHERE F_ID = $catid";
return $this->update($sql);
}
/**
* 功能:删除文章
* 参数:$userid 用户ID,$postid 文章ID
* 返回:TRUE OR FALSE;
*/
public function DelPost($userid,$postid)
{
$r = $this->getInfo($postid,"EE_BLOG_POSTS");
$this->begintransaction(); //开始事务处理
try{
$sql = "UPDATE EE_BLOG_CATEGORIES SET F_CATEGORIES_POSTS = F_CATEGORIES_POSTS - 1 WHERE F_ID = {$r['F_ID_CATEGORIES']}";
$this->update($sql); //更新分类文章数
$sql = "DELETE FROM EE_BLOG_POSTS WHERE F_ID = $postid AND F_ID_USER_INFO = $userid";
$this->delete($sql); //删除文章
}catch (Exception $e){ //捕获异常,回滚
$this->rollback();
return false;
}
$this->commit();
return true;
}
/**
* 功能:删除评论
* 参数:$comid 评论ID
* 返回:TRUE OR FALSE
*/
public function DelComments($comid)
{
$r = $this->getInfo($comid,"EE_BLOG_COMMENTS");
$this->begintransaction(); //开始事务处理
try{
$sql = "UPDATE EE_BLOG_POSTS SET F_POSTS_COMMENTS = F_POSTS_COMMENTS - 1 WHERE F_ID = {$r['F_ID_POSTS_INFO']}";
$this->update($sql); //更新文章评论数
$sql = "DELETE FROM EE_BLOG_COMMENTS WHERE F_ID = $comid";
$this->delete($sql); //删除评论
}catch (Exception $e){ //捕获异常,回滚
$this->rollback();
return false;
}
$this->commit();
return true;
}
/**
* 功能:提取模版信息
* 返回:数组
*/
public function GetSkinsList() {
$sql = "SELECT * FROM em_blog_skins";
return $this->select($sql);
}
/**
* 功能:设置BLOG信息
* 参数:$blogid 博客ID,$array 表单数据
* 返回:TRUE OR FALSE
*/
public function BlogSet($blogid,$array) {
$thi
上一篇:
blog.admin.php
下一篇:
法律专业开题报告范文