clans fixes
This commit is contained in:
@@ -9,38 +9,44 @@ class nick
|
||||
{
|
||||
private $user_data;
|
||||
|
||||
|
||||
/**
|
||||
* nick constructor.
|
||||
* @param int $playerId
|
||||
*/
|
||||
public function __construct($playerId) {
|
||||
public function __construct($playerId)
|
||||
{
|
||||
if (!$this->user_data) {
|
||||
$user = db::c()->query('SELECT `login`, `level`, `hp`, `align`, `klan`, `hp`, `maxhp` FROM `users` WHERE `id` = ?i',$playerId)->fetch_assoc();
|
||||
$user = db::c()->query('SELECT `login`, `level`, `align`, (SELECT `short` FROM `clans` WHERE `clans`.`id` = `klan`) AS `klan`, `hp`, `maxhp` FROM `users` WHERE `id` = ?i', $playerId)->fetch_assoc();
|
||||
$this->user_data = $user;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $showInvisibility
|
||||
* @return array
|
||||
*/
|
||||
public function login($showInvisibility = 0){
|
||||
public function show($showInvisibility = 0)
|
||||
{
|
||||
$n ='';
|
||||
if ($showInvisibility) {
|
||||
$this->user_data['login'] = 'Невидимка';
|
||||
$this->user_data['login'] = '<i>невидимка</i>';
|
||||
$this->user_data['level'] = '??';
|
||||
} else {
|
||||
if ($this->user_data['align']) {
|
||||
$n .= sprintf('<img src="i/align_%s.gif">', $this->user_data['align']);
|
||||
}
|
||||
if ($this->user_data['klan']) {
|
||||
$n .= sprintf('<img src="i/klan/%s.gif">', $this->user_data['klan']);
|
||||
}
|
||||
}
|
||||
if ($this->user_data['align']) {
|
||||
$n.= sprintf('<img src="i/align_%s.gif">', $this->user_data['align']);
|
||||
}
|
||||
if ($this->user_data['klan']) {
|
||||
$n. = sprintf('');
|
||||
}
|
||||
$n .= sprintf('<b>%s</b> [%s] <a href="inf.php?%s" target="_blank"><img src="i/inf.gif" style="width:12px;height:11px"></a>', $this->user_data['login'], $this->user_data['level'], $this->user_data['login']);
|
||||
// if ($this->invis){
|
||||
// // db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = ?i', $id, 1022)->fetch_assoc();
|
||||
// $user['login'] = 'невидимка';
|
||||
// $user['level'] = 100;
|
||||
// }
|
||||
return $this->user_data;
|
||||
echo $n;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user