/**
  * Обновляет юзера
  *
  * @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;
 }
예제 #2
0
 /**
  * Отправляет юзеру уведомление о новом комментарии в его топике
  *
  * @param ModuleUser_EntityUser $oUserTo	Объект пользователя кому отправляем
  * @param ModuleTopic_EntityTopic $oTopic	Объект топика
  * @param ModuleComment_EntityComment $oComment	Объект комментария
  * @param ModuleUser_EntityUser $oUserComment	Объект пользователя, написавшего комментарий
  * @return bool
  */
 public function SendCommentNewToAuthorTopic(ModuleUser_EntityUser $oUserTo, ModuleTopic_EntityTopic $oTopic, ModuleComment_EntityComment $oComment, ModuleUser_EntityUser $oUserComment)
 {
     /**
      * Проверяем можно ли юзеру рассылать уведомление
      */
     if (!$oUserTo->getSettingsNoticeNewComment()) {
         return false;
     }
     $this->Send($oUserTo, 'notify.comment_new.tpl', $this->Lang_Get('notify_subject_comment_new'), array('oUserTo' => $oUserTo, 'oTopic' => $oTopic, 'oComment' => $oComment, 'oUserComment' => $oUserComment));
     return true;
 }
예제 #3
0
 /**
  * Отправляет юзеру уведомление о новом комментарии в его топике
  *
  * @param ModuleUser_EntityUser $oUserTo
  * @param ModuleTopic_EntityTopic $oTopic
  * @param CommentEntity_TopicComment $oComment
  * @param ModuleUser_EntityUser $oUserComment
  */
 public function SendCommentNewToAuthorTopic(ModuleUser_EntityUser $oUserTo, ModuleTopic_EntityTopic $oTopic, ModuleComment_EntityComment $oComment, ModuleUser_EntityUser $oUserComment)
 {
     /**
      * Проверяем можно ли юзеру рассылать уведомление
      */
     if (!$oUserTo->getSettingsNoticeNewComment()) {
         return;
     }
     /**
      * Передаём в шаблон переменные
      */
     $this->oViewerLocal->Assign('oUserTo', $oUserTo);
     $this->oViewerLocal->Assign('oTopic', $oTopic);
     $this->oViewerLocal->Assign('oComment', $oComment);
     $this->oViewerLocal->Assign('oUserComment', $oUserComment);
     /**
      * Формируем шаблон
      */
     $sBody = $this->oViewerLocal->Fetch($this->GetTemplatePath('notify.comment_new.tpl'));
     /**
      * Если в конфигураторе указан отложенный метод отправки, 
      * то добавляем задание в массив. В противном случае,
      * сразу отсылаем на email
      */
     if (Config::Get('module.notify.delayed')) {
         $oNotifyTask = Engine::GetEntity('Notify_Task', array('user_mail' => $oUserTo->getMail(), 'user_login' => $oUserTo->getLogin(), 'notify_text' => $sBody, 'notify_subject' => $this->Lang_Get('notify_subject_comment_new'), 'date_created' => date("Y-m-d H:i:s"), 'notify_task_status' => self::NOTIFY_TASK_STATUS_NULL));
         if (Config::Get('module.notify.insert_single')) {
             $this->aTask[] = $oNotifyTask;
         } else {
             $this->oMapper->AddTask($oNotifyTask);
         }
     } else {
         /**
          * Отправляем мыло
          */
         $this->Mail_SetAdress($oUserTo->getMail(), $oUserTo->getLogin());
         $this->Mail_SetSubject($this->Lang_Get('notify_subject_comment_new'));
         $this->Mail_SetBody($sBody);
         $this->Mail_setHTML();
         $this->Mail_Send();
     }
 }
예제 #4
0
    public function Update(ModuleUser_EntityUser $oUser)
    {
        $sql = 'UPDATE ' . Config::Get('db.table.user') . '
			SET
				user_settings_notice_new_topic = ?,
				user_settings_notice_new_comment = ?,
				user_settings_notice_new_talk = ?,
				user_settings_notice_reply_comment = ?,
				user_settings_notice_new_friend = ?,
				user_settings_notice_new_topic_commented = ?,
				user_settings_notice_friend_news = ?,
				user_settings_notice_request = ?,
				user_settings_notice_new_comment_blogs_subscribe = ?,
				user_settings_notice_new_gift = ?,
				user_settings_notice_frequency = ?,
				user_settings_notice_new_user_blogs_subscribe = ?
			WHERE user_id = ?
		';
        if ($this->oDb->query($sql, $oUser->getSettingsNoticeNewTopic(), $oUser->getSettingsNoticeNewComment(), $oUser->getSettingsNoticeNewTalk(), $oUser->getSettingsNoticeReplyComment(), $oUser->getSettingsNoticeNewFriend(), $oUser->getSettingsNoticeNewTopicCommented(), $oUser->getSettingsNoticeFriendNews(), $oUser->getSettingsNoticeRequest(), $oUser->getSettingsNoticeNewCommentBlogsSubscribe(), $oUser->getSettingsNoticeNewGift(), $oUser->getSettingsNoticeFrequency(), $oUser->getSettingsNoticeNewUserBlogsSubscribe(), $oUser->getId()) !== null) {
            return parent::Update($oUser);
        }
        return false;
    }
예제 #5
0
 /**
  * Отправляет юзеру уведомление о новом комментарии в его топике
  *
  * @param ModuleUser_EntityUser       $oUserTo         Объект пользователя кому отправляем
  * @param ModuleTopic_EntityTopic     $oTopic          Объект топика
  * @param ModuleComment_EntityComment $oComment        Объект комментария
  * @param ModuleUser_EntityUser       $oUserComment    Объект пользователя, написавшего комментарий
  *
  * @return bool
  */
 public function SendCommentNewToAuthorTopic(ModuleUser_EntityUser $oUserTo, ModuleTopic_EntityTopic $oTopic, ModuleComment_EntityComment $oComment, ModuleUser_EntityUser $oUserComment)
 {
     /**
      * Автор топика не должен получать уведомлений о своём комментарии
      * к своему же топику
      */
     if ($oUserTo->getId() == $oComment->getUserId()) {
         return false;
     }
     /**
      * Проверяем можно ли юзеру рассылать уведомление
      */
     if (!$oUserTo->getSettingsNoticeNewComment()) {
         return false;
     }
     return $this->Send($oUserTo, 'comment_new.tpl', E::ModuleLang()->Get('notify_subject_comment_new'), array('oUserTo' => $oUserTo, 'oTopic' => $oTopic, 'oComment' => $oComment, 'oUserComment' => $oUserComment));
 }