fixes
This commit is contained in:
parent
28615eec69
commit
a715f06e3b
11
clan.php
11
clan.php
@ -28,14 +28,15 @@ if (isset($_POST['kr']) && ($_POST['kolv'] > 0)) {
|
||||
}
|
||||
|
||||
if (!empty($_POST['login']) AND $_POST['action'] == 'add_member' AND $polno[$user['id']][0] == 1) {
|
||||
$sok = db::c()->query('SELECT `id`,`level` FROM `users` WHERE `klan` = "?s" AND `align` = 0 AND `login` = "?s"', '', $_POST['login'])->fetch_assoc();
|
||||
$sok = db::c()->query('SELECT `id`,`level`,`klan` FROM `users` WHERE `align` = 0 AND `login` = "?s"', $_POST['login'])->fetch_assoc();
|
||||
$proverka = db::c()->query('SELECT 1 FROM `effects` WHERE `type` = 20 AND `owner` = ?i', $sok['id'])->getNumRows();
|
||||
if (!$proverka) echo "Нет проверки!";
|
||||
elseif (!empty($sok['klan'])) echo 'Персонаж уже состоит в клане!';
|
||||
elseif ($sok['level'] > 0 && $user['money'] >= 100) {
|
||||
db::c()->query('UPDATE `users` SET `money` = `money` - 100 WHERE `id` = ?i', $_SESSION['uid']);
|
||||
db::c()->query('UPDATE `users` SET `status` = "?s", `klan` = "?s", `align` = ?i WHERE `id` = ?i', 'Боец', $klan['id'], $klan['align'], $sok['id']);
|
||||
$status = 'Персонаж «' . $_POST['login'] . '» успешно принят в клан.';
|
||||
} else $status = 'Не хватает денег, или его попросту не существует.';
|
||||
} else $status = 'Не хватает денег, или персонажа не существует.';
|
||||
}
|
||||
|
||||
if (!empty($_POST['login']) AND $_POST['action'] == 'remove_member' AND $polno[$user['id']][0] == 1) {
|
||||
@ -49,8 +50,6 @@ if (!empty($_POST['login']) AND $_POST['action'] == 'remove_member' AND $polno[$
|
||||
|
||||
if (!empty($_POST['login']) AND $_POST['action'] == 'change_owner' AND $klan['glava'] == $_SESSION['uid']) { //смена главы
|
||||
$sok = db::c()->query('SELECT `id` FROM `users` WHERE `klan` = "?s" AND `login` = "?s"', $klan['id'], $_POST['login'])->fetch_assoc();
|
||||
//mysql_query('update `users` set `money` = `money` - 30 WHERE `id` = '.$_SESSION['uid'].';');
|
||||
//mysql_query('update `users` set `klan` = \'\', `align` = 0 WHERE `id` = '.$sok['id'].';');
|
||||
db::c()->query('UPDATE `clans` SET `glava` = ?i WHERE `id` = ?i', $sok['id'], $klan['id']);
|
||||
db::c()->query('UPDATE `users` SET `status` = null WHERE `id` = ?i', $sok['id']);
|
||||
db::c()->query('UPDATE `users` SET `status` = "?s" WHERE `id` = ?i', 'Боец', $_SESSION['uid']);
|
||||
@ -94,10 +93,6 @@ if (!empty($_POST['login']) AND $_POST['action'] == 'change_owner' AND $klan['gl
|
||||
|
||||
<?php
|
||||
|
||||
if (!empty($_POST['login'])) {
|
||||
$sok = db::c()->query('SELECT * FROM `users` WHERE `klan` = "?s" AND `login` = "?s"', $klan['id'], $user['id'])->fetch_assoc();
|
||||
}
|
||||
|
||||
if ($klan['glava'] == $user['id'] OR $polno[$user['id']][0] == 1 OR $polno[$user['id']][1] == 1) {
|
||||
echo "<form method=post>";
|
||||
if ($polno[$user['id']][0] == 1) echo '<INPUT TYPE="button" onclick="findlogin(\'Принять в клан\', \'login2\');" value="Принять в клан" title="Принять в клан"> (это вам обойдется в <B>100</B> кр.)<BR>
|
||||
|
@ -849,7 +849,11 @@ function show_eff_inf($u, $type)
|
||||
if ($type == 1) {
|
||||
$and = " AND `type` != 1022";
|
||||
}
|
||||
$effs = db::c()->query('SELECT * FROM `effects` WHERE `owner` = ?i' . $and, $u)->fetch_assoc();
|
||||
$effs = db::c()->query('SELECT * FROM `effects` WHERE `type` <> 20 AND `owner` = ?i' . $and, $u)->fetch_assoc();
|
||||
/* FIXME Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 132644820 bytes) in /home/combats/web/combats.loc/public_html/functions.php on line 873
|
||||
* Если на человеке стоит type=20
|
||||
*
|
||||
*/
|
||||
$etype = $effs['type'];
|
||||
if ($type == 1) {
|
||||
while ($effs) {
|
||||
|
Loading…
Reference in New Issue
Block a user