Added nick class to remove bunch of nick{1-7} functions
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
* Project name: Battles-Game
|
||||
*/
|
||||
|
||||
/* @DEPRECATED */
|
||||
|
||||
class n
|
||||
{
|
||||
private static $_instance = null;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
class nick
|
||||
{
|
||||
private $user_data;
|
||||
|
||||
private $
|
||||
|
||||
/**
|
||||
* nick constructor.
|
||||
@@ -23,7 +23,7 @@ class nick
|
||||
|
||||
}
|
||||
|
||||
public static function search($playerId)
|
||||
public static function id($playerId)
|
||||
{
|
||||
return new self($playerId);
|
||||
}
|
||||
@@ -31,7 +31,7 @@ class nick
|
||||
/**
|
||||
* @param int $showInvisibility
|
||||
*/
|
||||
public function geninf($showInvisibility = 0)
|
||||
public function full($showInvisibility = 0)
|
||||
{
|
||||
$n ='';
|
||||
if ($showInvisibility) {
|
||||
@@ -51,4 +51,9 @@ class nick
|
||||
|
||||
return $n;
|
||||
}
|
||||
|
||||
public function short()
|
||||
{
|
||||
return $this->user_data['login'];
|
||||
}
|
||||
}
|
||||
@@ -5,19 +5,19 @@
|
||||
* Project name: Battles-Game
|
||||
*/
|
||||
|
||||
class u
|
||||
class users_row
|
||||
{
|
||||
private $user_id;
|
||||
private $row;
|
||||
|
||||
|
||||
/**
|
||||
* u constructor.
|
||||
* users_row constructor.
|
||||
* @param $playerId
|
||||
*/
|
||||
public function __construct($playerId)
|
||||
{
|
||||
if (!$this->user_id) {
|
||||
$this->user_id = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i',$playerId)->fetch_assoc();
|
||||
if (!$this->row) {
|
||||
$this->row = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $playerId)->fetch_assoc();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ class u
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function i()
|
||||
public function result()
|
||||
{
|
||||
return $this->user_id;
|
||||
return $this->row;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user