コード例 #1
0
ファイル: album.php プロジェクト: phpbbgallery/phpbb-gallery
* Build auth-list
*/
phpbb_gallery::$auth->gen_auth_level('album', $album_id, $album_data['album_status'], $album_data['album_user_id']);
if (!phpbb_gallery::$auth->acl_check('i_view', $album_id, $album_data['album_user_id'])) {
    if ($user->data['is_bot']) {
        phpbb_gallery::redirect('index');
    }
    if (!$user->data['is_registered']) {
        login_box();
    } else {
        trigger_error('NOT_AUTHORISED');
    }
}
// Build the navigation & display subalbums
phpbb_gallery_album::generate_nav($album_data);
phpbb_gallery_album::display_albums($album_data, $config['load_moderators']);
// Set some variables to their defaults
$allowed_create = false;
$image_counter = 0;
$l_moderator = $moderators_list = $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
$grouprows = $album_moderators = array();
$images_per_page = phpbb_gallery_config::get('album_rows') * phpbb_gallery_config::get('album_columns');
/**
* We have album_type so that there may be images ...
*/
if ($album_data['album_type'] != phpbb_gallery_album::TYPE_CAT) {
    if (phpbb_gallery::$auth->acl_check('m_', $album_id, $album_data['album_user_id'])) {
        $template->assign_var('U_MCP', phpbb_gallery_url::append_sid('mcp', "album_id={$album_id}"));
    }
    // When we do the slideshow, we don't need the moderators
    if ($mode != 'slide_show') {
コード例 #2
0
ファイル: index.php プロジェクト: phpbbgallery/phpbb-gallery
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include 'common.' . $phpEx;
include $phpbb_root_path . 'common.' . $phpEx;
phpbb_gallery::setup(array('mods/gallery'));
phpbb_gallery_url::_include('functions_display', 'phpbb');
/**
* Display albums
*/
$mode = request_var('mode', 'index', true);
phpbb_gallery_album::display_albums($mode == 'personal' ? 'personal' : 0, $config['load_moderators']);
if ($mode == 'personal') {
    $template->assign_block_vars('navlinks', array('FORUM_NAME' => $user->lang['PERSONAL_ALBUMS'], 'U_VIEW_FORUM' => phpbb_gallery_url::append_sid('index', 'mode=personal')));
    $template->assign_var('S_PERSONAL_GALLERY', true);
} else {
    if (phpbb_gallery_config::get('pegas_index_album') && phpbb_gallery::$auth->acl_check('a_list', phpbb_gallery_auth::PERSONAL_ALBUM)) {
        $images = $images_real = $last_image = 0;
        $last_image = $lastimage_image_id = $lastimage_user_id = $lastimage_album_id = 0;
        $lastimage_time = $lastimage_name = $lastimage_username = $lastimage_user_colour = $last_image_page_url = $last_thumb_url = '';
        $sql = 'SELECT *
		FROM ' . GALLERY_ALBUMS_TABLE . '
		WHERE album_user_id <> ' . phpbb_gallery_album::PUBLIC_ALBUM;
        $result = $db->sql_query($sql);
        while ($row = $db->sql_fetchrow($result)) {
            $images += $row['album_images'];
            $images_real += $row['album_images_real'];