本文整理汇总了PHP中access::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP access::delete方法的具体用法?PHP access::delete怎么用?PHP access::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类access
的用法示例。
在下文中一共展示了access::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_mk_publish_content
public function check_mk_publish_content($data = array())
{
if (!$data) {
$sql = "SELECT * FROM " . DB_PREFIX . "content_publish_time ORDER BY id LIMIT 1";
$data = $this->db->query_first($sql);
if (empty($data)) {
echo "没有可执行计划";
exit;
}
$sql = "DELETE FROM " . DB_PREFIX . "content_publish_time WHERE id=" . $data['id'];
$this->db->query($sql);
}
if ($this->settings['App_mk_publish_content']) {
$this->curl = new curl($this->settings['App_mk_publish_content']['host'], $this->settings['App_mk_publish_content']['dir']);
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->initPostData();
$this->curl->addRequestData('html', true);
$this->curl->addRequestData('cmid', $data['content_id']);
$this->curl->request('mk_publish_content.php');
}
if ($this->settings['is_syn_clouds']) {
$content_data = $this->obj->get_all_content_by_relationid($data['content_id']);
include_once CUR_CONF_PATH . 'lib/content_syn.class.php';
$content_syn = new content_syn();
if (!$content_data) {
$content_syn->delete_syn_content($data['content_id']);
} else {
$content_syn->content($data['content_id']);
}
}
if ($this->settings['App_mkpublish']) {
$content_data = $content_data ? $content_data : $this->obj->get_all_content_by_relationid($data['content_id'], true);
if ($this->settings['is_need_audit']) {
if ($content_data && is_array($content_data)) {
if ($content_data['status'] != 1) {
$this->mk->del_publish(array('rid' => $data['content_id']));
//请求访问统计,更改对应已被删除内容
if ($data['cid']) {
@(include ROOT_PATH . 'lib/class/access.class.php');
if (class_exists('access')) {
$access = new access();
$access->delete($data['cid']);
}
}
@(include DATA_DIR . 'hooks/publish.php');
exit;
}
}
}
if (!$content_data) {
$this->mk->del_publish(array('rid' => $data['content_id']));
//请求访问统计,更改对应已被删除内容
if ($data['cid']) {
@(include ROOT_PATH . 'lib/class/access.class.php');
if (class_exists('access')) {
$access = new access();
$access->delete($data['cid']);
}
}
@(include DATA_DIR . 'hooks/publish.php');
exit;
}
$sql = "SELECT id FROM " . DB_PREFIX . "content_field WHERE bundle_id='" . $content_data['bundle_id'] . "' AND module_id='" . $content_data['module_id'] . "' AND content_type!='' AND struct_ast_id='' ORDER BY id";
$content_type = $this->db->query_first($sql);
$plan['title'] = $content_data['title'];
$plan['site_id'] = $content_data['site_id'];
$plan['page_data_id'] = $content_data['column_id'];
$plan['content_type'] = intval($content_type['id']);
$plan['template_sign'] = $content_data['template_sign'];
$plan['rid'] = $content_data['id'];
$plan['content_type_sign'] = $content_data['bundle_id'];
$plan['client_type'] = 2;
$plan['content_detail'] = array('content_url' => $content_data['content_url'], 'id' => $content_data['id'], 'rid' => $content_data['id'], 'cid' => $content_data['cid'], 'content_fromid' => $content_data['content_fromid'], 'file_name' => $content_data['file_name'], 'template_sign' => $content_data['template_sign'], 'content_type_sign' => $content_data['bundle_id'], 'column_id' => $content_data['column_id'], 'site_id' => $content_data['site_id']);
$error_data = $plan;
//取栏目的page_id
include_once ROOT_PATH . 'lib/class/publishsys.class.php';
$this->pub_sys = new publishsys();
$page_data = $this->pub_sys->get_page_by_sign('column', $content_data['site_id']);
if (!$page_data['id']) {
//插入错误日志;
$error_data['failure'] = '模板->页面管理:可能没有栏目页面类型,或者栏目配置错误';
$this->insert_error_log($error_data);
return;
}
$plan['page_id'] = $page_data['id'];
if ($content_data['template_sign'] && in_array($content_data['bundle_id'], array('special'))) {
//查询页面类型id
$page_data_c = $this->pub_sys->get_page_by_sign($content_data['bundle_id']);
if ($page_data_c['id']) {
$plan['page_data_id_c'] = $content_data['content_fromid'];
$plan['page_id_c'] = $page_data_c['id'];
} else {
$plan['template_sign'] = '';
//插入错误日志;
$error_data['failure'] = '模板->页面管理:可能没有专题页面类型,或者专题配置,专题添加参数错误';
$this->insert_error_log($error_data);
return;
}
} else {
//.........这里部分代码省略.........
示例2:
$toolInst->errorStatus("not allowed in this demo. Sorry ;)");
}
}
if (tool::securePost('action') == "new") {
$accessInst->fill(tool::securePostAll());
if ($accessInst->insert()) {
$accessInst->clear();
$recordType = "new";
} else {
$recordType = "edit";
}
}
if (tool::securePost('action') == "delete") {
$accessInst->id = tool::securePost('id');
if (!DEMO_MODE) {
$accessInst->delete();
} else {
$toolInst->errorStatus("not allowed in this demo. Sorry ;)");
}
}
if (tool::securePost('action') == "edit") {
$recordType = "edit";
}
#######################################################################
## make edit / new form
?>
<h2><?php
echo $recordType;
?>
<?php