コード例 #1
0
ファイル: NonVuService.php プロジェクト: teraelis/forum
 protected function getQuotedUsersComment(Comment $comment)
 {
     $body = $comment->getBody();
     $arrayUserId = [];
     preg_match_all('#\\[quote="([0-9]+)"\\].*[/quote]#', $body, $matches);
     if (isset($matches['1'])) {
         foreach ($matches['1'] as $q) {
             $arrayUserId[] = $q;
         }
     }
     return $arrayUserId;
 }
コード例 #2
0
ファイル: PostExtension.php プロジェクト: teraelis/forum
 public function shortComment(Comment $post)
 {
     $res = $post->getBody();
     return strlen($res) > 150 ? mb_substr($res, 0, 150) . "..." : $res;
 }