本文整理匯總了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;
}
示例2: UserSettings
<?php
include_once "config.php";
$setting = new UserSettings();
$setting->setSetting("philinfo2", "value2");
?>
示例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']));
}