本文整理汇总了PHP中cmsCore::deleteUploadImages方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsCore::deleteUploadImages方法的具体用法?PHP cmsCore::deleteUploadImages怎么用?PHP cmsCore::deleteUploadImages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsCore
的用法示例。
在下文中一共展示了cmsCore::deleteUploadImages方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applet_tickets
function applet_tickets()
{
global $adminAccess;
if (!cmsUser::isAdminCan('admin/tickets', $adminAccess)) {
cpAccessDenied();
}
global $_LANG;
cmsUser::sessionDel('ticket_cat');
$do = cmsCore::request('do', 'str', 'list');
$super_user = cmsCore::c('user')->id == 1;
$toolmenu = array(array('icon' => 'new.gif', 'title' => $_LANG['AD_TICKET_CREATE'], 'link' => '?view=tickets&do=add'), array('icon' => 'liststuff.gif', 'title' => $_LANG['AD_TICKET_LIST'], 'link' => '?view=tickets&do=list'));
cpToolMenu($toolmenu, 'list', 'do');
cmsCore::c('page')->setTitle($_LANG['AD_TICKETS']);
cpAddPathway($_LANG['AD_TICKETS'], 'index.php?view=tickets');
if ($do == 'list') {
$fields = array(array('title' => 'id', 'field' => 'id', 'width' => '40'), array('title' => $_LANG['AD_TICKET_STATUS'], 'field' => 'status', 'width' => '100', 'filter' => 1, 'prc' => 'cpTicketStatus', 'filterlist' => cpGetTicketStatusList()), array('title' => $_LANG['AD_TICKET_DATE'], 'field' => 'pubdate', 'width' => '80'), array('title' => $_LANG['AD_TICKET_TITLE'], 'field' => 'title', 'width' => '', 'filter' => 32, 'link' => 'index.php?view=tickets&do=view&id=%id%'), array('title' => $_LANG['AD_TICKET_LAST_MSG_DATE'], 'field' => 'last_msg_date', 'width' => '80'), array('title' => $_LANG['AD_TICKET_CAT'], 'field' => 'cat_id', 'width' => '150', 'filter' => 1, 'prc' => 'cpTicketCategory', 'filter' => 1, 'filterlist' => cpGetTicketCats()), array('title' => $_LANG['AD_TICKET_PRIORITY'], 'field' => 'priority', 'width' => '100', 'filter' => 1, 'prc' => 'cpTicketPriority', 'filterlist' => cpGetTicketPriorityList()));
if ($super_user) {
$fields[] = array('title' => $_LANG['AD_TICKET_USER'], 'field' => 'user_id', 'width' => '110', 'prc' => 'cpTicketAuthor');
}
$actions = array(array('title' => $_LANG['AD_TICKET_CLOSE'], 'icon' => 'off.gif', 'link' => '?view=tickets&do=close_ticket&id=%id%', 'condition' => 'cpCheckTicketClose'), array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'link' => '?view=tickets&do=delete&id=%id%', 'confirm' => $_LANG['AD_TICKET_DELETE']));
cpListTable('cms_ticket', $fields, $actions, $super_user ? '' : 'user_id=' . cmsCore::c('user')->id, 'last_msg_date DESC', 30);
}
if ($do == 'delete') {
$id = cmsCore::request('id', 'int', 0);
$item = cmsCore::c('db')->get_fields('cms_ticket', 'id=' . $id, '*');
if (!empty($item)) {
$server = cmsCore::c('db')->get_field('cms_ticket_cat', 'id=' . $item['cat_id'], 'server');
if (empty($server)) {
$server = 'http://ds-soft.ru/tickets.api.php';
}
//Удаляем сам тиккет
cmsCore::c('db')->delete('cms_ticket', 'id=' . $item['id']);
//Удаляем все сообщения тиккета
cmsCore::c('db')->delete('cms_ticket_msg', 'ticket_id=' . $item['id']);
//Удаляем все прикрепленные изображения тиккета
cmsCore::deleteUploadImages($item['id'], 'ticket');
if ($item['status'] != '3') {
//Отправляем сообщение на сервер техподдержки что тикет удален
cmsCore::c('curl')->ajax()->request('post', $server . '?do=ticket_deleted', array('ticket_id' => $item['id'], 'ticket_secret_key' => $item['secret_key'], 'host' => cmsCore::c('config')->host));
}
cmsCore::addSessionMessage($_LANG['AD_TICKET_DELETE_SUCCESS'], 'success');
} else {
cmsCore::addSessionMessage($_LANG['AD_TICKET_ERROR'], 'error');
}
cmsCore::redirect('index.php?view=tickets');
}
if ($do == 'close_ticket') {
$id = cmsCore::request('id', 'int', 0);
$item = cmsCore::c('db')->get_fields('cms_ticket', 'id=' . $id, '*');
if (!empty($item)) {
cmsCore::c('db')->setFlag('cms_ticket', $item['id'], 'status', '3');
$server = cmsCore::c('db')->get_field('cms_ticket_cat', 'id=' . $item['cat_id'], 'server');
if (empty($server)) {
$server = 'http://ds-soft.ru/tickets.api.php';
}
//Отправляем сообщение на сервер техподдержки что тикет закрыт
cmsCore::c('curl')->ajax()->request('post', $server . '?do=ticket_closed', array('ticket_id' => $item['id'], 'ticket_secret_key' => $item['secret_key'], 'host' => cmsCore::c('config')->host));
cmsCore::addSessionMessage($_LANG['AD_TICKET_CLOSE_SUCCESS'], 'success');
} else {
cmsCore::addSessionMessage($_LANG['AD_TICKET_ERROR'], 'error');
}
cmsCore::redirect('index.php?view=tickets');
}
if ($do == 'add') {
cpAddPathway($_LANG['AD_TICKET_CREATE'], 'index.php?view=tickets&do=add');
cmsCore::c('page')->initTemplate('applets', 'tickets_add')->assign('cats', cpGetTicketCats())->display();
}
if ($do == 'submit') {
$cats = cpGetTicketCats();
$item = array('cat_id' => cmsCore::request('cat_id', 'int', 0), 'priority' => cmsCore::request('priority', array(0, 1, 2, 3), 0), 'title' => cmsCore::request('title', 'str', ''), 'msg' => cmsCore::request('msg', 'str', ''));
if (!isset($cats[$item['cat_id']])) {
$item['cat_id'] = 0;
}
if (!empty($item['title']) && !empty($item['msg'])) {
$item['msg'] = cmsCore::c('db')->escape_string($item['msg']);
$item['msg_count'] = 1;
$item['pubdate'] = date('Y-m-d H:i:s');
$item['last_msg_date'] = $item['pubdate'];
$item['user_id'] = cmsCore::c('user')->id;
$item['id'] = cmsCore::c('db')->insert('cms_ticket', $item);
cmsCore::addSessionMessage($_LANG['AD_TICKET_CREATED'], 'success');
$do = 'send';
} else {
cmsCore::addSessionMessage($_LANG['AD_TICKET_ERROR_2'], 'error');
cmsCore::redirect('index.php?view=tickets&do=add');
}
}
if ($do == 'send') {
if (empty($item)) {
$id = cmsCore::request('id', 'int', 0);
$item = cmsCore::c('db')->get_fields('cms_ticket', 'id=' . $id, '*');
}
if (!empty($item)) {
$cat = cmsCore::c('db')->get_fields('cms_ticket_cat', 'id=' . $item['cat_id'], '*');
$server = !empty($cat['server']) ? $cat['server'] : 'http://ds-soft.ru/tickets.api.php';
$ticket = array('ticket_id' => $item['id'], 'cat_id' => $item['cat_id'], 'priority' => $item['priority'], 'title' => $item['title'], 'msg' => $item['msg'], 'host' => cmsCore::c('config')->host, 'module' => $cat['module']);
if ($ticket['cat_id'] > 0 && !empty($cat['module'])) {
$ticket['module'] = $cat['module'];
}
//Отправляем тикет на сервер техподдержки
//.........这里部分代码省略.........
示例2: deletePost
/**
* Удаляет пост в блоге
* @param int $post_id
* @return bool
*/
public function deletePost($post_id)
{
cmsCore::callEvent('DELETE_POST', $post_id);
$post = $this->getPost($post_id);
if (!$post) {
return false;
}
// пересчитываем рейтинг блога
$this->inDB->query("UPDATE cms_blogs SET rating = rating - ({$post['rating']}) WHERE id = '{$post['blog_id']}'");
$this->inDB->delete('cms_blog_posts', "id = '{$post_id}'", 1);
cmsCore::deleteRatings($this->getTarget('rating'), $post_id);
cmsCore::deleteComments($this->getTarget('comments'), $post_id);
cmsClearTags($this->getTarget('tags'), $post_id);
cmsCore::deleteUploadImages($post_id, 'blog_post');
cmsActions::removeObjectLog($this->getTarget('actions_post'), $post_id);
return true;
}
示例3: applet_tickets
function applet_tickets() {
global $adminAccess;
if (!cmsUser::isAdminCan('admin/tickets', $adminAccess)) { cpAccessDenied(); }
global $_LANG;
cmsUser::sessionDel('ticket_cat');
$do = cmsCore::request('do', 'str', 'list');
$super_user = cmsCore::c('user')->id == 1;
$toolmenu = array(
array( 'icon' => 'new.gif', 'title' => $_LANG['AD_TICKET_CREATE'], 'link' => '?view=tickets&do=add' ),
array( 'icon' => 'liststuff.gif', 'title' => $_LANG['AD_TICKET_LIST'], 'link' => '?view=tickets&do=list' )
);
cpToolMenu($toolmenu, 'list', 'do');
cmsCore::c('page')->setTitle($_LANG['AD_TICKETS']);
cpAddPathway($_LANG['AD_TICKETS'], 'index.php?view=tickets');
if ($do == 'list') {
$fields = array(
array( 'title' => 'id', 'field' => 'id', 'width' => '40' ),
array( 'title' => $_LANG['AD_TICKET_STATUS'], 'field' => 'status', 'width' => '100', 'filter' => 1, 'prc' => 'cpTicketStatus', 'filterlist' => cpGetTicketStatusList() ),
array( 'title' => $_LANG['AD_TICKET_DATE'], 'field' => 'pubdate', 'width' => '80' ),
array( 'title' => $_LANG['AD_TICKET_TITLE'], 'field' => 'title', 'width' => '', 'filter' => 32, 'link' => 'index.php?view=tickets&do=view&id=%id%' ),
array( 'title' => $_LANG['AD_TICKET_LAST_MSG_DATE'], 'field' => 'last_msg_date', 'width' => '80' ),
array( 'title' => $_LANG['AD_TICKET_CAT'], 'field' => 'cat_id', 'width' => '150', 'filter' => 1, 'prc' => 'cpTicketCategory', 'filter' => 1, 'filterlist' => cpGetTicketCats() ),
array( 'title' => $_LANG['AD_TICKET_PRIORITY'], 'field' => 'priority', 'width' => '100', 'filter' => 1, 'prc' => 'cpTicketPriority', 'filterlist' => cpGetTicketPriorityList() )
);
if ($super_user) {
$fields[] = array( 'title' => $_LANG['AD_TICKET_USER'], 'field' => 'user_id', 'width' => '110', 'prc' => 'cpTicketAuthor' );
}
$actions = array(
array( 'title' => $_LANG['AD_TICKET_CLOSE'], 'icon' => 'off.gif', 'link' => '?view=tickets&do=close_ticket&id=%id%', 'condition' => 'cpCheckTicketClose' ),
array( 'title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'link' => '?view=tickets&do=delete&id=%id%', 'confirm' => $_LANG['AD_TICKET_DELETE'] )
);
cpListTable('cms_ticket', $fields, $actions, $super_user ? '' : 'user_id='. cmsCore::c('user')->id, 'last_msg_date DESC', 30);
}
if ($do == 'delete') {
$id = cmsCore::request('id', 'int', 0);
$item = cmsCore::c('db')->get_fields('cms_ticket', 'id='. $id, '*');
if (!empty($item)) {
$server = cmsCore::c('db')->get_field('cms_ticket_cat', 'id='. $item['cat_id'], 'server');
if (empty($server)) { $server = 'http://ds-soft.ru/tickets.api.php'; }
//Удаляем сам тиккет
cmsCore::c('db')->delete('cms_ticket', 'id='. $item['id']);
//Удаляем все сообщения тиккета
cmsCore::c('db')->delete('cms_ticket_msg', 'ticket_id='. $item['id']);
//Удаляем все прикрепленные изображения тиккета
cmsCore::deleteUploadImages($item['id'], 'ticket');
if ($item['status'] != '3') {
//Отправляем сообщение на сервер техподдержки что тикет удален
cmsCore::c('curl')->ajax()->request('post', $server .'?do=ticket_deleted', array( 'ticket_id' => $item['id'], 'ticket_secret_key' => $item['secret_key'], 'host' => cmsCore::c('config')->host ));
}
cmsCore::addSessionMessage($_LANG['AD_TICKET_DELETE_SUCCESS'], 'success');
} else {
cmsCore::addSessionMessage($_LANG['AD_TICKET_ERROR'], 'error');
}
cmsCore::redirect('index.php?view=tickets');
}
if ($do == 'close_ticket') {
$id = cmsCore::request('id', 'int', 0);
$item = cmsCore::c('db')->get_fields('cms_ticket', 'id='. $id, '*');
if (!empty($item)) {
cmsCore::c('db')->setFlag('cms_ticket', $item['id'], 'status', '3');
$server = cmsCore::c('db')->get_field('cms_ticket_cat', 'id='. $item['cat_id'], 'server');
if (empty($server)) { $server = 'http://ds-soft.ru/tickets.api.php'; }
//Отправляем сообщение на сервер техподдержки что тикет закрыт
cmsCore::c('curl')->ajax()->request('post', $server .'?do=ticket_closed', array( 'ticket_id' => $item['id'], 'ticket_secret_key' => $item['secret_key'], 'host' => cmsCore::c('config')->host ));
cmsCore::addSessionMessage($_LANG['AD_TICKET_CLOSE_SUCCESS'], 'success');
} else {
cmsCore::addSessionMessage($_LANG['AD_TICKET_ERROR'], 'error');
}
cmsCore::redirect('index.php?view=tickets');
}
if ($do == 'add') {
cpAddPathway($_LANG['AD_TICKET_CREATE'], 'index.php?view=tickets&do=add');
$cats = cpGetTicketCats();
?>
//.........这里部分代码省略.........
示例4: deleteWallRecord
public function deleteWallRecord($record_id) {
$this->inDB->delete('cms_user_wall', "id = '$record_id'", 1);
cmsCore::deleteUploadImages($record_id, 'wall');
cmsActions::removeObjectLog('add_wall_my', $record_id);
cmsActions::removeObjectLog('add_wall', $record_id);
return true;
}
示例5: deletePost
public function deletePost($post_id)
{
cmsCore::callEvent('DELETE_POST', $post_id);
$this->deletePostAttachments($post_id);
cmsCore::deleteUploadImages($post_id, 'post');
$this->inDB->delete('cms_forum_posts', "id = '{$post_id}'", 1);
cmsActions::removeObjectLog('add_fpost', $post_id);
return true;
}
示例6: deleteArticle
/**
* Удаляет статью
* @return bool
*/
public function deleteArticle($id) {
cmsCore::callEvent('DELETE_ARTICLE', $id);
cmsCore::c('db')->delete('cms_content', "id='". $id ."'", 1);
cmsCore::c('db')->delete('cms_tags', "target='content' AND item_id='". $id ."'");
cmsCore::clearAccess($id, 'material');
cmsActions::removeObjectLog('add_article', $id);
@unlink(PATH .'/images/content/medium/'. ceil($id/100) .'/article'. $id .'.jpg');
@unlink(PATH .'/images/content/small/'. ceil($id/100) .'/article'. $id .'.jpg');
cmsCore::deleteUploadImages($id, '', 'content');
cmsCore::deleteRatings('content', $id);
cmsCore::deleteComments('article', $id);
return true;
}
示例7: deleteComment
public function deleteComment($comment_id)
{
cmsCore::callEvent('DELETE_COMMENT', $comment_id);
$this->childs = array();
$this->getCommentChilds($comment_id);
$sql = "DELETE FROM cms_comments WHERE id = '{$comment_id}' LIMIT 1";
$this->inDB->query($sql);
cmsCore::deleteRatings('comment', $comment_id);
cmsActions::removeObjectLog('add_comment', $comment_id);
cmsCore::deleteUploadImages($comment_id, 'comment');
if ($this->childs) {
foreach ($this->childs as $child) {
cmsCore::callEvent('DELETE_COMMENT', $child['id']);
$sql = "DELETE FROM cms_comments WHERE id = '{$child['id']}' LIMIT 1";
$this->inDB->query($sql);
cmsCore::deleteRatings('comment', $child['id']);
cmsActions::removeObjectLog('add_comment', $child['id']);
cmsCore::deleteUploadImages($child['id'], 'comment');
}
}
return true;
}