Файл: users/includes/album/list.php
Строк: 46
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
require('../incfiles/head.php');
/*
-----------------------------------------------------------------
Список альбомов юзера
-----------------------------------------------------------------
*/
if (isset($_SESSION['ap'])) {
unset($_SESSION['ap']);
}
echo '<div class="phdr"><a href="album.php"><b>' . $lng['photo_albums'] . '</b></a> | ' . $lng['personal_2'] . '</div>';
$req = mysql_query("SELECT * FROM `cms_album_cat` WHERE `user_id` = '" . $user['id'] . "' " . ($user['id'] == $user_id || $rights >= 6 ? "" : "AND `access` > 1") . " ORDER BY `sort` ASC");
$total = mysql_num_rows($req);
if ($user['id'] == $user_id && $total < $max_album && empty($ban) || $rights >= 7) {
echo '<div class="topmenu"><a href="album.php?act=edit&user=' . $user['id'] . '">' . $lng_profile['album_create'] . '</a></div>';
}
echo '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1,)) . '</p></div>';
if ($total) {
$i = 0;
while ($res = mysql_fetch_assoc($req)) {
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `album_id` = '" . $res['id'] . "'"), 0);
echo ($i % 2 ? '<div class="list2">' : '<div class="list1">') .
'<img src="../images/album-' . $res['access'] . '.gif" width="16" height="16" class="left" /> ' .
'<a href="album.php?act=show&al=' . $res['id'] . '&user=' . $user['id'] . '"><b>' . functions::checkout($res['name']) . '</b></a> (' . $count . ')';
if ($user['id'] == $user_id || $rights >= 6 || !empty($res['description'])) {
$menu = array(
'<a href="album.php?act=sort&mod=up&al=' . $res['id'] . '&user=' . $user['id'] . '">' . $lng['up'] . '</a>',
'<a href="album.php?act=sort&mod=down&al=' . $res['id'] . '&user=' . $user['id'] . '">' . $lng['down'] . '</a>',
'<a href="album.php?act=edit&al=' . $res['id'] . '&user=' . $user['id'] . '">' . $lng['edit'] . '</a>',
'<a href="album.php?act=delete&al=' . $res['id'] . '&user=' . $user['id'] . '">' . $lng['delete'] . '</a>'
);
echo '<div class="sub">' .
(!empty($res['description']) ? '<div class="gray">' . functions::checkout($res['description'], 1, 1) . '</div>' : '') .
($user['id'] == $user_id && empty($ban) || $rights >= 6 ? functions::display_menu($menu) : '') .
'</div>';
}
echo '</div>';
++$i;
}
} else {
echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';