Файл: info.php
Строк: 74
<?php
require 'sys/sid.php';
require 'sys/config.php';
include 'sys/user.php';
include 'sys/head.php';
visit(0, 'info');
$nick = trim(mysql_real_escape_string(char($_GET['nick'], 0)));
$ctrl = mysql_query("SELECT * FROM users WHERE nick = '$nick' LIMIT 1");
if (mysql_num_rows($ctrl) == false)
{
err('Игрок не найден!');
include 'sys/foot.php';
exit();
}
$f = mysql_fetch_assoc($ctrl);
if ($f['level'] == 1) $lvl = '<span class="war">[Мд]</span>';
elseif ($f['level'] == 2) $lvl = '<span class="war">[Адм]</span>';
if (isset($_GET['rating']))
{
$rating = number($_GET['rating']);
$controlCarm = mysql_query("SELECT id FROM carma WHERE who = '$user[id]' AND whom = '$f[id]' LIMIT 1");
if ($user['id'] == $f['id'])
{
err('Себе нельзя менять карму!');
}
elseif ($user['crystal'] < 1)
{
err('Нехватает кристаллов! Стоимость изменения кармы 1 кристалл.');
}
elseif (mysql_num_rows($controlCarm) == false)
{
if ($rating == true)
{
mysql_query("UPDATE users SET crystal = crystal - '1' WHERE id = '$user[id]' LIMIT 1");
mysql_query("UPDATE users SET carma = carma + '1' WHERE id = '$f[id]' LIMIT 1");
msg('Карма повышена на 1');
}
elseif ($rating == false)
{
mysql_query("UPDATE users SET crystal = crystal - '1' WHERE id = '$user[id]' LIMIT 1");
mysql_query("UPDATE users SET carma = carma - '1' WHERE id = '$f[id]' LIMIT 1");
msg('Карма понижена на 1');
}
mysql_query("INSERT INTO carma SET who = '$user[id]', whom = '$f[id]'");
}
else
{
err('Карма уже была изменена!');
}
}
$lg = mysql_query("SELECT uid FROM players_aliance WHERE player = '" . user($nick, 'id') . "' LIMIT 1");
if (mysql_num_rows($lg) != false)
{
$inLG = mysql_fetch_assoc($lg);
$iLG = mysql_fetch_assoc(mysql_query("SELECT id, logo, name FROM aliance WHERE id = '$inLG[uid]' LIMIT 1"));
if ($iLG['logo'] != '') $l = '<img src="images/clan/'.$iLG['logo'].'" alt=""/> <a href="aliance'.$iLG['id'].'">' . $iLG['name'] . '</a>';
}
echo '<div align="center">
' . ($f['avatar'] != '' ? '<img src="resize.php?img='.$f['avatar'].'&width=150&height=0" alt="*"/><br/>' : '') . '
<a href="rating1_'.$nick.'"><img src="images/plus.png" alt="+"></a>
Карма: ' . $f['carma'] . '
<a href="rating0_'.$nick.'"><img src="images/minus.png" alt="-"></a>
</div>
' . $lvl . ' ' . $f['nick'] . '
<a href="location'.$f['coor_x'].'_'.$f['coor_y'].'_2">[x:' . $f['coor_x'] . ';y:' . $f['coor_y'] . ']</a>
(' . ($f['race'] == 1 ? 'Люди' : 'Некроманты') . ') ' . (online_user($f['id'], 'online') ? '<img src="images/online.png" title="online" alt="online"/>' : '<img src="images/offline.png" title="offline" alt="offline"/>') . '<br/>' . $l . '
' . separator;
echo '<img src="images/write_letter.png" alt=""/> <a href="send">Написать письмо</a><br/>
<img src="images/photo.png" alt=""/> <a href="photo_'.$nick.'">Фото</a><br/>
<img src="images/account.png" alt=""/> <a href="account_'.$nick.'">Анкета</a><br/>
<img src="images/mute.png" alt=""/> <a href="addignor_'.$nick.'">В игнор</a><br/>';
echo '<br/><a href="index.php">На главную</a>';
include 'sys/foot.php';
?>