private function move($dir = -1, $bid) { if (false === ($board = GWF_ForumBoard::getBoard($bid))) { return $this->module->error('err_board'); } if ($board->isRoot()) { return GWF_HTML::err('ERR_PARAMETER', array(__FILE__, __LINE__, 'board_is_root')); } $myPos = $board->getVar('board_pos'); $pid = $board->getVar('board_pid'); $cmp = $dir === 1 ? '>' : '<'; $orderby = $dir === 1 ? 'board_pos ASC' : 'board_pos DESC'; if (false === ($swap = $board->selectFirstObject('*', "board_pid={$pid} AND board_pos{$cmp}{$myPos}", $orderby))) { return $this->module->requestMethodB('Forum'); } $swapPos = $swap->getVar('board_pos'); if (false === $board->saveVar('board_pos', $swapPos)) { return GWF_HTML::err('ERR_DATABASE', __FILE__, __LINE__); } if (false === $swap->saveVar('board_pos', $myPos)) { return GWF_HTML::err('ERR_DATABASE', __FILE__, __LINE__); } $this->cleanupPositions(); $this->module->setCurrentBoard(GWF_ForumBoard::getBoard($pid)); GWF_ForumBoard::init(true, true); return $this->module->requestMethodB('Forum'); }
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 static function onCronjob(Module_Forum $module) { GWF_ForumBoard::init(false, true); self::start('Forum'); // self::autoModeration($module); self::emailSubscription($module); self::fixCounters($module); self::end('Forum'); }
public function execute() { GWF_ForumBoard::init(true); if (false !== ($error = $this->sanitize())) { return $error; } GWF_Website::addJavascript(GWF_WEB_ROOT . 'js/module/Forum/gwf_forum.js'); if ($this->module->cfgUseGTranslate()) { GWF_Website::addJavascript(Common::getProtocol() . '://www.google.com/jsapi'); GWF_Website::addJavascriptInline('google.load("language", "1");'); } GWF_Website::setPageTitle($this->module->lang('pt_thread', array($this->thread->getBoard()->getVar('board_title'), $this->thread->getVar('thread_title')))); return $this->templateThread(); }
public function execute() { if (false !== ($mod_forum = GWF_Module::getModule('Forum', true))) { $mod_forum->onInclude(); GWF_ForumBoard::init(false); } if (false !== Common::getPost('quicktranslate')) { return $this->onQuickTranslate(); } $newsid = (int) Common::getGet('newsid', '0'); $langid = (int) Common::getGet('langid', '0'); if (false === ($news = GWF_News::getNewsItem($newsid))) { return $this->module->error('err_news'); } // if (false === ($news->loadTranslations())) { // return GWF_HTML::err('ERR_UNKNOWN_LANGUAGE'); // } if (false === ($lang = GWF_Language::getByID($langid))) { return GWF_HTML::err('ERR_UNKNOWN_LANGUAGE'); } if (!GWF_Language::isSupported($langid)) { return GWF_HTML::err('ERR_UNKNOWN_LANGUAGE'); } $this->news = $news; $this->lang = $lang; if (false !== Common::getPost('edit')) { return $this->onEdit() . $this->templateEdit(); } if (false !== Common::getPost('translate')) { return $this->onTranslate(); } if (false !== Common::getPost('preview')) { return $this->onPreview(); } return $this->templateEdit(); }
public static function includeForums() { if (false !== GWF_Module::loadModuleDB('Forum', true)) { GWF_ForumBoard::init(true); } }
echo $tLang->lang('it_graph_sitechalls', array($name)); ?> " alt="<?php echo $tLang->lang('it_graph_sitechalls', array($name)); ?> "></img></div> <?php } ?> <?php #} ?> <div class="cl"></div> <?php } ?> <?php if ('0' !== ($tid = $site->getVar('site_threadid'))) { $_GET['tid'] = $tid; $_GET['last_page'] = true; if (false !== ($forum = GWF_Module::loadModuleDB('Forum', true, true))) { GWF_ForumBoard::init(true, false); echo $forum->requestMethodB('ShowThread'); } } $dtitle = $site->getVar('site_name'); $args = array($dtitle); GWF_Website::setPageTitle($tLang->lang('pt_site_detail', $args)); GWF_Website::setMetaTags($tLang->lang('mt_site_detail', $args)); GWF_Website::setMetaDescr($tLang->lang('md_site_detail', $args));
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); } }
<?php GWF_Module::loadModuleDB('Forum', true); GWF_ForumBoard::init(true); $show_tags_and_filters = is_array($tVars['tags']); $solved_bits = $tVars['solved_bits']; $challs = array(); foreach ($tVars['challs'] as $chall) { if (isset($solved_bits[$chall->getID()])) { if (!$tVars['sel_unsolved']) { $challs[] = $chall; } } else { if (!$tVars['sel_solved']) { $challs[] = $chall; } } } $by = $tVars['by']; $dir = $tVars['dir']; if ($show_tags_and_filters) { $cloud = ''; $cloud .= '<div class="gwf_tags_outer">' . PHP_EOL; $cloud .= '<div class="gwf_tags">' . PHP_EOL; $cloud_tags = ''; foreach ($tVars['tags'] as $tag => $count) { $count = 0; foreach ($challs as $chall) { $chall instanceof WC_Challenge; if ($chall->hasTag($tag)) { $count++;
public function onCreateSite(Module_WeChall $module, &$back = '') { if (!$this->insert()) { $back = GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } elseif (!self::onCreateVotes()) { $back = GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } elseif (!self::onCreateBoard()) { $back = GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } elseif (!GWF_ForumBoard::init(true, true) || !self::onCreateThread($module)) { $back = GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } else { return true; } return false; }