Внедрение шаблонизатора.
This commit is contained in:
parent
56a3a437a5
commit
8262dd3f45
8
buy.php
8
buy.php
@ -9,8 +9,7 @@ $is_now = db::c()->query('SELECT `id`, `uid` FROM `abils_user` WHERE `uid` = ?i'
|
||||
function add_user_abil($ab, $cost)
|
||||
{
|
||||
global $user, $banks;
|
||||
if (isset($ab)) {
|
||||
if ($banks['ekr'] >= $cost) {
|
||||
if (isset($ab) && $banks['ekr'] >= $cost) {
|
||||
$isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_user` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
|
||||
$isset[$ab] += 1;
|
||||
mysql_query('UPDATE `abils_user` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `uid` = "' . $user['id'] . '" LIMIT 1');
|
||||
@ -18,12 +17,11 @@ function add_user_abil($ab, $cost)
|
||||
mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$cost = array(1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1);
|
||||
$mag = array('sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone');
|
||||
$cost = [1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1];
|
||||
$mag = ['sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone'];
|
||||
|
||||
if (isset($_POST['type'], $_POST['user'])) {
|
||||
if (isset($user['id'])) {
|
||||
|
13
inf.php
13
inf.php
@ -1,21 +1,16 @@
|
||||
<?php
|
||||
session_start();
|
||||
include_once 'config.php';
|
||||
|
||||
$login = urldecode($_SERVER['QUERY_STRING']) ?? '';
|
||||
$userInfo = new UserInfo($login);
|
||||
$presentsModel = new PresentsModel($userInfo->id);
|
||||
$presentsList = $presentsModel->getAllPresents();
|
||||
$userInfo->watcher_id = $userInfo->id ?? null;
|
||||
Template::header('Информация о ' . $userInfo->login);
|
||||
|
||||
if (empty($userInfo->id)): ?>
|
||||
Ошибка: персонаж <em><?= $login ?></em> не найден...
|
||||
<p><a style="color: #99f" href="javascript:window.history.go(-1);">←назад</a></p>
|
||||
<?php exit(); endif; ?>
|
||||
|
||||
<?php
|
||||
|
||||
if (!$userInfo->id) {
|
||||
sprintf('Ошибка: персонаж <em>%s</em> не найден...<p><a style="color: #99f;" href="javascript:window.history.go(-1);">←назад</a></p>', $login);
|
||||
exit;
|
||||
}
|
||||
try {
|
||||
$userInfo->showUserInfo();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user