echo '<span class="ib">' . GWF_Select::display('iso', $data, $tVars['iso'], "window.location=GWF_WEB_ROOT+'lang_ranking/'+this.value;") . '</span>' . PHP_EOL; echo sprintf('<input type="submit" name="cmd" value="%s" />', $tLang->lang('btn_quickjump')) . PHP_EOL; echo '</div></div>' . PHP_EOL; echo '</form>' . PHP_EOL; $headers = array(array($tLang->lang('th_rank')), array(), array($tLang->lang('th_user_name')), array($tLang->lang('th_score')), array($tLang->lang('th_progress'))); echo $tVars['page_menu'] . PHP_EOL; echo GWF_Table::start(); $hl_rank = $tVars['hlrank']; $rank = $tVars['rank']; echo GWF_Table::displayHeaders2($headers) . PHP_EOL; $solvetext = ' solved '; $ontxt = ' on '; foreach ($tVars['users'] as $user) { $user instanceof GWF_User; $username = $user->displayUsername(); $style = $rank === $hl_rank ? WC_HTML::styleSelected() : ''; echo GWF_Table::rowStart(true, '', '', $style); echo sprintf('<td class="gwf_num">%s</td>', $rank); echo sprintf('<td>%s</td>', $user->displayCountryFlag()); echo sprintf('<td><a href="%s" title="%s">%s</a></td>', $user->getProfileHREF(), $tLang->lang('a_title', array($user->getVar('user_level'), $username)), $user->displayUsername()); echo sprintf('<td class="gwf_num">%s</td>', $user->getVar('sum')); echo '<td>'; foreach ($tVars['sites'] as $site) { $site instanceof WC_Site; // echo $site->displayName(); $sid = $site->getVar('site_id'); $var = 'ss_' . $sid; if ($user->hasVar($var)) { $solved = $user->getVar($var); $percent = round($solved * 100, 2); $txt = $username . $solvetext . $percent . '%' . $ontxt . $site->display('site_name');
<?php echo GWF_Box::box($tLang->lang('pi_csrank'), $tLang->lang('pt_csrank')); WC_HTML::rankingPageButtons(); $headers = array(array('#', null, null, 2), array('', null, null, 1), array($tLang->lang('th_user_countryid'), 'countryname', 'ASC', 3), array($tLang->lang('th_players'), 'users', 'DESC', 6), array($tLang->lang('th_score'), 'totalscore', 'DESC', 4), array($tLang->lang('th_spc'), 'spc', 'DESC', 7), array($tLang->lang('th_avg'), 'avg', 'DESC', 8), array($tLang->lang('th_sumtop3'), 'top3', 'DESC', 9), array($tLang->lang('th_top_player'), 'topuser', 'ASC', 5)); $rank = 1; $hlc = $tVars['highlight_country']; echo GWF_Table::start(); echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']); $sl = WC_HTML::styleSelected(); foreach ($tVars['data'] as $row) { $cid = $row['country_id']; $topuser = $row['topuser']; $style = $hlc == $cid ? $sl : ''; $href = GWF_WEB_ROOT . 'country_ranking/for/' . $cid . '/' . Common::urlencodeSEO($row['countryname']); echo GWF_Table::rowStart(true, '', '', $style); echo sprintf('<td class="gwf_num">%d</td>', $rank++); echo sprintf('<td>%s</td>', GWF_Country::displayFlagS2($cid, $row['countryname'])); echo sprintf('<td><a href="%s">%s</a></td>', $href, GWF_HTML::display($row['countryname'])); echo sprintf('<td class="gwf_num">%d</td>', $row['users']); echo sprintf('<td class="gwf_num">%d</td>', $row['totalscore']); echo sprintf('<td class="gwf_num">%s</td>', $row['spc']); echo sprintf('<td class="gwf_num">%d</td>', $row['avg']); echo sprintf('<td class="gwf_num">%d</td>', $row['top3']); echo sprintf('<td><a href="%s" title="%s">%s</a></td>', GWF_WEB_ROOT . 'profile/' . urlencode($topuser), $tLang->lang('a_title', array($row['topscore'])), GWF_HTML::display($topuser)); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo GWF_Box::box($tLang->lang('scorefaq_box', GWF_WEB_ROOT . 'scoring_faq'));
$samerank = $rank; $samescore = 0; echo $tVars['pagemenu']; echo '<table>' . PHP_EOL; // echo '<thead>'.PHP_EOL; echo GWF_Table::displayHeaders2($headers); // echo '</thead>'.PHP_EOL; foreach ($tVars['userdata'] as $user) { $user instanceof GWF_User; // var_dump($user->getGDOData()); $score = $user->getLevel(); if ($score !== $samescore) { $samerank = $rank; $samescore = $score; } $style = $samerank === $highlight_rank ? WC_HTML::styleSelected() : ''; echo GWF_Table::rowStart(true, '', 'rank_' . $rank, $style); echo sprintf('<td>%s</td>', $samerank) . PHP_EOL; echo sprintf('<td>%s</td>', $user->displayCountryFlag()) . PHP_EOL; echo sprintf('<td>%s</td>', $user->displayProfileLink()) . PHP_EOL; echo sprintf('<td class="gwf_num">%s</td>', $user->getVar('nlinks')); echo sprintf('<td class="gwf_num">%s</td>', $user->getLevel()) . PHP_EOL; foreach ($tVars['langs'] as $i => $lang) { if ($user->hasVar('grank_' . $lang)) { $anchor = GWF_HTML::anchor(GWF_WEB_ROOT . 'lang_ranking/' . $isos[$i] . '/for/' . $user->urlencode2('user_name'), $user->getVar('grank_' . $lang, '')); } else { $anchor = ''; } echo sprintf('<td class="gwf_num">%s</td>', $anchor) . PHP_EOL; } echo GWF_Table::rowEnd();