Файл: DARK WARS/dark_war/clans/clan.php
Строк: 94
<?php
include_once '../start.php';
$doc = new document();
$doc->title('Кланы');
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
$doc->err('Ошибка, не выбран клан');
exit();
}
$id = (int)$_GET['id'];
$ar = mysql_fetch_array(mysql_query("SELECT * FROM `dark_war_clans` WHERE id='$id' LIMIT 1"));
$l = mysql_query("SELECT * FROM `dark_war_clan_builds` WHERE id_clans='$id'");
if (!isset($ar['id'])) {
$doc->err('Ошибка, нет такого клана');
exit();
}
$admin = mysql_fetch_assoc(mysql_query("SELECT * FROM `dark_war_clans_us` WHERE id_player='{$player->id}' AND `id_clan` = '$id' LIMIT 1"));
$count_us = mysql_result(mysql_query("SELECT COUNT(*) FROM `dark_war_clans_us` WHERE `id_clan` = '$id' AND `id_player` = '{$player->id}' "),0);
if (is_file(H.'/dark_war/files/clans/logo/'.$ar['id'].'.jpg')) {
echo "<center><img src='/dark_war/files/clans/logo/$ar[id].jpg' alt='!' /></center>";
}
$dispatch[] = array ('title' => text::length($ar['name'], 80), 'descrip' =>text::opis($ar['description']));
$doc->assign('post', $dispatch);
$doc->display('view_list_plus_img.tpl');
$r = array();
$i = 1;
while($sup = mysql_fetch_assoc($l)){
$r[$i] = $sup;
$i++;
}
$hp = $r['1']['hp'] + $r['2']['hp'] + $r['3']['hp'] + $r['4']['hp'] + $r['5']['hp'];
$arrmor = $r['1']['arrmor'] + $r['2']['arrmor'] + $r['3']['arrmor'] + $r['4']['arrmor'] + $r['5']['arrmor'];
$attack = $r['1']['attack'] + $r['2']['attack'] + $r['3']['attack'] + $r['4']['attack'] + $r['5']['attack'];
echo "Жизнь: ".$hp." Защита: ".$arrmor." Атака: ".$attack;
$dispatch = array();
if(!$admin['id_player'] == $player->id){
$dispatch[] = array ('title' => '<FONT color="red">Вступить в клан</FONT>', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'demand/?id='.$id.'', 'ico_size' => 32);
}else{
$_SESSION['clan'] = $id;
setcookie ("clan", $id);
$dispatch[] = array ('title' => 'Участники', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'users.php?id='.$id.'', 'ico_size' => 32);
if ($admin['admin'] > 0 || $player->admin > 1) {
$dispatch[] = array ('title' => 'Строения клана', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'builds/?id='.$id.'', 'ico_size' => 32);
}
$dispatch[] = array ('title' => 'В клане построено', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'builds/constructed.php?id='.$id.'', 'ico_size' => 32);
$dispatch[] = array ('title' => 'Рейд <FONT color="red">тест</FONT>', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'raid', 'ico_size' => 32);
$dispatch[] = array ('title' => 'Оружие клана', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'artifacts/?id='.$id.'', 'ico_size' => 32);
$dispatch[] = array ('title' => 'Банк клана', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'bank/?id='.$id.'', 'ico_size' => 32);
$dispatch[] = array ('title' => 'Таверна клана', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'taverna/?id='.$id.'', 'ico_size' => 32);
$dispatch[] = array ('title' => 'Обсуждения', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'board/?id='.$id.'', 'ico_size' => 32);
$dispatch[] = array ('title' => 'Голосования', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'voting/?id='.$id.'', 'ico_size' => 32);
if ($admin['admin'] > 0 || $player->admin > 1) {
$dispatch[] = array ('title' => 'Админка', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'admin.php?id='.$id.'', 'ico_size' => 32);
}
if ($count_us) {
$dispatch[] = array ('title' => 'Покинуть клан', 'img' => '/dark_war/all_img/clans/menu/board.png', 'link' => 'leave.php?id='.$id.'', 'ico_size' => 32);
}
}
$doc->assign('post', $dispatch);
$doc->display('view_list_plus_img.tpl');
if($admin['id_player'] == $player->id){
if ($ar['set_wall'] == 0) { // Отоброжение стены в клане
include_once 'wall/index.php';
}
}
$doc->ret("/dark_war/clans/", 'Кланы');
?>