Файл: user/bookmark/index.php
Строк: 89
<?php
/* DCMS S (Special)
* Версия файла 0.0.1
* Дата последнего редактирования 22.11.2015
* Модифицировал densnet
*/
require_once '../../sys/inc/start.php';
require_once H . 'sys/inc/compress.php';
require_once H . 'sys/inc/sess.php';
require_once H . 'sys/inc/settings.php';
require_once H . 'sys/inc/db_connect.php';
require_once H . 'sys/inc/ipua.php';
require_once H . 'sys/inc/fnc.php';
require_once H . 'sys/inc/user.php';
if (isset($user) && isset($_GET['delete']) && $user['id'] == $ank['id']) {
mysql_query("DELETE FROM `bookmark_user` WHERE `id` = '" . intval($_GET['delete']) . "' AND `id_user` = '$user[id]' LIMIT 1");
msg("Закладка удалена");
header("Location: ?page=" . intval($_GET['page']) . "" . SID);
exit;
}
if (isset($user)) {
$ank['id'] = $user['id'];
}
if (isset($_GET['id'])) {
$ank['id'] = intval($_GET['id']);
}
if ($ank['id'] == 0) {
header("Location: /index.php?" . SID);
exit;
}
$ank = user::get_user($ank['id']);
if (!$ank) {
header("Location: /index.php?" . SID);
exit;
}
$set['title'] = 'Закладки ' . $ank['nick'];
require_once H . 'sys/inc/thead.php';
title();
aut();
$users = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `bookmark_user` WHERE `id_user` = '" . $ank['id'] . "'"), 0);
$foto = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `bookmark_foto` WHERE `id_user` = '" . $ank['id'] . "'"), 0);
echo "<div class='card'>";
echo "<div class='card-header'>Закладки</div><div class='card-block'>";
echo "<ul class='nav nav-tabs'>";
echo "<li class='nav-item'><a class='nav-link active'>Люди <span class='label label-default label-pill'>$users</span></a></li>";
echo "<li class='nav-item'><a class='nav-link' href='foto.php?id=$ank[id]'>Фото <span class='label label-default label-pill'>$foto</span></a></li>";
echo "<li class='nav-item'><a class='nav-link' href='forum.php?id=$ank[id]'>Форум <span class='label label-default label-pill'>0</span></a></li>";
echo "</ul>";
echo "</div>";
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `bookmark_user` WHERE `id_user` = '$ank[id]'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
if ($k_post == 0) {
echo "<div class='card-block'>";
echo "<span class='fa fa-info-circle'></span> Нет результатов";
echo "</div>";
}
$q = mysql_query("SELECT * FROM `bookmark_user` WHERE `id_user` = '$ank[id]' ORDER BY id DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q)) {
$ank_p = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_people] LIMIT 1"));
if ($ank_p['id'] == 0) {
$ank_p['id'] = 0;
}
echo "<div class='card-block'>";
echo "<table><tr><td class = 'icon14'>";
avatar($ank_p['id'], '48');
echo "</td><td class = 'null'>";
echo "<div style = 'float:right;color:grey;'><small title='" . date::time($post['time']) . "'>" . date::timek($post['time']) . "</small></div>";
echo user($ank_p['id']);
echo "<br />";
if (isset($user) && $user['id'] == $ank['id']) {
echo "<div style='float:right;' id='hides'>";
echo "<a href='?delete=$post[id]&page=$page' title='Удалить'><span class='fa fa-trash-o'></span></a>";
echo "</div>";
}
if ($ank_p['id'] == 0) {
echo "<a style='color:grey;'><span class='fa fa-envelope'></span> Сообщение</a>";
} else {
echo "<a href = '/user/mail/?new_message=$ank[id]'><span class='fa fa-envelope'></span> Сообщение</a>";
}
echo "</td></tr></table></div>";
}
if ($k_page > 1) {
str('?', $k_page, $page);
}
echo "</div>";
require_once H . 'sys/inc/tfoot.php';