本文整理匯總了PHP中GWF_User::getInt方法的典型用法代碼示例。如果您正苦於以下問題:PHP GWF_User::getInt方法的具體用法?PHP GWF_User::getInt怎麽用?PHP GWF_User::getInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GWF_User
的用法示例。
在下文中一共展示了GWF_User::getInt方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: displayIcons
public static function displayIcons(GWF_User $user)
{
$back = '';
$db = gdo_db();
$uid = $user->getInt('user_id');
$regats = GWF_TABLE_PREFIX . 'wc_regat';
$query = "SELECT regat_sid, regat_solved FROM {$regats} WHERE regat_uid={$uid}";
if (false === ($result = $db->queryRead($query))) {
return '';
}
$i = 0;
while (false !== ($row = $db->fetchRow($result))) {
if (0.05 > ($solved = floatval($row[1]))) {
continue;
}
if (++$i % 5 === 0) {
$back .= '<br/>' . PHP_EOL;
}
$siteid = (int) $row[0];
$site = WC_Site::getByID($siteid);
$back .= $site->displayLogoUN($user->getVar('user_name'), $solved, 6, 28, true) . PHP_EOL;
}
$db->free($result);
return $back;
}
示例2: calcRank
/**
* Calcs the shared rank. Multiple users can share one rank in theory.
* @param GWF_User $user
* @return int
*/
public static function calcRank(GWF_User $user)
{
$score = $user->getInt('user_level');
return $user->countRows("user_level>{$score} AND user_options&0x10000000=0") + 1;
}