public static function single($name, $selected = '0') { GWF_ForumBoard::init(true); $back = sprintf('<select name="%s">', htmlspecialchars($name)); self::singleB(GWF_ForumBoard::getRoot(), $back, 0, $selected); $back .= '</select>' . PHP_EOL; return $back; }
public function onRequestInit() { GWF_ForumBoard::init(); # Init by Post if (0 !== ($this->post_id = (int) Common::getGet('pid', 0))) { if (false === ($this->post = GWF_ForumPost::getPost($this->post_id))) { $this->post_id = 0; } elseif (false !== ($this->thread = $this->post->getThread())) { $this->thread_id = $this->thread->getID(); if (false !== ($this->board = $this->thread->getBoard())) { $this->board_id = $this->board->getID(); } } } elseif (0 !== ($this->thread_id = (int) Common::getGet('tid', 0))) { if (false === ($this->thread = GWF_ForumThread::getThread($this->thread_id))) { $this->thread_id = 0; } elseif (false !== ($this->board = $this->thread->getBoard())) { $this->board_id = $this->board->getID(); } } else { $this->board_id = Common::getGetString('bid', '1'); if (false === ($this->board = GWF_ForumBoard::getBoard($this->board_id))) { $this->board_id = '1'; if (false === ($this->board = GWF_ForumBoard::getRoot())) { $this->board_id = '0'; } } } if ($this->thread_id !== 0 && 0 < ($cut = $this->cfgWatchTimeout())) { GWF_ForumVisitors::setWatching($this->thread, $cut); } }