当前位置: 首页>>代码示例>>PHP>>正文


PHP cmsCore::deleteRatings方法代码示例

本文整理汇总了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;
 }
开发者ID:deltas1,项目名称:icms1,代码行数:22,代码来源:blog.class.php

示例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;
    }
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:21,代码来源:photo.class.php

示例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;
    }
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:22,代码来源:model.php

示例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;
 }
开发者ID:deltas1,项目名称:icms1,代码行数:18,代码来源:model.php

示例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;
 }
开发者ID:deltas1,项目名称:icms1,代码行数:22,代码来源:model.php


注:本文中的cmsCore::deleteRatings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。