Файл: modules/forum/view/reports.php
Строк: 48
<?php
/* DCMS Special
* Дата последнего редактирования 19.12.2015
* Модифицировал densnet
* Автор yadalay
*/
if (!access('forum_them_edit')) {
header('Location: ' . DIR_FORUM);
exit;
} else {
$set['title'] = 'Жалобы на темы';
if (isset($_GET['delete'])) {
$this_report = intval($_GET['delete']);
if (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_reports` WHERE `id` = ' . $this_report), 0) != 0) {
mysql_query('DELETE FROM `forum_reports` WHERE `id` = ' . $this_report);
}
header('Location: ' . DIR_FORUM . 'reports.html');
exit;
}
$k_post = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_reports`'), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
#Навигация
echo "<nav class='navbar navbar-light' style='background-color: #607D8B; color: #fff;'>";
echo "<ul class='nav navbar-nav'>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link' href='/'><i class='material-icons'>home</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'><i class='material-icons'>keyboard_arrow_right</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link' href='" . DIR_FORUM . "'>Форум</a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'><i class='material-icons'>keyboard_arrow_right</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'>Жалобы на темы</a></li>";
echo "</ul>";
echo "</nav>";
if ($k_post == 0) {
echo "<div class='list-group-item'>";
echo "<i class='material-icons'>feedback</i> Нет результатов";
echo "</div>";
}
$reports = mysql_query('SELECT * FROM `forum_reports` ORDER BY `id` ASC LIMIT ' . $start . ', ' . $set['p_str']);
while ($report = mysql_fetch_object($reports)) {
$who = mysql_fetch_object(mysql_query('SELECT `id`,`nick` FROM `user` WHERE `id` = ' . $report->id_user));
$theme = mysql_fetch_object(mysql_query('SELECT `id`, `id_razdel`, `name` FROM `forum_themes` WHERE `id` = ' . $report->id_theme));
$razdel = mysql_fetch_object(mysql_query('SELECT `id`, `id_forum` FROM `forum_razdels` WHERE `id` = ' . $theme->id_razdel));
$forum = mysql_fetch_object(mysql_query('SELECT `id` FROM `forum` WHERE `id` = ' . $razdel->id_forum));
echo "<div class='list-group-item' style='margin-top: 5px;margin-bottom: 5px;'>n";
echo "<a href='" . DIR_FORUM . "reports/delete_$report->id' style='float: right;'><i class='material-icons'>delete</i></a>";
echo "Тема: <a href='" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id.html'>" . toOutput($theme->name, 1, 1, 0, 0, 0) . "</a> ";
echo "<b><a href='/info.php?id=$who->id'>$who->nick</a></b><br />";
echo toOutput($report->text);
echo "</div>";
}
if ($k_page > 1) {
echo "<div class='list-group-item'>n";
str(DIR_FORUM . 'reports/', $k_page, $page);
echo "</div>";
}
}