Файл: DARK WARS/dark_war/clans/wall/index.php
Строк: 42
<?php
if (isset($_POST['msg'])) {
$msg = my_esc(trim($_POST['msg']));
if (!$msg) {
$doc->err('Постое сообщение');
} else {
mysql_query("INSERT INTO `dark_war_clan_wall` (`id_player`, `id_clan`, `msg`, `time`) values('{$player->id}', '$id', '$msg', '".TIME."')");
$doc->msg('Сообщение отправлено');
}
}
if ($ar['set_access_wall'] == 0 || $admin['admin'] > 0 || $player->admin > 0) {
$doc->assign('method', 'post');
$doc->assign('action', null);
$dispatch = array();
$dispatch[] = array('type' => 'textarea', 'name' => 'msg', 'title' => 'Сообщение', 'br' => 1);
$dispatch[] = array('type' => 'submit', 'name' => 'save', 'value' => 'Отправить', 'br' => 0);
$doc->assign('dis', $dispatch);
$doc->display('form.tpl');
}
$pages = new pages;
$pages->posts = mysql_result(mysql_query("SELECT COUNT(*) FROM `dark_war_clan_wall` WHERE `id_clan` = '$id'"), 0);
$pages->this_page(); // получаем текущую страницу
$dispatch = array();
$q=mysql_query("SELECT * FROM `dark_war_clan_wall` WHERE `id_clan` = '$id' ORDER BY id DESC LIMIT {$pages->my_start()}, {$pages->items_per_page}");
while ($post = mysql_fetch_array($q)) {
$action = array();
$ank = new player($post['id_player']);
$list = $ank->name;
$link = "/dark_war/profil.php?id=".$ank->id."";
$descrip = text::lead_text($post['msg']);
$action[] = array('link' => 'wall/reply.php?id='.$post['id'].'&id_clan='.$id.'', 'name' => 'Ответ');
if ($admin['admin'] || $player->admin) {
$action[] = array('link' => "wall/delete_msg.php?id=$post[id]&id_clan=$id".(isset($_GET['page'])?'&page='.$_GET['page'].'' : '')."", 'name' => 'Удалить');
}
$dispatch[] = array ('title' => $list, 'link' => $link, 'descrip' => $descrip, 'action' => $action);
}
if (!$dispatch) {
$dispatch[] = array ('title' => 'Нет сообщений');
}
$doc->assign('post', $dispatch);
$doc->display('view_list_plus_img.tpl');
$pages->listing("?id=$id&"); // вывод страниц
?>