Exemple #1
0
 private function templateLevels()
 {
     $bid = $this->box->getID();
     $_GET['sid'] = $this->box->getSiteID();
     $_GET['bid'] = $bid;
     $tVars = array('site_quickjump' => $this->module->templateSiteQuickjump('boxdetail'), 'data' => $this->getData(), 'box' => $this->box, 'site' => $this->box->getSite(), 'method' => $this, 'sort_url' => GWF_WEB_ROOT . 'index.php?mo=WeChall&me=WarboxDetails&boxid=' . $bid . '&by=%BY%&dir=%DIR%');
     return $this->module->templatePHP('warbox_details.php', $tVars);
 }
Exemple #2
0
 private function templatePlayers()
 {
     $bid = $this->box->getID();
     $_GET['sid'] = $this->box->getSiteID();
     $_GET['bid'] = $bid;
     $table = GDO::table('WC_Warflags');
     $where = "wf_wbid={$bid} AND wf_solved_at IS NOT NULL";
     $orderby = 'score DESC, solvedate ASC';
     $joins = array('flag', 'flagbox', 'solvers');
     $ipp = 50;
     $nItems = $table->countRows($where, $joins, 'user_name');
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     $page = Common::clamp(Common::getGetInt('page', 1), 1, $nPages);
     $from = GWF_PageMenu::getFrom($page, $ipp);
     $tVars = array('site_quickjump' => $this->module->templateSiteQuickjump('boxranking'), 'data' => $table->selectAll("user_name, user_countryid country, COUNT(*) solved, SUM(wf_score) score, SUM(wf_score)/{$this->box->getVar('wb_totalscore')}*100 percent, MAX(wf_solved_at) solvedate", $where, $orderby, $joins, $ipp, $from, GDO::ARRAY_A, 'user_name'), 'box' => $this->box, 'playercount' => $nItems, 'rank' => $from + 1, 'pagemenu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'index.php?mo=WeChall&me=WarboxPlayers&boxid=' . $bid . '&page=%PAGE%'));
     return $this->module->templatePHP('warbox_players.php', $tVars);
 }