本文整理汇总了PHP中iPHP::cleanHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP iPHP::cleanHtml方法的具体用法?PHP iPHP::cleanHtml怎么用?PHP iPHP::cleanHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iPHP
的用法示例。
在下文中一共展示了iPHP::cleanHtml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __action_manage_publish
private function __action_manage_publish()
{
$aid = (int) $_POST['id'];
$cid = (int) $_POST['cid'];
$_cid = (int) $_POST['_cid'];
$ucid = (int) $_POST['ucid'];
$_ucid = (int) $_POST['_ucid'];
$mobile = (int) $_POST['mobile'];
$title = iS::escapeStr($_POST['title']);
$source = iS::escapeStr($_POST['source']);
$keywords = iS::escapeStr($_POST['keywords']);
$description = iS::escapeStr($_POST['description']);
$creative = (int) $_POST['creative'];
$userid = user::$userid;
$author = user::$nickname;
$editor = user::$nickname;
if (iCMS::$config['user']['post']['seccode']) {
$seccode = iS::escapeStr($_POST['seccode']);
iPHP::seccode($seccode, true) or iPHP::alert('iCMS:seccode:error');
}
if (iCMS::$config['user']['post']['interval']) {
$last_postime = iDB::value("\n SELECT MAX(postime)\n FROM `#iCMS@__article`\n WHERE userid='" . user::$userid . "'");
if ($_SERVER['REQUEST_TIME'] - $last_postime < iCMS::$config['user']['post']['interval']) {
iPHP::alert('user:publish:interval');
}
}
if ($mobile) {
$_POST['body'] = ubb2html($_POST['body']);
$_POST['body'] = trim($_POST['body']);
}
$body = iPHP::cleanHtml($_POST['body']);
empty($title) && iPHP::alert('标题不能为空!');
empty($cid) && iPHP::alert('请选择所属栏目!');
empty($body) && iPHP::alert('文章内容不能为空!');
$fwd = iCMS::filter($title);
$fwd && iPHP::alert('user:publish:filter_title');
$fwd = iCMS::filter($description);
$fwd && iPHP::alert('user:publish:filter_desc');
$fwd = iCMS::filter($body);
$fwd && iPHP::alert('user:publish:filter_body');
$articleApp = iPHP::app("admincp.article.app");
if (empty($description)) {
$description = $articleApp->autodesc($body);
}
$pubdate = time();
$postype = "0";
$category = iCache::get('iCMS/category/' . $cid);
$status = $category['isexamine'] ? 3 : 1;
iPHP::import(iPHP_APP_CORE . '/iMAP.class.php');
iPHP::app('article.table');
$fields = articleTable::fields($aid);
$data_fields = articleTable::data_fields($aid);
if (empty($aid)) {
$postime = $pubdate;
$chapter = $hits = $good = $bad = $comments = 0;
$data = compact($fields);
$aid = articleTable::insert($data);
$article_data = compact($data_fields);
articleTable::data_insert($article_data);
map::init('category', iCMS_APP_ARTICLE);
map::add($cid, $aid);
iDB::query("UPDATE `#iCMS@__user_category` SET `count` = count+1 WHERE `cid` = '{$ucid}' AND `uid`='" . user::$userid . "' AND `appid`='" . iCMS_APP_ARTICLE . "';");
user::update_count(user::$userid, 1, 'article');
$lang = array('1' => 'user:article:add_success', '3' => 'user:article:add_examine');
} else {
if (articleTable::update(compact($fields), array('id' => $aid, 'userid' => user::$userid))) {
articleTable::data_update(compact($data_fields), array('aid' => $aid));
}
map::init('category', iCMS_APP_ARTICLE);
map::diff($cid, $_cid, $aid);
if ($ucid != $_ucid) {
iDB::query("UPDATE `#iCMS@__user_category` SET `count` = count+1 WHERE `cid` = '{$ucid}' AND `uid`='" . user::$userid . "' AND `appid`='" . iCMS_APP_ARTICLE . "';");
iDB::query("UPDATE `#iCMS@__user_category` SET `count` = count-1 WHERE `cid` = '{$_ucid}' AND `uid`='" . user::$userid . " AND `count`>0' AND `appid`='" . iCMS_APP_ARTICLE . "';");
}
$lang = array('1' => 'user:article:update_success', '3' => 'user:article:update_examine');
}
$url = iPHP::router('/user/article', iPHP_ROUTER_REWRITE);
iPHP::success($lang[$status], 'url:' . $url);
}