public static function logModerateForumPost($operation, $post, $user = null) { // ideally should log post_id as well but current phpbb logging doesn't // log it and I'm just matching with whatever it's doing. Except post // title - phpbb uses actual post title which are all empty for recent // posts but this one use topic's. return static::logModerateForumTopic($operation, $post->topic, $user); }
public function removePost($post, $user = null) { DB::transaction(function () use($post, $user) { $post->delete(); if ($this->posts()->exists() === true) { $this->refreshCache(); } else { $this->deleteWithCover(); } if ($this->forum !== null) { $this->forum->refreshCache(); } if ($post->user !== null) { $post->user->refreshForumCache(); } if ($user !== null && $user->user_id !== $post->poster_id && $user->isAdmin() === true) { Log::logModerateForumPost('LOG_DELETE_POST', $post); } }); return true; }