/** * Constructor * @since Version 3.0 * @version 3.10.0 */ public function __construct() { $timer = Debug::getTimer(); Debug::RecordInstance(); parent::__construct(); $this->guest(); $this->Module = new Module("users"); foreach (func_get_args() as $arg) { if (filter_var($arg, FILTER_VALIDATE_INT)) { $this->id = $arg; $this->load(); } elseif (is_string($arg) && strlen($arg) > 1) { $query = "SELECT user_id FROM nuke_users WHERE username = ?"; $this->id = $this->db->fetchOne($query, $arg); if (filter_var($this->id, FILTER_VALIDATE_INT)) { $this->load(); } } } Debug::LogEvent(__METHOD__ . "(" . $this->id . ")", $timer); }
/** * Constructor * @since Version 3.0 * @version 3.0 * @param object $db * @param array $preferences */ public function __construct() { if (RP_DEBUG) { global $site_debug; $debug_timer_start = microtime(true); } debug_recordInstance(__CLASS__); parent::__construct(); $this->guest(); $this->Module = new Module("users"); foreach (func_get_args() as $arg) { if (filter_var($arg, FILTER_VALIDATE_INT)) { $this->id = $arg; $this->load(); } elseif (is_string($arg) && strlen($arg) > 1) { $query = "SELECT user_id FROM nuke_users WHERE username = ?"; $this->id = $this->db->fetchOne($query, $arg); if (filter_var($this->id, FILTER_VALIDATE_INT)) { $this->load(); } } } if (RP_DEBUG) { $site_debug[] = "Railpage: " . __CLASS__ . "(" . $this->id . ") instantiated in " . round(microtime(true) - $debug_timer_start, 5) . "s"; } }