Beispiel #1
0
function MG_editConfig($msgString = '')
{
    global $_CONF, $_MG_CONF, $_TABLES, $_USER, $LANG_MG00, $LANG_MG01, $LANG_DIRECTION, $LANG04;
    $retval = '';
    $T = new Template($_MG_CONF['template_path'] . '/admin');
    $T->set_file('admin', 'cfgedit.thtml');
    $T->set_var('site_url', $_MG_CONF['site_url']);
    if ($msgString != '') {
        $T->set_var('feedback', $msgString);
    }
    if (!isset($_MG_CONF['rating_max'])) {
        $_MG_CONF['rating_max'] = 5;
    }
    if (!isset($_MG_CONF['moderation'])) {
        $_MG_CONF['moderation'] = 0;
    }
    // build our graphics package select...
    $gp_select = "<select name='graphicspackage'>";
    $gp_select .= "<option value='0'" . ($_MG_CONF['graphicspackage'] == 0 ? ' selected="selected"' : "") . ">ImageMagick</option>";
    $gp_select .= "<option value='1'" . ($_MG_CONF['graphicspackage'] == 1 ? ' selected="selected"' : "") . ">NetPBM</option>";
    $gp_select .= "<option value='2'" . ($_MG_CONF['graphicspackage'] == 2 ? ' selected="selected"' : "") . ">GD Libraries</option>";
    $gp_select .= "</select>";
    $block_select = '<select name="displayblocks">';
    $block_select .= '<option value="0"' . ($_MG_CONF['displayblocks'] == 0 ? ' selected="selected"' : "") . '>' . $LANG_MG01['left_blocks_only'] . '</option>';
    $block_select .= '<option value="1"' . ($_MG_CONF['displayblocks'] == 1 ? ' selected="selected"' : "") . '>' . $LANG_MG01['right_blocks_only'] . '</option>';
    $block_select .= '<option value="2"' . ($_MG_CONF['displayblocks'] == 2 ? ' selected="selected"' : "") . '>' . $LANG_MG01['left_right_blocks'] . '</option>';
    $block_select .= '<option value="3"' . ($_MG_CONF['displayblocks'] == 3 ? ' selected="selected"' : "") . '>' . $LANG_MG01['none'] . '</option>';
    $block_select .= '</select>';
    $dfid_select = '<select name="dfid"><option value="99">' . $LANG_MG00['no_date'] . '</option>' . COM_optionList($_TABLES['dateformats'], 'dfid,description', $_MG_CONF['dfid'], 0) . '</select>';
    if (isset($_MG_CONF['index_all']) && $_MG_CONF['index_all'] == 1) {
        $T->set_var('index_all_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('index_all_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['loginrequired'] == 1) {
        $T->set_var('lr_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('lr_no_checked', ' checked="checked"');
    }
    if (isset($_MG_CONF['moderation']) && $_MG_CONF['moderation'] == 1) {
        $T->set_var('au_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('au_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['htmlallowed'] == 1) {
        $T->set_var('ha_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('ha_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['whatsnew'] == 1) {
        $T->set_var('wn_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('wn_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['usage_tracking'] == 1) {
        $T->set_var('ut_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('ut_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['preserve_filename'] == 1) {
        $T->set_var('pf_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('pf_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['discard_original'] == 1) {
        $T->set_var('do_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('do_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['verbose'] == 1) {
        $T->set_var('verbose_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('verbose_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['disable_whatsnew_comments'] == 1) {
        $T->set_var('dwnc_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('dwnc_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['enable_media_id'] == 1) {
        $T->set_var('emid_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('emid_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['full_in_popup'] == 1) {
        $T->set_var('fip_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('fip_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['commentbar'] == 1) {
        $T->set_var('cmtbar_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('cmtbar_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['profile_hook'] == 1) {
        $T->set_var('ph_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('ph_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['subalbum_select'] == 1) {
        $T->set_var('sa_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('sa_no_checked', ' checked="checked"');
    }
    $T->set_var('wn_length', $_MG_CONF['title_length']);
    // -- auto tag defaults
    if ($_MG_CONF['at_border'] == 1) {
        $T->set_var('at_border_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('at_border_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['at_autoplay'] == 1) {
        $T->set_var('at_autoplay_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('at_autoplay_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['at_enable_link'] == 2) {
        $T->set_var('at_enable_link_lb_checked', ' checked="checked"');
    } elseif ($_MG_CONF['at_enable_link'] == 1) {
        $T->set_var('at_enable_link_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('at_enable_link_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['at_showtitle'] == 1) {
        $T->set_var('at_showtitle_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('at_showtitle_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['search_enable_views'] == 1) {
        $T->set_var('search_enable_views_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('search_enable_views_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['search_enable_rating'] == 1) {
        $T->set_var('search_enable_rating_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('search_enable_rating_no_checked', ' checked="checked"');
    }
    if ($_MG_CONF['gallery_only'] == 1) {
        $T->set_var('gallery_only_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('gallery_only_no_checked', ' checked="checked"');
    }
    $search_playback_type = '<select name="search_playback_type">';
    $search_playback_type .= '<option value="0"' . ($_MG_CONF['search_playback_type'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['play_in_popup'] . '</option>';
    $search_playback_type .= '<option value="1"' . ($_MG_CONF['search_playback_type'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['download_to_local'] . '</option>';
    $search_playback_type .= '<option value="2"' . ($_MG_CONF['search_playback_type'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['play_inline'] . '</option>';
    $search_playback_type .= '<option value="3"' . ($_MG_CONF['search_playback_type'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['use_mms'] . '</option>';
    $search_playback_type .= '</select>';
    $at_align_select = '<select name="at_align">';
    $at_align_select .= '<option value="none"' . ($_MG_CONF['at_align'] == 'none' ? ' selected="selected"' : "") . '>' . $LANG_MG01['none'] . '</option>';
    $at_align_select .= '<option value="auto"' . ($_MG_CONF['at_align'] == 'auto' ? ' selected="selected"' : "") . '>' . $LANG_MG01['auto'] . '</option>';
    $at_align_select .= '<option value="left"' . ($_MG_CONF['at_align'] == 'left' ? ' selected="selected"' : "") . '>' . $LANG_MG01['left'] . '</option>';
    $at_align_select .= '<option value="right"' . ($_MG_CONF['at_align'] == 'right' ? ' selected="selected"' : "") . '>' . $LANG_MG01['right'] . '</option>';
    $at_align_select .= '<option value="center"' . ($_MG_CONF['at_align'] == 'center' ? ' selected="selected"' : "") . '>' . $LANG_MG01['center'] . '</option>';
    $at_align_select .= '</select>';
    $at_src_select = '<select name="at_src">';
    $at_src_select .= '<option value="tn"' . ($_MG_CONF['at_src'] == 'tn' ? ' selected="selected"' : "") . '>' . $LANG_MG01['thumbnail'] . '</option>';
    $at_src_select .= '<option value="disp"' . ($_MG_CONF['at_src'] == 'disp' ? ' selected="selected"' : "") . '>' . $LANG_MG01['display_image'] . '</option>';
    $at_src_select .= '<option value="orig"' . ($_MG_CONF['at_src'] == 'orig' ? ' selected="selected"' : "") . '>' . $LANG_MG01['original_image'] . '</option>';
    $at_src_select .= '</select>';
    $wn_time_select = '<select name="whatsnew_time">';
    $wn_time_select .= '<option value="1"' . ($_MG_CONF['whatsnew_time'] == 1 ? ' selected="selected"' : "") . '>1 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="2"' . ($_MG_CONF['whatsnew_time'] == 2 ? ' selected="selected"' : "") . '>2 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="3"' . ($_MG_CONF['whatsnew_time'] == 3 ? ' selected="selected"' : "") . '>3 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="4"' . ($_MG_CONF['whatsnew_time'] == 4 ? ' selected="selected"' : "") . '>4 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="5"' . ($_MG_CONF['whatsnew_time'] == 5 ? ' selected="selected"' : "") . '>5 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="6"' . ($_MG_CONF['whatsnew_time'] == 6 ? ' selected="selected"' : "") . '>6 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="7"' . ($_MG_CONF['whatsnew_time'] == 7 ? ' selected="selected"' : "") . '>7 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="8"' . ($_MG_CONF['whatsnew_time'] == 8 ? ' selected="selected"' : "") . '>8 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="9"' . ($_MG_CONF['whatsnew_time'] == 9 ? ' selected="selected"' : "") . '>9 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="10"' . ($_MG_CONF['whatsnew_time'] == 10 ? ' selected="selected"' : "") . '>10 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="11"' . ($_MG_CONF['whatsnew_time'] == 11 ? ' selected="selected"' : "") . '>11 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="12"' . ($_MG_CONF['whatsnew_time'] == 12 ? ' selected="selected"' : "") . '>12 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="13"' . ($_MG_CONF['whatsnew_time'] == 13 ? ' selected="selected"' : "") . '>13 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="14"' . ($_MG_CONF['whatsnew_time'] == 14 ? ' selected="selected"' : "") . '>14 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="15"' . ($_MG_CONF['whatsnew_time'] == 15 ? ' selected="selected"' : "") . '>15 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="16"' . ($_MG_CONF['whatsnew_time'] == 16 ? ' selected="selected"' : "") . '>16 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="17"' . ($_MG_CONF['whatsnew_time'] == 17 ? ' selected="selected"' : "") . '>17 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="18"' . ($_MG_CONF['whatsnew_time'] == 18 ? ' selected="selected"' : "") . '>18 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="19"' . ($_MG_CONF['whatsnew_time'] == 19 ? ' selected="selected"' : "") . '>19 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="20"' . ($_MG_CONF['whatsnew_time'] == 20 ? ' selected="selected"' : "") . '>20 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="21"' . ($_MG_CONF['whatsnew_time'] == 21 ? ' selected="selected"' : "") . '>21 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="22"' . ($_MG_CONF['whatsnew_time'] == 22 ? ' selected="selected"' : "") . '>22 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="23"' . ($_MG_CONF['whatsnew_time'] == 23 ? ' selected="selected"' : "") . '>23 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="24"' . ($_MG_CONF['whatsnew_time'] == 24 ? ' selected="selected"' : "") . '>24 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="25"' . ($_MG_CONF['whatsnew_time'] == 25 ? ' selected="selected"' : "") . '>25 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="26"' . ($_MG_CONF['whatsnew_time'] == 26 ? ' selected="selected"' : "") . '>26 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="27"' . ($_MG_CONF['whatsnew_time'] == 27 ? ' selected="selected"' : "") . '>27 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="28"' . ($_MG_CONF['whatsnew_time'] == 28 ? ' selected="selected"' : "") . '>28 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="29"' . ($_MG_CONF['whatsnew_time'] == 29 ? ' selected="selected"' : "") . '>29 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '<option value="30"' . ($_MG_CONF['whatsnew_time'] == 30 ? ' selected="selected"' : "") . '>30 ' . $LANG_MG01['days'] . '</option>';
    $wn_time_select .= '</select>';
    $rating_select = '<select name="rating_max">';
    $rating_select .= '<option value="5"' . ($_MG_CONF['rating_max'] == 5 ? ' selected="selected"' : "") . '>5</option>';
    $rating_select .= '<option value="10"' . ($_MG_CONF['rating_max'] == 10 ? ' selected="selected"' : "") . '>10</option>';
    $rating_select .= '<option value="15"' . ($_MG_CONF['rating_max'] == 15 ? ' selected="selected"' : "") . '>15</option>';
    $rating_select .= '<option value="20"' . ($_MG_CONF['rating_max'] == 20 ? ' selected="selected"' : "") . '>20</option>';
    $rating_select .= '</select>';
    $gallery_tn_size_select = '<select name="gallery_tn_size">';
    $gallery_tn_size_select .= '<option value="0"' . ($_MG_CONF['gallery_tn_size'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['small'] . '</option>';
    $gallery_tn_size_select .= '<option value="1"' . ($_MG_CONF['gallery_tn_size'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['medium'] . '</option>';
    $gallery_tn_size_select .= '<option value="2"' . ($_MG_CONF['gallery_tn_size'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['large'] . '</option>';
    $gallery_tn_size_select .= '<option value="3"' . ($_MG_CONF['gallery_tn_size'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['custom'] . '</option>';
    $gallery_tn_size_select .= '<option value="4"' . ($_MG_CONF['gallery_tn_size'] == 4 ? 'selected="selected"' : '') . '>' . $LANG_MG01['square'] . '</option>';
    $gallery_tn_size_select .= '</select>';
    $gallery_tnheight_input = '<input type="text" size="3" name="tnheight" value="' . $_MG_CONF['gallery_tn_height'] . '" />';
    $gallery_tnwidth_input = '<input type="text" size="3" name="tnwidth" value="' . $_MG_CONF['gallery_tn_width'] . '" />';
    $mp3_select = '<select name="mp3_player">';
    $mp3_select .= '<option value="0"' . ($_MG_CONF['mp3_player'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['windows_media_player'] . '</option>';
    $mp3_select .= '<option value="1"' . ($_MG_CONF['mp3_player'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['quicktime'] . '</option>';
    $mp3_select .= '<option value="2"' . ($_MG_CONF['mp3_player'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['flashplayer'] . '</option>';
    $mp3_select .= '</select>';
    $flv_select = '<select name="use_flowplayer">';
    $flv_select .= '<option value="0"' . ($_MG_CONF['use_flowplayer'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['mgflv'] . '</option>';
    $flv_select .= '<option value="1"' . ($_MG_CONF['use_flowplayer'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['flowplayer'] . '</option>';
    $flv_select .= '</select>';
    $T->set_var(array('popupfromalbum_selected' => $_MG_CONF['popup_from_album'] ? ' checked="checked"' : '', 'autotag_caption_selected' => $_MG_CONF['autotag_caption'] ? ' checked="checked"' : '', 'up_dr_selected' => $_MG_CONF['up_display_rows_enabled'] ? ' checked="checked"' : '', 'up_dc_selected' => $_MG_CONF['up_display_columns_enabled'] ? ' checked="checked"' : '', 'up_mp3_selected' => $_MG_CONF['up_mp3_player_enabled'] ? ' checked="checked"' : '', 'up_playback_selected' => $_MG_CONF['up_av_playback_enabled'] ? ' checked="checked"' : '', 'up_tn_size_selected' => $_MG_CONF['up_thumbnail_size_enabled'] ? ' checked="checked"' : '', 'jh_selected' => $_MG_CONF['jhead_enabled'] ? ' checked="checked"' : '', 'jt_selected' => $_MG_CONF['jpegtran_enabled'] ? ' checked="checked"' : '', 'zip_selected' => $_MG_CONF['zip_enabled'] ? ' checked="checked"' : '', 'ffmpeg_selected' => $_MG_CONF['ffmpeg_enabled'] ? ' checked="checked"' : '', 'at_align_select' => $at_align_select, 'at_width' => $_MG_CONF['at_width'], 'at_height' => $_MG_CONF['at_height'], 'at_src_select' => $at_src_select, 'at_delay' => $_MG_CONF['at_delay'], 'flv_select' => $flv_select, 'search_playback_type' => $search_playback_type, 'search_columns' => $_MG_CONF['search_columns'], 'search_rows' => $_MG_CONF['search_rows']));
    if ($_MG_CONF['up_display_rows_enabled'] == 1) {
        $T->set_var('up_dr_yes_checked', ' checked="checked"');
    } else {
        $T->set_var('up_dr_no_checked', ' checked="checked"');
    }
    if (ini_get('safe_mode') != 1 && $_MG_CONF['skip_file_find'] == 0) {
        // don't check in safe mode, the file_exists() will fail
        if (PHP_OS == "WINNT") {
            $binary = "/unzip.exe";
        } else {
            $binary = "/unzip";
        }
        clearstatcache();
        if (file_exists($_MG_CONF['zip_path'] . $binary)) {
            // do nothing..
        } else {
            clearstatcache();
            $_MG_CONF['zip_path'] = '/usr/bin';
            if (file_exists($_MG_CONF['zip_path'] . $binary)) {
                // do nothing..
            } else {
                clearstatcache();
                $_MG_CONF['zip_path'] = '/usr/local/bin';
                if (file_exists($_MG_CONF['zip_path'] . $binary)) {
                    // do nothing..
                } else {
                    clearstatcache();
                    $_MG_CONF['zip_path'] = '/usr/X11R6/bin';
                    if (file_exists($_MG_CONF['zip_path'] . $binary)) {
                        // do nothing..
                    }
                }
            }
        }
        if (PHP_OS == "WINNT") {
            $binary = "/ffmpeg.exe";
        } else {
            $binary = "/ffmpeg";
        }
        clearstatcache();
        if (file_exists($_MG_CONF['ffmpeg_path'] . $binary)) {
            // do nothing..
        } else {
            clearstatcache();
            $_MG_CONF['ffmpeg_path'] = '/usr/bin';
            if (file_exists($_MG_CONF['ffmpeg_path'] . $binary)) {
                // do nothing..
            } else {
                clearstatcache();
                $_MG_CONF['ffmpeg_path'] = '/usr/local/bin';
                if (file_exists($_MG_CONF['ffmpeg_path'] . $binary)) {
                    // do nothing..
                } else {
                    clearstatcache();
                    $_MG_CONF['ffmpeg_path'] = '/usr/X11R6/bin';
                    if (file_exists($_MG_CONF['ffmpeg_path'] . $binary)) {
                        // do nothing..
                    }
                }
            }
        }
    }
    $frames = new mgFrame();
    $skins = array();
    $skins = $frames->getFrames();
    if (!isset($_MG_CONF['random_skin']) || $_MG_CONF['random_skin'] == '') {
        $_MG_CONF['random_skin'] = 'mgShadow';
    }
    $skin_select = '<select name="skin">';
    $rskin_select = '<select name="rskin">';
    for ($i = 0; $i < count($skins); $i++) {
        $skin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($_MG_CONF['indexskin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
        $rskin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($_MG_CONF['random_skin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
    }
    $skin_select .= '</select>';
    $rskin_select .= '</select>';
    $themes = array();
    $themes = MG_getThemes();
    $theme_select = '<select name="theme">';
    for ($i = 0; $i < count($themes); $i++) {
        $theme_select .= '<option value="' . $themes[$i] . '"' . ($_MG_CONF['indextheme'] == $themes[$i] ? ' selected="selected" ' : '') . '>' . $themes[$i] . '</option>';
    }
    $theme_select .= '</select>';
    require_once $_CONF['path_system'] . 'classes/navbar.class.php';
    $navbar = new navbar();
    $navbar->add_menuitem($LANG_MG01['general_options'], 'showhideMGAdminEditorDiv("general",0);return false;', true);
    $navbar->add_menuitem($LANG_MG01['display_options'], 'showhideMGAdminEditorDiv("display",1);return false;', true);
    $navbar->add_menuitem($LANG_MG01['batch_options'], 'showhideMGAdminEditorDiv("batch",2);return false;', true);
    $navbar->add_menuitem($LANG_MG01['up_overrides'], 'showhideMGAdminEditorDiv("userprefs",3);return false;', true);
    $navbar->add_menuitem($LANG_MG01['graphicspackage_prompt'], 'showhideMGAdminEditorDiv("graphics",4);return false;', true);
    $navbar->set_selected($LANG_MG01['general_options']);
    $T->set_var('navbar', $navbar->generate());
    $T->set_var(array('no_javascript_warning' => $LANG04[150], 'lang_config_title' => $LANG_MG01['configuration_title'], 'lang_config_help' => $LANG_MG01['configuration_help'], 'lang_config_header' => $LANG_MG01['configuration_header'], 'lang_yes' => $LANG_MG01['yes'], 'lang_no' => $LANG_MG01['no'], 'lang_save' => $LANG_MG01['save'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_reset' => $LANG_MG01['reset'], 'lang_album_columns' => $LANG_MG01['album_display_columns_prompt'], 'lang_album_colums_help' => $LANG_MG01['album_display_columns_help'], 'lang_album_rows' => $LANG_MG01['album_display_rows'], 'lang_subalbum_select' => $LANG_MG01['subalbum_select'], 'lang_loginrequired' => $LANG_MG01['loginrequired_prompt'], 'lang_loginrequired_help' => $LANG_MG01['loginrequired_help'], 'lang_anonymous_uploads' => $LANG_MG01['anonymous_uploads_prompt'], 'lang_anonymous_uploads_help' => $LANG_MG01['anonymous_uploads_help'], 'lang_comments' => $LANG_MG01['comments_prompt'], 'lang_comments_help' => $LANG_MG01['comments_help'], 'lang_graphicspackage' => $LANG_MG01['graphicspackage_prompt'], 'lang_graphicspackage_help' => $LANG_MG01['graphicspackage_help'], 'lang_gp_path' => $LANG_MG01['graphicspackage_path_prompt'], 'lang_gp_path_help' => $LANG_MG01['graphicspackage_path_help'], 'lang_userpref_options' => $LANG_MG01['up_overrides'], 'lang_display_rows_enabled' => $LANG_MG01['up_rows_override'], 'lang_display_columns_enabled' => $LANG_MG01['up_columns_override'], 'lang_mp3_player_enabled' => $LANG_MG01['up_mp3_override'], 'lang_av_playback_enabled' => $LANG_MG01['up_av_override'], 'lang_thumbnail_size_enabled' => $LANG_MG01['up_tn_override'], 'lang_album_skin' => $LANG_MG01['index_album_skin'], 'lang_display_rows' => $LANG_MG01['album_display_rows'], 'album_display_columns' => $_MG_CONF['album_display_columns'], 'album_display_rows' => $_MG_CONF['album_display_rows'], 'loginrequired' => $_MG_CONF['loginrequired'], 'anonymous_uploads' => $_MG_CONF['moderation'], 'graphicspackage' => $gp_select, 'graphicspackage_path' => $_MG_CONF['graphicspackage_path'], 'lang_displayblock' => $LANG_MG01['displayblock_prompt'], 'lang_displayblock_help' => $LANG_MG01['displayblock_help'], 'lang_jhead_enable' => $LANG_MG01['jhead_enable'], 'lang_jh_path' => $LANG_MG01['jhead_path'], 'lang_jpegtran_enable' => $LANG_MG01['jpegtran_enable'], 'lang_ffmpeg_enable' => $LANG_MG01['ffmpeg_enable'], 'lang_jt_path' => $LANG_MG01['jpegtran_path'], 'lang_zip_enable' => $LANG_MG01['zip_enable'], 'lang_zip_path' => $LANG_MG01['zip_path'], 'lang_tmp_path' => $LANG_MG01['tmp_path'], 'lang_ffmpeg_path' => $LANG_MG01['ffmpeg_path'], 'jhead_path' => $_MG_CONF['jhead_path'], 'jpegtran_path' => $_MG_CONF['jpegtran_path'], 'zip_path' => $_MG_CONF['zip_path'], 'tmp_path' => $_MG_CONF['tmp_path'], 'ftp_path' => $_MG_CONF['ftp_path'], 'ffmpeg_path' => $_MG_CONF['ffmpeg_path'], 'displayblock' => $block_select, 'dfidselect' => $dfid_select, 'rating_select' => $rating_select, 'wn_time_select' => $wn_time_select, 'custom_image_height' => $_MG_CONF['custom_image_height'], 'random_width' => $_MG_CONF['random_width'], 'random_skin' => $_MG_CONF['random_skin'], 'custom_image_width' => $_MG_CONF['custom_image_width'], 'refresh_rate' => $_MG_CONF['def_refresh_rate'], 'item_limit' => $_MG_CONF['def_item_limit'], 'time_limit' => $_MG_CONF['def_time_limit'], 'gallery_tn_size_select' => $gallery_tn_size_select, 'gallery_tnheight_input' => $gallery_tnheight_input, 'gallery_tnwidth_input' => $gallery_tnwidth_input, 'jpg_quality' => $_MG_CONF['jpg_quality'], 'tn_jpg_quality' => $_MG_CONF['tn_jpg_quality'], 'orig_jpg_quality' => $_MG_CONF['jpg_orig_quality'], 'truncate_breadcrumb' => $_MG_CONF['truncate_breadcrumb'], 'seperator' => $_MG_CONF['seperator'], 'mp3_select' => $mp3_select, 'skin_select' => $skin_select, 'rskin_select' => $rskin_select, 'theme_select' => $theme_select, 'postcard_retention' => $_MG_CONF['postcard_retention'], 'lang_wn_time' => $LANG_MG01['whatsnew_time'], 'lang_theme_select' => $LANG_MG01['index_theme'], 'lang_gallery_tn_size' => $LANG_MG01['gallery_tn_size'], 'lang_jpg_quality' => $LANG_MG01['jpg_quality'], 'lang_tn_jpg_quality' => $LANG_MG01['tn_jpg_quality'], 'lang_orig_jpg_quality' => $LANG_MG01['orig_jpg_quality'], 'lang_truncate_breadcrumb' => $LANG_MG01['truncate_breadcrumb'], 'lang_seperator' => $LANG_MG01['seperator'], 'lang_mp3_player' => $LANG_MG01['mp3_player'], 'lang_htmlallowed' => $LANG_MG01['htmlallowed'], 'lang_whatsnew' => $LANG_MG01['whatsnew'], 'lang_dfid' => $LANG_MG01['dfid'], 'lang_general_options' => $LANG_MG01['general_options'], 'lang_display_options' => $LANG_MG01['display_options'], 'lang_graphics_options' => $LANG_MG01['graphics_options'], 'lang_usage_tracking' => $LANG_MG01['usage_tracking'], 'lang_gallery_import' => $LANG_MG01['gallery_import'], 'lang_4images_import' => $LANG_MG01['fourimages_import'], 'lang_xppubwiz_install' => $LANG_MG01['xppubwizard_install'], 'lang_logviewer' => $LANG_MG01['log_viewer'], 'lang_preserve_filename' => $LANG_MG01['preserve_filename'], 'lang_discard_originals' => $LANG_MG01['discard_originals'], 'lang_custom_image_height' => $LANG_MG01['custom_image_height'], 'lang_custom_image_width' => $LANG_MG01['custom_image_width'], 'lang_verbose' => $LANG_MG01['verbose'], 'lang_dwnc' => $LANG_MG01['disable_wn_comments'], 'lang_emid' => $LANG_MG01['enable_mid'], 'lang_fip' => $LANG_MG01['full_in_popup'], 'lang_cmtbar' => $LANG_MG01['cmtbar'], 'lang_wn_length' => $LANG_MG01['wn_title_length'], 'lang_batch_options' => $LANG_MG01['batch_options'], 'lang_refresh_rate' => $LANG_MG01['refresh_rate'], 'lang_time_limit' => $LANG_MG01['time_limit'], 'lang_item_limit' => $LANG_MG01['item_limit'], 'lang_ftp_path' => $LANG_MG01['ftp_path'], 'lang_characters' => $LANG_MG01['characters'], 'lang_postcard_retention' => $LANG_MG01['postcard_retention'], 'lang_profile_hook' => $LANG_MG01['profile_hook'], 's_form_action' => $_MG_CONF['admin_url'] . 'cfgedit.php', 'rtl' => $LANG_DIRECTION == "rtl" ? "rtl" : "", 'lang_autotag_caption' => $LANG_MG01['autotag_caption'], 'lang_popup_from_album' => $LANG_MG01['popup_from_album'], 'lang_random_size' => $LANG_MG01['random_size'], 'lang_random_skin' => $LANG_MG01['random_skin'], 'lang_auto_tag_defaults' => $LANG_MG01['auto_tag_defaults'], 'lang_alignment' => $LANG_MG01['alignment'], 'lang_border' => $LANG_MG01['border'], 'lang_width' => $LANG_MG01['width'], 'lang_height' => $LANG_MG01['height'], 'lang_source' => $LANG_MG01['source'], 'lang_autoplay' => $LANG_MG01['autoplay'], 'lang_link_to_media' => $LANG_MG01['link_to_media'], 'lang_ss_delay' => $LANG_MG01['ss_delay'], 'lang_show_titles' => $LANG_MG01['show_titles'], 'lang_flv' => $LANG_MG01['flash_video_player'], 'lang_search_result_options' => $LANG_MG01['search_result_options'], 'lang_search_columns' => $LANG_MG01['search_columns'], 'lang_search_rows' => $LANG_MG01['search_rows'], 'lang_search_av_playback' => $LANG_MG01['search_av_playback'], 'lang_search_views' => $LANG_MG01['search_views'], 'lang_search_rating' => $LANG_MG01['search_rating'], 'lang_gallery_only' => $LANG_MG01['gallery_only'], 'lang_tnheight' => $LANG_MG01['tn_height'], 'lang_tnwidth' => $LANG_MG01['tn_width'], 'lang_index_all' => $LANG_MG01['index_all'], 'gltoken_name' => CSRF_TOKEN, 'gltoken' => SEC_createToken()));
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    return $retval;
}
Beispiel #2
0
function MG_editDefaults()
{
    global $_CONF, $_MG_CONF, $_TABLES, $_USER, $LANG_MG00, $LANG_MG01, $LANG_MG03, $LANG_ACCESS, $LANG_DIRECTION;
    global $LANG04;
    $retval = '';
    $T = new Template($_MG_CONF['template_path'] . '/admin');
    $T->set_file(array('admin' => 'editdefaults.thtml', 'admin_formats' => 'editalbum_formats.thtml'));
    $T->set_var('site_url', $_MG_CONF['site_url']);
    $T->set_var('site_admin_url', $_CONF['site_admin_url']);
    include_once $_CONF['path_system'] . "classes/navbar.class.php";
    $navbar = new navbar();
    $navbar->add_menuitem($LANG_MG01['album_attributes'], 'showhideMGAdminEditorDiv("attributes",0);return false;', true);
    $navbar->add_menuitem($LANG_MG01['watermark'], 'showhideMGAdminEditorDiv("watermark",1);return false;', true);
    $navbar->add_menuitem($LANG_MG01['allowed_media_formats'], 'showhideMGAdminEditorDiv("media",2);return false;', true);
    $navbar->add_menuitem($LANG_MG01['anonymous_uploads_prompt'], 'showhideMGAdminEditorDiv("useruploads",3);return false;', true);
    $navbar->add_menuitem($LANG_ACCESS['accessrights'], 'showhideMGAdminEditorDiv("access",4);return false;', true);
    $navbar->set_selected($LANG_MG01['album_attributes']);
    $T->set_var('navbar', $navbar->generate());
    $T->set_var('no_javascript_warning', $LANG04[150]);
    // build exif select box...
    $exif_select = '<select name="enable_exif">';
    $exif_select .= '<option value="0"' . ($_MG_CONF['ad_exif_display'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['disable_exif'] . '</option>';
    $exif_select .= '<option value="1"' . ($_MG_CONF['ad_exif_display'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['display_below_media'] . '</option>';
    $exif_select .= '<option value="2"' . ($_MG_CONF['ad_exif_display'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['display_in_popup'] . '</option>';
    $exif_select .= '<option value="3"' . ($_MG_CONF['ad_exif_display'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['both'] . '</option>';
    $exif_select .= '</select>';
    $full_select = '<select name="full_display"' . ($_MG_CONF['discard_original'] ? ' disabled=disabled ' : '') . '>';
    $full_select .= '<option value="0"' . ($_MG_CONF['ad_full_display'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['always'] . '</option>';
    $full_select .= '<option value="1"' . ($_MG_CONF['ad_full_display'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['members_only'] . '</option>';
    $full_select .= '<option value="2"' . ($_MG_CONF['ad_full_display'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['disabled'] . '</option>';
    $full_select .= '</select>';
    $ranking_select = '<select name="enable_rating">';
    $ranking_select .= '<option value="0"' . ($_MG_CONF['ad_enable_rating'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['disabled'] . '</option>';
    $ranking_select .= '<option value="1"' . ($_MG_CONF['ad_enable_rating'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['members_only'] . '</option>';
    $ranking_select .= '<option value="2"' . ($_MG_CONF['ad_enable_rating'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['always'] . '</option>';
    $ranking_select .= '</select>';
    $mp3ribbon_select = '<input type="checkbox" name="mp3ribbon" value="1" />';
    $rsschildren_select = '<input type="checkbox" name="rsschildren" value="1" />';
    $themes = MG_getThemes();
    $album_theme_select = '<select name="album_theme">';
    for ($i = 0; $i < count($themes); $i++) {
        $album_theme_select .= '<option value="' . $themes[$i] . '"' . ($_MG_CONF['ad_album_skin'] == $themes[$i] ? 'selected="selected"' : '') . '>' . $themes[$i] . '</option>';
    }
    $album_theme_select .= '</select>';
    $comment_select = '<input type="checkbox" name="enable_comments" value="1" ' . ($_MG_CONF['ad_enable_comments'] ? ' checked="checked"' : '') . '/>';
    $podcast_select = '<input type="checkbox" name="podcast" value="1" />';
    $ss_select = '<select name="enable_slideshow">';
    $ss_select .= '<option value="0" ' . ($_MG_CONF['ad_enable_slideshow'] == 0 ? ' selected="selected"' : '') . '>' . $LANG_MG01['disabled'] . '</option>';
    $ss_select .= '<option value="1"' . ($_MG_CONF['ad_enable_slideshow'] == 1 ? ' selected="selected"' : '') . '>' . $LANG_MG01['js_slideshow'] . '</option>';
    $ss_select .= '<option value="2"' . ($_MG_CONF['ad_enable_slideshow'] == 2 ? ' selected="selected"' : '') . '>' . $LANG_MG01['lightbox'] . '</option>';
    $ss_select .= '<option value="3"' . ($_MG_CONF['ad_enable_slideshow'] == 3 ? ' selected="selected"' : '') . '>' . $LANG_MG01['flash_slideshow_disp'] . '</option>';
    $ss_select .= '<option value="4"' . ($_MG_CONF['ad_enable_slideshow'] == 4 ? ' selected="selected"' : '') . '>' . $LANG_MG01['flash_slideshow_full'] . '</option>';
    $ss_select .= '</select>';
    $ri_select = '<input type="checkbox" name="enable_random" value="1" ' . ($_MG_CONF['ad_enable_random'] ? ' checked="checked"' : '') . '/>';
    $sf_select = '<input type="checkbox" name="enable_shutterfly" value="1" ' . ($_MG_CONF['ad_enable_shutterfly'] ? ' checked="checked"' : '') . '/>';
    $views_select = '<input type="checkbox" name="enable_views" value="1" ' . ($_MG_CONF['ad_enable_views'] ? ' checked="checked"' : '') . '/>';
    $keywords_select = '<input type="checkbox" name="enable_keywords" value="1" ' . ($_MG_CONF['ad_enable_keywords'] ? ' checked="checked"' : '') . '/>';
    $sort_select = '<input type="checkbox" name="enable_sort" value="1" ' . ($_MG_CONF['ad_enable_sort'] ? ' checked="checked"' : '') . '/>';
    $rss_select = '<input type="checkbox" name="enable_rss" value="1" ' . ($_MG_CONF['ad_enable_rss'] ? ' checked="checked"' : '') . '/>';
    $postcard_select = '<select name="enable_postcard">';
    $postcard_select .= '<option value="0"' . ($_MG_CONF['ad_enable_postcard'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['disabled'] . '</option>';
    $postcard_select .= '<option value="1"' . ($_MG_CONF['ad_enable_postcard'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['members_only'] . '</option>';
    $postcard_select .= '<option value="2"' . ($_MG_CONF['ad_enable_postcard'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['all_users'] . '</option>';
    $postcard_select .= '</select>';
    $afirst_select = '<input type="checkbox" name="albums_first" value="1" ' . ($_MG_CONF['ad_albums_first'] ? ' checked="checked"' : '') . '/>';
    $album_views_select = '<input type="checkbox" name="enable_album_views" value="1" ' . ($_MG_CONF['ad_enable_album_views'] ? ' checked="checked"' : '') . '/>';
    $tn_size_select = '<select name="tn_size">';
    $tn_size_select .= '<option value="0"' . ($_MG_CONF['ad_tn_size'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['small'] . '</option>';
    $tn_size_select .= '<option value="1"' . ($_MG_CONF['ad_tn_size'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['medium'] . '</option>';
    $tn_size_select .= '<option value="2"' . ($_MG_CONF['ad_tn_size'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['large'] . '</option>';
    $tn_size_select .= '<option value="3"' . ($_MG_CONF['ad_tn_size'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['custom'] . '</option>';
    $tn_size_select .= '<option value="4"' . ($_MG_CONF['ad_tn_size'] == 4 ? 'selected="selected"' : '') . '>' . $LANG_MG01['square'] . '</option>';
    $tn_size_select .= '</select>';
    $tnheight_input = '<input type="text" size="3" name="tnheight" value="' . $_MG_CONF['ad_tn_height'] . '"' . '/>';
    $tnwidth_input = '<input type="text" size="3" name="tnwidth" value="' . $_MG_CONF['ad_tn_width'] . '"' . '/>';
    $display_image_size_select = '<select name="display_image_size">';
    $display_image_size_select .= '<option value="0"' . ($_MG_CONF['ad_display_image_size'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_500x375'] . '</option>';
    $display_image_size_select .= '<option value="1"' . ($_MG_CONF['ad_display_image_size'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_600x450'] . '</option>';
    $display_image_size_select .= '<option value="2"' . ($_MG_CONF['ad_display_image_size'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_620x465'] . '</option>';
    $display_image_size_select .= '<option value="3"' . ($_MG_CONF['ad_display_image_size'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_720x540'] . '</option>';
    $display_image_size_select .= '<option value="4"' . ($_MG_CONF['ad_display_image_size'] == 4 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_800x600'] . '</option>';
    $display_image_size_select .= '<option value="5"' . ($_MG_CONF['ad_display_image_size'] == 5 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_912x684'] . '</option>';
    $display_image_size_select .= '<option value="6"' . ($_MG_CONF['ad_display_image_size'] == 6 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_1024x768'] . '</option>';
    $display_image_size_select .= '<option value="7"' . ($_MG_CONF['ad_display_image_size'] == 7 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_1152x864'] . '</option>';
    $display_image_size_select .= '<option value="8"' . ($_MG_CONF['ad_display_image_size'] == 8 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_1280x1024'] . '</option>';
    $display_image_size_select .= '<option value="9"' . ($_MG_CONF['ad_display_image_size'] == 9 ? 'selected="selected"' : '') . '>' . $LANG_MG01['custom'] . ' - ' . $_MG_CONF['custom_image_width'] . 'x' . $_MG_CONF['custom_image_height'] . '</option>';
    $display_image_size_select .= '</select>';
    $rows_input = '<input type="text" size="3" name="display_rows" value="' . $_MG_CONF['ad_display_rows'] . '"' . '/>';
    $columns_input = '<input type="text" size="3" name="display_columns" value="' . $_MG_CONF['ad_display_columns'] . '"' . '/>';
    $max_image_height_input = '<input type="text" size="4" name="max_image_height" value="' . $_MG_CONF['ad_max_image_height'] . '"' . '/>';
    $max_image_width_input = '<input type="text" size="4" name="max_image_width" value="' . $_MG_CONF['ad_max_image_width'] . '"' . '/>';
    if ($_MG_CONF['ad_max_filesize'] != 0) {
        $max_filesize = $_MG_CONF['ad_max_filesize'] / 1024;
    } else {
        $max_filesize = 0;
    }
    $max_filesize_input = '<input type="text" size="10" name="max_filesize" value="' . $max_filesize . '"' . '/>';
    $email_mod_select = '<input type="checkbox" name="email_mod" value="1" ' . ($_MG_CONF['ad_email_mod'] ? ' checked="checked"' : '') . '/>';
    $playback_type = '<select name="playback_type">';
    $playback_type .= '<option value="0"' . ($_MG_CONF['ad_playback_type'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['play_in_popup'] . '</option>';
    $playback_type .= '<option value="1"' . ($_MG_CONF['ad_playback_type'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['download_to_local'] . '</option>';
    $playback_type .= '<option value="2"' . ($_MG_CONF['ad_playback_type'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['play_inline'] . '</option>';
    $playback_type .= '<option value="3"' . ($_MG_CONF['ad_playback_type'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['use_mms'] . '</option>';
    $playback_type .= '</select>';
    $album_sort_select = '<select name="album_sort_order">';
    $album_sort_select .= '<option value="0"' . ($_MG_CONF['ad_album_sort_order'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG03['no_sort'] . '</option>';
    $album_sort_select .= '<option value="1"' . ($_MG_CONF['ad_album_sort_order'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_capture_asc'] . '</option>';
    $album_sort_select .= '<option value="2"' . ($_MG_CONF['ad_album_sort_order'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_capture'] . '</option>';
    $album_sort_select .= '<option value="3"' . ($_MG_CONF['ad_album_sort_order'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_upload_asc'] . '</option>';
    $album_sort_select .= '<option value="4"' . ($_MG_CONF['ad_album_sort_order'] == 4 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_upload'] . '</option>';
    $album_sort_select .= '<option value="5"' . ($_MG_CONF['ad_album_sort_order'] == 5 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_alpha'] . '</option>';
    $album_sort_select .= '<option value="6"' . ($_MG_CONF['ad_album_sort_order'] == 6 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_alpha_asc'] . '</option>';
    $album_sort_select .= '</select>';
    $display_album_desc_select = '<input type="checkbox" name="display_album_desc" value="1" ' . ($_MG_CONF['ad_display_album_desc'] ? ' checked="checked"' : '') . '/>';
    // watermark stuff...
    $wm_auto_select = '<input type="checkbox" name="wm_auto" value="1" ' . ($_MG_CONF['ad_wm_auto'] ? ' checked="checked"' : '') . '/>';
    $wm_opacity_select = '<select name="wm_opacity">';
    $wm_opacity_select .= '<option value="10"' . ($_MG_CONF['ad_wm_opacity'] == 10 ? 'selected="selected"' : '') . '>10%</option>';
    $wm_opacity_select .= '<option value="20"' . ($_MG_CONF['ad_wm_opacity'] == 20 ? 'selected="selected"' : '') . '>20%</option>';
    $wm_opacity_select .= '<option value="30"' . ($_MG_CONF['ad_wm_opacity'] == 30 ? 'selected="selected"' : '') . '>30%</option>';
    $wm_opacity_select .= '<option value="40"' . ($_MG_CONF['ad_wm_opacity'] == 40 ? 'selected="selected"' : '') . '>40%</option>';
    $wm_opacity_select .= '<option value="50"' . ($_MG_CONF['ad_wm_opacity'] == 50 ? 'selected="selected"' : '') . '>50%</option>';
    $wm_opacity_select .= '<option value="60"' . ($_MG_CONF['ad_wm_opacity'] == 60 ? 'selected="selected"' : '') . '>60%</option>';
    $wm_opacity_select .= '<option value="70"' . ($_MG_CONF['ad_wm_opacity'] == 70 ? 'selected="selected"' : '') . '>70%</option>';
    $wm_opacity_select .= '<option value="80"' . ($_MG_CONF['ad_wm_opacity'] == 80 ? 'selected="selected"' : '') . '>80%</option>';
    $wm_opacity_select .= '<option value="90"' . ($_MG_CONF['ad_wm_opacity'] == 90 ? 'selected="selected"' : '') . '>90%</option>';
    $wm_opacity_select .= '</select>';
    $wm_location_select = '<select name="wm_location">';
    $wm_location_select .= '<option value="1"' . ($_MG_CONF['ad_wm_location'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['top_left'] . '</option>';
    $wm_location_select .= '<option value="2"' . ($_MG_CONF['ad_wm_location'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['top_center'] . '</option>';
    $wm_location_select .= '<option value="3"' . ($_MG_CONF['ad_wm_location'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['top_right'] . '</option>';
    $wm_location_select .= '<option value="4"' . ($_MG_CONF['ad_wm_location'] == 4 ? 'selected="selected"' : '') . '>' . $LANG_MG01['middle_left'] . '</option>';
    $wm_location_select .= '<option value="5"' . ($_MG_CONF['ad_wm_location'] == 5 ? 'selected="selected"' : '') . '>' . $LANG_MG01['middle_center'] . '</option>';
    $wm_location_select .= '<option value="6"' . ($_MG_CONF['ad_wm_location'] == 6 ? 'selected="selected"' : '') . '>' . $LANG_MG01['middle_right'] . '</option>';
    $wm_location_select .= '<option value="7"' . ($_MG_CONF['ad_wm_location'] == 7 ? 'selected="selected"' : '') . '>' . $LANG_MG01['bottom_left'] . '</option>';
    $wm_location_select .= '<option value="8"' . ($_MG_CONF['ad_wm_location'] == 8 ? 'selected="selected"' : '') . '>' . $LANG_MG01['bottom_center'] . '</option>';
    $wm_location_select .= '<option value="9"' . ($_MG_CONF['ad_wm_location'] == 9 ? 'selected="selected"' : '') . '>' . $LANG_MG01['bottom_right'] . '</option>';
    $wm_location_select .= '</select>';
    // now select what watermarks we have permission to use...
    $whereClause = " WHERE wm_id<>0 AND ";
    if (SEC_hasRights('mediagallery.config')) {
        $whereClause .= "1=1";
    } else {
        $whereClause .= "(owner_id=" . $_USER['uid'] . " OR owner_id=0)";
    }
    $sql = "SELECT * FROM {$_TABLES['mg_watermarks']} " . $whereClause . " ORDER BY owner_id";
    $result = DB_query($sql);
    $nRows = DB_numRows($result);
    $wm_select = '<select name="wm_id"  onchange="javascript:change(this)">';
    $wm_select .= '<option value="blank.png">' . $LANG_MG01['no_watermark'] . '</option>';
    $wm_current = '<img src="' . $_MG_CONF['site_url'] . '/watermarks/blank.png" name="myImage" alt=""' . '/>';
    for ($i = 0; $i < $nRows; $i++) {
        $row = DB_fetchArray($result);
        $wm_select .= '<option value="' . $row['filename'] . '"' . ($_MG_CONF['ad_wm_id'] == $row['wm_id'] ? 'selected="selected"' : '') . '>' . $row['filename'] . '</option>';
        if ($_MG_CONF['ad_wm_id'] == $row['wm_id']) {
            $wm_current = '<img src="' . $_MG_CONF['site_url'] . '/watermarks/' . $row['filename'] . '" name="myImage" alt=""' . '/>';
        }
    }
    $wm_select .= '</select>';
    $allow_download_select = '<input type="checkbox" name="allow_download" value="1" ' . ($_MG_CONF['ad_allow_download'] ? ' checked="checked"' : '') . '/>';
    $filename_title_select = '<input type="checkbox" name="filename_title" value="1" ' . ($_MG_CONF['ad_filename_title'] ? ' checked="checked"' : '') . '/>';
    // permission template
    $usergroups = SEC_getUserGroups();
    $groupdd = '';
    $moddd = '';
    $gresult = DB_query("SELECT grp_id FROM {$_TABLES['groups']} WHERE grp_name LIKE 'mediagallery Admin'");
    $grow = DB_fetchArray($gresult);
    $default_group_id = $grow['grp_id'];
    if (!isset($_MG_CONF['ad_mod_group_id'])) {
        $_MG_CONF['ad_mod_group_id'] = $default_group_id;
    }
    $groupdd .= '<select name="group_id">';
    $moddd .= '<select name="mod_id">';
    for ($i = 0; $i < count($usergroups); $i++) {
        if ($usergroups[key($usergroups)] != 2 && $usergroups[key($usergroups)] != 13) {
            $groupdd .= '<option value="' . $usergroups[key($usergroups)] . '"';
            $moddd .= '<option value="' . $usergroups[key($usergroups)] . '"';
            if ($default_group_id == $usergroups[key($usergroups)]) {
                $groupdd .= ' selected="selected"';
                $groupname = key($usergroups);
            }
            if ($_MG_CONF['ad_mod_group_id'] == $usergroups[key($usergroups)]) {
                $moddd .= ' selected="selected"';
            }
            $groupdd .= '>' . key($usergroups) . '</option>';
            $moddd .= '>' . key($usergroups) . '</option>';
        }
        next($usergroups);
    }
    $groupdd .= '</select>';
    $moddd .= '</select>';
    $upload_select = '<input type="checkbox" name="uploads" value="1" ' . ($_MG_CONF['ad_member_uploads'] ? ' checked="checked"' : '') . '/>';
    $moderate_select = '<input type="checkbox" name="moderate" value="1" ' . ($_MG_CONF['ad_moderate'] ? ' checked="checked"' : '') . '/>';
    $frames = new mgFrame();
    $skins = array();
    $skins = $frames->getFrames();
    $skin_select = '<select name="skin">';
    $askin_select = '<select name="askin">';
    $dskin_select = '<select name="dskin">';
    for ($i = 0; $i < count($skins); $i++) {
        $skin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($_MG_CONF['ad_image_skin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
        $askin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($_MG_CONF['ad_album_skin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
        $dskin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($_MG_CONF['ad_display_skin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
    }
    $skin_select .= '</select>';
    $askin_select .= '</select>';
    $dskin_select .= '</select>';
    $T->set_var(array('jpg_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_JPG ? ' checked="checked"' : '', 'png_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_PNG ? ' checked="checked"' : '', 'tif_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_TIF ? ' checked="checked"' : '', 'gif_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_GIF ? ' checked="checked"' : '', 'bmp_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_BMP ? ' checked="checked"' : '', 'tga_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_TGA ? ' checked="checked"' : '', 'psd_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_PSD ? ' checked="checked"' : '', 'mp3_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_MP3 ? ' checked="checked"' : '', 'ogg_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_OGG ? ' checked="checked"' : '', 'asf_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_ASF ? ' checked="checked"' : '', 'swf_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_SWF ? ' checked="checked"' : '', 'mov_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_MOV ? ' checked="checked"' : '', 'mp4_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_MP4 ? ' checked="checked"' : '', 'mpg_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_MPG ? ' checked="checked"' : '', 'zip_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_ZIP ? ' checked="checked"' : '', 'flv_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_FLV ? ' checked="checked"' : '', 'rflv_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_RFLV ? ' checked="checked"' : '', 'emb_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_EMB ? ' checked="checked"' : '', 'other_checked' => (int) $_MG_CONF['ad_valid_formats'] & (int) MG_OTHER ? ' checked="checked"' : '', 'lang_jpg' => $LANG_MG01['jpg'], 'lang_png' => $LANG_MG01['png'], 'lang_tif' => $LANG_MG01['tif'], 'lang_gif' => $LANG_MG01['gif'], 'lang_bmp' => $LANG_MG01['bmp'], 'lang_tga' => $LANG_MG01['tga'], 'lang_psd' => $LANG_MG01['psd'], 'lang_mp3' => $LANG_MG01['mp3'], 'lang_ogg' => $LANG_MG01['ogg'], 'lang_asf' => $LANG_MG01['asf'], 'lang_swf' => $LANG_MG01['swf'], 'lang_mov' => $LANG_MG01['mov'], 'lang_mp4' => $LANG_MG01['mp4'], 'lang_mpg' => $LANG_MG01['mpg'], 'lang_zip' => $LANG_MG01['zip'], 'lang_flv' => $LANG_MG01['flv'], 'lang_rflv' => $LANG_MG01['rflv'], 'lang_emb' => $LANG_MG01['emb'], 'lang_other' => $LANG_MG01['other'], 'lang_allowed_formats' => $LANG_MG01['allowed_media_formats'], 'lang_image' => $LANG_MG01['image'], 'lang_audio' => $LANG_MG01['audio'], 'lang_video' => $LANG_MG01['video']));
    $T->parse('valid_formats', 'admin_formats');
    $T->set_var(array('lang_uploads' => $LANG_MG01['anonymous_uploads_prompt'], 'lang_accessrights' => $LANG_ACCESS['accessrights'], 'lang_owner' => $LANG_ACCESS['owner'], 'lang_group' => $LANG_ACCESS['group'], 'lang_permissions' => $LANG_ACCESS['permissions'], 'lang_perm_key' => $LANG_ACCESS['permissionskey'], 'lang_hidden' => $LANG_MG01['hidden'], 'permissions_editor' => SEC_getPermissionsHTML($_MG_CONF['ad_perm_owner'], $_MG_CONF['ad_perm_group'], $_MG_CONF['ad_perm_members'], $_MG_CONF['ad_perm_anon']), 'permissions_msg' => $LANG_ACCESS['permmsg'], 'group_dropdown' => $groupdd, 'mod_dropdown' => $moddd, 'lang_member_upload' => $LANG_MG01['member_upload'], 'lang_moderate_album' => $LANG_MG01['mod_album'], 'lang_mod_group' => $LANG_MG01['moderation_group'], 'lang_zero_unlimited' => $LANG_MG01['zero_unlimited'], 'uploads' => $upload_select, 'moderate' => $moderate_select));
    $T->set_var(array('action' => 'album', 'path_mg' => $_MG_CONF['site_url'], 'comment_select' => $comment_select, 'exif_select' => $exif_select, 'ranking_select' => $ranking_select, 'full_select' => $full_select, 'ss_select' => $ss_select, 'ri_select' => $ri_select, 'sf_select' => $sf_select, 'views_select' => $views_select, 'keywords_select' => $keywords_select, 'album_views_select' => $album_views_select, 'display_album_desc_select' => $display_album_desc_select, 'sort_select' => $sort_select, 'rss_select' => $rss_select, 'podcast_select' => $podcast_select, 'postcard_select' => $postcard_select, 'afirst_select' => $afirst_select, 'tn_size_select' => $tn_size_select, 'tnheight_input' => $tnheight_input, 'tnwidth_input' => $tnwidth_input, 'height_input' => $max_image_height_input, 'width_input' => $max_image_width_input, 'max_size_input' => $max_filesize_input, 'display_image_size' => $display_image_size_select, 'rows_input' => $rows_input, 'columns_input' => $columns_input, 'email_mod_select' => $email_mod_select, 'playback_type' => $playback_type, 'album_theme_select' => $album_theme_select, 'rsschildren_select' => $rsschildren_select, 'mp3ribbon_select' => $mp3ribbon_select, 'wm_auto_select' => $wm_auto_select, 'wm_opacity_select' => $wm_opacity_select, 'wm_location_select' => $wm_location_select, 'wm_select' => $wm_select, 'wm_current' => $wm_current, 'album_sort_select' => $album_sort_select, 'allow_download_select' => $allow_download_select, 'filename_title_select' => $filename_title_select, 'skin_select' => $skin_select, 'askin_select' => $askin_select, 'dskin_select' => $dskin_select, 'lang_save' => $LANG_MG01['save'], 's_form_action' => $_CONF['site_admin_url'] . '/plugins/mediagallery/defaults.php', 'lang_album_edit_help' => $LANG_MG01['album_edit_help'], 'lang_title' => $LANG_MG01['title'], 'lang_parent_album' => $LANG_MG01['parent_album'], 'lang_description' => $LANG_MG01['description'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_delete' => $LANG_MG01['delete'], 'lang_comments' => $LANG_MG01['comments_prompt'], 'lang_enable_exif' => $LANG_MG01['enable_exif'], 'lang_enable_ratings' => $LANG_MG01['enable_ratings'], 'lang_ss_enable' => $LANG_MG01['ss_enable'], 'lang_ri_enable' => $LANG_MG01['ri_enable'], 'lang_sf_enable' => $LANG_MG01['sf_enable'], 'lang_tn_size' => $LANG_MG01['tn_size'], 'lang_rows' => $LANG_MG01['rows'], 'lang_columns' => $LANG_MG01['columns'], 'lang_av_play_album' => $LANG_MG01['av_play_album'], 'lang_av_play_options' => $LANG_MG01['av_play_options'], 'lang_attached_thumbnail' => $LANG_MG01['attached_thumbnail'], 'lang_thumbnail' => $LANG_MG01['thumbnail'], 'lang_email_mods_on_submission' => $LANG_MG01['email_mods_on_submission'], 'lang_album_attributes' => $LANG_MG01['album_attributes'], 'lang_album_cover' => $LANG_MG01['album_cover'], 'lang_enable_views' => $LANG_MG01['enable_views'], 'lang_enable_keywords' => $LANG_MG01['enable_keywords'], 'lang_enable_album_views' => $LANG_MG01['enable_album_views'], 'lang_enable_sort' => $LANG_MG01['enable_sort'], 'lang_enable_rss' => $LANG_MG01['enable_rss'], 'lang_enable_postcard' => $LANG_MG01['enable_postcard'], 'lang_albums_first' => $LANG_MG01['albums_first'], 'lang_full_display' => $LANG_MG01['full_display'], 'lang_max_image_height' => $LANG_MG01['max_image_height'], 'lang_max_image_width' => $LANG_MG01['max_image_width'], 'lang_max_filesize' => $LANG_MG01['max_filesize'], 'lang_display_image_size' => $LANG_MG01['display_image_size'], 'lang_album_sort' => $LANG_MG01['default_album_sort'], 'lang_watermark' => $LANG_MG01['watermark'], 'lang_wm_auto' => $LANG_MG01['watermark_auto'], 'lang_wm_opacity' => $LANG_MG01['watermark_opacity'], 'lang_wm_location' => $LANG_MG01['watermark_location'], 'lang_wm_id' => $LANG_MG01['watermark_image'], 'lang_allow_download' => $LANG_MG01['allow_download'], 'lang_display_album_desc' => $LANG_MG01['display_album_desc'], 'lang_filename_title' => $LANG_MG01['filename_title'], 'lang_image_skin' => $LANG_MG01['image_skin'], 'lang_album_skin' => $LANG_MG01['album_skin'], 'lang_display_skin' => $LANG_MG01['display_skin'], 'rtl' => $LANG_DIRECTION == "rtl" ? "rtl" : "", 'lang_podcast' => $LANG_MG01['podcast'], 'lang_theme_select' => $LANG_MG01['album_theme'], 'lang_rsschildren' => $LANG_MG01['rsschildren'], 'lang_mp3ribbon' => $LANG_MG01['mp3ribbon'], 'lang_tnheight' => $LANG_MG01['tn_height'], 'lang_tnwidth' => $LANG_MG01['tn_width']));
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    return $retval;
}
Beispiel #3
0
/**
* edits or creates an album
*
* @param    int     album_id    album_id to edit
* @param    string  mode        create or edit
* @param    string  actionURL   where to redirection on finish
* @param    int     oldaid      original album id
* @return   string              HTML
*
*/
function MG_editAlbum($album_id = 0, $mode = '', $actionURL = '', $oldaid = 0)
{
    global $_USER, $_CONF, $_TABLES, $_MG_CONF, $LANG_MG00, $LANG_MG01, $LANG_MG03, $LANG_ACCESS, $REMOTE_ADDR;
    global $MG_albums, $album_selectbox, $_DB_dbms;
    $valid_albums = 0;
    if ($actionURL == '') {
        $actionURL = $_CONF['site_admin_url'] . '/plugins/mediagallery/index.php';
    }
    if ($_DB_dbms == "mssql") {
        $sql = "SELECT *,CAST(album_desc AS TEXT) as album_desc FROM " . $_TABLES['mg_albums'] . " WHERE album_id=" . $album_id;
    } else {
        $sql = "SELECT * FROM " . $_TABLES['mg_albums'] . " WHERE album_id=" . intval($album_id);
    }
    $result = DB_query($sql);
    $numRows = DB_numRows($result);
    if ($numRows > 0) {
        $A = DB_fetchArray($result);
    }
    $retval = '';
    $T = new Template(MG_getTemplatePath($album_id));
    $T->set_var('site_url', $_CONF['site_url']);
    $T->set_var('site_admin_url', $_CONF['site_admin_url']);
    if ($album_id != 0 && $mode == 'edit') {
        // If edit, pull up the existing album information...
        if ($MG_albums[$album_id]->access != 3) {
            COM_errorLog("MediaGallery: Someone has tried to illegally edit a Media Gallery Album.  User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$REMOTE_ADDR}", 1);
            return MG_genericError($LANG_MG00['access_denied_msg']);
        }
    } else {
        if ($album_id == 0 && $mode == 'create') {
            // create the album...
            $A['album_id'] = -1;
            $A['album_order'] = 0;
            $album_id = -1;
            $A['album_parent'] = 0;
            $A['album_title'] = '';
            $A['album_desc'] = '';
            $A['hidden'] = 0;
            $A['album_cover'] = -1;
            $A['featured'] = 0;
            $A['cbposition'] = 0;
            $A['cbpage'] = 'all';
            $A['owner_id'] = $_USER['uid'];
            $A['member_uploads'] = $_MG_CONF['ad_member_uploads'];
            $A['moderate'] = $_MG_CONF['ad_moderate'];
            $A['tn_attached'] = 0;
            $A['exif_display'] = $_MG_CONF['ad_exif_display'];
            $A['enable_slideshow'] = $_MG_CONF['ad_enable_slideshow'];
            $A['enable_random'] = $_MG_CONF['ad_enable_random'];
            $A['enable_shutterfly'] = $_MG_CONF['ad_enable_shutterfly'];
            $A['enable_views'] = $_MG_CONF['ad_enable_views'];
            $A['enable_keywords'] = $_MG_CONF['ad_enable_keywords'];
            $A['display_album_desc'] = $_MG_CONF['ad_display_album_desc'];
            $A['enable_album_views'] = $_MG_CONF['ad_enable_album_views'];
            $A['image_skin'] = $_MG_CONF['ad_image_skin'];
            $A['album_skin'] = $_MG_CONF['ad_album_skin'];
            $A['display_skin'] = $_MG_CONF['ad_display_skin'];
            $A['enable_sort'] = $_MG_CONF['ad_enable_sort'];
            $A['enable_rss'] = $_MG_CONF['ad_enable_rss'];
            $A['enable_postcard'] = $_MG_CONF['ad_enable_postcard'];
            $A['albums_first'] = $_MG_CONF['ad_albums_first'];
            $A['enable_rating'] = $_MG_CONF['ad_enable_rating'];
            $A['enable_comments'] = $_MG_CONF['ad_enable_comments'];
            $A['tn_size'] = $_MG_CONF['ad_tn_size'];
            $A['allow_download'] = $_MG_CONF['ad_allow_download'];
            $A['max_image_height'] = $_MG_CONF['ad_max_image_height'];
            $A['max_image_width'] = $_MG_CONF['ad_max_image_width'];
            $A['max_filesize'] = $_MG_CONF['ad_max_filesize'];
            $A['display_image_size'] = $_MG_CONF['ad_display_image_size'];
            $A['display_rows'] = $_MG_CONF['ad_display_rows'];
            $A['display_columns'] = $_MG_CONF['ad_display_columns'];
            $A['valid_formats'] = $_MG_CONF['ad_valid_formats'];
            $A['filename_title'] = $_MG_CONF['ad_filename_title'];
            $A['wm_auto'] = $_MG_CONF['ad_wm_auto'];
            $A['wm_id'] = $_MG_CONF['ad_wm_id'];
            $A['opacity'] = $_MG_CONF['ad_wm_opacity'];
            $A['wm_location'] = $_MG_CONF['ad_wm_location'];
            $A['album_sort_order'] = $_MG_CONF['ad_album_sort_order'];
            $A['email_mod'] = $_MG_CONF['ad_email_mod'];
            $A['album_cover_filename'] = '';
            $A['last_update'] = 0;
            $A['media_count'] = 0;
            $A['full_display'] = $_MG_CONF['ad_full_display'];
            $A['playback_type'] = $_MG_CONF['ad_playback_type'];
            $A['podcast'] = isset($_MG_CONF['ad_podcast']) ? $_MG_CONF['ad_podcast'] : 0;
            $A['mp3ribbon'] = 0;
            $A['rsschildren'] = 0;
            $A['usealternate'] = isset($_MG_CONF['ad_use_alternate']) ? $_MG_CONF['ad_use_alternate'] : 0;
            $A['skin'] = isset($_MG_CONF['ad_skin']) ? $_MG_CONF['ad_skin'] : 'default';
            $gresult = DB_query("SELECT grp_id FROM {$_TABLES['groups']} WHERE grp_name LIKE 'mediagallery Admin'");
            $grow = DB_fetchArray($gresult);
            $grp_id = $grow['grp_id'];
            $A['group_id'] = $grp_id;
            $A['mod_group_id'] = $grp_id;
            $A['perm_owner'] = $_MG_CONF['ad_perm_owner'];
            $A['perm_group'] = $_MG_CONF['ad_perm_group'];
            $A['perm_members'] = $_MG_CONF['ad_perm_members'];
            $A['perm_anon'] = $_MG_CONF['ad_perm_anon'];
            $A['tnheight'] = $_MG_CONF['ad_tn_height'];
            $A['tnwidth'] = $_MG_CONF['ad_tn_width'];
        }
    }
    $T->set_var('album_id', $A['album_id']);
    $retval .= COM_startBlock($mode == 'create' ? $LANG_MG01['create_album'] : $LANG_MG01['edit_album'] . ' - ' . strip_tags($A['album_title']), '', COM_getBlockTemplate('_admin_block', 'header'));
    // If edit, pull up the existing album information...
    $T->set_file(array('admin' => 'editalbum.thtml', 'falbum' => 'featured_album.thtml', 'perms_admin' => 'edit_album_permissions.thtml', 'perms_member' => 'edit_album_perm_member.thtml', 'admin_attr' => 'editalbum_admin.thtml', 'admin_formats' => 'editalbum_formats.thtml'));
    // construct the album jumpbox...
    if ($mode == 'create') {
        $select = $oldaid;
    } else {
        $select = $A['album_parent'];
    }
    $album_selectbox = '<select name="parentaid">';
    $valid_albums += $MG_albums[0]->buildAlbumBox($select, 3, $A['album_id'], $mode);
    $album_selectbox .= '</select>';
    $album_select = $album_selectbox;
    if ($valid_albums == 0) {
        COM_errorLog("MediaGallery: Someone has tried to illegally create a Medig Gallery Album.  User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$REMOTE_ADDR}", 1);
        return MG_genericError($LANG_MG00['access_denied_msg']);
    }
    // build exif select box...
    $exif_select = '<select name="enable_exif">';
    $exif_select .= '<option value="0"' . ($A['exif_display'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['disable_exif'] . '</option>';
    $exif_select .= '<option value="1"' . ($A['exif_display'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['display_below_media'] . '</option>';
    $exif_select .= '<option value="2"' . ($A['exif_display'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['display_in_popup'] . '</option>';
    $exif_select .= '<option value="3"' . ($A['exif_display'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['both'] . '</option>';
    $exif_select .= '</select>';
    $full_select = '<select name="full_display"' . ($_MG_CONF['discard_original'] ? ' disabled=disabled ' : '') . '>';
    $full_select .= '<option value="0"' . ($A['full_display'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['always'] . '</option>';
    $full_select .= '<option value="1"' . ($A['full_display'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['members_only'] . '</option>';
    $full_select .= '<option value="2"' . ($A['full_display'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['disabled'] . '</option>';
    $full_select .= '</select>';
    $ranking_select = '<select name="enable_rating">';
    $ranking_select .= '<option value="0"' . ($A['enable_rating'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['disabled'] . '</option>';
    $ranking_select .= '<option value="1"' . ($A['enable_rating'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['members_only'] . '</option>';
    $ranking_select .= '<option value="2"' . ($A['enable_rating'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['always'] . '</option>';
    $ranking_select .= '</select>';
    $podcast_select = '<input type="checkbox" name="podcast" value="1" ' . ($A['podcast'] ? ' checked="checked"' : '') . '/>';
    $mp3ribbon_select = '<input type="checkbox" name="mp3ribbon" value="1" ' . ($A['mp3ribbon'] ? ' checked="checked"' : '') . '/>';
    $rsschildren_select = '<input type="checkbox" name="rsschildren" value="1" ' . ($A['rsschildren'] ? ' checked="checked"' : '') . '/>';
    $comment_select = '<input type="checkbox" name="enable_comments" value="1" ' . ($A['enable_comments'] ? ' checked="checked"' : '') . '/>';
    $ss_select = '<select name="enable_slideshow">';
    $ss_select .= '<option value="0" ' . ($A['enable_slideshow'] == 0 ? ' selected="selected"' : '') . '>' . $LANG_MG01['disabled'] . '</option>';
    $ss_select .= '<option value="1"' . ($A['enable_slideshow'] == 1 ? ' selected="selected"' : '') . '>' . $LANG_MG01['js_slideshow'] . '</option>';
    $ss_select .= '<option value="2"' . ($A['enable_slideshow'] == 2 ? ' selected="selected"' : '') . '>' . $LANG_MG01['lightbox'] . '</option>';
    $ss_select .= '<option value="3"' . ($A['enable_slideshow'] == 3 ? ' selected="selected"' : '') . '>' . $LANG_MG01['flash_slideshow_disp'] . '</option>';
    $ss_select .= '<option value="4"' . ($A['enable_slideshow'] == 4 ? ' selected="selected"' : '') . '>' . $LANG_MG01['flash_slideshow_full'] . '</option>';
    $ss_select .= '<option value="5"' . ($A['enable_slideshow'] == 5 ? ' selected="selected"' : '') . '>' . $LANG_MG01['mp3_jukebox'] . '</option>';
    $ss_select .= '</select>';
    $sf_select = '<input type="checkbox" name="enable_shutterfly" value="1" ' . ($A['enable_shutterfly'] ? ' checked="checked"' : '') . '/>';
    $views_select = '<input type="checkbox" name="enable_views" value="1" ' . ($A['enable_views'] ? ' checked="checked"' : '') . '/>';
    $keywords_select = '<input type="checkbox" name="enable_keywords" value="1" ' . ($A['enable_keywords'] ? ' checked="checked"' : '') . '/>';
    $sort_select = '<input type="checkbox" name="enable_sort" value="1" ' . ($A['enable_sort'] ? ' checked="checked"' : '') . '/>';
    $rss_select = '<input type="checkbox" name="enable_rss" value="1" ' . ($A['enable_rss'] ? ' checked="checked"' : '') . '/>';
    $postcard_select = '<select name="enable_postcard">';
    $postcard_select .= '<option value="0"' . ($A['enable_postcard'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['disabled'] . '</option>';
    $postcard_select .= '<option value="1"' . ($A['enable_postcard'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['members_only'] . '</option>';
    $postcard_select .= '<option value="2"' . ($A['enable_postcard'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['all_users'] . '</option>';
    $postcard_select .= '</select>';
    $afirst_select = '<input type="checkbox" name="albums_first" value="1" ' . ($A['albums_first'] ? ' checked="checked"' : '') . '/>';
    $usealternate_select = '<input type="checkbox" name="usealternate" value="1" ' . ($A['usealternate'] ? ' checked="checked"' : '') . '/>';
    $album_views_select = '<input type="checkbox" name="enable_album_views" value="1" ' . ($A['enable_album_views'] ? ' checked="checked"' : '') . '/>';
    $display_album_desc_select = '<input type="checkbox" name="display_album_desc" value="1" ' . ($A['display_album_desc'] ? ' checked="checked"' : '') . '/>';
    $tn_size_select = '<select name="tn_size">';
    $tn_size_select .= '<option value="0"' . ($A['tn_size'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['small'] . '</option>';
    $tn_size_select .= '<option value="1"' . ($A['tn_size'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['medium'] . '</option>';
    $tn_size_select .= '<option value="2"' . ($A['tn_size'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['large'] . '</option>';
    $tn_size_select .= '<option value="3"' . ($A['tn_size'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['custom'] . '</option>';
    $tn_size_select .= '<option value="4"' . ($A['tn_size'] == 4 ? 'selected="selected"' : '') . '>' . $LANG_MG01['square'] . '</option>';
    $tn_size_select .= '</select>';
    $display_image_size_select = '<select name="display_image_size">';
    $display_image_size_select .= '<option value="0"' . ($A['display_image_size'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_500x375'] . '</option>';
    $display_image_size_select .= '<option value="1"' . ($A['display_image_size'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_600x450'] . '</option>';
    $display_image_size_select .= '<option value="2"' . ($A['display_image_size'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_620x465'] . '</option>';
    $display_image_size_select .= '<option value="3"' . ($A['display_image_size'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_720x540'] . '</option>';
    $display_image_size_select .= '<option value="4"' . ($A['display_image_size'] == 4 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_800x600'] . '</option>';
    $display_image_size_select .= '<option value="5"' . ($A['display_image_size'] == 5 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_912x684'] . '</option>';
    $display_image_size_select .= '<option value="6"' . ($A['display_image_size'] == 6 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_1024x768'] . '</option>';
    $display_image_size_select .= '<option value="7"' . ($A['display_image_size'] == 7 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_1152x864'] . '</option>';
    $display_image_size_select .= '<option value="8"' . ($A['display_image_size'] == 8 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_1280x1024'] . '</option>';
    $display_image_size_select .= '<option value="9"' . ($A['display_image_size'] == 9 ? 'selected="selected"' : '') . '>' . $LANG_MG01['size_custom'] . $_MG_CONF['custom_image_width'] . 'x' . $_MG_CONF['custom_image_height'] . '</option>';
    $display_image_size_select .= '</select>';
    $rows_input = '<input type="text" size="3" name="display_rows" value="' . $A['display_rows'] . '"/>';
    $columns_input = '<input type="text" size="3" name="display_columns" value="' . $A['display_columns'] . '"/>';
    $max_image_height_input = '<input type="text" size="4" name="max_image_height" value="' . $A['max_image_height'] . '"/>';
    $max_image_width_input = '<input type="text" size="4" name="max_image_width" value="' . $A['max_image_width'] . '"/>';
    $tnheight_input = '<input type="text" size="3" name="tnheight" value="' . $A['tnheight'] . '"/>';
    $tnwidth_input = '<input type="text" size="3" name="tnwidth" value="' . $A['tnwidth'] . '"/>';
    if ($A['max_filesize'] != 0) {
        $A['max_filesize'] = $A['max_filesize'] / 1024;
    }
    $max_filesize_input = '<input type="text" size="10" name="max_filesize" value="' . $A['max_filesize'] . '"/>';
    $email_mod_select = '<input type="checkbox" name="email_mod" value="1" ' . ($A['email_mod'] ? ' checked="checked"' : '') . '/>';
    $playback_type = '<select name="playback_type">';
    $playback_type .= '<option value="0"' . ($A['playback_type'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['play_in_popup'] . '</option>';
    $playback_type .= '<option value="1"' . ($A['playback_type'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['download_to_local'] . '</option>';
    $playback_type .= '<option value="2"' . ($A['playback_type'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['play_inline'] . '</option>';
    $playback_type .= '<option value="3"' . ($A['playback_type'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['use_mms'] . '</option>';
    $playback_type .= '</select>';
    $themes = MG_getThemes();
    $album_theme_select = '<select name="album_theme">';
    for ($i = 0; $i < count($themes); $i++) {
        $album_theme_select .= '<option value="' . $themes[$i] . '"' . ($A['skin'] == $themes[$i] ? 'selected="selected"' : '') . '>' . $themes[$i] . '</option>';
    }
    $album_theme_select .= '</select>';
    $attach_select = '<input type="checkbox" name="attach_tn" value="1" ' . ($A['tn_attached'] ? ' checked="checked"' : '') . '/>';
    $result = DB_query("SELECT * FROM {$_TABLES['users']}");
    $nRows = DB_numRows($result);
    $owner_select = '<select name="owner_id">';
    for ($i = 0; $i < $nRows; $i++) {
        $row = DB_fetchArray($result);
        if ($row['uid'] == 1) {
            continue;
        }
        $owner_select .= '<option value="' . $row['uid'] . '"' . ($A['owner_id'] == $row['uid'] ? 'selected="selected"' : '') . '>' . COM_getDisplayName($row['uid'], $row['username'], $row['fullname'], $row['remoteusername'], $row['remoteservice']) . '</option>';
    }
    $owner_select .= '</select>';
    $album_sort_select = '<select name="album_sort_order">';
    $album_sort_select .= '<option value="0"' . ($A['album_sort_order'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG03['no_sort'] . '</option>';
    $album_sort_select .= '<option value="1"' . ($A['album_sort_order'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_capture_asc'] . '</option>';
    $album_sort_select .= '<option value="2"' . ($A['album_sort_order'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_capture'] . '</option>';
    $album_sort_select .= '<option value="3"' . ($A['album_sort_order'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_upload_asc'] . '</option>';
    $album_sort_select .= '<option value="4"' . ($A['album_sort_order'] == 4 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_upload'] . '</option>';
    $album_sort_select .= '<option value="5"' . ($A['album_sort_order'] == 5 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_alpha'] . '</option>';
    $album_sort_select .= '<option value="6"' . ($A['album_sort_order'] == 6 ? 'selected="selected"' : '') . '>' . $LANG_MG03['sort_alpha_asc'] . '</option>';
    $album_sort_select .= '</select>';
    if (SEC_hasRights('mediagallery.admin')) {
        //
        // -- build the featured selects and info...
        //
        $featured_select = '<input type="checkbox" name="featured" value="1" ' . ($A['featured'] ? ' checked="checked"' : '') . '/>';
        // build featurepage select...
        $featurepage_select = '<select name="featurepage">';
        $featurepage_select .= '<option value="all"' . ($A['cbpage'] == 'all' ? 'selected="selected"' : '') . '>' . $LANG_MG01['all'] . '</option>';
        $featurepage_select .= '<option value="allnhp"' . ($A['cbpage'] == 'allnhp' ? 'selected="selected"' : '') . '>' . $LANG_MG01['all_nhp'] . '</option>';
        $featurepage_select .= '<option value="none"' . ($A['cbpage'] == 'none' ? 'selected="selected"' : '') . '>' . $LANG_MG01['homepage_only'] . '</option>';
        $featurepage_select .= COM_topicList('tid,topic', $A['cbpage']);
        $featurepage_select .= '</select>';
        // position
        $feature_pos = '<select name="featureposition">';
        $feature_pos .= '<option value="1"' . ($A['cbposition'] == 1 ? ' selected="selected"' : '') . '>' . $LANG_MG01['top'] . '</option>';
        $feature_pos .= '<option value="2"' . ($A['cbposition'] == 2 ? ' selected="selected"' : '') . '>' . $LANG_MG01['after_featured_articles'] . '</option>';
        $feature_pos .= '<option value="3"' . ($A['cbposition'] == 3 ? ' selected="selected"' : '') . '>' . $LANG_MG01['bottom'] . '</option>';
        $feature_pos .= '</select>    ';
        $T->set_var(array('featured_select' => $featured_select, 'feature_page_select' => $featurepage_select, 'feature_position' => $feature_pos, 'lang_featured_album' => $LANG_MG01['featured_album'], 'lang_set_featured' => $LANG_MG01['set_featured'], 'lang_featured_help' => $LANG_MG01['featured_help'], 'lang_position' => $LANG_MG01['position'], 'lang_topic' => $LANG_MG01['topic']));
        $T->parse('featureselect', 'falbum');
        $ri_select = '<input type="checkbox" name="enable_random" value="1" ' . ($A['enable_random'] ? ' checked="checked"' : '') . '/>';
        $T->set_var(array('height_input' => $max_image_height_input, 'width_input' => $max_image_width_input, 'max_size_input' => $max_filesize_input, 'ri_select' => $ri_select, 'lang_ri_enable' => $LANG_MG01['ri_enable'], 'lang_max_image_height' => $LANG_MG01['max_image_height'], 'lang_max_image_width' => $LANG_MG01['max_image_width'], 'lang_max_filesize' => $LANG_MG01['max_filesize']));
        $T->parse('adminattr', 'admin_attr');
        $T->set_var(array('jpg_checked' => $A['valid_formats'] & MG_JPG ? ' checked="checked"' : '', 'png_checked' => $A['valid_formats'] & MG_PNG ? ' checked="checked"' : '', 'tif_checked' => $A['valid_formats'] & MG_TIF ? ' checked="checked"' : '', 'gif_checked' => $A['valid_formats'] & MG_GIF ? ' checked="checked"' : '', 'bmp_checked' => $A['valid_formats'] & MG_BMP ? ' checked="checked"' : '', 'tga_checked' => $A['valid_formats'] & MG_TGA ? ' checked="checked"' : '', 'psd_checked' => $A['valid_formats'] & MG_PSD ? ' checked="checked"' : '', 'mp3_checked' => $A['valid_formats'] & MG_MP3 ? ' checked="checked"' : '', 'ogg_checked' => $A['valid_formats'] & MG_OGG ? ' checked="checked"' : '', 'asf_checked' => $A['valid_formats'] & MG_ASF ? ' checked="checked"' : '', 'swf_checked' => $A['valid_formats'] & MG_SWF ? ' checked="checked"' : '', 'mov_checked' => $A['valid_formats'] & MG_MOV ? ' checked="checked"' : '', 'mp4_checked' => $A['valid_formats'] & MG_MP4 ? ' checked="checked"' : '', 'mpg_checked' => $A['valid_formats'] & MG_MPG ? ' checked="checked"' : '', 'zip_checked' => $A['valid_formats'] & MG_ZIP ? ' checked="checked"' : '', 'flv_checked' => $A['valid_formats'] & MG_FLV ? ' checked="checked"' : '', 'rflv_checked' => $A['valid_formats'] & MG_RFLV ? ' checked="checked"' : '', 'emb_checked' => $A['valid_formats'] & MG_EMB ? ' checked="checked"' : '', 'other_checked' => $A['valid_formats'] & MG_OTHER ? ' checked="checked"' : '', 'lang_jpg' => $LANG_MG01['jpg'], 'lang_png' => $LANG_MG01['png'], 'lang_tif' => $LANG_MG01['tif'], 'lang_gif' => $LANG_MG01['gif'], 'lang_bmp' => $LANG_MG01['bmp'], 'lang_tga' => $LANG_MG01['tga'], 'lang_psd' => $LANG_MG01['psd'], 'lang_mp3' => $LANG_MG01['mp3'], 'lang_ogg' => $LANG_MG01['ogg'], 'lang_asf' => $LANG_MG01['asf'], 'lang_swf' => $LANG_MG01['swf'], 'lang_mov' => $LANG_MG01['mov'], 'lang_mp4' => $LANG_MG01['mp4'], 'lang_mpg' => $LANG_MG01['mpg'], 'lang_zip' => $LANG_MG01['zip'], 'lang_flv' => $LANG_MG01['flv'], 'lang_rflv' => $LANG_MG01['rflv'], 'lang_emb' => $LANG_MG01['emb'], 'lang_other' => $LANG_MG01['other'], 'lang_allowed_formats' => $LANG_MG01['allowed_media_formats'], 'lang_image' => $LANG_MG01['image'], 'lang_audio' => $LANG_MG01['audio'], 'lang_video' => $LANG_MG01['video']));
        $T->parse('valid_formats', 'admin_formats');
    }
    $r = rand();
    if ($A['tn_attached']) {
        $media_size = false;
        foreach ($_MG_CONF['validExtensions'] as $ext) {
            if (file_exists($_MG_CONF['path_mediaobjects'] . 'covers/cover_' . $A['album_id'] . $ext)) {
                $album_last_image = $_MG_CONF['mediaobjects_url'] . '/covers/cover_' . $A['album_id'] . $ext;
                $media_size = @getimagesize($_MG_CONF['path_mediaobjects'] . 'covers/cover_' . $A['album_id'] . $ext);
                if ($media_size != false) {
                    $T->set_var('thumbnail', '<img src="' . $_MG_CONF['mediaobjects_url'] . '/covers/cover_' . $A['album_id'] . $ext . '?r=' . $r . '" alt=""/>');
                }
                break;
            }
        }
        //        $T->set_var('thumbnail','<img src="' . $_MG_CONF['mediaobjects_url'] . '/covers/cover_' . $A['album_id'] . '.jpg?r=' . $r . '" alt="">');
    }
    $filename_title_select = '<input type="checkbox" name="filename_title" value="1" ' . ($A['filename_title'] ? ' checked="checked"' : '') . '/>';
    // watermark stuff...
    $wm_auto_select = '<input type="checkbox" name="wm_auto" value="1" ' . ($A['wm_auto'] ? ' checked="checked"' : '') . '/>';
    $wm_opacity_select = '<select name="wm_opacity">';
    $wm_opacity_select .= '<option value="10"' . ($A['opacity'] == 10 ? 'selected="selected"' : '') . '>10%</option>';
    $wm_opacity_select .= '<option value="20"' . ($A['opacity'] == 20 ? 'selected="selected"' : '') . '>20%</option>';
    $wm_opacity_select .= '<option value="30"' . ($A['opacity'] == 30 ? 'selected="selected"' : '') . '>30%</option>';
    $wm_opacity_select .= '<option value="40"' . ($A['opacity'] == 40 ? 'selected="selected"' : '') . '>40%</option>';
    $wm_opacity_select .= '<option value="50"' . ($A['opacity'] == 50 ? 'selected="selected"' : '') . '>50%</option>';
    $wm_opacity_select .= '<option value="60"' . ($A['opacity'] == 60 ? 'selected="selected"' : '') . '>60%</option>';
    $wm_opacity_select .= '<option value="70"' . ($A['opacity'] == 70 ? 'selected="selected"' : '') . '>70%</option>';
    $wm_opacity_select .= '<option value="80"' . ($A['opacity'] == 80 ? 'selected="selected"' : '') . '>80%</option>';
    $wm_opacity_select .= '<option value="90"' . ($A['opacity'] == 90 ? 'selected="selected"' : '') . '>90%</option>';
    $wm_opacity_select .= '</select>';
    $wm_location_select = '<select name="wm_location">';
    $wm_location_select .= '<option value="1"' . ($A['wm_location'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['top_left'] . '</option>';
    $wm_location_select .= '<option value="2"' . ($A['wm_location'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['top_center'] . '</option>';
    $wm_location_select .= '<option value="3"' . ($A['wm_location'] == 3 ? 'selected="selected"' : '') . '>' . $LANG_MG01['top_right'] . '</option>';
    $wm_location_select .= '<option value="4"' . ($A['wm_location'] == 4 ? 'selected="selected"' : '') . '>' . $LANG_MG01['middle_left'] . '</option>';
    $wm_location_select .= '<option value="5"' . ($A['wm_location'] == 5 ? 'selected="selected"' : '') . '>' . $LANG_MG01['middle_center'] . '</option>';
    $wm_location_select .= '<option value="6"' . ($A['wm_location'] == 6 ? 'selected="selected"' : '') . '>' . $LANG_MG01['middle_right'] . '</option>';
    $wm_location_select .= '<option value="7"' . ($A['wm_location'] == 7 ? 'selected="selected"' : '') . '>' . $LANG_MG01['bottom_left'] . '</option>';
    $wm_location_select .= '<option value="8"' . ($A['wm_location'] == 8 ? 'selected="selected"' : '') . '>' . $LANG_MG01['bottom_center'] . '</option>';
    $wm_location_select .= '<option value="9"' . ($A['wm_location'] == 9 ? 'selected="selected"' : '') . '>' . $LANG_MG01['bottom_right'] . '</option>';
    $wm_location_select .= '</select>';
    // now select what watermarks we have permission to use...
    $whereClause = " WHERE wm_id<>0 AND ";
    if (SEC_hasRights('mediagallery.admin')) {
        $whereClause .= "1=1";
    } else {
        $whereClause .= "(owner_id=" . $_USER['uid'] . " OR owner_id=0)";
    }
    $sql = "SELECT * FROM {$_TABLES['mg_watermarks']} " . $whereClause . " ORDER BY owner_id";
    $result = DB_query($sql);
    $nRows = DB_numRows($result);
    $wm_select = '<select name="wm_id"  onchange="change(this)">';
    $wm_select .= '<option value="blank.png">' . $LANG_MG01['no_watermark'] . '</option>';
    $wm_current = '<img src="' . $_MG_CONF['site_url'] . '/watermarks/blank.png" name="myImage" alt=""/>';
    for ($i = 0; $i < $nRows; $i++) {
        $row = DB_fetchArray($result);
        $wm_select .= '<option value="' . $row['filename'] . '"' . ($A['wm_id'] == $row['wm_id'] ? 'selected="selected"' : '') . '>' . $row['filename'] . '</option>';
        if ($A['wm_id'] == $row['wm_id']) {
            $wm_current = '<img src="' . $_MG_CONF['site_url'] . '/watermarks/' . $row['filename'] . '" name="myImage" alt=""/>';
        }
    }
    $wm_select .= '</select>';
    $frames = new mgFrame();
    $skins = array();
    $skins = $frames->getFrames();
    $skin_select = '<select name="skin">';
    $askin_select = '<select name="askin">';
    $dskin_select = '<select name="dskin">';
    for ($i = 0; $i < count($skins); $i++) {
        $skin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($A['image_skin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
        $askin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($A['album_skin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
        $dskin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($A['display_skin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
    }
    $skin_select .= '</select>';
    $askin_select .= '</select>';
    $dskin_select .= '</select>';
    // permission template
    $usergroups = SEC_getUserGroups();
    $groupdd = '';
    $moddd = '';
    $groupdd .= '<select name="group_id">';
    $moddd .= '<select name="mod_id">';
    for ($i = 0; $i < count($usergroups); $i++) {
        if ($usergroups[key($usergroups)] != 2 && $usergroups[key($usergroups)] != 13) {
            $groupdd .= '<option value="' . $usergroups[key($usergroups)] . '"';
            $moddd .= '<option value="' . $usergroups[key($usergroups)] . '"';
            if ($A['group_id'] == $usergroups[key($usergroups)]) {
                $groupdd .= ' selected="selected"';
            }
            if ($A['mod_group_id'] == $usergroups[key($usergroups)]) {
                $moddd .= ' selected="selected"';
            }
            $groupdd .= '>' . key($usergroups) . '</option>';
            $moddd .= '>' . key($usergroups) . '</option>';
        }
        next($usergroups);
    }
    $groupdd .= '</select>';
    $moddd .= '</select>';
    $upload_select = '<input type="checkbox" name="uploads" value="1" ' . ($A['member_uploads'] ? ' checked="checked"' : '') . '/>';
    $moderate_select = '<input type="checkbox" name="moderate" value="1" ' . ($A['moderate'] ? ' checked="checked"' : '') . '/>';
    $child_update_select = '<input type="checkbox" name="force_child_update" value="1"/>';
    $hidden_select = '<input type="checkbox" name="hidden" value="1" ' . ($A['hidden'] ? ' checked="checked"' : '') . '/>';
    $allow_download_select = '<input type="checkbox" name="allow_download" value="1" ' . ($A['allow_download'] ? ' checked="checked"' : '') . '/>';
    if (SEC_hasRights('mediagallery.admin')) {
        $perm_editor = SEC_getPermissionsHTML($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']);
    } else {
        $perm_editor = MG_getMemberPermissionsHTML($A['perm_members'], $A['perm_anon']);
    }
    $T->set_var(array('lang_uploads' => $LANG_MG01['anonymous_uploads_prompt'], 'lang_accessrights' => $LANG_ACCESS['accessrights'], 'lang_owner' => $LANG_ACCESS['owner'], 'owner_username' => DB_getItem($_TABLES['users'], 'username', "uid={$A['owner_id']}"), 'owner_id' => $A['owner_id'], 'lang_group' => $LANG_ACCESS['group'], 'lang_permissions' => $LANG_ACCESS['permissions'], 'lang_perm_key' => $LANG_ACCESS['permissionskey'], 'lang_hidden' => $LANG_MG01['hidden'], 'permissions_msg' => $LANG_ACCESS['permmsg'], 'permissions_editor' => $perm_editor, 'origaid' => '<input type="hidden" name="origaid" value="' . $oldaid . '"/>', 'group_dropdown' => $groupdd, 'mod_dropdown' => $moddd, 'lang_member_upload' => $LANG_MG01['member_upload'], 'lang_moderate_album' => $LANG_MG01['mod_album'], 'lang_mod_group' => $LANG_MG01['moderation_group'], 'uploads' => $upload_select, 'moderate' => $moderate_select, 'hidden' => $hidden_select, 'force_child_update' => $child_update_select, 'lang_force_child_update' => $LANG_MG01['force_child_update'], 'lang_allow_download' => $LANG_MG01['allow_download'], 'owner_select' => $owner_select, 'email_mod_select' => $email_mod_select, 'lang_email_mods_on_submission' => $LANG_MG01['email_mods_on_submission']));
    if (SEC_hasRights('mediagallery.admin')) {
        $T->parse('perm_editor', 'perms_admin');
    } else {
        $T->parse('perm_editor', 'perms_member');
    }
    $T->set_var(array('action' => 'album', 'path_mg' => $_MG_CONF['site_url'], 'attach_select' => $attach_select, 'comment_select' => $comment_select, 'exif_select' => $exif_select, 'ranking_select' => $ranking_select, 'podcast_select' => $podcast_select, 'mp3ribbon_select' => $mp3ribbon_select, 'rsschildren_select' => $rsschildren_select, 'full_select' => $full_select, 'ss_select' => $ss_select, 'sf_select' => $sf_select, 'views_select' => $views_select, 'keywords_select' => $keywords_select, 'album_views_select' => $album_views_select, 'display_album_desc_select' => $display_album_desc_select, 'sort_select' => $sort_select, 'rss_select' => $rss_select, 'postcard_select' => $postcard_select, 'afirst_select' => $afirst_select, 'tn_size_select' => $tn_size_select, 'display_image_size' => $display_image_size_select, 'rows_input' => $rows_input, 'columns_input' => $columns_input, 'playback_type' => $playback_type, 'album_title' => $A['album_title'], 'album_desc' => $A['album_desc'], 'album_id' => $A['album_id'], 'parent_select' => $album_select, 'album_cover' => $A['album_cover'], 'album_owner' => $A['owner_id'], 'album_order' => $A['album_order'], 'album_cover_filename' => $A['album_cover_filename'], 'last_update' => $A['last_update'], 'media_count' => $A['media_count'], 'wm_auto_select' => $wm_auto_select, 'wm_opacity_select' => $wm_opacity_select, 'wm_location_select' => $wm_location_select, 'wm_select' => $wm_select, 'wm_current' => $wm_current, 'album_theme_select' => $album_theme_select, 'album_sort_select' => $album_sort_select, 'allow_download_select' => $allow_download_select, 'filename_title_select' => $filename_title_select, 'skin_select' => $skin_select, 'askin_select' => $askin_select, 'dskin_select' => $dskin_select, 'tnheight_input' => $tnheight_input, 'tnwidth_input' => $tnwidth_input, 'usealternate_select' => $usealternate_select, 'lang_usealternate' => $LANG_MG01['use_alternate_url'], 'lang_tnheight' => $LANG_MG01['tn_height'], 'lang_tnwidth' => $LANG_MG01['tn_width'], 'lang_save' => $LANG_MG01['save'], 'lang_edit_title' => $mode == 'create' ? $LANG_MG01['create_album'] : $LANG_MG01['edit_album'], 's_form_action' => $actionURL, 'lang_image_skin' => $LANG_MG01['image_skin'], 'lang_album_skin' => $LANG_MG01['album_skin'], 'lang_display_skin' => $LANG_MG01['display_skin'], 'lang_album_edit_help' => $LANG_MG01['album_edit_help'], 'lang_title' => $LANG_MG01['title'], 'lang_podcast' => $LANG_MG01['podcast'], 'lang_mp3ribbon' => $LANG_MG01['mp3ribbon'], 'lang_rsschildren' => $LANG_MG01['rsschildren'], 'lang_parent_album' => $LANG_MG01['parent_album'], 'lang_description' => $LANG_MG01['description'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_delete' => $LANG_MG01['delete'], 'lang_comments' => $LANG_MG01['comments_prompt'], 'lang_enable_exif' => $LANG_MG01['enable_exif'], 'lang_enable_ratings' => $LANG_MG01['enable_ratings'], 'lang_ss_enable' => $LANG_MG01['ss_enable'], 'lang_sf_enable' => $LANG_MG01['sf_enable'], 'lang_tn_size' => $LANG_MG01['tn_size'], 'lang_rows' => $LANG_MG01['rows'], 'lang_columns' => $LANG_MG01['columns'], 'lang_av_play_album' => $LANG_MG01['av_play_album'], 'lang_av_play_options' => $LANG_MG01['av_play_options'], 'lang_attached_thumbnail' => $LANG_MG01['attached_thumbnail'], 'lang_thumbnail' => $LANG_MG01['thumbnail'], 'lang_album_attributes' => $LANG_MG01['album_attributes'], 'lang_album_cover' => $LANG_MG01['album_cover'], 'lang_enable_views' => $LANG_MG01['enable_views'], 'lang_enable_keywords' => $LANG_MG01['enable_keywords'], 'lang_enable_album_views' => $LANG_MG01['enable_album_views'], 'lang_enable_sort' => $LANG_MG01['enable_sort'], 'lang_enable_rss' => $LANG_MG01['enable_rss'], 'lang_enable_postcard' => $LANG_MG01['enable_postcard'], 'lang_albums_first' => $LANG_MG01['albums_first'], 'lang_full_display' => $LANG_MG01['full_display'], 'lang_display_image_size' => $LANG_MG01['display_image_size'], 'lang_album_sort' => $LANG_MG01['default_album_sort'], 'lang_watermark' => $LANG_MG01['watermark'], 'lang_wm_auto' => $LANG_MG01['watermark_auto'], 'lang_wm_opacity' => $LANG_MG01['watermark_opacity'], 'lang_wm_location' => $LANG_MG01['watermark_location'], 'lang_wm_id' => $LANG_MG01['watermark_image'], 'lang_unlimited' => $LANG_MG01['zero_unlimited'], 'lang_display_album_desc' => $LANG_MG01['display_album_desc'], 'lang_filename_title' => $LANG_MG01['filename_title'], 'lang_media_attributes' => $LANG_MG01['media_attributes'], 'lang_theme_select' => $LANG_MG01['album_theme']));
    if ($_MG_CONF['htmlallowed'] == 1) {
        $T->set_var('allowed_html', COM_allowedHTML(SEC_getUserPermissions(), false, 'mediagallery', 'album_title'));
    }
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
Beispiel #4
0
/**
* Global album attribute editor
*
* @return   string              HTML
*
**/
function MG_globalAlbumAttributeEditor($adminMenu = 0)
{
    global $_CONF, $_TABLES, $_MG_CONF, $LANG_MG00, $LANG_MG01, $REMOTE_ADDR;
    global $MG_albums, $album_jumpbox;
    $retval = '';
    $valid_albums = 0;
    if (!SEC_hasRights('mediagallery.admin')) {
        $display .= COM_startBlock('', '', COM_getBlockTemplate('_admin_block', 'header'));
        $T = new Template($_MG_CONF['template_path']);
        $T->set_file('admin', 'error.thtml');
        $T->set_var('site_url', $_CONF['site_url']);
        $T->set_var('site_admin_url', $_CONF['site_admin_url']);
        $T->set_var('errormessage', $LANG_MG00['access_denied_msg']);
        $T->parse('output', 'admin');
        $display .= $T->finish($T->get_var('output'));
        $display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
        $display .= MG_siteFooter();
        return $display;
    }
    $T = new Template(MG_getTemplatePath(0));
    $T->set_var('site_url', $_CONF['site_url']);
    $T->set_var('site_admin_url', $_CONF['site_admin_url']);
    $A['enable_slideshow'] = 0;
    $A['enable_random'] = 0;
    $A['enable_shutterfly'] = 0;
    $A['enable_views'] = 0;
    $A['enable_keywords'] = 0;
    $A['enable_sort'] = 0;
    $A['enable_rating'] = 0;
    $A['albums_first'] = 0;
    $A['tn_size'] = 1;
    $A['display_rows'] = 3;
    $A['display_columns'] = 3;
    $A['full_display'] = 0;
    $A['enable_album_views'] = 0;
    $A['allow_download'] = 0;
    $A['display_album_desc'] = 0;
    $A['filename_title'] = 0;
    $A['podcast'] = 0;
    $A['mp3ribbon'] = 0;
    $A['rsschildren'] = 1;
    $A['skin'] = '';
    $retval .= COM_startBlock($LANG_MG01['global_attr_editor'], '', COM_getBlockTemplate('_admin_block', 'header'));
    $T->set_file(array('admin' => 'global_album_attr.thtml'));
    // build exif select box...
    $exif_select = '<select name="enable_exif">';
    $exif_select .= '<option value="0">' . $LANG_MG01['disable_exif'] . '</option>';
    $exif_select .= '<option value="1">' . $LANG_MG01['display_below_media'] . '</option>';
    $exif_select .= '<option value="2">' . $LANG_MG01['display_in_popup'] . '</option>';
    $exif_select .= '<option value="3">' . $LANG_MG01['both'] . '</option>';
    $exif_select .= '</select>';
    $full_select = '<select name="full_display">';
    $full_select .= '<option value="0"' . ($A['full_display'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['always'] . '</option>';
    $full_select .= '<option value="1"' . ($A['full_display'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['members_only'] . '</option>';
    $full_select .= '<option value="2"' . ($A['full_display'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['disabled'] . '</option>';
    $full_select .= '</select>';
    $ranking_select = '<select name="enable_rating">';
    $ranking_select .= '<option value="0"' . ($A['enable_rating'] == 0 ? 'selected="selected"' : '') . '>' . $LANG_MG01['disabled'] . '</option>';
    $ranking_select .= '<option value="1"' . ($A['enable_rating'] == 1 ? 'selected="selected"' : '') . '>' . $LANG_MG01['members_only'] . '</option>';
    $ranking_select .= '<option value="2"' . ($A['enable_rating'] == 2 ? 'selected="selected"' : '') . '>' . $LANG_MG01['always'] . '</option>';
    $ranking_select .= '</select>';
    $podcast_select = '<input type="checkbox" name="podcast" value="1" ' . ($A['podcast'] ? ' checked="checked"' : '') . '/>';
    $mp3ribbon_select = '<input type="checkbox" name="mp3ribbon" value="1" ' . ($A['mp3ribbon'] ? ' checked="checked"' : '') . '/>';
    $rsschildren_select = '<input type="checkbox" name="rsschildren" value="1" ' . ($A['rsschildren'] ? ' checked="checked"' : '') . '/>';
    $filename_title_select = '<input type="checkbox" name="filename_title" value="1" />';
    $comment_select = '<input type="checkbox" name="enable_comments" value="1" />';
    $ss_select = '<select name="enable_slideshow">';
    $ss_select .= '<option value="0">' . $LANG_MG01['disabled'] . '</option>';
    $ss_select .= '<option value="1">' . $LANG_MG01['js_slideshow'] . '</option>';
    $ss_select .= '<option value="2">' . $LANG_MG01['lightbox'] . '</option>';
    $ss_select .= '</select>';
    $ri_select = '<input type="checkbox" name="enable_random" value="1" />';
    $sf_select = '<input type="checkbox" name="enable_shutterfly" value="1" />';
    $views_select = '<input type="checkbox" name="enable_views" value="1" />';
    $keywords_select = '<input type="checkbox" name="enable_keywords" value="1" />';
    $sort_select = '<input type="checkbox" name="enable_sort" value="1" />';
    $afirst_select = '<input type="checkbox" name="albums_first" value="1" />';
    $album_views_select = '<input type="checkbox" name="enable_album_views" value="1" />';
    $tn_size_select = '<select name="tn_size">';
    $tn_size_select .= '<option value="0">' . $LANG_MG01['small'] . '</option>';
    $tn_size_select .= '<option value="1">' . $LANG_MG01['medium'] . '</option>';
    $tn_size_select .= '<option value="2">' . $LANG_MG01['large'] . '</option>';
    $tn_size_select .= '<option value="3">' . $LANG_MG01['custom'] . '</option>';
    $tn_size_select .= '<option value="4">' . $LANG_MG01['square'] . '</option>';
    $tn_size_select .= '</select>';
    $tnheight_input = '<input type="text" size="3" name="tnheight" value="" />';
    $tnwidth_input = '<input type="text" size="3" name="tnwidth" value="" />';
    $display_image_size_select = '<select name="display_image_size">';
    $display_image_size_select .= '<option value="0">' . $LANG_MG01['size_500x375'] . '</option>';
    $display_image_size_select .= '<option value="1">' . $LANG_MG01['size_600x450'] . '</option>';
    $display_image_size_select .= '<option value="2">' . $LANG_MG01['size_620x465'] . '</option>';
    $display_image_size_select .= '<option value="3">' . $LANG_MG01['size_720x540'] . '</option>';
    $display_image_size_select .= '<option value="4">' . $LANG_MG01['size_800x600'] . '</option>';
    $display_image_size_select .= '<option value="5">' . $LANG_MG01['size_912x684'] . '</option>';
    $display_image_size_select .= '<option value="6">' . $LANG_MG01['size_1024x768'] . '</option>';
    $display_image_size_select .= '<option value="7">' . $LANG_MG01['size_1152x864'] . '</option>';
    $display_image_size_select .= '<option value="8">' . $LANG_MG01['size_1280x1024'] . '</option>';
    $display_image_size_select .= '<option value="9">' . $LANG_MG01['size_custom'] . $_MG_CONF['custom_image_width'] . 'x' . $_MG_CONF['custom_image_height'] . '</option>';
    $display_image_size_select .= '</select>';
    $max_image_height_input = '<input type="text" size="4" name="max_image_height" value="0"' . '/>';
    $max_image_width_input = '<input type="text" size="4" name="max_image_width" value="0" />';
    $max_filesize_input = '<input type="text" size="10" name="max_filesize" value="0" />';
    $rows_input = '<input type="text" size="3" name="display_rows" value="' . $_MG_CONF['display_rows'] . '" />';
    $columns_input = '<input type="text" size="3" name="display_columns" value="' . $_MG_CONF['display_columns'] . '" />';
    $playback_type = '<select name="playback_type">';
    $playback_type .= '<option value="0">' . $LANG_MG01['play_in_popup'] . '</option>';
    $playback_type .= '<option value="1">' . $LANG_MG01['download_to_local'] . '</option>';
    $playback_type .= '<option value="2">' . $LANG_MG01['play_inline'] . '</option>';
    $playback_type .= '<option value="3">' . $LANG_MG01['use_mms'] . '</option>';
    $playback_type .= '</select>';
    $rss_select = '<input type="checkbox" name="enable_rss" value="1" />';
    $display_album_desc_select = '<input type="checkbox" name="display_album_desc" value="1" />';
    $postcard_select = '<select name="enable_postcard">';
    $postcard_select .= '<option value="0">' . $LANG_MG01['disabled'] . '</option>';
    $postcard_select .= '<option value="1">' . $LANG_MG01['members_only'] . '</option>';
    $postcard_select .= '<option value="2">' . $LANG_MG01['all_users'] . '</option>';
    $postcard_select .= '</select>';
    $allow_download_select = '<input type="checkbox" name="allow_download" value="1" />';
    // build album list for starting point...
    $album_jumpbox = '<select name="startaid">';
    $album_jumpbox .= '<option value="0">------</option>';
    $valid_albums += $MG_albums[0]->buildJumpBox(0, 3);
    $album_jumpbox .= '</select>';
    $frames = new mgFrame();
    $skins = array();
    $skins = $frames->getFrames();
    $skin_select = '<select name="skin">';
    $askin_select = '<select name="askin">';
    $dskin_select = '<select name="dskin">';
    for ($i = 0; $i < count($skins); $i++) {
        $skin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($_MG_CONF['ad_image_skin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
        $askin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($_MG_CONF['ad_album_skin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
        $dskin_select .= '<option value="' . $skins[$i]['dir'] . '"' . ($_MG_CONF['ad_display_skin'] == $skins[$i]['dir'] ? ' selected="selected" ' : '') . '>' . $skins[$i]['name'] . '</option>';
    }
    $skin_select .= '</select>';
    $askin_select .= '</select>';
    $dskin_select .= '</select>';
    $themes = MG_getThemes();
    $album_theme_select = '<select name="album_theme">';
    for ($i = 0; $i < count($themes); $i++) {
        $album_theme_select .= '<option value="' . $themes[$i] . '"' . ($A['skin'] == $themes[$i] ? 'selected="selected"' : '') . '>' . $themes[$i] . '</option>';
    }
    $album_theme_select .= '</select>';
    $T->set_var(array('action' => 'globalattr', 'album_list' => $album_jumpbox, 'display_image_size_select' => $display_image_size_select, 'max_image_height_input' => $max_image_height_input, 'max_image_width_input' => $max_image_width_input, 'max_filesize_input' => $max_filesize_input, 'comment_select' => $comment_select, 'exif_select' => $exif_select, 'ranking_select' => $ranking_select, 'podcast_select' => $podcast_select, 'mp3ribbon_select' => $mp3ribbon_select, 'rsschildren_select' => $rsschildren_select, 'ss_select' => $ss_select, 'full_select' => $full_select, 'ri_select' => $ri_select, 'sf_select' => $sf_select, 'rss_select' => $rss_select, 'postcard_select' => $postcard_select, 'views_select' => $views_select, 'keywords_select' => $keywords_select, 'album_theme_select' => $album_theme_select, 'display_album_desc_select' => $display_album_desc_select, 'album_views_select' => $album_views_select, 'sort_select' => $sort_select, 'afirst_select' => $afirst_select, 'tn_size_select' => $tn_size_select, 'tnheight_input' => $tnheight_input, 'tnwidth_input' => $tnwidth_input, 'rows_input' => $rows_input, 'height_input' => $max_image_height_input, 'width_input' => $max_image_width_input, 'max_size_input' => $max_filesize_input, 'columns_input' => $columns_input, 'playback_type' => $playback_type, 'admin_menu' => $adminMenu, 'allow_download_select' => $allow_download_select, 'filename_title_select' => $filename_title_select, 'skin_select' => $skin_select, 'askin_select' => $askin_select, 'dskin_select' => $dskin_select, 'lang_image_skin' => $LANG_MG01['image_skin'], 'lang_album_skin' => $LANG_MG01['album_skin'], 'lang_display_skin' => $LANG_MG01['display_skin'], 'lang_jpg' => $LANG_MG01['jpg'], 'lang_png' => $LANG_MG01['png'], 'lang_tif' => $LANG_MG01['tif'], 'lang_gif' => $LANG_MG01['gif'], 'lang_bmp' => $LANG_MG01['bmp'], 'lang_tga' => $LANG_MG01['tga'], 'lang_psd' => $LANG_MG01['psd'], 'lang_mp3' => $LANG_MG01['mp3'], 'lang_ogg' => $LANG_MG01['ogg'], 'lang_asf' => $LANG_MG01['asf'], 'lang_swf' => $LANG_MG01['swf'], 'lang_mov' => $LANG_MG01['mov'], 'lang_mp4' => $LANG_MG01['mp4'], 'lang_mpg' => $LANG_MG01['mpg'], 'lang_zip' => $LANG_MG01['zip'], 'lang_flv' => $LANG_MG01['flv'], 'lang_rflv' => $LANG_MG01['rflv'], 'lang_emb' => $LANG_MG01['emb'], 'lang_other' => $LANG_MG01['other'], 'lang_allowed_formats' => $LANG_MG01['allowed_media_formats'], 'lang_image' => $LANG_MG01['image'], 'lang_audio' => $LANG_MG01['audio'], 'lang_video' => $LANG_MG01['video'], 'lang_save' => $LANG_MG01['save'], 'lang_edit_title' => $LANG_MG01['edit_album'], 's_form_action' => $_MG_CONF['site_url'] . '/admin.php', 'lang_album_edit_help' => $LANG_MG01['album_edit_help'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_comments' => $LANG_MG01['comments_prompt'], 'lang_enable_exif' => $LANG_MG01['enable_exif'], 'lang_enable_ratings' => $LANG_MG01['enable_ratings'], 'lang_ss_enable' => $LANG_MG01['ss_enable'], 'lang_ri_enable' => $LANG_MG01['ri_enable'], 'lang_sf_enable' => $LANG_MG01['sf_enable'], 'lang_tn_size' => $LANG_MG01['tn_size'], 'lang_rows' => $LANG_MG01['rows'], 'lang_columns' => $LANG_MG01['columns'], 'lang_av_play_album' => $LANG_MG01['av_play_album'], 'lang_av_play_options' => $LANG_MG01['av_play_options'], 'lang_album_attributes' => $LANG_MG01['album_attributes'], 'lang_global_attr_help' => $LANG_MG01['global_attr_help'], 'lang_value' => $LANG_MG01['value'], 'lang_attribute' => $LANG_MG01['attribute'], 'lang_update' => $LANG_MG01['update'], 'lang_enable_views' => $LANG_MG01['enable_views'], 'lang_enable_keywords' => $LANG_MG01['enable_keywords'], 'lang_enable_album_views' => $LANG_MG01['enable_album_views'], 'lang_enable_sort' => $LANG_MG01['enable_sort'], 'lang_albums_first' => $LANG_MG01['albums_first'], 'lang_full_display' => $LANG_MG01['full_display'], 'lang_max_image_height' => $LANG_MG01['max_image_height'], 'lang_max_image_width' => $LANG_MG01['max_image_width'], 'lang_max_filesize' => $LANG_MG01['max_filesize'], 'lang_display_image_size' => $LANG_MG01['display_image_size'], 'lang_starting_album' => $LANG_MG01['starting_album'], 'lang_enable_rss' => $LANG_MG01['enable_rss'], 'lang_enable_postcard' => $LANG_MG01['enable_postcard'], 'lang_allow_download' => $LANG_MG01['allow_download'], 'lang_display_album_desc' => $LANG_MG01['display_album_desc'], 'lang_filename_title' => $LANG_MG01['filename_title'], 'lang_theme_select' => $LANG_MG01['album_theme'], 'lang_podcast' => $LANG_MG01['podcast'], 'lang_mp3ribbon' => $LANG_MG01['mp3ribbon'], 'lang_rsschildren' => $LANG_MG01['rsschildren'], 'lang_tnheight' => $LANG_MG01['tn_height'], 'lang_tnwidth' => $LANG_MG01['tn_width']));
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}