Файл: foto/inc/all_gallery.php
Строк: 83
<?
/*
* Autor :: Tw1nGo
* Sait ::: xSimka.Ru
*/
if (isset($user))$ank['id'] = $user['id'];
if (isset($_GET['id']))$ank['id'] = intval($_GET['id']);
// Автор текущего альбома
$ank = get_user($ank['id']);
/* Бан пользователя */
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `razdel` = 'foto' AND `id_user` = '$user[id]' AND (`time` > '$time' OR `view` = '0' OR `navsegda` = '1')"), 0)!=0)
{
header('Location: /ban.php?'.SID);
exit;
}
$set['title'] = 'Фотоальбомы'; // заголовок страницы
include_once '../sys/inc/thead.php';
title();
aut();
?>
<link rel="stylesheet" href="/foto/Tw1nGo.css" type="text/css" />
<div class="lc_br wbg relative oh" id="header_path">
<a href="/" style="font-size:0;" title="Главная"> <img src="/foto/img/home.png" alt="Tw1nGo"> </a>
<?
if (isset($user) && $user['id'] == $ank['id']){
?>
<span class="lc_brw"> <img src="/foto/img/sep.png" alt="Tw1nGo" class="lc_br_sep">
<a href="/info.php?id=<?= $user['id']?>"><?= text($user['nick'])?></a> </span>
<span class="lc_brw"> <img src="/foto/img/sep.png" alt="Tw1nGo" class="lc_br_sep">
<a href="/foto/<?= $user['id']?>/">Мои альбомы</a> </span>
<?
}
?>
<span class="lc_brw"> <img src="/foto/img/sep.png" alt="Tw1nGo" class="lc_br_sep">
<a style="color: #000;">Общие альбомы </a> </span>
</div>
<div class="tw1ngo_bg">
<?
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery`"),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)
{
?>
<div class="widgets-group"><div class="busi"> Фотоальбомов на сайте нет :(..</div></div>
<?
}
$q = mysql_query("SELECT * FROM `gallery` ORDER BY `time` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q))
{
$ank = get_user($post['id_user']);
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_gallery` = '$post[id]'"),0);
$foto = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$post[id]' ORDER BY RAND()"));
$qfoto = mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$post[id]' ORDER BY RAND() LIMIT 4");
?>
<div class="cont_usr">
<a href="/foto/<?= $ank['id']?>/<?= $post['id']?>/">
<div class="content-item3" style="margin-bottom:10px; padding:15px;">
<div class="user__ava user__ava_big">
<div class="change_avatar_link js-my_avatar">
<?
if ($foto==null){
?><img class="preview s81_80" style="border-radius: 5px;border: 2px solid #cdd4e1;padding:0 1px;" src="/foto/img/no_photo.png" title="В Альбоме нет фото."/><?
}else{
?><div class="preview s81_80" style="border-radius: 4px;border: 2px solid #cdd4e1;"><?
while ($post_fotos = mysql_fetch_assoc($qfoto))
{
?><img class="previewka s41_40" src="/foto/img.php?size=50&id=<?= $post_fotos['id']?>.<?= $post_fotos['ras']?>" title="Случайное фото из Альбома"/><?
}
?></div><?
}
?>
</div></div><div class="user__info">
<?
if ($post['privat'] == 2)echo ' <img src="/foto/img/status_me.png" alt="Tw1nGo" title="Доступен автору"> ';
if ($post['privat'] == 1)echo ' <img src="/foto/img/status_friends.png" alt="Tw1nGo" title="Доступен друзьям"> ';
if ($post['privat'] == 0)echo ' <img src="/foto/img/status_all.png" alt="Tw1nGo" title="Доступен всем"> ';
?>
<span class="no_word_break"><?= text($post['name'])?></span>
<div style="float:right;"><span class="cnt switch__item_cnt"><?= $count?></span></div>
<div class="user__descr">
<span class="post-author"><?=group($ank['id'])?> <a href="/info.php?id=<?= $ank['id']?>"><?= text($ank['nick'])?></a>
<?= online($ank['id'])?></span><br />
<span class="mail__service mail__date m"><?= vremja($post['time_create'])?></span>
<?
if ($post['opis'] == null){ ?><br /><br /><? }else{
?><div class="mail__service mail__date m"><?= output_text($post['opis'])?></div><?
}
?>
</div></div>
<div style="padding:5px 0;"></div>
</div>
</a>
<?
echo '</div>';
}
echo '</table>';
if ($k_page>1)str('?',$k_page,$page); // Вывод страниц
include_once '../sys/inc/tfoot.php';
exit;
?>