當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GWF_User::setVar方法代碼示例

本文整理匯總了PHP中GWF_User::setVar方法的典型用法代碼示例。如果您正苦於以下問題:PHP GWF_User::setVar方法的具體用法?PHP GWF_User::setVar怎麽用?PHP GWF_User::setVar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GWF_User的用法示例。


在下文中一共展示了GWF_User::setVar方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: selectUsers

 /**
  * Select Users For Global Ranking.
  * @param int $count
  * @param int $from
  * @return array
  */
 private function selectUsers($count, $from)
 {
     $db = gdo_db();
     $count = (int) $count;
     $from = (int) $from;
     $regat = GDO::table('WC_RegAt')->getTableName();
     $users = GDO::table('GWF_User')->getTableName();
     $query = "SELECT user_id,user_name,user_level,SUM(regat_score) AS lts, COUNT(regat_score) AS nlinks, regat_langid,user_countryid FROM {$regat} AS B JOIN (SELECT user_id,user_name,user_level,user_countryid FROM {$users} WHERE user_options&0x10000000=0 ORDER BY user_level DESC, user_id ASC LIMIT {$from}, {$count}) AS C ON user_id=regat_uid GROUP by user_id,regat_langid ORDER BY user_level DESC, user_id ASC";
     $back = array();
     if (false === ($result = $db->queryRead($query))) {
         return $back;
     }
     $current = false;
     while (false !== ($row = $db->fetchAssoc($result))) {
         if ($current === false) {
             $current = new GWF_User($row);
             $current->setVar('nlinks', 0);
             $back[] = $current;
         } elseif ($current->getVar('user_id') !== $row['user_id']) {
             if (count($back) === $count) {
                 break;
             }
             $current = new GWF_User($row);
             $current->setVar('nlinks', 0);
             $back[] = $current;
         }
         $current->setVar('grank_' . $row['regat_langid'], $row['lts']);
         $current->setVar('nlinks', $current->getVar('nlinks') + $row['nlinks']);
         //			var_dump($current->getGDOData());
     }
     $db->free($result);
     //		var_dump($back);
     return $back;
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:40,代碼來源:Ranking.php

示例2: getUserStuff

 private function getUserStuff(array $row, GDO_Database $db, $bits)
 {
     $back = new GWF_User($row);
     $regat = GWF_TABLE_PREFIX . 'wc_regat';
     $uid = $row['user_id'];
     $query = "SELECT regat_sid, regat_solved FROM {$regat} WHERE regat_uid={$uid} AND regat_tagbits&{$bits} AND regat_options&4=0";
     if (false === ($result = $db->queryRead($query))) {
         return $back;
     }
     while (false !== ($row = $db->fetchRow($result))) {
         $back->setVar('site_' . $row[0], $row[1]);
     }
     $db->free($result);
     return $back;
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:15,代碼來源:SiteRankings.php


注:本文中的GWF_User::setVar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。