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


PHP cmsActions::removeObjectLog方法代码示例

本文整理汇总了PHP中cmsActions::removeObjectLog方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsActions::removeObjectLog方法的具体用法?PHP cmsActions::removeObjectLog怎么用?PHP cmsActions::removeObjectLog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cmsActions的用法示例。


在下文中一共展示了cmsActions::removeObjectLog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteQuest

 public function deleteQuest($id)
 {
     $inCore = cmsCore::getInstance();
     $this->inDB->query("DELETE FROM cms_armedlist_quests WHERE id={$id}");
     $inCore->deleteComments('armedlist', $id);
     cmsActions::removeObjectLog('add_quest', $id);
     return true;
 }
开发者ID:4uva4ek,项目名称:svato,代码行数:8,代码来源:model.php

示例2: deleteItem

 public function deleteItem($id)
 {
     $imageurl = $this->getItemImageUrl($id);
     @chmod(PATH . "/images/catalog/{$imageurl}", 0777);
     @chmod(PATH . "/images/catalog/small/{$imageurl}", 0777);
     @chmod(PATH . "/images/catalog/medium/{$imageurl}", 0777);
     @unlink(PATH . '/images/catalog/' . $imageurl);
     @unlink(PATH . '/images/catalog/small/' . $imageurl);
     @unlink(PATH . '/images/catalog/medium/' . $imageurl);
     $this->inDB->query("DELETE FROM cms_uc_items WHERE id= '{$id}'");
     $this->inDB->query("DELETE FROM cms_tags WHERE target='catalog' AND item_id = '{$id}'");
     $this->inDB->query("DELETE FROM cms_uc_ratings WHERE item_id = '{$id}'");
     cmsActions::removeObjectLog('add_catalog', $id);
     cmsCore::deleteComments('catalog', $id);
 }
开发者ID:deltas1,项目名称:icms1,代码行数:15,代码来源:model.php

示例3: clubs


//.........这里部分代码省略.........
            display();
    }

}
///////////////////////// ВЫХОД ИЗ КЛУБА ///////////////////////////////////////////
if ($do == 'leave'){

    if(!$inUser->id) { return false; }

    if(!cmsCore::isAjax()) { return false; }

	$club = $model->getClub($id);
	if(!$club){	cmsCore::halt(); }

	// Инициализируем участников клуба
	$model->initClubMembers($club['id']);
	// Выйти из клуба могут только его участники
    $is_admin  = $inUser->id == $club['admin_id'];
    $is_member = $model->checkUserRightsInClub();
	if ($is_admin || !$is_member){ cmsCore::halt(); }

    if (cmsCore::inRequest('confirm')){

		if(!cmsUser::checkCsrfToken()) { cmsCore::halt(); }

		cmsCore::callEvent('LEAVE_CLUB', $club);

        $model->removeUserFromClub($club['id'], $inUser->id);
		// Пересчитываем рейтинг
        $model->setClubRating($club['id']);
		// Кешируем (пересчитываем) количество участников
		$model->setClubMembersCount($club['id']);
		// Добавляем событие в ленте активности
		cmsActions::removeObjectLog('add_club_user', $club['id'], $inUser->id);
		cmsCore::addSessionMessage($_LANG['YOU_LEAVE_CLUB'].'"'.$club['title'].'"', 'success');

		cmsCore::jsonOutput(array('error' => false, 'redirect'  => '/clubs/'.$club['id']));

    }

}
///////////////////////// ВСТУПЛЕНИЕ В КЛУБ ////////////////////////////////////
if ($do == 'join'){

	if (!$inUser->id){ cmsCore::halt(); }

	$club = $model->getClub($id);
	if(!$club){	cmsCore::halt(); }

	// В приватный клуб участников добавляет администратор
    if ($club['clubtype']=='private'){ cmsCore::halt(); }

	// Инициализируем участников клуба
	$model->initClubMembers($club['id']);
	// проверяем наличие пользователя в клубе
    $is_admin  = $inUser->id == $club['admin_id'];
    $is_member = $model->checkUserRightsInClub();
	if ($is_admin || $is_member){ cmsCore::halt(); }

    // Проверяем ограничения на количество участников
    if ($club['maxsize'] && ($model->club_total_members >= $club['maxsize']) && !$inUser->is_admin){
        cmsCore::jsonOutput(array('error' => true, 'text'  => $_LANG['CLUB_SIZE_LIMIT']));
    }
    // Проверяем ограничения по карме на вступление
    if($club['join_karma_limit'] && ($inUser->karma < $club['join_min_karma']) && !$inUser->is_admin){
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:66,代码来源:frontend.php

示例4: 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

示例5: deleteFriend

 /**
  * Удаляет пользователя $user_id из списка друзей текущего пользователя
  * @param int $user_id
  * @return bool
  */
 public static function deleteFriend($user_id = 0)
 {
     if (!$user_id) {
         return false;
     }
     $friend_field_id = self::getFriendFieldId($user_id);
     if ($friend_field_id) {
         cmsCore::callEvent('DELETE_FRIEND', $user_id);
         cmsDatabase::getInstance()->query("DELETE FROM cms_user_friends WHERE id = '{$friend_field_id}'");
         cmsActions::removeObjectLog('add_friend', $friend_field_id);
         cmsUser::clearSessionFriends();
         return true;
     }
     return false;
 }
开发者ID:vicktorwork,项目名称:cms1,代码行数:20,代码来源:user.class.php

示例6: deleteComments

 /**
  * Удаляет все комментарии для указанной цели
  * @param string $target
  * @param int $target_id
  * @return boolean
  */
 public static function deleteComments($target, $target_id)
 {
     $inDB = cmsDatabase::getInstance();
     $comments = $inDB->get_table('cms_comments', "target='{$target}' AND target_id='{$target_id}'", 'id');
     if (!$comments) {
         return false;
     }
     self::loadClass('actions');
     foreach ($comments as $comment) {
         cmsActions::removeObjectLog('add_comment', $comment['id']);
         self::deleteUploadImages($comment['id'], 'comment');
         self::deleteRatings('comment', $comment['id']);
     }
     $inDB->delete('cms_comments', "target='{$target}' AND target_id='{$target_id}'");
     return true;
 }
开发者ID:vityapro,项目名称:cms,代码行数:22,代码来源:cms.php

示例7: 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

示例8: deleteRecord

 public function deleteRecord($item_id)
 {
     cmsCore::callEvent('DELETE_BOARD_RECORD', $item_id);
     $item = $this->getRecord($item_id);
     if (!$item) {
         return false;
     }
     @unlink(PATH . '/images/board/' . $item['file']);
     @unlink(PATH . '/images/board/small/' . $item['file']);
     @unlink(PATH . '/images/board/medium/' . $item['file']);
     $this->inDB->delete('cms_board_items', " id = '{$item_id}'", 1);
     cmsCore::deleteComments('boarditem', $item_id);
     cmsActions::removeObjectLog('add_board', $item_id);
     return true;
 }
开发者ID:deltas1,项目名称:icms1,代码行数:15,代码来源:model.php

示例9: deleteThread

 public function deleteThread($thread_id)
 {
     cmsActions::removeObjectLog('add_thread', $thread_id);
     $this->whereThreadIs($thread_id);
     $posts = $this->getPosts();
     if ($posts) {
         foreach ($posts as $post) {
             $this->deletePost($post['id']);
         }
     }
     $this->inDB->query("DELETE FROM cms_forum_threads WHERE id = '{$thread_id}'");
     $poll = $this->getThreadPoll($thread_id);
     if ($poll) {
         $this->deletePoll($poll['id']);
     }
 }
开发者ID:r2git,项目名称:icms1,代码行数:16,代码来源:model.php

示例10: 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

示例11: deleteComments

    /**
     * Удаляет все комментарии для указанной цели
     * @param string $target
     * @param int $target_id
     * @return boolean
     */
    public static function deleteComments($target, $target_id){
        $comments = self::c('db')->get_table('cms_comments', "target='". $target ."' AND target_id='". $target_id ."'", 'id');
        
        if (!$comments){ return false; }

        self::loadClass('actions');

        foreach($comments as $comment){
            cmsActions::removeObjectLog('add_comment', $comment['id']);
            self::deleteUploadImages($comment['id'], 'comment');
            self::deleteRatings('comment', $comment['id']);
        }

        self::c('db')->delete('cms_comments', "target='". $target ."' AND target_id='". $target_id ."'");;

        return true;
    }
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:23,代码来源:cms.php

示例12: deleteClub

 /**
  * Удаляет клуб
  * @return bool
  */
 public function deleteClub($club_id)
 {
     cmsCore::callEvent('DELETE_CLUB', $club_id);
     $club = $this->getClub($club_id);
     if (!$club) {
         return false;
     }
     $inBlog = $this->initBlog();
     cmsCore::loadClass('photo');
     $inPhoto = $this->initPhoto();
     //Удаляем логотип клуба
     if ($club['imageurl'] != 'nopic.jpg') {
         @unlink(PATH . '/images/clubs/' . $club['imageurl']);
         @unlink(PATH . '/images/clubs/small/' . $club['imageurl']);
     }
     //Удаляем клуб и привязки пользователей
     $this->inDB->query("DELETE FROM cms_clubs WHERE id = '{$club_id}'");
     $this->inDB->query("DELETE FROM cms_user_clubs WHERE club_id = '{$club_id}'");
     //Удаляем блог клуба
     $inBlog->deleteBlog($this->getClubBlogId($club_id));
     //Удаляем фотоальбомы клуба
     $inPhoto->deleteAlbum($this->inDB->getNsRootCatId('cms_photo_albums', 'club' . $club_id), 'club' . $club_id, $this->initUploadClass());
     $this->inDB->query("DELETE FROM cms_photo_albums WHERE NSDiffer = 'club{$club_id}'");
     cmsActions::removeObjectLog('add_club', $club_id);
     return true;
 }
开发者ID:4uva4ek,项目名称:svato,代码行数:30,代码来源:model.php

示例13: 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

示例14: users


//.........这里部分代码省略.........
        cmsCore::addSessionMessage($_LANG['MESS_ALL_DEL_OK'], 'info');
        cmsCore::redirectBack();
    }
    //============================================================================//
    //============================= Загрузка аватара  ============================//
    //============================================================================//
    if ($do == 'avatar') {
        if (!$inUser->id || $inUser->id && $inUser->id != $id) {
            cmsCore::error404();
        }
        $inPage->setTitle($_LANG['LOAD_AVATAR']);
        $inPage->addPathway($inUser->nickname, cmsUser::getProfileURL($inUser->login));
        $inPage->addPathway($_LANG['LOAD_AVATAR']);
        if (cmsCore::inRequest('upload')) {
            cmsCore::loadClass('upload_photo');
            $inUploadPhoto = cmsUploadPhoto::getInstance();
            // Выставляем конфигурационные параметры
            $inUploadPhoto->upload_dir = PATH . '/images/';
            $inUploadPhoto->dir_medium = 'users/avatars/';
            $inUploadPhoto->dir_small = 'users/avatars/small/';
            $inUploadPhoto->small_size_w = $model->config['smallw'];
            $inUploadPhoto->medium_size_w = $model->config['medw'];
            $inUploadPhoto->medium_size_h = $model->config['medh'];
            $inUploadPhoto->is_watermark = false;
            $inUploadPhoto->input_name = 'picture';
            $file = $inUploadPhoto->uploadPhoto($inUser->orig_imageurl);
            if (!$file) {
                cmsCore::addSessionMessage('<strong>' . $_LANG['ERROR'] . ':</strong> ' . cmsCore::uploadError() . '!', 'error');
                cmsCore::redirect('/users/' . $id . '/avatar.html');
            }
            $sql = "UPDATE cms_user_profiles SET imageurl = '{$file['filename']}' WHERE user_id = '{$id}' LIMIT 1";
            $inDB->query($sql);
            // очищаем предыдущую запись о смене аватара
            cmsActions::removeObjectLog('add_avatar', $id);
            // выводим сообщение в ленту
            cmsActions::log('add_avatar', array('object' => '', 'object_url' => '', 'object_id' => $id, 'target' => '', 'target_url' => '', 'description' => '<a href="' . cmsUser::getProfileURL($inUser->login) . '" class="act_usr_ava">
								   <img border="0" src="/images/users/avatars/small/' . $file['filename'] . '">
								</a>'));
            cmsCore::redirect(cmsUser::getProfileURL($inUser->login));
        } else {
            cmsPage::initTemplate('components', 'com_users_avatar_upload')->assign('id', $id)->display('com_users_avatar_upload.tpl');
        }
    }
    //============================================================================//
    //============================= Библиотека аватаров  =========================//
    //============================================================================//
    if ($do == 'select_avatar') {
        if (!$inUser->id || $inUser->id && $inUser->id != $id) {
            cmsCore::error404();
        }
        $avatars_dir = PATH . "/images/users/avatars/library";
        $avatars_dir_rel = "/images/users/avatars/library";
        $avatars_dir_handle = opendir($avatars_dir);
        $avatars = array();
        while ($nextfile = readdir($avatars_dir_handle)) {
            if ($nextfile != '.' && $nextfile != '..' && (mb_strstr($nextfile, '.gif') || mb_strstr($nextfile, '.jpg') || mb_strstr($nextfile, '.jpeg') || mb_strstr($nextfile, '.png'))) {
                $avatars[] = $nextfile;
            }
        }
        closedir($avatars_dir_handle);
        if (!cmsCore::inRequest('set_avatar')) {
            $inPage->setTitle($_LANG['SELECT_AVATAR']);
            $inPage->addPathway($inUser->nickname, cmsUser::getProfileURL($inUser->login));
            $inPage->addPathway($_LANG['SELECT_AVATAR']);
            $perpage = 20;
            $total = sizeof($avatars);
开发者ID:deltas1,项目名称:icms1,代码行数:67,代码来源:frontend.php

示例15: deletePhoto

    public function deletePhoto($photo_id) {

        cmsCore::loadLib('tags');

        $sql = "SELECT imageurl FROM cms_user_photos WHERE id = '{$photo_id}'";
        $result = $this->inDB->query($sql);

        if ($this->inDB->num_rows($result)){
            $photo = $this->inDB->fetch_assoc($result);
            @unlink(PATH.'/images/users/photos/'.$photo['imageurl']);
            @unlink(PATH.'/images/users/photos/small/'.$photo['imageurl']);
            @unlink(PATH.'/images/users/photos/medium/'.$photo['imageurl']);
            $this->inDB->query("DELETE FROM cms_user_photos WHERE id = $photo_id") ;
            cmsCore::deleteComments('userphoto', $photo_id);
			cmsActions::removeObjectLog('add_user_photo', $photo_id);
            cmsClearTags('userphoto', $photo_id);
        }

        return true;

    }
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:21,代码来源:model.php


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