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


PHP UserSettings::setSetting方法代碼示例

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


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

示例1: create

 /**
  * Creates a new game account.
  * 
  * @param	int		user id
  * @param	string	user name
  * @param	string	email
  */
 public static function create($userID, $username, $email)
 {
     $sql = "INSERT INTO ugml_users\n\t\t\t\t(id, username, email,\n\t\t\t\t email_2, register_time, lastLoginTime,\n\t\t\t\t dilizium, diliziumFeatures)\n\t\t\t\tVALUES\n\t\t\t\t(" . $userID . ", '" . escapeString($username) . "', '" . escapeString($email) . "',\n\t\t\t\t '" . $email . "', " . time() . ", " . time() . ",\n\t\t\t\t 500, 'a:0:{}')";
     WCF::getDB()->sendQuery($sql);
     $sql = "UPDATE ugml_config\n\t\t\t\tSET config_value = (SELECT COUNT(*)\n\t\t\t\t\t\t\t\t\tFROM ugml_users)\n\t\t\t\tWHERE config_name = 'users_amount'";
     WCF::getDB()->sendQuery($sql);
     $accountEditor = new AccountEditor($userID);
     // TODO: event listener
     require_once LW_DIR . 'lib/data/news/News.class.php';
     require_once LW_DIR . 'lib/data/user/UserSettings.class.php';
     WCF::getCache()->addResource('news-' . PACKAGE_ID, WCF_DIR . 'cache/cache.news-' . PACKAGE_ID . '.php', LW_DIR . 'lib/system/cache/CacheBuilderNews.class.php');
     $news = WCF::getCache()->get('news-' . PACKAGE_ID);
     foreach ($news as $key => $newsItem) {
         if ($key != "hash") {
             UserSettings::setSetting($userID, $newsItem->getIdentifier(), TIME_NOW);
         }
     }
     return $accountEditor;
 }
開發者ID:sonicmaster,項目名稱:RPG,代碼行數:26,代碼來源:AccountEditor.class.php

示例2: UserSettings

<?php

include_once "config.php";
$setting = new UserSettings();
$setting->setSetting("philinfo2", "value2");
?>


開發者ID:jacquesbagui,項目名稱:ofuz,代碼行數:6,代碼來源:test_setting.php

示例3: checkAll

 /**
  * Sets the 'checked'-flag for the messages of a given user.
  * 
  * @param	int		userID
  * @param	int		checked
  * @param	array	folderIDs
  */
 public function checkAll($userID, $checked = 1, $folderIDs = null)
 {
     $sql = "UPDATE ugml_message\n\t\t\t\tSET checked = " . $checked . "\n\t\t\t\tWHERE recipentID = " . $userID;
     if ($folderIDs !== null && count($folderIDs)) {
         $sql .= " AND folderID IN (" . implode(',', $folderIDs) . ")";
     }
     WCF::getDB()->sendQuery($sql);
     $sql = "SELECT COUNT(*) AS count\n\t\t\t\tFROM ugml_message\n\t\t\t\tWHERE checked = 1\n\t\t\t\t\tAND recipentID = " . $userID;
     $row = WCF::getDB()->getFirstRow($sql);
     UserSettings::setSetting($userID, 'checkedMessages', intval($row['count']));
 }
開發者ID:Biggerskimo,項目名稱:WOT-Game,代碼行數:18,代碼來源:NMessageEditor.class.php


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