tests
This commit is contained in:
parent
a8ff0a54f0
commit
5abf451314
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
include '../config.php';
|
||||
include_once '../classes/nick.php';
|
||||
//include '../functions.php';
|
||||
|
||||
//showinf_pers(10736,1);
|
||||
@ -14,4 +15,7 @@ print_r($row2);
|
||||
echo '<hr>';
|
||||
$row3 = db::c()->query('select * from `bank` WHERE owner=10929 OR owner=11221')->fetch_object_array();
|
||||
print_r($row3);
|
||||
echo '<hr>';
|
||||
echo '<hr>';
|
||||
|
||||
$obj = new nick(11221);
|
||||
$obj->get();
|
22
classes/nick.php
Normal file
22
classes/nick.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (c) 2018.
|
||||
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
||||
* Project name: Battles-Game
|
||||
*/
|
||||
|
||||
class nick
|
||||
{
|
||||
private $user;
|
||||
function __construct($id)
|
||||
{
|
||||
$this->user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $id)->fetch_assoc();
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
return $this->user['login'];
|
||||
}
|
||||
|
||||
|
||||
}
|
150
functions.php
150
functions.php
@ -1504,22 +1504,22 @@ function nick($user)
|
||||
return $r;
|
||||
}
|
||||
|
||||
// nick
|
||||
function nicks($user)
|
||||
{
|
||||
?>
|
||||
<div id=HP><img src="i/align_<?
|
||||
echo($user['align'] > 0 ? $user['align'] : "0"); ?>.gif"/><?php if ($user['klan'] != '') {
|
||||
echo '<img title="' . ClanImage($user['klan']) . '" src="i/klan/' . ClanImage($user['klan']) . '.gif">';
|
||||
} ?><B><?= $user['login'] ?></B> [<?= $user['level'] ?>]<a href=inf.php?<?= $user['id'] ?> target=_blank><IMG
|
||||
SRC=i/inf.gif WIDTH=12 HEIGHT=11 ALT="Инф. о <?= $user['login'] ?>"></a>
|
||||
<IMG SRC=i/herz.gif WIDTH=10 HEIGHT=10 ALT="Уровень жизни"> <IMG SRC=i/1green.gif
|
||||
WIDTH='<?= (150 * ($user['hp'] / $user['maxhp'])) ?>'
|
||||
HEIGHT=10 ALT="Уровень жизни" name=HP1><IMG
|
||||
SRC=i/1silver.gif WIDTH='<?= (150 - 150 * ($user['hp'] / $user['maxhp'])) ?>' HEIGHT=10
|
||||
ALT="Уровень жизни" name=HP2>: <span id="hp_value"><?= $user['hp'] ?><span>/<?= $user['maxhp'] ?></div>
|
||||
<?
|
||||
}
|
||||
//// nick
|
||||
//function nicks($user)
|
||||
//{
|
||||
// ?>
|
||||
<!-- <div id=HP><img src="i/align_--><?//
|
||||
// echo($user['align'] > 0 ? $user['align'] : "0"); ?><!--.gif"/>--><?php //if ($user['klan'] != '') {
|
||||
// echo '<img title="' . ClanImage($user['klan']) . '" src="i/klan/' . ClanImage($user['klan']) . '.gif">';
|
||||
// } ?><!--<B>--><?//= $user['login'] ?><!--</B> [--><?//= $user['level'] ?><!--]<a href=inf.php?--><?//= $user['id'] ?><!-- target=_blank><IMG-->
|
||||
<!-- SRC=i/inf.gif WIDTH=12 HEIGHT=11 ALT="Инф. о --><?//= $user['login'] ?><!--"></a>-->
|
||||
<!-- <IMG SRC=i/herz.gif WIDTH=10 HEIGHT=10 ALT="Уровень жизни"> <IMG SRC=i/1green.gif-->
|
||||
<!-- WIDTH='--><?//= (150 * ($user['hp'] / $user['maxhp'])) ?><!--'-->
|
||||
<!-- HEIGHT=10 ALT="Уровень жизни" name=HP1><IMG-->
|
||||
<!-- SRC=i/1silver.gif WIDTH='--><?//= (150 - 150 * ($user['hp'] / $user['maxhp'])) ?><!--' HEIGHT=10-->
|
||||
<!-- ALT="Уровень жизни" name=HP2>: <span id="hp_value">--><?//= $user['hp'] ?><!--<span>/--><?//= $user['maxhp'] ?><!--</div>-->
|
||||
<!-- --><?//
|
||||
//}
|
||||
|
||||
function mick2s($id, $showinvis = 1)
|
||||
{
|
||||
@ -1725,28 +1725,28 @@ function aligntype($a)
|
||||
return 0;
|
||||
}
|
||||
|
||||
function nick6($id)
|
||||
{
|
||||
if ($id > _BOTSEPARATOR_) {
|
||||
$bots = mysql_fetch_array(mysql_query('SELECT `id`, `prototype`, `hp`, `name` FROM `bots` WHERE `id` = ' . $id . ' LIMIT 1'));
|
||||
$id = $bots['prototype'];
|
||||
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = ' . $id . ' LIMIT 1'));
|
||||
$user['login'] = $bots['name'];
|
||||
$user['hp'] = $bots['hp'];
|
||||
$user['id'] = $bots['id'];
|
||||
} else {
|
||||
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = ' . $id . ' LIMIT 1'));
|
||||
}
|
||||
if ($user[0]) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$id}' AND `type` = '1022' LIMIT 1"));
|
||||
if ($effect) {
|
||||
$user['login'] = '</a><b><i>невидимка</i></b>';
|
||||
$user['level'] = '??';
|
||||
$user['id'] = '??';
|
||||
}
|
||||
return "" . $user['login'] . "</b> [" . $user['level'] . "] <a href=inf.php?" . $user['id'] . " target=_blank><IMG SRC=i/inf.gif WIDTH=12 HEIGHT=11 ALT=\"Инф. о " . $user['login'] . "\"></a><B>";
|
||||
}
|
||||
}
|
||||
//function nick6($id)
|
||||
//{
|
||||
// if ($id > _BOTSEPARATOR_) {
|
||||
// $bots = mysql_fetch_array(mysql_query('SELECT `id`, `prototype`, `hp`, `name` FROM `bots` WHERE `id` = ' . $id . ' LIMIT 1'));
|
||||
// $id = $bots['prototype'];
|
||||
// $user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = ' . $id . ' LIMIT 1'));
|
||||
// $user['login'] = $bots['name'];
|
||||
// $user['hp'] = $bots['hp'];
|
||||
// $user['id'] = $bots['id'];
|
||||
// } else {
|
||||
// $user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = ' . $id . ' LIMIT 1'));
|
||||
// }
|
||||
// if ($user[0]) {
|
||||
// $effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$id}' AND `type` = '1022' LIMIT 1"));
|
||||
// if ($effect) {
|
||||
// $user['login'] = '</a><b><i>невидимка</i></b>';
|
||||
// $user['level'] = '??';
|
||||
// $user['id'] = '??';
|
||||
// }
|
||||
// return "" . $user['login'] . "</b> [" . $user['level'] . "] <a href=inf.php?" . $user['id'] . " target=_blank><IMG SRC=i/inf.gif WIDTH=12 HEIGHT=11 ALT=\"Инф. о " . $user['login'] . "\"></a><B>";
|
||||
// }
|
||||
//}
|
||||
|
||||
function nick3($id)
|
||||
{
|
||||
@ -1776,7 +1776,7 @@ function nick3($id)
|
||||
if ($user['klan'] > 0) {
|
||||
$mm .= '<img title="' . ClanImage($user['klan']) . '" src="i/klan/' . ClanImage($user['klan']) . '.gif" />';
|
||||
}
|
||||
$mm .= "<b>{$user['login']}</b> [{$user['level']}]<a href=inf.php?{$user['id']} target=_blank><img src=i/inf.gif width=12 height=11 /></a>";
|
||||
$mm .= "<b>{$user['login']}</b> [{$user['level']}]<a href=inf.php?{$user['login']} target=_blank><img src=i/inf.gif width=12 height=11 /></a>";
|
||||
}
|
||||
return $mm;
|
||||
}
|
||||
@ -1949,7 +1949,7 @@ function timeOut($ttm)
|
||||
return $out;
|
||||
}
|
||||
|
||||
$img = array(
|
||||
$img = [
|
||||
1 => "travma.gif", 2 => "magic/sleep.gif", 3 => "magic/sleepf.gif", 4 => "magic/haos.gif",
|
||||
5 => "magic/obezl.gif", 6 => "expx15.gif", 7 => "euphoria.png", 8 => "sleep_obj.gif",
|
||||
10 => "magic/chains.gif", 11 => "travma.gif", 12 => "travma.gif", 13 => "travma.gif",
|
||||
@ -1959,7 +1959,7 @@ $img = array(
|
||||
220 => "magic/wis_earth_def3.gif", 221 => "magic/wis_fire_def1.gif", 222 => "magic/wis_fire_def2.gif", 223 => "magic/wis_fire_def3.gif",
|
||||
224 => "magic/wis_water_def1.gif", 225 => "magic/wis_water_def2.gif", 226 => "magic/wis_water_def3.gif", 227 => "magic/attack_defence.gif",
|
||||
1022 => "sh/hidden.gif"
|
||||
);
|
||||
];
|
||||
|
||||
function show_eff_inf($u, $type)
|
||||
{
|
||||
@ -2028,40 +2028,40 @@ function show_eff_inf($u, $type)
|
||||
return $r;
|
||||
}
|
||||
|
||||
function nick5_1($id, $st)
|
||||
{
|
||||
if ($id > _BOTSEPARATOR_) {
|
||||
$bots = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `id` = ' . $id . ' LIMIT 1;'));
|
||||
$id = $bots['prototype'];
|
||||
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1;"));
|
||||
$user['login'] = $bots['name'];
|
||||
$user['hp'] = $bots['hp'];
|
||||
$user['id'] = $bots['id'];
|
||||
} else {
|
||||
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1;"));
|
||||
}
|
||||
|
||||
if ($user[0]) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$id}' and `type` = '1022' LIMIT 1;"));
|
||||
if ($effect) {
|
||||
$user['level'] = '??';
|
||||
$user['login'] = '</a><b><i>невидимка</i></b>';
|
||||
$user['align'] = '0';
|
||||
$user['klan'] = '';
|
||||
$user['id'] = '';
|
||||
$user['hp'] = '??';
|
||||
$user['maxhp'] = '??';
|
||||
$user['mana'] = '??';
|
||||
$user['maxmana'] = '??';
|
||||
}
|
||||
$align = ($user['align'] > 0 ? $user['align'] : "0");
|
||||
if ($user['klan'] != '') {
|
||||
$klan = '<img title="' . ClanImage($user['klan']) . '" src="i/klan/' . ClanImage($user['klan']) . '.gif" />';
|
||||
}
|
||||
$userb = "<img src=\"i/align_" . $align . ".gif\">" . $klan . $user['login'] . " [" . $user['level'] . "]<a href=/inf.php?" . $user['id'] . " target=_blank><IMG SRC=\"i/inf.gif\" WIDTH=12 HEIGHT=11 ALT=\"Инф. о " . $user['login'] . "\"></a>";
|
||||
return "<span class={$st}>" . $userb . "</span>";
|
||||
}
|
||||
}
|
||||
//function nick5_1($id, $st)
|
||||
//{
|
||||
// if ($id > _BOTSEPARATOR_) {
|
||||
// $bots = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `id` = ' . $id . ' LIMIT 1;'));
|
||||
// $id = $bots['prototype'];
|
||||
// $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1;"));
|
||||
// $user['login'] = $bots['name'];
|
||||
// $user['hp'] = $bots['hp'];
|
||||
// $user['id'] = $bots['id'];
|
||||
// } else {
|
||||
// $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1;"));
|
||||
// }
|
||||
//
|
||||
// if ($user[0]) {
|
||||
// $effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$id}' and `type` = '1022' LIMIT 1;"));
|
||||
// if ($effect) {
|
||||
// $user['level'] = '??';
|
||||
// $user['login'] = '</a><b><i>невидимка</i></b>';
|
||||
// $user['align'] = '0';
|
||||
// $user['klan'] = '';
|
||||
// $user['id'] = '';
|
||||
// $user['hp'] = '??';
|
||||
// $user['maxhp'] = '??';
|
||||
// $user['mana'] = '??';
|
||||
// $user['maxmana'] = '??';
|
||||
// }
|
||||
// $align = ($user['align'] > 0 ? $user['align'] : "0");
|
||||
// if ($user['klan'] != '') {
|
||||
// $klan = '<img title="' . ClanImage($user['klan']) . '" src="i/klan/' . ClanImage($user['klan']) . '.gif" />';
|
||||
// }
|
||||
// $userb = "<img src=\"i/align_" . $align . ".gif\">" . $klan . $user['login'] . " [" . $user['level'] . "]<a href=/inf.php?" . $user['id'] . " target=_blank><IMG SRC=\"i/inf.gif\" WIDTH=12 HEIGHT=11 ALT=\"Инф. о " . $user['login'] . "\"></a>";
|
||||
// return "<span class={$st}>" . $userb . "</span>";
|
||||
// }
|
||||
//}
|
||||
|
||||
function del_efs($uid, $id, $type)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user