本文整理汇总了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']));
}