Пример #1
0
 /**
  * 发送消息给关注用户
  * @param null $rt
  * @param int  $f_id 被关注ID
  * @param int  $u_id 关注者ID
  * @return null
  */
 public function message_follow_me($rt, $f_id, $u_id)
 {
     try {
         if ($this->notice($f_id, 'message', 'follow_me')) {
             $user = User::getUser($u_id);
             $follow_user = User::getUser($f_id);
             $mt = new MailTemplate("message_notice/follow_me.md");
             $mt->setUserInfo($follow_user->getInfo());
             $mt->setValues(['follow_user_aliases' => $user->getAliases(), 'follow_user_url' => user_link($user->getName()), 'follow_list_link' => get_url('Follow', 'ta'), 'follow_user_name' => $user->getName()]);
             $this->message->addNoticeMsg($mt->getTitle(), $mt->getContent(), $f_id);
         }
     } catch (\Exception $ex) {
         Log::write(_("Message to message_follow_me create a Exception.") . "EX:[" . $ex->getCode() . "]:" . $ex->getMessage(), Log::NOTICE);
     }
     return $rt;
 }
Пример #2
0
 public function message_del()
 {
     try {
         $this->throwMsgCheck('is_post');
         $req = req()->_plain();
         $this->__lib('Message');
         $ms = new Message();
         $ms->SystemDelete($req->post('id'));
         $this->rt_msg['status'] = true;
     } catch (\Exception $ex) {
         $this->rt_msg['msg'] = $ex->getMessage();
         $this->rt_msg['code'] = $ex->getCode();
     }
 }
Пример #3
0
 public function message_read_flag()
 {
     try {
         $this->throwMsgCheck('is_post', 'is_login');
         $this->__lib('Message');
         $m = new Message();
         $req = req()->_plain();
         $m->set_read($req->post('id'), login_user()->getId());
         $this->rt_msg['status'] = true;
     } catch (\Exception $ex) {
         $this->rt_msg['msg'] = $ex->getMessage();
         $this->rt_msg['code'] = $ex->getCode();
     }
 }