Beispiel #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;
 }