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


PHP ModuleUser_EntityUser::getId方法代码示例

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


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

示例1: EventShowTopics

 /**
  * Выводит список топиков
  *
  */
 protected function EventShowTopics()
 {
     /**
      * Меню
      */
     $this->sMenuSubItemSelect = $this->sCurrentEvent;
     /**
      * Передан ли номер страницы
      */
     $iPage = $this->GetParamEventMatch(0, 2) ? $this->GetParamEventMatch(0, 2) : 1;
     /**
      * Получаем список топиков
      */
     $aResult = E::ModuleTopic()->GetTopicsPersonalByUser($this->oUserCurrent->getId(), $this->sCurrentEvent == 'published' ? 1 : 0, $iPage, Config::Get('module.topic.per_page'));
     $aTopics = $aResult['collection'];
     /**
      * Формируем постраничность
      */
     $aPaging = E::ModuleViewer()->MakePaging($aResult['count'], $iPage, Config::Get('module.topic.per_page'), Config::Get('pagination.pages.count'), R::GetPath('content') . $this->sCurrentEvent);
     /**
      * Загружаем переменные в шаблон
      */
     E::ModuleViewer()->Assign('aPaging', $aPaging);
     E::ModuleViewer()->Assign('aTopics', $aTopics);
     E::ModuleViewer()->AddHtmlTitle(E::ModuleLang()->Get('topic_menu_' . $this->sCurrentEvent));
 }
开发者ID:AntiqS,项目名称:altocms,代码行数:30,代码来源:ActionContent.class.php

示例2: AjaxResponseComment

 /**
  * Получение новых комментариев
  *
  */
 protected function AjaxResponseComment()
 {
     /**
      * Устанавливаем формат Ajax ответа
      */
     $this->Viewer_SetResponseAjax('json');
     /**
      * Пользователь авторизован?
      */
     if (!$this->oUserCurrent) {
         $this->oUserCurrent = $this->User_GetUserById(0);
     }
     /**
      * Топик существует?
      */
     $idTopic = getRequest('idTarget', null, 'post');
     if (!($oTopic = $this->Topic_GetTopicById($idTopic))) {
         $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     $idCommentLast = getRequest('idCommentLast', null, 'post');
     $selfIdComment = getRequest('selfIdComment', null, 'post');
     $aComments = array();
     /**
      * Если используется постраничность, возвращаем только добавленный комментарий
      */
     if (getRequest('bUsePaging', null, 'post') and $selfIdComment) {
         if ($oComment = $this->Comment_GetCommentById($selfIdComment) and $oComment->getTargetId() == $oTopic->getId() and $oComment->getTargetType() == 'topic') {
             $oViewerLocal = $this->Viewer_GetLocalViewer();
             $oViewerLocal->Assign('oUserCurrent', $this->oUserCurrent);
             $oViewerLocal->Assign('bOneComment', true);
             $oViewerLocal->Assign('oComment', $oComment);
             $sText = $oViewerLocal->Fetch($this->Comment_GetTemplateCommentByTarget($oTopic->getId(), 'topic'));
             $aCmt = array();
             $aCmt[] = array('html' => $sText, 'obj' => $oComment);
         } else {
             $aCmt = array();
         }
         $aReturn['comments'] = $aCmt;
         $aReturn['iMaxIdComment'] = $selfIdComment;
     } else {
         $aReturn = $this->Comment_GetCommentsNewByTargetId($oTopic->getId(), 'topic', $idCommentLast);
     }
     $iMaxIdComment = $aReturn['iMaxIdComment'];
     $oTopicRead = Engine::GetEntity('Topic_TopicRead');
     $oTopicRead->setTopicId($oTopic->getId());
     $oTopicRead->setUserId($this->oUserCurrent->getId());
     $oTopicRead->setCommentCountLast($oTopic->getCountComment());
     $oTopicRead->setCommentIdLast($iMaxIdComment);
     $oTopicRead->setDateRead(date("Y-m-d H:i:s"));
     $this->Topic_SetTopicRead($oTopicRead);
     $aCmts = $aReturn['comments'];
     if ($aCmts and is_array($aCmts)) {
         foreach ($aCmts as $aCmt) {
             $aComments[] = array('html' => $aCmt['html'], 'idParent' => $aCmt['obj']->getPid(), 'id' => $aCmt['obj']->getId());
         }
     }
     $this->Viewer_AssignAjax('iMaxIdComment', $iMaxIdComment);
     $this->Viewer_AssignAjax('aComments', $aComments);
 }
开发者ID:sergeym,项目名称:livestreet_plugin_guestcomments,代码行数:64,代码来源:ActionGuestcomments.class.php

示例3: EventShutdown

 /**
  * Обработка завершения работу экшена
  */
 public function EventShutdown()
 {
     if (!E::User()) {
         return;
     }
     $iCountTalkFavourite = E::ModuleTalk()->GetCountTalksFavouriteByUserId($this->oUserCurrent->getId());
     E::ModuleViewer()->Assign('iCountTalkFavourite', $iCountTalkFavourite);
     $iUserId = E::UserId();
     // Get stats of various user publications topics, comments, images, etc. and stats of favourites
     $aProfileStats = E::ModuleUser()->GetUserProfileStats($iUserId);
     // Получим информацию об изображениях пользователя
     /** @var ModuleMresource_EntityMresourceCategory[] $aUserImagesInfo */
     $aUserImagesInfo = E::ModuleMresource()->GetAllImageCategoriesByUserId($iUserId);
     E::ModuleViewer()->Assign('oUserProfile', E::User());
     E::ModuleViewer()->Assign('aProfileStats', $aProfileStats);
     E::ModuleViewer()->Assign('aUserImagesInfo', $aUserImagesInfo);
     // Old style skin compatibility
     E::ModuleViewer()->Assign('iCountTopicUser', $aProfileStats['count_topics']);
     E::ModuleViewer()->Assign('iCountCommentUser', $aProfileStats['count_comments']);
     E::ModuleViewer()->Assign('iCountTopicFavourite', $aProfileStats['favourite_topics']);
     E::ModuleViewer()->Assign('iCountCommentFavourite', $aProfileStats['favourite_comments']);
     E::ModuleViewer()->Assign('iCountNoteUser', $aProfileStats['count_usernotes']);
     E::ModuleViewer()->Assign('iCountWallUser', $aProfileStats['count_wallrecords']);
     E::ModuleViewer()->Assign('iPhotoCount', $aProfileStats['count_images']);
     E::ModuleViewer()->Assign('iCountCreated', $aProfileStats['count_created']);
     E::ModuleViewer()->Assign('iCountFavourite', $aProfileStats['count_favourites']);
     E::ModuleViewer()->Assign('iCountFriendsUser', $aProfileStats['count_friends']);
     E::ModuleViewer()->Assign('sMenuSubItemSelect', $this->sMenuSubItemSelect);
     E::ModuleViewer()->Assign('sMenuSubItemSelect', $this->sMenuSubItemSelect);
     // * Передаем константы состояний участников разговора
     E::ModuleViewer()->Assign('TALK_USER_ACTIVE', ModuleTalk::TALK_USER_ACTIVE);
     E::ModuleViewer()->Assign('TALK_USER_DELETE_BY_SELF', ModuleTalk::TALK_USER_DELETE_BY_SELF);
     E::ModuleViewer()->Assign('TALK_USER_DELETE_BY_AUTHOR', ModuleTalk::TALK_USER_DELETE_BY_AUTHOR);
 }
开发者ID:anp135,项目名称:altocms,代码行数:37,代码来源:ActionTalk.class.php

示例4: EventUnsubscribe

 /**
  * Отписка от блога или пользователя
  *
  */
 protected function EventUnsubscribe()
 {
     // * Устанавливаем формат Ajax ответа
     E::ModuleViewer()->SetResponseAjax('json');
     if (!F::GetRequest('id')) {
         E::ModuleMessage()->AddError(E::ModuleLang()->Get('system_error'), E::ModuleLang()->Get('error'));
         return;
     }
     $sType = F::GetRequestStr('type');
     $iType = null;
     // * Определяем от чего отписываемся
     switch ($sType) {
         case 'blogs':
         case 'blog':
             $iType = ModuleUserfeed::SUBSCRIBE_TYPE_BLOG;
             break;
         case 'users':
         case 'user':
             $iType = ModuleUserfeed::SUBSCRIBE_TYPE_USER;
             break;
         default:
             E::ModuleMessage()->AddError(E::ModuleLang()->Get('system_error'), E::ModuleLang()->Get('error'));
             return;
     }
     // * Отписываем пользователя
     E::ModuleUserfeed()->UnsubscribeUser($this->oUserCurrent->getId(), $iType, F::GetRequestStr('id'));
     E::ModuleMessage()->AddNotice(E::ModuleLang()->Get('userfeed_subscribes_updated'), E::ModuleLang()->Get('attention'));
 }
开发者ID:AntiqS,项目名称:altocms,代码行数:32,代码来源:ActionUserfeed.class.php

示例5: EventAjaxVote

 /**
  * Голосование админа
  */
 public function EventAjaxVote()
 {
     // * Устанавливаем формат ответа
     E::ModuleViewer()->SetResponseAjax('json');
     if (!E::IsAdmin()) {
         E::ModuleMessage()->AddErrorSingle(E::ModuleLang()->Get('need_authorization'), E::ModuleLang()->Get('error'));
         return;
     }
     $nUserId = $this->GetPost('idUser');
     if (!$nUserId || !($oUser = E::ModuleUser()->GetUserById($nUserId))) {
         E::ModuleMessage()->AddErrorSingle(E::ModuleLang()->Get('user_not_found'), E::ModuleLang()->Get('error'));
         return;
     }
     $nValue = $this->GetPost('value');
     $oUserVote = E::GetEntity('Vote');
     $oUserVote->setTargetId($oUser->getId());
     $oUserVote->setTargetType('user');
     $oUserVote->setVoterId($this->oUserCurrent->getId());
     $oUserVote->setDirection($nValue);
     $oUserVote->setDate(F::Now());
     $iVal = (double) E::ModuleRating()->VoteUser($this->oUserCurrent, $oUser, $nValue);
     $oUserVote->setValue($iVal);
     $oUser->setCountVote($oUser->getCountVote() + 1);
     if (E::ModuleVote()->AddVote($oUserVote) && E::ModuleUser()->Update($oUser)) {
         E::ModuleViewer()->AssignAjax('iRating', $oUser->getRating());
         E::ModuleViewer()->AssignAjax('iSkill', $oUser->getSkill());
         E::ModuleViewer()->AssignAjax('iCountVote', $oUser->getCountVote());
         E::ModuleMessage()->AddNoticeSingle(E::ModuleLang()->Get('user_vote_ok'), E::ModuleLang()->Get('attention'));
     } else {
         E::ModuleMessage()->AddErrorSingle(E::ModuleLang()->Get('action.admin.vote_error'), E::ModuleLang()->Get('error'));
     }
 }
开发者ID:ZeoNish,项目名称:altocms,代码行数:35,代码来源:ActionAdmin.class.php

示例6: EventShutdown

 /**
  * Обработка завершения работу экшена
  */
 public function EventShutdown()
 {
     if (!$this->oUserCurrent) {
         return;
     }
     $iCountTalkFavourite = $this->Talk_GetCountTalksFavouriteByUserId($this->oUserCurrent->getId());
     $this->Viewer_Assign('iCountTalkFavourite', $iCountTalkFavourite);
     $iCountTopicFavourite = $this->Topic_GetCountTopicsFavouriteByUserId($this->oUserCurrent->getId());
     $iCountTopicUser = $this->Topic_GetCountTopicsPersonalByUser($this->oUserCurrent->getId(), 1);
     $iCountCommentUser = $this->Comment_GetCountCommentsByUserId($this->oUserCurrent->getId(), 'topic');
     $iCountCommentFavourite = $this->Comment_GetCountCommentsFavouriteByUserId($this->oUserCurrent->getId());
     $iCountNoteUser = $this->User_GetCountUserNotesByUserId($this->oUserCurrent->getId());
     $this->Viewer_Assign('oUserProfile', $this->oUserCurrent);
     $this->Viewer_Assign('iCountWallUser', $this->Wall_GetCountWall(array('wall_user_id' => $this->oUserCurrent->getId(), 'pid' => null)));
     /**
      * Общее число публикация и избранного
      */
     $this->Viewer_Assign('iCountCreated', $iCountNoteUser + $iCountTopicUser + $iCountCommentUser);
     $this->Viewer_Assign('iCountFavourite', $iCountCommentFavourite + $iCountTopicFavourite);
     $this->Viewer_Assign('iCountFriendsUser', $this->User_GetCountUsersFriend($this->oUserCurrent->getId()));
     $this->Viewer_Assign('sMenuProfileItemSelect', $this->sMenuProfileItemSelect);
     $this->Viewer_Assign('sMenuSubItemSelect', $this->sMenuSubItemSelect);
     /**
      * Передаем во вьевер константы состояний участников разговора
      */
     $this->Viewer_Assign('TALK_USER_ACTIVE', ModuleTalk::TALK_USER_ACTIVE);
     $this->Viewer_Assign('TALK_USER_DELETE_BY_SELF', ModuleTalk::TALK_USER_DELETE_BY_SELF);
     $this->Viewer_Assign('TALK_USER_DELETE_BY_AUTHOR', ModuleTalk::TALK_USER_DELETE_BY_AUTHOR);
 }
开发者ID:Casper-SC,项目名称:livestreet,代码行数:32,代码来源:ActionTalk.class.php

示例7: EventAjaxRemoveUser

 /**
  * Отписка от пользователя
  */
 protected function EventAjaxRemoveUser()
 {
     $iUserId = (int) getRequestStr('user_id');
     /**
      * Устанавливаем формат Ajax ответа
      */
     $this->Viewer_SetResponseAjax('json');
     /**
      * Пользователь авторизован?
      */
     if (!$this->oUserCurrent) {
         return $this->EventErrorDebug();
     }
     /**
      * Пользователь с таким ID существует?
      */
     if (!$this->User_GetUserById($iUserId)) {
         return $this->EventErrorDebug();
     }
     /**
      * Отписываем
      */
     $this->Stream_unsubscribeUser($this->oUserCurrent->getId(), $iUserId);
     $this->Message_AddNotice($this->Lang_Get('common.success.remove'), $this->Lang_Get('common.attention'));
 }
开发者ID:Casper-SC,项目名称:livestreet,代码行数:28,代码来源:ActionStream.class.php

示例8: EventUnsubscribe

 /**
  * Отписка от блога или пользователя
  *
  */
 protected function EventUnsubscribe()
 {
     /**
      * Устанавливаем формат Ajax ответа
      */
     $this->Viewer_SetResponseAjax('json');
     if (!getRequest('id')) {
         $this->Message_AddError($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     $sType = getRequestStr('type');
     $iType = null;
     /**
      * Определяем от чего отписываемся
      */
     switch ($sType) {
         case 'blogs':
             $iType = ModuleUserfeed::SUBSCRIBE_TYPE_BLOG;
             break;
         case 'users':
             $iType = ModuleUserfeed::SUBSCRIBE_TYPE_USER;
             break;
         default:
             $this->Message_AddError($this->Lang_Get('system_error'), $this->Lang_Get('error'));
             return;
     }
     /**
      * Отписываем пользователя
      */
     $this->Userfeed_unsubscribeUser($this->oUserCurrent->getId(), $iType, getRequestStr('id'));
     $this->Message_AddNotice($this->Lang_Get('userfeed_subscribes_updated'), $this->Lang_Get('attention'));
 }
开发者ID:lunavod,项目名称:bunker_stable,代码行数:36,代码来源:ActionUserfeed.class.php

示例9: Update

 /**
  * Обновляет юзера
  *
  * @param ModuleUser_EntityUser $oUser Объект пользователя
  * @return bool
  */
 public function Update(ModuleUser_EntityUser $oUser)
 {
     $sql = "UPDATE " . Config::Get('db.table.user') . "\n      SET\n        user_password = ? ,\n        user_mail = ? ,\n        user_skill = ? ,\n        user_date_activate = ? ,\n        user_date_comment_last = ? ,\n        user_rating = ? ,\n        user_count_vote = ? ,\n        user_activate = ? ,\n                user_activate_key = ? ,\n        user_profile_name = ? ,\n        user_profile_sex = ? ,\n        user_profile_country = ? ,\n        user_profile_region = ? ,\n        user_profile_city = ? ,\n        user_profile_birthday = ? ,\n        user_profile_about = ? ,\n        user_profile_date = ? ,\n        user_profile_avatar = ?  ,\n        user_profile_foto = ? ,\n        user_settings_notice_new_topic = ?  ,\n        user_settings_notice_new_comment = ? ,\n        user_settings_notice_new_talk = ?  ,\n        user_settings_notice_reply_comment = ? ,\n        user_settings_notice_new_friend = ? ,\n        user_settings_timezone = ?\n      WHERE user_id = ?\n    ";
     if ($this->oDb->query($sql, $oUser->getPassword(), $oUser->getMail(), $oUser->getSkill(), $oUser->getDateActivate(), $oUser->getDateCommentLast(), $oUser->getRating(), $oUser->getCountVote(), $oUser->getActivate(), $oUser->getActivateKey(), $oUser->getProfileName(), $oUser->getProfileSex(), $oUser->getProfileCountry(), $oUser->getProfileRegion(), $oUser->getProfileCity(), $oUser->getProfileBirthday(), $oUser->getProfileAbout(), $oUser->getProfileDate(), $oUser->getProfileAvatar(), $oUser->getProfileFoto(), $oUser->getSettingsNoticeNewTopic(), $oUser->getSettingsNoticeNewComment(), $oUser->getSettingsNoticeNewTalk(), $oUser->getSettingsNoticeReplyComment(), $oUser->getSettingsNoticeNewFriend(), $oUser->getSettingsTimezone(), $oUser->getId())) {
         return true;
     }
     return false;
 }
开发者ID:cbrspc,项目名称:LIVESTREET-1-DISTRIB,代码行数:14,代码来源:User.mapper.class.php

示例10: updateUserCat

    protected function updateUserCat(ModuleUser_EntityUser $oUser)
    {
        $sql = 'UPDATE ' . Config::Get('db.table.user') . ' 
			SET 
				user_cat = ?
			WHERE
				user_id = ?d';
        if ($this->oDb->query($sql, $oUser->getCategory(), $oUser->getId()) !== null) {
            return true;
        }
        return false;
    }
开发者ID:lifecom,项目名称:test,代码行数:12,代码来源:User.mapper.class.php

示例11: GetAllowMediaItemsById

 /**
  * Возвращает список media с учетов прав доступа текущего пользователя
  * В методе происходит проверка на права:
  * 1. разрешаем объекты, которые создал пользователь
  * 2. разрешаем объекты, которые связаны таргетом, к которому у пользователя есть доступ на редактирование
  * @param array $aId
  *
  * @return array
  */
 public function GetAllowMediaItemsById($aId)
 {
     $aIdItems = array();
     foreach ((array) $aId as $iId) {
         $aIdItems[] = (int) $iId;
     }
     $aIdItemsAll = $aIdItems;
     if (is_array($aIdItems) and count($aIdItems)) {
         $iUserId = $this->oUserCurrent ? $this->oUserCurrent->getId() : null;
         $aMediaItems = $this->Media_GetMediaItemsByFilter(array('#where' => array('id in (?a) AND ( user_id is null OR user_id = ?d )' => array($aIdItems, $iUserId)), '#index-from-primary'));
         /**
          * Смотрим что осталось
          */
         if (!is_null($iUserId) and $aIdItems = array_diff($aIdItems, array_keys($aMediaItems))) {
             $aMediaAllowIds = array();
             $aTargetMediaGroup = $this->GetTargetItemsByFilter(array('media_id in' => $aIdItems, '#with' => 'media', '#index-group' => 'media_id'));
             $_this = $this;
             foreach ($aTargetMediaGroup as $iMediaId => $aTargetMedia) {
                 /**
                  * Проверяем каждый таргет
                  */
                 foreach ($aTargetMedia as $oTargetMedia) {
                     if ($this->Cache_Remember("media_check_target_{$oTargetMedia->getTargetType()}_{$oTargetMedia->getTargetId()}", function () use($_this, $oTargetMedia, $iUserId) {
                         if ($oTargetMedia->getTargetId()) {
                             return $_this->CheckTarget($oTargetMedia->getTargetType(), $oTargetMedia->getTargetId(), ModuleMedia::TYPE_CHECK_ALLOW_ADD);
                         }
                         if ($oMedia = $oTargetMedia->getMedia() and $oMedia->getUserId() == $iUserId) {
                             return true;
                         }
                         return false;
                     }, false, array(), 'life', true)) {
                         $aMediaAllowIds[] = $oTargetMedia->getMediaId();
                         break;
                     }
                 }
             }
             if ($aMediaAllowIds) {
                 $aMediaItems = $aMediaItems + $this->GetMediaItemsByFilter(array('id in' => $aMediaAllowIds, '#index-from-primary'));
             }
         }
         /**
          * Нужно отсортировать по первоначальному массиву $aIdItems
          */
         $aReturn = array();
         foreach ($aIdItemsAll as $iId) {
             if (isset($aMediaItems[$iId])) {
                 $aReturn[$iId] = $aMediaItems[$iId];
             }
         }
         return $aReturn;
     }
     return array();
 }
开发者ID:pinguo-liguo,项目名称:livestreet,代码行数:62,代码来源:Media.class.php

示例12: EventAjaxSubscribeToggle

 /**
  * Изменение состояния подписки
  */
 protected function EventAjaxSubscribeToggle()
 {
     /**
      * Устанавливаем формат Ajax ответа
      */
     $this->Viewer_SetResponseAjax('json');
     /**
      * Получаем емайл подписки и проверяем его на валидность
      */
     $sMail = getRequestStr('mail');
     if ($this->oUserCurrent) {
         $sMail = $this->oUserCurrent->getMail();
     }
     if (!func_check($sMail, 'mail')) {
         $this->Message_AddError($this->Lang_Get('field.email.notices.error'), $this->Lang_Get('common.error.error'));
         return;
     }
     /**
      * Получаем тип объекта подписки
      */
     $sTargetType = getRequestStr('target_type');
     if (!$this->Subscribe_IsAllowTargetType($sTargetType)) {
         return $this->EventErrorDebug();
     }
     $sTargetId = getRequestStr('target_id') ? getRequestStr('target_id') : null;
     $iValue = getRequest('value') ? 1 : 0;
     $oSubscribe = null;
     /**
      * Есть ли доступ к подписке гостям?
      */
     if (!$this->oUserCurrent and !$this->Subscribe_IsAllowTargetForGuest($sTargetType)) {
         $this->Message_AddError($this->Lang_Get('common.error.need_authorization'), $this->Lang_Get('common.error.error'));
         return;
     }
     /**
      * Проверка объекта подписки
      */
     if (!$this->Subscribe_CheckTarget($sTargetType, $sTargetId, $iValue)) {
         return $this->EventErrorDebug();
     }
     /**
      * Если подписка еще не существовала, то создаем её
      */
     if ($oSubscribe = $this->Subscribe_AddSubscribeSimple($sTargetType, $sTargetId, $sMail, $this->oUserCurrent ? $this->oUserCurrent->getId() : null)) {
         $oSubscribe->setStatus($iValue);
         $this->Subscribe_UpdateSubscribe($oSubscribe);
         $this->Message_AddNotice($this->Lang_Get('common.success.save'), $this->Lang_Get('common.attention'));
         return;
     }
     return $this->EventErrorDebug();
 }
开发者ID:pinguo-liguo,项目名称:livestreet,代码行数:54,代码来源:ActionSubscribe.class.php

示例13: AjaxResponseComment

 /**
  * Получение новых комментариев
  *
  */
 protected function AjaxResponseComment()
 {
     $this->Viewer_SetResponseAjax('json');
     if (!$this->oUserCurrent) {
         $this->Message_AddErrorSingle($this->Lang_Get('need_authorization'), $this->Lang_Get('error'));
         return;
     }
     $idImage = getRequest('idTarget', null, 'post');
     if (!($oImage = $this->PluginLsgallery_Image_GetImageById($idImage))) {
         $this->Message_AddErrorSingle($this->Lang_Get('system_error'), $this->Lang_Get('error'));
         return;
     }
     $idCommentLast = getRequest('idCommentLast', null, 'post');
     $selfIdComment = getRequest('selfIdComment', null, 'post');
     $aComments = array();
     if (getRequest('bUsePaging', null, 'post') && $selfIdComment) {
         $oComment = $this->Comment_GetCommentById($selfIdComment);
         if ($oComment && $oComment->getTargetId() == $oImage->getId() && $oComment->getTargetType() == 'image') {
             $oViewerLocal = $this->Viewer_GetLocalViewer();
             $oViewerLocal->Assign('oUserCurrent', $this->oUserCurrent);
             $oViewerLocal->Assign('bOneComment', true);
             $oViewerLocal->Assign('oComment', $oComment);
             $sText = $oViewerLocal->Fetch("comment.tpl");
             $aCmt = array();
             $aCmt[] = array('html' => $sText, 'obj' => $oComment);
         } else {
             $aCmt = array();
         }
         $aReturn['comments'] = $aCmt;
         $aReturn['iMaxIdComment'] = $selfIdComment;
     } else {
         $aReturn = $this->Comment_GetCommentsNewByTargetId($oImage->getId(), 'image', $idCommentLast);
     }
     $iMaxIdComment = $aReturn['iMaxIdComment'];
     $oImageRead = Engine::GetEntity('PluginLsgallery_ModuleImage_EntityImageRead');
     $oImageRead->setImageId($oImage->getId());
     $oImageRead->setUserId($this->oUserCurrent->getId());
     $oImageRead->setCommentCountLast($oImage->getCountComment());
     $oImageRead->setCommentIdLast($iMaxIdComment);
     $oImageRead->setDateRead();
     $this->PluginLsgallery_Image_SetImageRead($oImageRead);
     $aCmts = $aReturn['comments'];
     if ($aCmts and is_array($aCmts)) {
         foreach ($aCmts as $aCmt) {
             $aComments[] = array('html' => $aCmt['html'], 'idParent' => $aCmt['obj']->getPid(), 'id' => $aCmt['obj']->getId());
         }
     }
     $this->Viewer_AssignAjax('iMaxIdComment', $iMaxIdComment);
     $this->Viewer_AssignAjax('aComments', $aComments);
 }
开发者ID:webnitros,项目名称:ls-plugin_lsgallery,代码行数:54,代码来源:ActionGallery.class.php

示例14: CanPostTestimonialTime

 /**
  * Проверяет может ли пользователь создавать запись по времени
  */
 public function CanPostTestimonialTime(ModuleUser_EntityUser $oUser)
 {
     // Для администраторов ограничение по времени не действует
     if ($oUser->isAdministrator() or Config::Get('plugin.testimonials.acl.create.limit_time') == 0 or $oUser->getRating() >= Config::Get('plugin.testimonials.acl.create.limit_time_rating')) {
         return true;
     }
     /**
      * Проверяем, если топик опубликованный меньше чем acl.create.topic.limit_time секунд назад
      */
     $aTestimonials = $this->PluginTestimonials_Testimonials_GetTestimonialsItemsByFilter(array('#page' => array(1, 20), '#order' => array('id' => 'desc'), 'user_id' => $oUser->getId(), 'date_add >' => date("Y-m-d H:i:s", time() - Config::Get('plugin.testimonials.acl.create.limit_time'))));
     if (isset($aTestimonials['count']) and $aTestimonials['count'] > 0) {
         return false;
     }
     return true;
 }
开发者ID:vakulesh,项目名称:testimonials,代码行数:18,代码来源:ACL.class.php

示例15: CheckTargetTopicNewComment

 /**
  * Проверка объекта подписки с типом "topic_new_comment"
  * Название метода формируется автоматически
  *
  * @param int $iTargetId    ID владельца
  * @param int $iStatus      Статус
  *
  * @return bool
  */
 public function CheckTargetTopicNewComment($iTargetId, $iStatus)
 {
     if ($oTopic = E::ModuleTopic()->GetTopicById($iTargetId)) {
         /**
          * Топик может быть в закрытом блоге, поэтому необходимо разрешить подписку только если пользователь в нем состоит
          * Отписываться разрешаем с любого топика
          */
         if ($iStatus == 1 && $oTopic->getBlog()->IsPrivate()) {
             if (!$this->oUserCurrent || !($oTopic->getBlog()->getOwnerId() == $this->oUserCurrent->getId() || E::ModuleBlog()->GetBlogUserByBlogIdAndUserId($oTopic->getBlogId(), $this->oUserCurrent->getId()))) {
                 return false;
             }
         }
         return true;
     }
     return false;
 }
开发者ID:hard990,项目名称:altocms,代码行数:25,代码来源:Subscribe.class.php


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