本文整理汇总了PHP中cmsCore::deleteRatings方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsCore::deleteRatings方法的具体用法?PHP cmsCore::deleteRatings怎么用?PHP cmsCore::deleteRatings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsCore
的用法示例。
在下文中一共展示了cmsCore::deleteRatings方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: deletePhoto
/**
* Удаляет фото
* @param array $photo
* @param obj $inUploadPhoto
* @return bool
*/
public function deletePhoto($photo, $inUploadPhoto){
$photo = cmsCore::callEvent('DELETE_PHOTO', $photo);
if(!$this->deletePhotoFile($photo['file'], $inUploadPhoto)){ return false; }
cmsCore::deleteComments($this->getTarget('comments_photo'), $photo['id']);
cmsCore::deleteRatings($this->getTarget('rating'), $photo['id']);
cmsClearTags($this->getTarget('tags'), $photo['id']);
cmsActions::removeObjectLog($this->getTarget('actions_photo'), $photo['id']);
cmsCore::c('db')->query("DELETE FROM cms_photo_files WHERE id = '{$photo['id']}' LIMIT 1");
return true;
}
示例3: 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;
}
示例4: deleteArticle
/**
* Удаляет статью
* @return bool
*/
public function deleteArticle($id)
{
cmsCore::callEvent('DELETE_ARTICLE', $id);
$this->inDB->delete('cms_content', "id='{$id}'", 1);
$this->inDB->delete('cms_tags', "target='content' AND item_id='{$id}'");
cmsCore::clearAccess($id, 'material');
cmsActions::removeObjectLog('add_article', $id);
@unlink(PATH . '/images/photos/small/article' . $id . '.jpg');
@unlink(PATH . '/images/photos/medium/article' . $id . '.jpg');
cmsCore::deleteRatings('content', $id);
cmsCore::deleteComments('article', $id);
translations::deleteTargetTranslation('content_content', $id);
return true;
}
示例5: 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;
}