Exemple #1
0
 public function getPageForSession($ipp, $user)
 {
     if ($user === false || $user->isWebspider() || $user->isOptionEnabled(0x10000000)) {
         return array(1, 1);
     }
     $rank = WC_RegAt::calcExactRank($user);
     $page = GWF_PageMenu::getPageForPos($rank, $ipp);
     return array($page, WC_RegAt::calcRank($user));
 }
Exemple #2
0
 public static function insertEntry(GWF_User $user, WC_Site $site, $onsitescore, $comment)
 {
     $user = GWF_User::getByID($user->getID());
     $max = $site->getOnsiteScore();
     $perc = $max <= 0 ? 0 : round($onsitescore / $max * 10000);
     $entry = new self(array('userhist_uid' => $user->getVar('user_id'), 'userhist_date' => time(), 'userhist_sid' => $site->getVar('site_id'), 'userhist_percent' => $perc, 'userhist_onsitescore' => $onsitescore, 'userhist_rank' => WC_RegAt::calcRank($user), 'userhist_totalscore' => $user->getVar('user_level'), 'userhist_comment' => $comment));
     if (WECHALL_DEBUG_SCORING) {
         echo WC_HTML::message('Inserting User History entry...');
     }
     return $entry->insert();
 }
Exemple #3
0
if ($u->hasAvatar()) {
    echo gwfProfileRow($tLang->lang('th_user_avatar'), $u->displayAvatar());
}
if ($u->hasCountry()) {
    echo gwfProfileRow($tLang->lang('th_user_country'), $u->displayCountryFlag(true));
}
echo gwfProfileRow($tLang->lang('th_user_name'), $u->displayUsername());
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 {