Файл: moduls/album/index.php
Строк: 298
<?php
/**
* @package Prime Social
* @link http://primesocial.ru
* @copyright Copyright (C) 2016 Prime Social
* @author BoB | http://primesocial.ru/about
*/
require_once('../../core/start.php');
check_auth();
switch ($select) {
default:
head('Fotoalbom');
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS." WHERE `user_id` = ?", array($user['user_id']));
echo DIV_LI . ''.icon('foto.png').' <a href="'.HOME.'/album/user/'.$user['user_id'].'/">Mening fotoalbomlarim <span class="count">'.$all.'</span></a>' . CLOSE_DIV;
if ($_POST['add'] && privilegy('album')) {
$name = html($_POST['name']);
if (empty($name)) {
echo DIV_ERROR . 'Bo`lim nomini kiriting' . CLOSE_DIV;
} else {
DB::$dbs->query("INSERT INTO ".ALBUMS_CAT." (`name`) VALUES (?)", array($name));
header("Location: ".HOME."/album/");
}
}
echo DIV_BLOCK . '<b>Bo`limlar:</b>' . CLOSE_DIV;
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS_CAT."");
if ($all == 0) {
echo DIV_AUT . 'Bo`limlar yo`q' . CLOSE_DIV;
} else {
$sql = DB::$dbs->query("SELECT * FROM ".ALBUMS_CAT." ORDER BY `id` DESC ");
while($cat = $sql -> fetch()) {
$albums = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS." WHERE `cat_id` = ? ", array($cat['id']));
$photos = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS_PHOTOS." WHERE `cat_id` = ? ", array($cat['id']));
echo DIV_LI . ''.icon('folder.gif').' <a href="'.HOME.'/album/'.$cat['id'].'/">'.$cat['name'].'</a> <span class="count">'.$albums.' / '.$photos.'</span>' . CLOSE_DIV;
}
}
echo '<div class="white" style="font-size:12px;color: #757575;"><b>U</b>shbu bo`limda saytimizning barcha foydalanuvchilarining foto albomlari joylangan. Bu yerda siz boshqa foydalanuvchilarning rasmlarini ko`rishingiz hamda o`zingizgaham albom ochib suratlaringizni kiritishingiz mumkun!</div>';
if (privilegy('album')) {
echo DIV_AUT;
echo '<form action="#" method="POST">';
echo 'Yangi bo`lim:<br /><input type="text" name="name" />';
echo '<input type="submit" name="add" value="+" /></form>';
echo CLOSE_DIV;
}
$array = array('Fotoalbomlar');
nav($array);
break;
case 'cat':
$cat = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS_CAT." WHERE `id` = ? ", array(abs(num($_GET['cat']))));
if (empty($cat)) {
head('Bo`lim topilmadi');
echo DIV_TITLE . 'Bo`lim topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
} else {
head('Bo`lim: ' . $cat['name']);
if (isset($_GET['del']) && privilegy('album')) {
if (!isset($_GET['go'])) {
echo DIV_LI . '<b>O`chirishni tastiqlang:</b> <a href="?del&go">[O`chirish]</a> <a href="'.HOME.'/album/'.$cat['id'].'/">[Yo`q]</a>' . CLOSE_DIV;
} else {
DB::$dbs->query("DELETE FROM ".ALBUMS_CAT." WHERE `id` = ? ", array($cat['id']));
header("Location: ".HOME."/album/");
}
}
if (isset($_GET['edit']) && privilegy('album')) {
if ($_POST['edit']) {
$name = html($_POST['name']);
if (empty($name)) {
echo DIV_ERROR . 'Bo`lim nomini kiriting' . CLOSE_DIV;
} else {
DB::$dbs->query("UPDATE ".ALBUMS_CAT." SET `name` = ? WHERE `id` = ? ", array($name, $cat['id']));
header("Location: ".HOME."/album/".$cat['id']."/");
}
}
echo DIV_AUT;
echo '<form action="#" method="POST">';
echo 'Bo`limni o`zgartirish:<br /><input type="text" value="'.$cat['name'].'" name="name" />';
echo '<input type="submit" name="edit" value="O`zgartirish" /></form>';
echo CLOSE_DIV;
}
if ($_POST['add']) {
$name = html($_POST['name']);
$info = html($_POST['info']);
if (empty($name)) {
echo DIV_ERROR . 'Fotoalbom nomini kiriting' . CLOSE_DIV;
} else {
DB::$dbs->query("INSERT INTO ".ALBUMS." (`cat_id`, `name`, `info`, `user_id`, `time`) VALUES (?, ?, ?, ?, ?)", array($cat['id'], $name, $info, $user['user_id'], time()));
header("Location: ".HOME."/album/".$cat['id']."/");
}
}
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS." WHERE `cat_id` = ?", array($cat['id']));
if (empty($all)) {
echo DIV_BLOCK . 'Fotoalbomlar ochilmagan' . CLOSE_DIV;
} else {
$n = new Navigator($all,$config['write']['album_albums'],'cat='.$cat['id'].'&select=cat');
$sql = DB::$dbs->query("SELECT * FROM ".ALBUMS." WHERE `cat_id` = ? ORDER BY `id` DESC LIMIT {$n->start()}, ".$config['write']['album_albums']." ", array($cat['id']));
while($album = $sql -> fetch()) {
$photos = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS_PHOTOS." WHERE `album_id` = ? ", array($album['id']));
echo DIV_LI . ''.icon('folder.gif').' <a href="'.HOME.'/album/'.$cat['id'].'/'.$album['id'].'/">'.$album['name'].'</a>
<span class="count">'.$photos.'</span> '.userLink($album['user_id']).'' . CLOSE_DIV;
}
echo $n->navi();
}
echo DIV_AUT;
echo '<form action="#" method="POST">';
echo 'Yangi albom:<br /><input type="text" name="name" /><br />';
echo 'Ta`rif:<br /><textarea name="info"></textarea><br />';
echo '<input type="submit" name="add" value="Yaratish" /></form>';
echo CLOSE_DIV;
if (privilegy('album') && !empty($cat)) {
echo DIV_BLOCK;
echo '- <a href="?edit">Bo`limni tahrirlash<br />';
echo '- <a href="?del">Bo`limni o`chirish<br />';
echo CLOSE_DIV;
}
}
$array = array('Fotoalbom');
nav($array);
break;
case 'rating';
$photo_id = abs(intval($_POST['photo_id']));
$data = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS_PHOTOS." WHERE `id` = ? && `user_id` != ?", array($photo_id, $user['user_id']));
if (empty($data)) {
header("Location: ".HOME);
exit();
}
$ocenka = abs(intval($_POST['ocenka']));
if (empty($ocenka) || $ocenka > 5) {
header("Location: ".HOME."/album/".$cat['id']."/".$album['id']."/view/".$data['id']."/");
exit();
}
$check_vote = DB::$dbs->querySingle("SELECT COUNT(*) FROM ".ALBUMS_RATING." WHERE `user_id` = ? && `photo_id` = ? ", array($user['user_id'], $data['id']));
if ($check_vote) {
header("Location: ".HOME."/album/".$cat['id']."/".$album['id']."/view/".$data['id']."/");
exit();
}
DB::$dbs->query("INSERT INTO ".ALBUMS_RATING." (`user_id`, `photo_id`, `time`, `ocenka`) VALUES (?,?,?,?)", array($user['user_id'], $data['id'], time(), $ocenka));
header("Location: ".HOME."/album/".$data['cat_id']."/".$data['album_id']."/view/".$data['id']."/?addrating");
break;
case 'rating_list';
$cat = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS_CAT." WHERE `id` = ? ", array(abs(num($_GET['cat']))));
if (empty($cat)) {
head('Bo`lim topilmadi');
echo DIV_TITLE . 'Bo`lim topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Bo`lim topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$album = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS." WHERE `id` = ? ", array(abs(num($_GET['album']))));
if (empty($album)) {
head('Fotoalbom topilmadi');
echo DIV_TITLE . 'Fotoalbom topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Fotoalbom topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$photo = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS_PHOTOS." WHERE `id` = ? ", array(abs(num($_GET['photo']))));
if (empty($photo)) {
head('Foto topilmadi');
echo DIV_TITLE . 'Foto topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Foto topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
head('Fotoga baxolar');
$total = DB::$dbs->querySingle("SELECT COUNT(*) FROM ".ALBUMS_RATING." WHERE `photo_id` = ? ", array($photo['id']));
if ($total) {
$sql = DB::$dbs->query("SELECT * FROM ".ALBUMS_RATING." WHERE `photo_id` = ? ORDER BY `id` DESC", array($photo['id']));
while($post = $sql -> fetch()) {
echo DIV_BLOCK;
echo vrem($post['time']), ': ', user_choice($post['user_id'], 'link') . ' ', $post['ocenka'], ' ballga baxoladi';
echo CLOSE_DIV;
}
} else {
echo DIV_BLOCK . 'Hali hech kim baxolamadi' . CLOSE_DIV;
}
echo DIV_LI . '<a href="'.HOME.'/album/'.$cat['id'].'/'.$album['id'].'/view/'.$photo['id'].'/">Sahifaga qaytish</a>' . CLOSE_DIV;
$array = array('Fotoalbomlar');
nav($array);
break;
case 'album':
$cat = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS_CAT." WHERE `id` = ? ", array(abs(num($_GET['cat']))));
if (empty($cat)) {
head('Bo`lim topilmadi');
echo DIV_TITLE . 'Bo`lim topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Bo`lim topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$album = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS." WHERE `id` = ? ", array(abs(num($_GET['album']))));
if (empty($album)) {
head('Fotoalbom topilmadi');
echo DIV_TITLE . 'Fotoalbom topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Fotoalbom topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
head('Fotoalbom:' . $album['name']);
if (!empty($_POST['upload']) && $album['user_id'] == $user['user_id']) {
if (isset($_FILES['photo']['name'])) {
foreach ($_FILES['photo']['name'] as $k=>$v) {
$name = $_FILES['photo']['name'][$k];
$ext = strtolower(strrchr($name, '.')); # Fayl formati
$pictures = array('.jpg', '.jpeg', '.gif', '.png'); # Mumkun bolgan formatlar
$size = $_FILES['photo']['size'][$k]; # Fayl hajmi
if (preg_match('/.phtml/i', $name) || preg_match('/.php/i', $name) || preg_match('/.pl/i', $name) || $name == '.htaccess' || !in_array($ext, $pictures)) {
} else {
$name_photo = 'img_' . time() . ''. $ext;
copy($_FILES['photo']['tmp_name'][$k], '../../files/album/'.$name_photo);
img_resize('../../files/album/'.$name_photo, '../../files/album/mini_'.$name_photo, $config['mini_photo_par'][0], $config['mini_photo_par'][1]); # Mini
DB::$dbs->query("INSERT INTO ".ALBUMS_PHOTOS." (`cat_id`, `album_id`, `url`, `user_id`, `size`, `type`, `time`) VALUES (?,?,?,?,?,?,?)", array($cat['id'], $album['id'], $name_photo, $user['user_id'], $size, $ext, time()));
}
}
}
header("Location: ".HOME."/album/".$cat['id']."/".$album['id']."/");
}
if (!empty($_GET['del'])) {
$photo = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS_PHOTOS." WHERE `id` = ? ", array(abs(num($_GET['del']))));
@unlink('../../files/album/' . $photo['url']);
@unlink('../../files/album/mini_' . $photo['url']);
DB::$dbs->query("DELETE FROM ".ALBUMS_PHOTOS." WHERE `id` = ? ", array(abs(num($_GET['del']))));
}
if (!empty($album['info'])) {
echo '<div class="white"> ' . text($album['info']) . CLOSE_DIV;
}
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS_PHOTOS." WHERE `album_id` = ?", array($album['id']));
if ($all == 0) {
echo DIV_AUT . 'Rasmlar joylanmagan' . CLOSE_DIV;
} else {
$n = new Navigator($all,$config['write']['album_photos'],'cat='.$cat['id'].'&album='.$album['id'].'&select=album');
$sql = DB::$dbs->query("SELECT * FROM ".ALBUMS_PHOTOS." WHERE `album_id` = ? ORDER BY `id` DESC LIMIT {$n->start()}, ".$config['write']['album_photos']." ", array($album['id']));
while($photo = $sql -> fetch()) {
echo DIV_BLOCK;
echo '<a href="'.HOME.'/album/'.$cat['id'].'/'.$album['id'].'/view/'.$photo['id'].'/">
<img src="'.HOME.'/files/album/mini_'.$photo['url'].'" /></a> ';
echo CLOSE_DIV;
}
echo $n->navi();
}
echo DIV_LI . '- <a href="'.HOME.'/album/'.$cat['id'].'/">Sahifaga qaytish</a>' . CLOSE_DIV;
if ($album['user_id'] == $user['user_id']) {
echo '<div class="grey">';
echo '<form action="'.HOME.'/album/'.$cat['id'].'/'.$album['id'].'/" enctype="multipart/form-data" method="POST">';
echo '<b>Foto kiritish:</b><br /><input name="photo[]" type="file" multiple="true" /><br />';
echo '<input type="submit" name="upload" value="Joylash" />';
echo '</form>';
echo CLOSE_DIV;
}
$array = array('Fotoalbom');
nav($array);
break;
case 'view';
$cat = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS_CAT." WHERE `id` = ? ", array(abs(num($_GET['cat']))));
if (empty($cat)) {
head('Bo`lim topilmadi');
echo DIV_TITLE . 'Bo`lim topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Bo`lim topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$album = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS." WHERE `id` = ? ", array(abs(num($_GET['album']))));
if (empty($album)) {
head('Fotoalbom topilmadi');
echo DIV_TITLE . 'Fotoalbom topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Fotoalbom topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$photo = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS_PHOTOS." WHERE `id` = ? ", array(abs(num($_GET['photo']))));
if (empty($photo)) {
head('Foto topilmadi');
echo DIV_TITLE . 'Foto topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Foto topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
head('Suratni ko`rish');
if (isset($_GET['addrating'])) {
echo DIV_MSG . 'Reyting muvaffaqiyatli o`zgartirildi!' . CLOSE_DIV;
}
if (isset($_GET['update_ava'])) {
echo DIV_MSG . 'Avatar muvaffaqiyatli yangilandi' . CLOSE_DIV;
}
echo '<div class="grey">'.icon('yuklash.png').' <a href="'.HOME.'/files/album/'.$photo['url'].'">Yuklash</a><br />';
/* *** */
if ($user['user_id'] == $photo['user_id']) {
echo ''.icon('ava.png').' <a href="'.HOME.'/album/'.$cat['id'].'/'.$album['id'].'/update_ava/'.$photo['id'].'/">Avatarga o`rnatish</a>';
}
echo '</div>';
echo '<div class="white"><a href="'.HOME.'/files/album/'.$photo['url'].'"><img src="'.HOME.'/files/album/'.$photo['url'].'" width="150"></a></div>';
echo DIV_BLOCK;
$check_vote = DB::$dbs->querySingle("SELECT COUNT(*) FROM ".ALBUMS_RATING." WHERE `user_id` = ? && `photo_id` = ? ", array($user['user_id'], $photo['id']));
if (!$check_vote) {
if ($user['user_id'] != $photo['user_id']) {
echo '<form action="'.HOME.'/album/'.$cat['id'].'/'.$album['id'].'/rating/" method="POST">';
echo '<b>Baxolash:</b><br />';
echo '<select name="ocenka">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<input type="hidden" name="photo_id" value="'.$photo['id'].'" />
<input type="submit" name="rating" value="Baxolash" /><br />
</form>';
}
}
//SELECT SUM(column_name) FROM table_name;
$rating = DB::$dbs->querySingle("SELECT SUM(ocenka) FROM ".ALBUMS_RATING." WHERE `photo_id` = ? ", array($photo['id']));
$total_votes = DB::$dbs->querySingle("SELECT COUNT(*) FROM ".ALBUMS_RATING." WHERE `photo_id` = ? ", array($photo['id']));
echo 'Foto reytingi: <b>', $rating, '</b> <a href="'.HOME.'/album/'.$cat['id'].'/'.$album['id'].'/rating_list/'.$photo['id'].'/" style="color:green;">'.$total_votes.'</a><br />';
/* *** */
echo get_size($photo['size']) . ' [' . $photo['type'] . ']<br />';
echo 'Joylangan: [' . vrem($photo['time']) . ']<br />';
if ($photo['user_id'] == $user['user_id']) {
echo '<br /><a href="'.HOME.'/album/'.$cat['id'].'/'.$album['id'].'/?del='.$photo['id'].'">O`chirish</a>';
}
echo CLOSE_DIV;
echo DIV_LI . '<a href="'.HOME.'/album/'.$cat['id'].'/'.$album['id'].'/">Orqaga</a>' . CLOSE_DIV;
$array = array('Fotoalbom');
nav($array);
break;
case 'update_ava':
$cat = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS_CAT." WHERE `id` = ? ", array(abs(num($_GET['cat']))));
if (empty($cat)) {
head('Bo`lim topilmadi');
echo DIV_TITLE . 'Bo`lim topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Bo`lim topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$album = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS." WHERE `id` = ? ", array(abs(num($_GET['album']))));
if (empty($album)) {
head('Fotoalbom topilmadi');
echo DIV_TITLE . 'Fotoalbom topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Fotoalbom topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$photo = DB::$dbs->queryFetch("SELECT * FROM ".ALBUMS_PHOTOS." WHERE `id` = ? && user_id = ? ", array(abs(num($_GET['photo'])), $user['user_id']));
if (empty($photo)) {
head('Foto topilmadi');
echo DIV_TITLE . 'Foto topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/album/">Fotoalbomlar</a> / <b>Foto topilmadi</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
if (copy('../../files/album/' . $photo['url'], '../../files/photo/' . $user['user_id'] . '.jpg')) {
img_resize('../../files/photo/'.$user['user_id'].'.jpg', '../../files/photo/mini_'.$user['user_id'].'.jpg', $config['mini_photo_par'][0], $config['mini_photo_par'][1]); # MiniDB::$dbs->query("UPDATE ".USERS." SET `photo` = ? WHERE `user_id` = ? ", array($user['user_id'].'.jpg', $user['user_id']));
DB::$dbs->query("UPDATE ".USERS." SET `photo` = ? WHERE `user_id` = ? ", array($user['user_id'].'.jpg', $user['user_id']));
header("Location: ".HOME."/album/".$cat['id']."/".$album['id']."/view/".$photo['id']."/?update_ava");
} else {
header("Location: ".HOME."/album/".$cat['id']."/".$album['id']."/view/".$photo['id']."/");
}
break;
case 'user':
$ank = DB::$dbs->queryFetch("SELECT * FROM ".USERS." WHERE `user_id` = ?",array(num($_GET['user'])));
if (empty($ank)) {
head('Foydalanuvchi topilmadi');
echo DIV_TITLE . 'Foydalanuvchi topilmadi' . CLOSE_DIV;
echo DIV_ERROR . 'Xatolik!' . CLOSE_DIV;
} else {
head('Fotoalbomlar: ' . $ank['nick']);
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS." WHERE `user_id` = ?", array($ank['user_id']));
if (empty($all)) {
echo DIV_BLOCK . 'Fotoalbomlar hali ochilmagan <br/><a href="/album/"><u>Ochish</u></a> ' . CLOSE_DIV;
} else {
$n = new Navigator($all,$config['write']['album_albums'],'select=user&user='.$ank['user_id']);
$sql = DB::$dbs->query("SELECT * FROM ".ALBUMS." WHERE `user_id` = ? ORDER BY `id` DESC LIMIT {$n->start()}, ".$config['write']['album_albums']." ", array($ank['user_id']));
while($album = $sql -> fetch()) {
$photos = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".ALBUMS_PHOTOS." WHERE `album_id` = ? ", array($album['id']));
echo DIV_LI . ''.icon('folder.gif').'
<a href="'.HOME.'/album/'.$album['cat_id'].'/'.$album['id'].'/">'.$album['name'].'</a> <span class="count">'.$photos.'</span>';
if (!empty($album['info'])) {
echo '<br/><span style="font-size:13px;color:#757575;">' . text($album['info']) . '</span>';
}
echo '</div>';
}
echo $n->navi();
}
}
$array = array('Fotoalbom');
nav($array);
break;
}
require_once('../../core/stop.php');
?>