本文整理汇总了PHP中ArticleModel::check_art方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleModel::check_art方法的具体用法?PHP ArticleModel::check_art怎么用?PHP ArticleModel::check_art使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleModel
的用法示例。
在下文中一共展示了ArticleModel::check_art方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_art
/**
* 添加文章
*/
public function add_art()
{
if (IS_POST) {
$title = trim($_POST['title']);
$classid = $_POST['classid'];
$keywords = trim($_POST['keywords']);
$description = trim($_POST['description']);
$fengmian = trim($_POST['fengmian']);
$is_tj = $_POST['is_tj'];
$content = trim($_POST['content']);
$click = trim($_POST['click']);
$uid = $_POST['uid'];
$status = $_POST['status'];
$parr = $this->getprovcity($uid);
$p_id = $parr['p_id'];
$c_id = $parr['c_id'];
if (empty($title)) {
$this->error("标题不能为空!");
exit;
}
$M = new ArticleModel();
if ($M->check_art($title)) {
$this->error("标题已经存在!");
exit;
}
if (empty($classid)) {
$this->error("请选择分类");
exit;
}
if (!empty($fengmian)) {
$fmimg = "/Uploads/product/" . $fengmian;
}
$data = array("title" => $title, "classid" => $classid, "keywords" => $keywords, "description" => $description, "fmimg" => $fmimg, "is_tj" => $is_tj, "content" => $content, "addtime" => time(), "click" => $click, "uid" => $uid, "adduid" => $_SESSION['my_info']['a_id'], "p_id" => $p_id, "c_id" => $c_id, "status" => $status);
$rs = $M->add($data);
if ($rs) {
$this->success("操作成功!", U("Article/index"));
} else {
$this->error("操作失败!");
}
exit;
}
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
#文章分类
$this->assign("artlist", $this->getartclass());
#会员列表
$this->assign("ulist", $this->getumemlist());
$this->display();
}