Файл: user/bookmark/index.php
Строк: 111
<?
/*
Модификация модуля закладок от PluginS
*/
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
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 = get_user($ank['id']);
if( !$ank ){ header("Location: /index.php?" . SID); exit; }
$set['title'] = 'Закладки ' . $ank['nick']; // заголовок страницы
include_once '../../sys/inc/thead.php';
title();
err();
aut(); // форма авторизации
$people = mysql_result(mysql_query("SELECT COUNT(id_object) FROM `bookmarks` WHERE `id_user` = '" . $ank['id'] . "' AND `type`='people'"),0);
echo '<a class="link" href="/user/bookmark/people.php?id=' . $ank['id'] . '"><i class="fa fa-users"></i> Люди <span class="c">' . $people . '</span></a>';
//$files = mysql_result(mysql_query("SELECT COUNT(id_object) FROM `bookmarks` WHERE `id_user` = '" . $ank['id'] . "' AND `type`='file'"),0);
//echo '<a class="link" href="/user/bookmark/files.php?id=' . $ank['id'] . '">Файлы <span class="c">' . $files . '</span></a>';
$foto = mysql_result(mysql_query("SELECT COUNT(id_object) FROM `bookmarks` WHERE `id_user` = '" . $ank['id'] . "' AND `type`='foto'"),0);
echo '<a class="link" href="/user/bookmark/foto.php?id=' . $ank['id'] . '"><i class="fa fa-camera"></i> Фотографии <span class="c">' . $foto . '</span></a>';
$forum = mysql_result(mysql_query("SELECT COUNT(id_object) FROM `bookmarks` WHERE `id_user` = '" . $ank['id'] . "' AND `type`='forum'"),0);
echo '<a class="link" href="/user/bookmark/forum.php?id=' . $ank['id'] . '"><i class="fab fa-hotjar"></i> Форум <span class="c">' . $forum . '</span></a>';
$notes = mysql_result(mysql_query("SELECT COUNT(id_object) FROM `bookmarks` WHERE `id_user` = '" . $ank['id'] . "' AND `type`='notes'"),0);
echo '<a class="link" href="/user/bookmark/notes.php?id=' . $ank['id'] . '"><i class="fas fa-address-book"></i> Блоги <span class="c">' . $notes . '</span></a>';
if(!isset($_GET['metki'])){
}elseif(isset($_GET['metki'])){}
if(isset($_GET['metki'])){
}else{
$k_post=mysql_result(mysql_query("SELECT COUNT(id_object) FROM `bookmarks` 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'];
$q=mysql_query("SELECT * FROM `bookmarks` WHERE `id_user`='$ank[id]' ORDER BY `time` DESC LIMIT $start,$set[p_str]");
while($post=mysql_fetch_assoc($q)){
echo "<div class='nav1'>";
if($post['type']=='forum'){
$them=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id`='$post[id_object]' LIMIT 1"));
echo "<a href='/forum/".$them['id_forum']."/".$them['id_razdel']."/".$them['id']."/'><img src='/style/icons/Forum.gif'> ".htmlspecialchars($them['name'])."</a><br/>";
echo substr(htmlspecialchars($them['text']),0,40)." (Добавлено ".vremja($post['time']).")";
}elseif($post['type']=='notes'){
$notes=mysql_fetch_assoc(mysql_query("SELECT * FROM `notes` WHERE `id`='$post[id_object]' LIMIT 1"));
echo "<a href='/plugins/notes/list.php?id=".$notes['id']."'><img src='/style/icons/diary.gif'> ".htmlspecialchars($notes['name'])."</a><br/>";
echo substr(htmlspecialchars($notes['msg']),0,40)."[...] (Добавлено ".vremja($post['time']).")";
}elseif($post['type']=='people'){
$people=get_user($post['id_object']);
echo "<img src='/style/icons/icon_readers.gif'> ";
echo group($people['id'])." ";
echo user::nick($people['id'],1,1,1)." <br/>";
echo " (Добавлено ".vremja($post['time']).")";
}elseif($post['type']=='foto'){
$foto=mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery_foto` WHERE `id`='$post[id_object]' LIMIT 1"));
echo "<a href='/foto/".$foto['id_user']."/".$foto['id_gallery']."/".$foto['id']."/'><img src='/style/icons/PhotoIcon.gif'> ".htmlspecialchars($foto['name'])."</a><br/>";
echo "<img style='height:60px;' src='/foto/foto0/".$foto['id'].".".$foto['ras']."'>";
echo substr(htmlspecialchars($foto['opis']),0,40)."[...] (Добавлено ".vremja($post['time']).")";
}elseif($post['type']=='file'){
$file_id = mysql_fetch_assoc(mysql_query("SELECT id_dir,id,name,ras FROM `obmennik_files` WHERE `id` = '" . $post['id_object'] . "' LIMIT 1"));
$dir = mysql_fetch_array(mysql_query("SELECT `dir` FROM `obmennik_dir` WHERE `id` = '$file_id[id_dir]' LIMIT 1"));
echo '<img src="/style/icons/film.gif"> <a href="/obmen' . $dir['dir'] . $file_id['id'] . '.' . $file_id['ras'] . '?showinfo">' . htmlspecialchars($file_id['name']) . '.' . $file_id['ras'] . '</a>';
echo" (Добавлено ".vremja($post['time']).")";
}
echo "</div>";
}
}
include_once '../../sys/inc/tfoot.php';
?>