当前位置: 首页>>代码示例>>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;未经允许,请勿转载。