コード例 #1
0
ファイル: profile.php プロジェクト: sinfocol/gwf3
if (isset($data['WC_HIDE_SCORE'])) {
    echo gwfProfileRow(WC_HTML::lang('th_score'), $wechall->lang('hidden'));
} else {
    echo gwfProfileRow(WC_HTML::lang('th_score'), GWF_HTML::anchor(GWF_WEB_ROOT . 'stats/' . $u->urlencode('user_name'), $u->getVar('user_level')));
}
if (isset($data['WC_HIDE_RANK'])) {
    echo gwfProfileRow(WC_HTML::lang('th_rank2'), $wechall->lang('hidden'));
} else {
    $rank = WC_RegAt::calcRank($u);
    echo gwfProfileRow(WC_HTML::lang('th_rank2'), GWF_HTML::anchor(GWF_WEB_ROOT . 'ranking/player/' . $u->urlencode2('user_name') . '#rank_' . $rank, $rank));
}
if ($u->getVar('user_countryid') !== '0') {
    if (isset($data['WC_HIDE_RANK'])) {
        echo gwfProfileRow(WC_HTML::lang('th_crank'), $wechall->lang('hidden'));
    } else {
        $cRank = WC_Regat::calcCountryRank($u);
        $href_crank = GWF_WEB_ROOT . 'country_ranking/player/' . $u->urlencode2('user_name') . '#rank_' . $cRank;
        echo gwfProfileRow(WC_HTML::lang('th_crank'), GWF_HTML::anchor($href_crank, $cRank));
    }
}
echo gwfProfileRow($tLang->lang('th_registered'), GWF_Time::displayDate($u->getVar('user_regdate')));
if ($u->isOptionEnabled(GWF_User::HIDE_ONLINE)) {
    $lastactivity = GWF_HTML::lang('unknown');
} else {
    $lastactivity = GWF_Time::displayTimestamp($u->getVar('user_lastactivity'));
}
echo gwfProfileRow($tLang->lang('th_last_active'), $lastactivity);
echo gwfProfileRow($tLang->lang('th_views'), $p->getVar('prof_views'));
if ('' !== ($v = $p->display('prof_firstname'))) {
    echo gwfProfileRow($tLang->lang('th_firstname'), $v);
}
コード例 #2
0
ファイル: WC_Site.php プロジェクト: sinfocol/gwf3
 /**
  * Calculate the % solved (0-1)
  * @param WC_Regat $regat
  * @return double
  */
 public function calcPercent(WC_Regat $regat)
 {
     if ('0' === ($maxscore = $this->getOnsiteScore())) {
         return 0;
     }
     return $regat->getOnsiteScore() / $maxscore;
 }