예제 #1
0
파일: Ranking.php 프로젝트: sinfocol/gwf3
 private function templateRanking($user)
 {
     require_once GWF_CORE_PATH . 'module/WeChall/WC_RegAt.php';
     $users = GDO::table('GWF_User');
     $ipp = $this->module->cfgItemsPerPage();
     $nItems = $users->countRows("user_level>0");
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     if (false === ($page = Common::getGet('page'))) {
         list($page, $rank) = $this->getPageForSession($ipp, $user);
     } else {
         $page = Common::clamp(intval($page), 1, $nPages);
         $rank = $user === false || $user->isOptionEnabled(0x10000000) ? 1 : WC_RegAt::calcExactRank($user);
     }
     //		var_dump($page);
     //		var_dump($rank);
     $from = GWF_PageMenu::getFrom($page, $ipp);
     $href = GWF_WEB_ROOT . 'ranking/page-%PAGE%';
     GWF_Website::setPageTitle($this->module->lang('pt_ranking', array($page)));
     GWF_Website::setMetaTags($this->module->lang('mt_ranking'));
     $userdata = $this->selectUsers($ipp, $from);
     $tVars = array('rank' => $from + 1, 'highlight_rank' => $rank, 'langs' => WC_Site::getLangs(), 'userdata' => $userdata, 'pagemenu' => GWF_PageMenu::display($page, $nPages, $href));
     return $this->module->templatePHP('ranking.php', $tVars);
 }