Файл: modules/albums/album_list.php
Строк: 43
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
$locate = 'in_photo_albums';
$title = _t('all_albums');
include_header($title);
Template::div('title', $title);
$album_r = $db->query("SELECT * FROM `albums`")->rowCount();
$pages = new Paginator($album_r, $ames);
if($album_r == 0)
{
Template::div('post', _t('no_albums'));
}
else
{
$albums = $db->query("SELECT * FROM `albums` ORDER BY id DESC LIMIT $start, $ames");
foreach($albums as $album)
{
echo'<div class="post">';
/* if ($album['type'] == 2 or $album['type'] == 3) echo img('photo-album-2-3.png');
else if ($album['type'] == 1) echo img('photo-album-1.png');
else */echo img('photo-album.png');
echo '<a href="/albums/album/'.$album['id'].'">'.$album['name'].'</a> ('.$db->query("SELECT * FROM `albums_photo` WHERE `album_id` = '".$album['id']."'")->rowCount().')
'.($user['level'] == 2 || $user['level'] >=6 ? '[ <a href="/albums/edit_album/'.$album['id'].'">'.img('edit.png').'</a> | <a href="/albums/delete_album/'.$album['id'].'">'.img('delete.png').'</a> ]' : NULL).'
'.(!empty($album['description']) ? '<br/><small>'.$album['description'] : null).'</small><br /> <b>'._t('author').'</b>: '.nick($album['user_id'], '', true).'</div>';
}
$pages->view();
}
echo '<div class="block">
'. NAV.' <a href="/albums">'. _t('photo_albums').'</a><br/>'
.HICO.' <a href="/">'._t('home').'</a>
</div>';
include_footer();