Example #1
0
 $req_a = mysql_query("SELECT * FROM `cms_album_cat` WHERE `id` = '" . $res_obj['album_id'] . "'");
 $res_a = mysql_fetch_assoc($req_a);
 if ($res_a['access'] == 1 && $owner['id'] != $user_id && $rights < 6 || $res_a['access'] == 2 && (!isset($_SESSION['ap']) || $_SESSION['ap'] != $res_a['password']) && $owner['id'] != $user_id) {
     // Если доступ закрыт
     require '../incfiles/head.php';
     echo functions::display_error($lng['access_forbidden']) . '<div class="phdr"><a href="album.php?act=list&amp;user='******'id'] . '">' . $lng_profile['album_list'] . '</a></div>';
     require '../incfiles/end.php';
     exit;
 }
 $context_top = '<div class="phdr"><a href="album.php"><b>' . $lng['photo_albums'] . '</b></a> | ' . '<a href="album.php?act=list&amp;user='******'id'] . '">' . $lng['personal_2'] . '</a></div>' . '<div class="menu"><a href="album.php?act=show&amp;al=' . $res_obj['album_id'] . '&amp;img=' . $img . '&amp;user='******'id'] . '&amp;view"><img src="../files/users/album/' . $owner['id'] . '/' . $res_obj['tmb_name'] . '" /></a>';
 if (!empty($res_obj['description'])) {
     $context_top .= '<div class="gray">' . functions::smileys(functions::checkout($res_obj['description'], 1)) . '</div>';
 }
 $context_top .= '<div class="sub">' . '<a href="profile.php?user='******'id'] . '"><b>' . $owner['name'] . '</b></a> | ' . '<a href="album.php?act=show&amp;al=' . $res_a['id'] . '&amp;user='******'id'] . '">' . functions::checkout($res_a['name']) . '</a>';
 if ($res_obj['access'] == 4 || $rights >= 7) {
     $context_top .= vote_photo($res_obj) . '<div class="gray">' . $lng['count_views'] . ': ' . $res_obj['views'] . ', ' . $lng['count_downloads'] . ': ' . $res_obj['downloads'] . '</div>' . '<a href="album.php?act=image_download&amp;img=' . $res_obj['id'] . '">' . $lng['download'] . '</a>';
 }
 $context_top .= '</div></div>';
 /*
 -----------------------------------------------------------------
 Параметры комментариев
 -----------------------------------------------------------------
 */
 $arg = array('comments_table' => 'cms_album_comments', 'object_table' => 'cms_album_files', 'script' => 'album.php?act=comments', 'sub_id_name' => 'img', 'sub_id' => $img, 'owner' => $owner['id'], 'owner_delete' => true, 'owner_reply' => true, 'owner_edit' => false, 'title' => $lng['comments'], 'context_top' => $context_top, 'context_bottom' => '');
 /*
 -----------------------------------------------------------------
 Ставим метку прочтения
 -----------------------------------------------------------------
 */
 if (core::$user_id == $user['id'] && $res_obj['unread_comments']) {
     mysql_query("UPDATE `cms_album_files` SET `unread_comments` = '0' WHERE `id` = '{$img}' LIMIT 1");
Example #2
0
                mysql_query("UPDATE `cms_album_files` SET `views` = '{$views}' WHERE `id` = '" . $res['id'] . "'");
            }
        } else {
            /*
            -----------------------------------------------------------------
            Предпросмотр изображения в списке
            -----------------------------------------------------------------
            */
            echo '<a href="album.php?act=show&amp;al=' . $al . '&amp;img=' . $res['id'] . '&amp;user='******'id'] . '&amp;view"><img src="../files/users/album/' . $user['id'] . '/' . $res['tmb_name'] . '" /></a>';
        }
        if (!empty($res['description'])) {
            echo '<div class="gray">' . functions::smileys(functions::checkout($res['description'], 1)) . '</div>';
        }
        echo '<div class="sub">';
        if ($user['id'] == $user_id || core::$user_rights >= 6) {
            echo functions::display_menu(array('<a href="album.php?act=image_edit&amp;img=' . $res['id'] . '&amp;user='******'id'] . '">' . $lng['edit'] . '</a>', '<a href="album.php?act=image_move&amp;img=' . $res['id'] . '&amp;user='******'id'] . '">' . $lng['move'] . '</a>', '<a href="album.php?act=image_delete&amp;img=' . $res['id'] . '&amp;user='******'id'] . '">' . $lng['delete'] . '</a>'));
            if ($user['id'] == $user_id && $view) {
                echo ' | <a href="album.php?act=show&amp;al=' . $al . '&amp;user='******'id'] . '&amp;view&amp;img=' . $res['id'] . '&amp;profile">' . $lng_profile['photo_profile'] . '</a>';
            }
        }
        echo vote_photo($res) . '<div class="gray">' . $lng['count_views'] . ': ' . $res['views'] . ', ' . $lng['count_downloads'] . ': ' . $res['downloads'] . '</div>' . '<div class="gray">' . $lng['date'] . ': ' . functions::display_date($res['time']) . '</div>' . '<a href="album.php?act=comments&amp;img=' . $res['id'] . '">' . $lng['comments'] . '</a> (' . $res['comm_count'] . ')<br />' . '<a href="album.php?act=image_download&amp;img=' . $res['id'] . '">' . $lng['download'] . '</a>' . '</div></div>';
        ++$i;
    }
} else {
    echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
    echo '<div class="topmenu">' . functions::display_pagination('album.php?act=show&amp;al=' . $al . '&amp;user='******'id'] . '&amp;' . ($view ? 'view&amp;' : ''), $start, $total, $kmess) . '</div>' . '<p><form action="album.php?act=show&amp;al=' . $al . '&amp;user='******'id'] . ($view ? '&amp;view' : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
}
echo '<p><a href="album.php?act=list&amp;user='******'id'] . '">' . $lng_profile['album_list'] . '</a></p>';