public function getModerators($con)
 {
     $moderators = array();
     $users = ForumUser::getAll($con);
     foreach ($users as $user) {
         if ($user->isModerating($this)) {
             $moderators[] = $user;
         }
     }
     if (!$this instanceof Category && $this->getParent() != null) {
         $moderators = array_merge($moderators, $this->getParent()->getModerators($con));
     }
     return $moderators;
 }
Example #2
0
         $board = Board::getByID(intval(str_replace("b", "", $_GET["d"])));
         if ($board != null) {
             if ($currentUser->hasPermission($delete_boards, $board)) {
                 $board->delete($con);
                 $successes[] = "Removed board: " . $board->name;
             }
         }
     } else {
         if (strstr($_GET["d"], "p")) {
             $post = Post::getByID(intval(str_replace("p", "", $_GET["d"])));
             if ($post != null) {
                 if ($currentUser->hasPermission($permission["post_delete"], $post)) {
                     $thread = Thread::getByID($post->fields["Parent"]);
                     if ($post->getID() == $thread->getFirstPost()->getID()) {
                         $thread = Thread::getByID($post->fields["Parent"]);
                         $users = ForumUser::getAll($con);
                         foreach ($users as $user) {
                             $user->unWatch($thread, $con);
                         }
                         $thread->delete($con);
                         $successes[] = "Removed thread: " . $thread->name;
                     } else {
                         $successes[] = "Removed post from thread: " . $post->name;
                         $post->delete($con);
                     }
                 }
             }
         }
     }
 }
 header("Location: " . $_SERVER['PHP_SELF']);
Example #3
0
 /**
  * @return Array<ForumUser> Gets an array of ForumUsers who are watching this thread.
  */
 public function getWatching($con)
 {
     $returnArray = array();
     $users = ForumUser::getAll($con);
     foreach ($users as $watchingUser) {
         if ($watchingUser->isWatching($this)) {
             $returnArray[] = $watchingUser;
         }
     }
     return $returnArray;
 }