Файл: modules/obmen/inc/file_form.php
Строк: 126
<?php
if ((user::access('obmen_file_delete') || $user['id'] == $file_id['id_user']) && isset($_GET['act']) && $_GET['act'] == 'edit') {
echo "<div class = 'razdel'>Параметры <a style = 'float:right;color: grey;' href = '?showinfo'><small>Закрыть</small></a></div>";
echo "<form method = 'post' class = 'razd' action = '?showinfo&act=edit&ok'>";
echo "<b>Название</b><br />";
echo "<input type = 'text' name = 'name' value = '$file_id[name]' maxlength = '512' /><br />";
echo "<b>Описание</b><br />";
echo "<textarea name = 'opis'>$file_id[opis]</textarea><br />";
echo "<b>Формат</b> : $file_id[ras]<br />";
echo "<button name = 'save' class = 'clik'>Сохранить</button>";
echo "</form>";
}
if ((user::access('obmen_file_delete') || $user['id'] == $file_id['id_user']) && isset($_GET['act']) && $_GET['act'] == 'parol') {
echo "<div class = 'razdel'>Новый пароль<a style = 'float:right;color: grey;' href = '?showinfo'><small>Закрыть</small></a></div>";
echo "<form method = 'post' class = 'razd' action = '?showinfo&act=parol&ok'>";
echo "<b>Пароль</b><br />";
echo "<input type = 'text' name = 'parol' value = '$file_id[parol]' maxlength = '512' /><br />";
echo "<button name = 'save' class = 'clik'>Сохранить</button>";
echo "</form>";
}
if (user::access('obmen_file_delete') && isset($_GET['act']) && $_GET['act'] == 'blokk') {
echo "<div class = 'razdel'>Блокировка<a style = 'float:right;color: grey;' href = '?showinfo'><small>Закрыть</small></a></div>";
echo "<form method='post' class = 'razd' action='?showinfo&act=blok&ok'>n";
echo "<b>Причина блокировки</b> <br />";
echo "<input type = 'text' name = 'blok' value = '' maxlength = '5102' /><br />n";
echo "<button name = 'save' class = 'clik'>Сохранить</button>";
echo "</form>";
}
if (user::access('obmen_file_delete') && isset($_GET['act']) && $_GET['act'] == 'delete') {
echo "<div class = 'errs'>";
echo "Удалить файл " . text::toOutput($file_id['name']) . "?<br /><br />";
echo "<a class = 'add' href = '?showinfo&act=delete&ok'>Да</a> ";
echo "<a class = 'add' href = '?showinfo'>Нет</a>";
echo "</div>";
}
if (user::access('obmen_file_delete')) {
echo "<div class = 'razd'>";
echo "<a class = 'count' href = '?showinfo&act=edit'>" . img('set_mini.png') . " Параметры</a> ";
echo "<a class = 'count' href = '?showinfo&act=delete'>" . img('del.png') . " Удалить файл</a><br />";
if ($file_id['parol'] != NULL && $file_id['blok'] == NULL) {
echo "<br /><a class = 'count' href = '?showinfo&act=parol'>" . img('lock-small.png') . " Изменить пароль</a> ";
echo "<a class = 'count' href = '?showinfo&act=paroll&ok'>" . img('lock-small.png') . " Убрать пароль</a><br />n";
} else if ($file_id['blok'] == NULL) {
echo "<br /><a class = 'count' href = '?showinfo&act=parol'>" . img('lock-small.png') . " Поставить пароль</a><br />n";
}
if ($file_id['blok'] != NULL) {
echo "<br /><a class = 'count' href='?showinfo&act=blokk&ok'>" . img('bl.png') . " Разблокировать файл</a><br />n";
} else {
echo "<br /><a class = 'count' href='?showinfo&act=blokk'>" . img('bl.png') . " Заблокировать файл</a><br />n";
}
echo "</div>n";
} elseif (isset($user) && $user['id'] == $file_id['id_user']) {
echo "<div class = 'razd'>";
echo "<a class = 'count' href = '?showinfo&act=edit'>" . img('set_mini.png') . " Параметры</a> ";
echo "<a class = 'count' href = '?showinfo&act=delete'>" . img('del.png') . " Удалить файл</a><br />";
if ($file_id['parol'] != NULL && $file_id['blok'] == NULL) {
echo "<br /><a class = 'count' href = '?showinfo&act=parol'>" . img('lock-small.png') . " Изменить пароль</a> ";
echo "<a class = 'count' href = '?showinfo&act=paroll&ok'>" . img('lock-small.png') . " Убрать пароль</a><br />n";
} else if ($file_id['blok'] == NULL) {
echo "<br /><a class = 'count' href = '?showinfo&act=parol'>" . img('lock-small.png') . " Поставить пароль</a><br />n";
}
echo "</div>n";
}
if (isset($user)) {
if (isset($_GET['idd']) && isset($user) && $user['id'] != $_GET['id']) {
$q_user = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='" . mysql_real_escape_string($_GET['idd']) . "'"));
echo "<form class = 'razd' method="post" name='message' action="?showinfo&mess&uidd=$q_user[id]">n";
} else {
echo "<form class = 'razd' method="post" name='message' action="?showinfo&mess">n";
}
if (isset($_GET['idd']) && isset($user) && $user['id'] != $_GET['id']) {
$q_user = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='" . mysql_real_escape_string($_GET['idd']) . "'"));
echo "<b>Комментарий</b><br /><textarea name = 'msg'>$q_user[nick], </textarea><br />";
} else {
echo "<b>Комментарий</b><br /><textarea name = 'msg'></textarea><br />n";
}
echo "<button class = 'clik'>Добавить</button>";
echo "</form>n";
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_komm` WHERE `id_file` = '$file_id[id]'"), 0);
$k_page = k_page($k_post, 5);
$page = page($k_page);
$start = 5 * $page - 5;
if ($k_post == 0) {
echo "<div class = 'errs'>";
echo img('error.png') . " Нет результатов";
echo "</div>";
}
$q = mysql_query("SELECT * FROM `obmennik_komm` WHERE `id_file` = '$file_id[id]' ORDER BY `id` DESC LIMIT $start, 5");
while ($post = mysql_fetch_assoc($q)) {
$ank = user::get_user($post['id_user']);
echo "<table class = 'razd'><tr><td class = 'icon14'>";
avatar($ank['id'], '30');
echo "</td><td class = 'null'>";
echo "<div style = 'float:right;' id = 'hide'>";
if ($ank['id'] != $user['id']) {
echo "<a class = 'count' href = '?showinfo&mess&page=$page&idd=$post[id_user]' title = 'Ответить'>" . img('pen.png') . "</a> ";
}
if (user::access('obmen_komm_del')) {
echo "<a class = 'count' href = '?showinfo&mess&page=$page&del_post=$post[id]' title = 'Удалить'>" . img('del.png') . "</a>";
}
echo "</div>";
echo user($ank['id']) . " (" . date::time($post['time']) . ")n";
echo "<br/>";
echo text::toOutput($post['msg']) . "<br />n";
echo "</td></tr></table>";
}
if ($k_page > 1) {
str('?showinfo&', $k_page, $page);
} // Вывод страниц