Example #1
0
 /**
  * @see Page::show()
  */
 public function show()
 {
     parent::show();
     $user = new LWUser($this->userID);
     $config = $user->getConfig();
     var_dump($config->overview, $config);
     $arr = array(0xff => true, 0x100 => false, 0x1e00 => true, 0x2000 => false, 0xc000 => true);
     /*$arr2 = array();
     		
     		foreach($arr as $key => $val) {
     			$arr2[$key<<16] = $val;
     		}
     		$arr += $arr2;*/
     $config->overview = $arr;
     var_dump($config->overview, $config);
     $config->saveChanges();
     exit;
 }
Example #2
0
 /**
  * Creates a new message
  * 
  * @param	int		recipent id
  * @param	string	subject
  * @param 	string	text
  * @param	int		sender id
  * @param	string	sender name
  * @param	int		message type
  */
 public static function create($recipentID, $subject, $text, $senderID = null, $senderName = null, $messageType = 1)
 {
     if ($senderID === null) {
         $senderID = WCF::getUser()->userID;
     }
     if ($senderName === null) {
         require_once LW_DIR . 'lib/data/user/LWUser.class.php';
         $sender = new LWUser($senderID);
         $senderName = $sender->getLinkedUsername();
     }
     // insert
     $sql = "INSERT INTO ugml_messages\r\n\t\t\t\t(message_owner, message_sender, message_time,\r\n\t\t\t\t message_type, message_from, message_subject,\r\n\t\t\t\t message_text)\r\n\t\t\t\tVALUES\r\n\t\t\t\t(" . $recipentID . ", " . $senderID . ", " . time() . ",\r\n\t\t\t\t " . $messageType . ", '" . escapeString($senderName) . "', '" . escapeString($subject) . "',\r\n\t\t\t\t '" . escapeString($text) . "')";
     WCF::getDB()->sendQuery($sql);
     // update user
     $sql = "UPDATE ugml_users\r\n\t\t\t\tSET new_message = new_message + 1\r\n\t\t\t\tWHERE id = " . $recipentID;
     WCF::getDB()->sendQuery($sql);
     Session::resetSessions($recipentID);
 }