Exemplo n.º 1
0
function MG_buildSearchBox(&$T, $searchinfo = array())
{
    global $_CONF, $_MG_CONF, $_TABLES, $LANG_MG01, $LANG_MG03;
    $cat_select = '<select name="cat_id">';
    $select_cat_id = $searchinfo['cat_id'] == '' ? UC_SELECTED : '';
    $cat_select .= '<option value="" ' . $select_cat_id . '>' . $LANG_MG03['all_categories'] . '</option>';
    $result = DB_query("SELECT cat_id, cat_name FROM {$_TABLES['mg_category']} ORDER BY cat_id ASC");
    while ($row = DB_fetchArray($result)) {
        $select_cat_id = $searchinfo['cat_id'] == $row['cat_id'] ? UC_SELECTED : '';
        $cat_select .= '<option value="' . $row['cat_id'] . '" ' . $select_cat_id . '>' . $row['cat_name'] . '</option>';
    }
    $cat_select .= '</select>';
    $keytype = MG_optionlist(array('name' => 'keyType', 'current' => $searchinfo['keytype'], 'values' => array('phrase' => $LANG_MG03['exact_phrase'], 'all' => $LANG_MG03['all'], 'any' => $LANG_MG03['any'])));
    $swhere = MG_optionlist(array('name' => 'swhere', 'current' => $searchinfo['swhere'], 'values' => array('0' => $LANG_MG03['title_desc_keywords'], '1' => $LANG_MG03['keywords_only'], '2' => $LANG_MG03['title_desc_only'], '3' => $LANG_MG01['artist'], '4' => $LANG_MG01['music_album'], '5' => $LANG_MG01['genre'])));
    $nresults = MG_optionlist(array('name' => 'numresults', 'current' => $searchinfo['numresults'], 'values' => array('10' => '10', '20' => '20', '30' => '30', '40' => '40', '50' => '50')));
    $userselect = '<select name="uid">';
    $select_uid = $searchinfo['uid'] == '0' ? UC_SELECTED : '';
    $userselect .= '<option value="0" ' . $select_uid . '>' . $LANG_MG01['all_users'] . '</option>';
    $result = DB_query("SELECT uid FROM {$_TABLES['users']} WHERE uid > 1 ORDER BY username");
    while ($U = DB_fetchArray($result)) {
        $select_uid = $searchinfo['uid'] == $U['uid'] ? UC_SELECTED : '';
        $userselect .= '<option value="' . $U['uid'] . '" ' . $select_uid . '>' . COM_getDisplayName($U['uid']) . '</option>';
    }
    $userselect .= '</select>';
    $T->set_var(array('s_form_action' => $_MG_CONF['site_url'] . '/search.php', 'mode' => 'search', 'action' => '', 'cat_select' => $cat_select, 'keytype_select' => $keytype, 'swhere_select' => $swhere, 'nresults_select' => $nresults, 'user_select' => $userselect, 'lang_search_title' => $LANG_MG03['advanced_search'], 'lang_search_query' => $LANG_MG03['search_query'], 'lang_search_help' => $LANG_MG03['search_help'], 'lang_options' => $LANG_MG03['options'], 'lang_keywords' => $LANG_MG03['keywords'], 'lang_category' => $LANG_MG03['category'], 'lang_all_fields' => $LANG_MG03['all_fields'], 'lang_keyword_only' => $LANG_MG03['keywords_only'], 'lang_return_results' => $LANG_MG03['return_results'], 'lang_search_for' => $LANG_MG03['search_for'], 'lang_search_in' => $LANG_MG03['search_in'], 'lang_results' => $LANG_MG03['results'], 'lang_per_page' => $LANG_MG03['per_page'], 'lang_search' => $LANG_MG01['search'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_user' => $LANG_MG01['select_user']));
}
Exemplo n.º 2
0
function MG_mediaEdit($album_id, $media_id, $actionURL = '', $mqueue = 0, $view = 0, $back = '')
{
    global $_USER, $_CONF, $_MG_CONF, $_TABLES, $_MG_CONF, $LANG_MG00, $LANG_MG01, $LANG_MG03, $LANG_MG07, $_DB_dbms;
    $album = new mgAlbum($album_id);
    if ($actionURL == '') {
        $actionURL = $_MG_CONF['site_url'] . '/index.php';
    }
    $retval = '';
    $T = COM_newTemplate(MG_getTemplatePath($album_id));
    $T->set_file(array('admin' => 'mediaedit.thtml', 'asf_options' => 'edit_asf_options.thtml', 'mp3_options' => 'edit_mp3_options.thtml', 'swf_options' => 'edit_swf_options.thtml', 'mov_options' => 'edit_mov_options.thtml', 'flv_options' => 'edit_flv_options.thtml'));
    // pull the media information from the database...
    $sql = "SELECT * FROM ";
    if ($_DB_dbms == "mssql") {
        $sql = "SELECT *,CAST(media_desc AS TEXT) AS media_desc FROM ";
    }
    $sql .= ($mqueue ? $_TABLES['mg_mediaqueue'] : $_TABLES['mg_media']) . " WHERE media_id='" . addslashes($media_id) . "'";
    $result = DB_query($sql);
    $row = DB_fetchArray($result);
    if ($album->access != 3 && !SEC_inGroup($album->mod_group_id) && $row['media_user_id'] != $_USER['uid']) {
        COM_errorLog("Someone has tried to illegally sort albums in Media Gallery. " . "User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$REMOTE_ADDR}", 1);
        return COM_showMessageText($LANG_MG00['access_denied_msg']);
    }
    // Build Album List
    $album_jumpbox = '<select name="albums" width="40">';
    $root_album = new mgAlbum(0);
    $root_album->buildJumpBox($album_jumpbox, $album_id);
    $album_jumpbox .= '</select>';
    // should check the above for errors, etc...
    $exif_info = '';
    if ($row['media_type'] == 0) {
        if (!function_exists('MG_readEXIF')) {
            require_once $_CONF['path'] . 'plugins/mediagallery/include/lib-exif.php';
        }
        $exif_info = MG_readEXIF($row['media_id'], 1, $mqueue);
        if (empty($exif_info)) {
            $exif_info = '';
        }
    }
    $media_time_month = date("m", $row['media_time']);
    $media_time_day = date("d", $row['media_time']);
    $media_time_year = date("Y", $row['media_time']);
    $media_time_hour = date("H", $row['media_time']);
    $media_time_minute = date("i", $row['media_time']);
    $month_select = '<select name="media_month">';
    $month_select .= COM_getMonthFormOptions($media_time_month);
    $month_select .= '</select>';
    $day_select = '<select name="media_day">';
    for ($i = 1; $i < 32; $i++) {
        $day_select .= '<option value="' . $i . '"' . ($media_time_day == $i ? 'selected="selected"' : "") . '>' . $i . '</option>';
    }
    $day_select .= '</select>';
    $current_year = (int) date("Y");
    $end_year = $current_year + 10;
    $year_select = '<select name="media_year">';
    for ($i = 1998; $i < $end_year; $i++) {
        $year_select .= '<option value="' . $i . '"' . ($media_time_year == $i ? 'selected="selected"' : "") . '>' . $i . '</option>';
    }
    $year_select .= '</select>';
    $hour_select = '<select name="media_hour">';
    for ($i = 0; $i < 24; $i++) {
        $hour_select .= '<option value="' . $i . '"' . ($media_time_hour == $i ? 'selected="selected"' : "") . '>' . $i . '</option>';
    }
    $hour_select .= '</select>';
    $minute_select = '<select name="media_minute">';
    for ($i = 0; $i < 60; $i++) {
        $minute_select .= '<option value="' . $i . '"' . ($media_time_minute == $i ? 'selected="selected"' : "") . '>' . ($i < 10 ? '0' : '') . $i . '</option>';
    }
    $minute_select .= '</select>';
    $media_time = MG_getUserDateTimeFormat($row['media_time']);
    $tn_size = 1;
    list($thumbnail, $pThumbnail, $size) = Media::getThumbInfo($row, $tn_size);
    $attached_thumbnail = '';
    if ($row['media_tn_attached'] == 1) {
        $atnsize = '';
        if ($size != false) {
            list($newwidth, $newheight) = Media::getImageWH($size[0], $size[1], 150, 150);
            $atnsize = 'width="' . $newwidth . '" height="' . $newheight . '"';
        }
        $attached_thumbnail = '<img src="' . $thumbnail . '" alt="" ' . $atnsize . XHTML . '>';
        $tmpthumb = Media::getDefaultThumbnail($row, $tn_size);
        $thumbnail = $_MG_CONF['mediaobjects_url'] . '/' . $tmpthumb;
        $size = getimagesize($_MG_CONF['path_mediaobjects'] . $tmpthumb);
    }
    $preview = '';
    $preview_end = '';
    if ($row['media_type'] == 0 || $row['media_type'] == 1 || $row['media_type'] == 2) {
        // image, video and music file
        if ($row['media_type'] == 2) {
            $win_width = 540;
            $win_height = 320;
        } elseif ($row['media_type'] == 1) {
            $win_width = 660;
            $win_height = 525;
        } elseif ($row['media_type'] == 0) {
            $path = Media::getFilePath('disp', $row['media_filename'], $row['media_mime_ext']);
            $media_size_disp = @getimagesize($path);
            $win_width = $media_size_disp[0] + 20;
            $win_height = $media_size_disp[1] + 20;
        } else {
            $win_width = 800;
            $win_height = 600;
        }
        $url = Media::getHref_showvideo($row['media_id'], $win_height, $win_width, $mqueue);
        $preview = "<a href=\"" . $url . "\">";
        $preview_end = "</a>";
    }
    $rotate_right = '';
    $rotate_left = '';
    if ($row['media_type'] == 0 && ($_CONF['image_lib'] != 'gdlib' || function_exists("imagerotate"))) {
        $rotate_right = '<a href="' . $_MG_CONF['site_url'] . '/admin.php?mode=rotate&amp;action=right&amp;media_id=' . $row['media_id'] . '&amp;album_id=' . $album_id . '">' . '<img src="' . $_MG_CONF['site_url'] . '/images/rotate_right_icon.gif" alt="' . $LANG_MG01['rotate_left'] . '" style="border:none;"' . XHTML . '></a>';
        $rotate_left = '<a href="' . $_MG_CONF['site_url'] . '/admin.php?mode=rotate&amp;action=left&amp;media_id=' . $row['media_id'] . '&amp;album_id=' . $album_id . '">' . '<img src="' . $_MG_CONF['site_url'] . '/images/rotate_left_icon.gif" alt="' . $LANG_MG01['rotate_right'] . '" style="border:none;"' . XHTML . '></a>';
    }
    $resolution = '';
    $lang_resolution = '';
    if ($row['media_type'] == 1) {
        // video file
        $resolution = 'unknown';
        if ($row['media_resolution_x'] > 0 && $row['media_resolution_y'] > 0) {
            $resolution = $row['media_resolution_x'] . 'x' . $row['media_resolution_y'];
        }
        $lang_resolution = $LANG_MG07['resolution'];
    }
    $sql = "SELECT * FROM {$_TABLES['mg_playback_options']} " . "WHERE media_id='" . addslashes($row['media_id']) . "'";
    $poResult = DB_query($sql);
    $poNumRows = DB_numRows($poResult);
    // playback options, if needed...
    if ($row['mime_type'] == 'video/x-ms-asf' || $row['mime_type'] == 'video/x-ms-wvx' || $row['mime_type'] == 'video/x-ms-wm' || $row['mime_type'] == 'video/x-ms-wmx' || $row['mime_type'] == 'video/x-ms-wmv' || $row['mime_type'] == 'audio/x-ms-wma' || $row['mime_type'] == 'video/x-msvideo') {
        // pull defaults, then override...
        $playback_options['autostart'] = $_MG_CONF['asf_autostart'];
        $playback_options['enablecontextmenu'] = $_MG_CONF['asf_enablecontextmenu'];
        $playback_options['stretchtofit'] = $_MG_CONF['asf_stretchtofit'];
        $playback_options['uimode'] = $_MG_CONF['asf_uimode'];
        $playback_options['showstatusbar'] = $_MG_CONF['asf_showstatusbar'];
        $playback_options['playcount'] = $_MG_CONF['asf_playcount'];
        $playback_options['height'] = $_MG_CONF['asf_height'];
        $playback_options['width'] = $_MG_CONF['asf_width'];
        $playback_options['bgcolor'] = $_MG_CONF['asf_bgcolor'];
        for ($i = 0; $i < $poNumRows; $i++) {
            $poRow = DB_fetchArray($poResult);
            $playback_options[$poRow['option_name']] = $poRow['option_value'];
        }
        $uimode_select = MG_optionlist(array('name' => 'uimode', 'current' => $playback_options['uimode'], 'values' => array('none' => $LANG_MG07['none'], 'mini' => $LANG_MG07['mini'], 'full' => $LANG_MG07['full'])));
        $T->set_var(array('autostart_enabled' => $playback_options['autostart'] ? ' checked="checked"' : '', 'autostart_disabled' => $playback_options['autostart'] ? '' : ' checked="checked"', 'enablecontextmenu_enabled' => $playback_options['enablecontextmenu'] ? ' checked="checked"' : '', 'enablecontextmenu_disabled' => $playback_options['enablecontextmenu'] ? '' : ' checked="checked"', 'stretchtofit_enabled' => $playback_options['stretchtofit'] ? ' checked="checked"' : '', 'stretchtofit_disabled' => $playback_options['stretchtofit'] ? '' : ' checked="checked"', 'showstatusbar_enabled' => $playback_options['showstatusbar'] ? ' checked="checked"' : '', 'showstatusbar_disabled' => $playback_options['showstatusbar'] ? '' : ' checked="checked"', 'uimode_select' => $uimode_select, 'uimode' => $playback_options['uimode'], 'playcount' => $playback_options['playcount'], 'height' => $playback_options['height'], 'width' => $playback_options['width'], 'bgcolor' => $playback_options['bgcolor'], 'lang_resolution' => $lang_resolution, 'resolution' => $resolution));
        $T->parse('playback_options', 'asf_options');
    }
    if ($row['mime_type'] == 'audio/mpeg') {
        // pull defaults, then override...
        $playback_options['autostart'] = $_MG_CONF['mp3_autostart'];
        $playback_options['enablecontextmenu'] = $_MG_CONF['mp3_enablecontextmenu'];
        $playback_options['uimode'] = $_MG_CONF['mp3_uimode'];
        $playback_options['showstatusbar'] = $_MG_CONF['mp3_showstatusbar'];
        $playback_options['loop'] = $_MG_CONF['mp3_loop'];
        for ($i = 0; $i < $poNumRows; $i++) {
            $poRow = DB_fetchArray($poResult);
            $playback_options[$poRow['option_name']] = $poRow['option_value'];
        }
        $uimode_select = MG_optionlist(array('name' => 'uimode', 'current' => $playback_options['uimode'], 'values' => array('none' => $LANG_MG07['none'], 'mini' => $LANG_MG07['mini'], 'full' => $LANG_MG07['full'])));
        $T->set_var(array('autostart_enabled' => $playback_options['autostart'] ? ' checked="checked"' : '', 'autostart_disabled' => $playback_options['autostart'] ? '' : ' checked="checked"', 'enablecontextmenu_enabled' => $playback_options['enablecontextmenu'] ? ' checked="checked"' : '', 'enablecontextmenu_disabled' => $playback_options['enablecontextmenu'] ? '' : ' checked="checked"', 'showstatusbar_enabled' => $playback_options['showstatusbar'] ? ' checked="checked"' : '', 'showstatusbar_disabled' => $playback_options['showstatusbar'] ? '' : ' checked="checked"', 'loop_enabled' => $playback_options['loop'] ? ' checked="checked"' : '', 'loop_disabled' => $playback_options['loop'] ? '' : ' checked="checked"', 'uimode_select' => $uimode_select, 'uimode' => $playback_options['uimode']));
        $T->parse('playback_options', 'mp3_options');
    }
    if ($row['mime_type'] == 'application/x-shockwave-flash' || $row['mime_type'] == 'video/x-flv') {
        // pull defaults, then override...
        $playback_options['play'] = $_MG_CONF['swf_play'];
        $playback_options['menu'] = $_MG_CONF['swf_menu'];
        $playback_options['quality'] = $_MG_CONF['swf_quality'];
        $playback_options['height'] = $_MG_CONF['swf_height'];
        $playback_options['width'] = $_MG_CONF['swf_width'];
        $playback_options['loop'] = $_MG_CONF['swf_loop'];
        $playback_options['scale'] = $_MG_CONF['swf_scale'];
        $playback_options['wmode'] = $_MG_CONF['swf_wmode'];
        $playback_options['allowscriptaccess'] = $_MG_CONF['swf_allowscriptaccess'];
        $playback_options['bgcolor'] = $_MG_CONF['swf_bgcolor'];
        $playback_options['swf_version'] = $_MG_CONF['swf_version'];
        for ($i = 0; $i < $poNumRows; $i++) {
            $poRow = DB_fetchArray($poResult);
            $playback_options[$poRow['option_name']] = $poRow['option_value'];
        }
        $quality_select = MG_optionlist(array('name' => 'quality', 'current' => $playback_options['quality'], 'values' => array('low' => $LANG_MG07['low'], 'high' => $LANG_MG07['high'])));
        $scale_select = MG_optionlist(array('name' => 'scale', 'current' => $playback_options['scale'], 'values' => array('showall' => $LANG_MG07['showall'], 'noborder' => $LANG_MG07['noborder'], 'exactfit' => $LANG_MG07['exactfit'])));
        $wmode_select = MG_optionlist(array('name' => 'wmode', 'current' => $playback_options['wmode'], 'values' => array('window' => $LANG_MG07['window'], 'opaque' => $LANG_MG07['opaque'], 'transparent' => $LANG_MG07['transparent'])));
        $asa_select = MG_optionlist(array('name' => 'allowscriptaccess', 'current' => $playback_options['allowscriptaccess'], 'values' => array('always' => $LANG_MG07['always'], 'sameDomain' => $LANG_MG07['sameDomain'], 'never' => $LANG_MG07['never'])));
        $T->set_var(array('play_enabled' => $playback_options['play'] ? ' checked="checked"' : '', 'play_disabled' => $playback_options['play'] ? '' : ' checked="checked"', 'menu_enabled' => $playback_options['menu'] ? ' checked="checked"' : '', 'menu_disabled' => $playback_options['menu'] ? '' : ' checked="checked"', 'loop_enabled' => $playback_options['loop'] ? ' checked="checked"' : '', 'loop_disabled' => $playback_options['loop'] ? '' : ' checked="checked"', 'quality_select' => $quality_select, 'scale_select' => $scale_select, 'wmode_select' => $wmode_select, 'asa_select' => $asa_select, 'flashvars' => isset($playback_options['flashvars']) ? $playback_options['flashvars'] : '', 'height' => $playback_options['height'], 'width' => $playback_options['width'], 'bgcolor' => $playback_options['bgcolor'], 'swf_version' => $playback_options['swf_version']));
        if ($row['mime_type'] == 'application/x-shockwave-flash') {
            $T->parse('playback_options', 'swf_options');
        } else {
            $T->parse('playback_options', 'flv_options');
        }
    }
    if ($row['media_mime_ext'] == 'mov' || $row['media_mime_ext'] == 'mp4' || $row['mime_type'] == 'video/quicktime' || $row['mime_type'] == 'video/mpeg') {
        // pull defaults, then override...
        $playback_options['autoref'] = $_MG_CONF['mov_autoref'];
        $playback_options['autoplay'] = $_MG_CONF['mov_autoplay'];
        $playback_options['controller'] = $_MG_CONF['mov_controller'];
        $playback_options['kioskmode'] = isset($_MG_CONF['mov_kioskmod']) ? $_MG_CONF['mov_kiokmode'] : '';
        $playback_options['scale'] = $_MG_CONF['mov_scale'];
        $playback_options['loop'] = $_MG_CONF['mov_loop'];
        $playback_options['height'] = $_MG_CONF['mov_height'];
        $playback_options['width'] = $_MG_CONF['mov_width'];
        $playback_options['bgcolor'] = $_MG_CONF['mov_bgcolor'];
        for ($i = 0; $i < $poNumRows; $i++) {
            $poRow = DB_fetchArray($poResult);
            $playback_options[$poRow['option_name']] = $poRow['option_value'];
        }
        $scale_select = MG_optionlist(array('name' => 'scale', 'current' => $playback_options['scale'], 'values' => array('tofit' => $LANG_MG07['to_fit'], 'aspect' => $LANG_MG07['aspect'], '1' => $LANG_MG07['normal_size'])));
        $T->set_var(array('autoref_enabled' => $playback_options['autoref'] ? ' checked="checked"' : '', 'autoref_disabled' => $playback_options['autoref'] ? '' : ' checked="checked"', 'autoplay_enabled' => $playback_options['autoplay'] ? ' checked="checked"' : '', 'autoplay_disabled' => $playback_options['autoplay'] ? '' : ' checked="checked"', 'controller_enabled' => $playback_options['controller'] ? ' checked="checked"' : '', 'controller_disabled' => $playback_options['controller'] ? '' : ' checked="checked"', 'kioskmode_enabled' => $playback_options['kioskmode'] ? ' checked="checked"' : '', 'kioskmode_disabled' => $playback_options['kioskmode'] ? '' : ' checked="checked"', 'loop_enabled' => $playback_options['loop'] ? ' checked="checked"' : '', 'loop_disabled' => $playback_options['loop'] ? '' : ' checked="checked"', 'height' => $playback_options['height'], 'width' => $playback_options['width'], 'bgcolor' => $playback_options['bgcolor']));
        $T->parse('playback_options', 'mov_options');
    }
    $remoteurl = $row['remote_url'];
    $lang_remote_url = $row['remote_media'] == 1 ? $LANG_MG01['remote_url'] : $LANG_MG01['alternate_url'];
    // user information
    $username = '';
    if (SEC_hasRights('mediagallery.admin')) {
        $username = '******';
        $sql = "SELECT * FROM {$_TABLES['users']} WHERE status=3 AND uid > 1 ORDER BY username ASC";
        $result = DB_query($sql);
        while ($userRow = DB_fetchArray($result)) {
            $username .= '<option value="' . $userRow['uid'] . '"' . ($userRow['uid'] == $row['media_user_id'] ? ' selected="selected"' : '') . '>' . $userRow['username'] . '</option>' . LB;
        }
        $username .= '</select>';
    } else {
        if ($row['media_user_id'] != '') {
            $displayname = $_CONF['show_fullname'] ? 'fullname' : 'username';
            $username = DB_getItem($_TABLES['users'], $displayname, "uid={$row['media_user_id']}");
        }
    }
    $cat_select = '<select name="cat_id" id="cat_id">';
    $cat_select .= '<option value="">' . $LANG_MG01['no_category'] . '</option>';
    $result = DB_query("SELECT * FROM {$_TABLES['mg_category']} ORDER BY cat_id ASC");
    while ($catRow = DB_fetchArray($result)) {
        $cat_select .= '<option value="' . $catRow['cat_id'] . '" ' . ($catRow['cat_id'] == $row['media_category'] ? ' selected="selected"' : '') . '>' . $catRow['cat_name'] . '</option>';
    }
    $cat_select .= '</select>';
    $T->set_var(array('original_filename' => $row['media_original_filename'], 'attach_tn' => $row['media_tn_attached'], 'at_tn_checked' => $row['media_tn_attached'] == 1 ? ' checked="checked"' : '', 'attached_thumbnail' => $attached_thumbnail, 'album_id' => $album_id, 'media_thumbnail' => $thumbnail, 'media_id' => $row['media_id'], 'media_title' => $row['media_title'], 'media_desc' => $row['media_desc'], 'media_time' => $media_time[0], 'media_views' => $row['media_views'], 'media_comments' => $row['media_comments'], 'media_exif_info' => $exif_info, 'media_rating_max' => 5, 'height' => $size[1] + 50, 'width' => $size[0] + 40, 'queue' => $mqueue, 'month_select' => $month_select, 'day_select' => $day_select, 'year_select' => $year_select, 'hour_select' => $hour_select, 'minute_select' => $minute_select, 'user_ip' => $row['media_user_ip'], 'album_select' => $album_jumpbox, 'media_rating' => $row['media_rating'] / 2, 'media_votes' => $row['media_votes'], 's_mode' => 'edit', 's_title' => $LANG_MG01['edit_media'], 's_rotate_right' => $rotate_right, 's_rotate_left' => $rotate_left, 's_form_action' => $actionURL, 'allowed_html' => COM_allowedHTML(), 'site_url' => $_MG_CONF['site_url'], 'preview' => $preview, 'preview_end' => $preview_end, 'rpath' => htmlentities($back, ENT_QUOTES, COM_getCharset()), 'remoteurl' => $remoteurl, 'lang_remote_url' => $lang_remote_url, 'resolution' => $resolution, 'lang_resolution' => $lang_resolution, 'username' => $username, 'cat_select' => $cat_select, 'media_keywords' => $row['media_keywords'], 'artist' => $row['artist'], 'musicalbum' => $row['album'], 'genre' => $row['genre']));
    // language items
    $T->set_var(array('lang_playcount' => $LANG_MG07['playcount'], 'lang_playcount_help' => $LANG_MG07['playcount_help'], 'lang_playback_options' => $LANG_MG07['playback_options'], 'lang_option' => $LANG_MG07['option'], 'lang_description' => $LANG_MG07['description'], 'lang_on' => $LANG_MG07['on'], 'lang_off' => $LANG_MG07['off'], 'lang_auto_start' => $LANG_MG07['auto_start'], 'lang_auto_start_help' => $LANG_MG07['auto_start_help'], 'lang_height' => $LANG_MG07['height'], 'lang_width' => $LANG_MG07['width'], 'lang_height_help' => $LANG_MG07['height_help'], 'lang_width_help' => $LANG_MG07['width_help'], 'lang_enable_context_menu' => $LANG_MG07['enable_context_menu'], 'lang_enable_context_menu_help' => $LANG_MG07['enable_context_menu_help'], 'lang_stretch_to_fit' => $LANG_MG07['stretch_to_fit'], 'lang_stretch_to_fit_help' => $LANG_MG07['stretch_to_fit_help'], 'lang_status_bar' => $LANG_MG07['status_bar'], 'lang_status_bar_help' => $LANG_MG07['status_bar_help'], 'lang_ui_mode' => $LANG_MG07['ui_mode'], 'lang_ui_mode_help' => $LANG_MG07['ui_mode_help'], 'lang_bgcolor' => $LANG_MG07['bgcolor'], 'lang_bgcolor_help' => $LANG_MG07['bgcolor_help'], 'lang_loop' => $LANG_MG07['loop'], 'lang_loop_help' => $LANG_MG07['loop_help'], 'lang_menu' => $LANG_MG07['menu'], 'lang_menu_help' => $LANG_MG07['menu_help'], 'lang_scale' => $LANG_MG07['scale'], 'lang_swf_scale_help' => $LANG_MG07['swf_scale_help'], 'lang_wmode' => $LANG_MG07['wmode'], 'lang_wmode_help' => $LANG_MG07['wmode_help'], 'lang_quality' => $LANG_MG07['quality'], 'lang_quality_help' => $LANG_MG07['quality_help'], 'lang_flash_vars' => $LANG_MG07['flash_vars'], 'lang_asa' => $LANG_MG07['asa'], 'lang_asa_help' => $LANG_MG07['asa_help'], 'lang_swf_version_help' => $LANG_MG07['swf_version_help'], 'lang_auto_ref' => $LANG_MG07['auto_ref'], 'lang_auto_ref_help' => $LANG_MG07['auto_ref_help'], 'lang_controller' => $LANG_MG07['controller'], 'lang_controller_help' => $LANG_MG07['controller_help'], 'lang_kiosk_mode' => $LANG_MG07['kiosk_mode'], 'lang_kiosk_mode_help' => $LANG_MG07['kiosk_mode_help'], 'lang_original_filename' => $LANG_MG01['original_filename'], 'lang_media_item' => $LANG_MG00['media_col_header'], 'lang_media_attributes' => $LANG_MG01['media_attributes'], 'lang_mediaattributes' => $LANG_MG01['mediaattributes'], 'lang_attached_thumbnail' => $LANG_MG01['attached_thumbnail'], 'lang_category' => $LANG_MG01['category'], 'lang_keywords' => $LANG_MG01['keywords'], 'lang_rating' => $LANG_MG03['rating'], 'lang_comments' => $LANG_MG03['comments'], 'lang_votes' => $LANG_MG03['votes'], 'media_edit_title' => $LANG_MG01['media_edit'], 'media_edit_help' => $LANG_MG01['media_edit_help'], 'rotate_left' => $LANG_MG01['rotate_left'], 'rotate_right' => $LANG_MG01['rotate_right'], 'lang_title' => $LANG_MG01['title'], 'albums' => $LANG_MG01['albums'], 'description' => $LANG_MG01['description'], 'capture_time' => $LANG_MG01['capture_time'], 'views' => $LANG_MG03['views'], 'uploaded_by' => $LANG_MG01['uploaded_by'], 'submit' => $LANG_MG01['submit'], 'cancel' => $LANG_MG01['cancel'], 'reset' => $LANG_MG01['reset'], 'lang_save' => $LANG_MG01['save'], 'lang_reset' => $LANG_MG01['reset'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_delete' => $LANG_MG01['delete'], 'lang_delete_confirm' => $LANG_MG01['delete_item_confirm'], 'lang_reset_rating' => $LANG_MG01['reset_rating'], 'lang_reset_views' => $LANG_MG01['reset_views'], 'lang_replacefile' => $LANG_MG01['replace_file'], 'lang_artist' => $LANG_MG01['artist'], 'lang_genre' => $LANG_MG01['genre'], 'lang_music_album' => $LANG_MG01['music_album']));
    $retval .= $T->finish($T->parse('output', 'admin'));
    return $retval;
}
Exemplo n.º 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($mode = '', $actionURL = '', $oldaid = 0)
{
    global $_USER, $_CONF, $_TABLES, $_MG_CONF, $LANG_MG00, $LANG_MG01, $LANG_MG03, $LANG_ACCESS;
    if ($actionURL == '') {
        $actionURL = $_CONF['site_admin_url'] . '/plugins/mediagallery/index.php';
    }
    if ($oldaid > 0 && $mode == 'edit') {
        $album = new mgAlbum($oldaid);
        $album_id = $album->id;
    } else {
        // create
        $album = new mgAlbum();
        $album->id = -1;
        $album_id = -1;
    }
    $retval = '';
    $T = COM_newTemplate(MG_getTemplatePath($album_id));
    $T->set_file('admin', 'editalbum.thtml');
    if ($album_id != 0 && $mode == 'edit') {
        // If edit, pull up the existing album information...
        if ($album->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 COM_showMessageText($LANG_MG00['access_denied_msg']);
        }
    }
    $block_title = $mode == 'create' ? $LANG_MG01['create_album'] : $LANG_MG01['edit_album'] . ' - ' . strip_tags($album->title);
    // construct the album jumpbox
    $select = $mode == 'create' ? $oldaid : $album->parent;
    $valid_albums = 0;
    $album_selectbox = '<select name="parentaid">';
    $root_album = new mgAlbum(0);
    $valid_albums += $root_album->buildAlbumBox($album_selectbox, $select, 3, $album_id, $mode);
    $album_selectbox .= '</select>';
    if ($valid_albums == 0) {
        COM_errorLog("MediaGallery: Someone has tried to illegally create a Media Gallery Album. " . "User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$REMOTE_ADDR}", 1);
        return COM_showMessageText($LANG_MG00['access_denied_msg']);
    }
    // build exif select box...
    $exif_select = MG_optionlist(array('name' => 'enable_exif', 'current' => $album->exif_display, 'values' => array('0' => $LANG_MG01['disable_exif'], '1' => $LANG_MG01['display_below_media'], '2' => $LANG_MG01['display_in_popup'], '3' => $LANG_MG01['both'])));
    $full_select = MG_optionlist(array('name' => 'full_display', 'current' => $album->full, 'values' => array('0' => $LANG_MG01['always'], '1' => $LANG_MG01['members_only'], '2' => $LANG_MG01['disabled']), 'disabled' => $_MG_CONF['discard_original']));
    $ranking_select = MG_optionlist(array('name' => 'enable_rating', 'current' => $album->enable_rating, 'values' => array('0' => $LANG_MG01['disabled'], '1' => $LANG_MG01['members_only'], '2' => $LANG_MG01['always'])));
    $podcast_select = MG_checkbox(array('name' => 'podcast', 'checked' => $album->podcast, 'value' => '1'));
    $mp3ribbon_select = MG_checkbox(array('name' => 'mp3ribbon', 'checked' => $album->mp3ribbon, 'value' => '1'));
    $rsschildren_select = MG_checkbox(array('name' => 'rsschildren', 'checked' => $album->rssChildren, 'value' => '1'));
    $comment_select = MG_checkbox(array('name' => 'enable_comments', 'checked' => $album->enable_comments, 'value' => '1'));
    $ss_select = MG_optionlist(array('name' => 'enable_slideshow', 'current' => $album->enable_slideshow, 'values' => array('0' => $LANG_MG01['disabled'], '1' => $LANG_MG01['js_slideshow'], '2' => $LANG_MG01['lightbox'], '3' => $LANG_MG01['flash_slideshow_disp'], '4' => $LANG_MG01['flash_slideshow_full'], '5' => $LANG_MG01['mp3_jukebox'])));
    $views_select = MG_checkbox(array('name' => 'enable_views', 'checked' => $album->enable_views, 'value' => '1'));
    $keywords_select = MG_checkbox(array('name' => 'enable_keywords', 'checked' => $album->enable_keywords, 'value' => '1'));
    $sort_select = MG_checkbox(array('name' => 'enable_sort', 'checked' => $album->enable_sort, 'value' => '1'));
    $rss_select = MG_checkbox(array('name' => 'enable_rss', 'checked' => $album->enable_rss, 'value' => '1'));
    $afirst_select = MG_checkbox(array('name' => 'albums_first', 'checked' => $album->albums_first, 'value' => '1'));
    $usealternate_select = MG_checkbox(array('name' => 'usealternate', 'checked' => $album->useAlternate, 'value' => '1'));
    $album_views_select = MG_checkbox(array('name' => 'enable_album_views', 'checked' => $album->enable_album_views, 'value' => '1'));
    $display_album_desc_select = MG_checkbox(array('name' => 'display_album_desc', 'checked' => $album->display_album_desc, 'value' => '1'));
    $tn_size_select = MG_optionlist(array('name' => 'tn_size', 'current' => $album->tn_size, 'values' => array('0' => $LANG_MG01['include_small'], '1' => $LANG_MG01['include_medium'], '2' => $LANG_MG01['include_large'], '3' => $LANG_MG01['include_custom'], '10' => $LANG_MG01['crop_small'], '11' => $LANG_MG01['crop_medium'], '12' => $LANG_MG01['crop_large'], '13' => $LANG_MG01['crop_custom'])));
    $display_image_size_select = MG_optionlist(array('name' => 'display_image_size', 'current' => $album->display_image_size, 'values' => array('0' => $LANG_MG01['size_500x375'], '1' => $LANG_MG01['size_600x450'], '2' => $LANG_MG01['size_620x465'], '3' => $LANG_MG01['size_720x540'], '4' => $LANG_MG01['size_800x600'], '5' => $LANG_MG01['size_912x684'], '6' => $LANG_MG01['size_1024x768'], '7' => $LANG_MG01['size_1152x864'], '8' => $LANG_MG01['size_1280x1024'], '9' => $LANG_MG01['size_custom'] . $_MG_CONF['custom_image_width'] . 'x' . $_MG_CONF['custom_image_height'])));
    $rows_input = MG_input(array('type' => 'text', 'size' => '3', 'name' => 'display_rows', 'value' => $album->display_rows));
    $columns_input = MG_input(array('type' => 'text', 'size' => '3', 'name' => 'display_columns', 'value' => $album->display_columns));
    $max_image_height_input = MG_input(array('type' => 'text', 'size' => '4', 'name' => 'max_image_height', 'value' => $album->max_image_height));
    $max_image_width_input = MG_input(array('type' => 'text', 'size' => '4', 'name' => 'max_image_width', 'value' => $album->max_image_width));
    $tnheight_input = MG_input(array('type' => 'text', 'size' => '3', 'name' => 'tnheight', 'value' => $album->tnHeight));
    $tnwidth_input = MG_input(array('type' => 'text', 'size' => '3', 'name' => 'tnwidth', 'value' => $album->tnWidth));
    $max_filesize = 0;
    if ($album->max_filesize != 0) {
        $max_filesize = $album->max_filesize / 1024;
    }
    $max_filesize_input = MG_input(array('type' => 'text', 'size' => '10', 'name' => 'max_filesize', 'value' => $max_filesize));
    $email_mod_select = MG_checkbox(array('name' => 'email_mod', 'checked' => $album->email_mod, 'value' => '1'));
    $playback_type = MG_optionlist(array('name' => 'playback_type', 'current' => $album->playback_type, 'values' => array('0' => $LANG_MG01['play_in_popup'], '1' => $LANG_MG01['download_to_local'], '2' => $LANG_MG01['play_inline'], '3' => $LANG_MG01['use_mms'])));
    $themes = MG_getThemes();
    $album_theme_select = '<select name="album_theme">';
    for ($i = 0; $i < count($themes); $i++) {
        $album_theme_select .= '<option value="' . $themes[$i] . '"' . ($album->skin == $themes[$i] ? ' selected="selected"' : '') . '>' . $themes[$i] . '</option>';
    }
    $album_theme_select .= '</select>';
    $attach_select = MG_checkbox(array('name' => 'attach_tn', 'checked' => $album->tn_attached, 'value' => '1'));
    $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'] . '"' . ($album->owner_id == $row['uid'] ? ' selected="selected"' : '') . '>' . COM_getDisplayName($row['uid']) . '</option>';
    }
    $owner_select .= '</select>';
    $album_sort_select = MG_optionlist(array('name' => 'album_sort_order', 'current' => $album->album_sort_order, 'values' => array('0' => $LANG_MG03['no_sort'], '1' => $LANG_MG03['sort_capture_asc'], '2' => $LANG_MG03['sort_capture'], '3' => $LANG_MG03['sort_upload_asc'], '4' => $LANG_MG03['sort_upload'], '5' => $LANG_MG03['sort_alpha'], '6' => $LANG_MG03['sort_alpha_asc'])));
    if (SEC_hasRights('mediagallery.admin')) {
        //
        // -- build the featured selects and info...
        //
        $featured_select = MG_checkbox(array('name' => 'featured', 'checked' => $album->featured, 'value' => '1'));
        // build featurepage select...
        $featurepage_select = '<select name="featurepage">';
        $featurepage_select .= MG_options(array('current' => $album->cbpage, 'values' => array('all' => $LANG_MG01['all'], 'allnhp' => $LANG_MG01['all_nhp'], 'none' => $LANG_MG01['homepage_only'])));
        $featurepage_select .= COM_topicList('tid,topic', $album->cbpage);
        $featurepage_select .= '</select>';
        // position
        $feature_pos = MG_optionlist(array('name' => 'featureposition', 'current' => $album->cbposition, 'values' => array('1' => $LANG_MG01['top'], '2' => $LANG_MG01['after_featured_articles'], '3' => $LANG_MG01['bottom'])));
        $ri_select = MG_checkbox(array('name' => 'enable_random', 'checked' => $album->enable_random, 'value' => '1'));
        $T->set_var(array('featured_select' => $featured_select, 'feature_page_select' => $featurepage_select, 'feature_position' => $feature_pos, 'height_input' => $max_image_height_input, 'width_input' => $max_image_width_input, 'max_size_input' => $max_filesize_input, 'ri_select' => $ri_select, 'jpg_checked' => $album->valid_formats & MG_JPG ? ' checked="checked"' : '', 'png_checked' => $album->valid_formats & MG_PNG ? ' checked="checked"' : '', 'tif_checked' => $album->valid_formats & MG_TIF ? ' checked="checked"' : '', 'gif_checked' => $album->valid_formats & MG_GIF ? ' checked="checked"' : '', 'bmp_checked' => $album->valid_formats & MG_BMP ? ' checked="checked"' : '', 'tga_checked' => $album->valid_formats & MG_TGA ? ' checked="checked"' : '', 'psd_checked' => $album->valid_formats & MG_PSD ? ' checked="checked"' : '', 'mp3_checked' => $album->valid_formats & MG_MP3 ? ' checked="checked"' : '', 'ogg_checked' => $album->valid_formats & MG_OGG ? ' checked="checked"' : '', 'asf_checked' => $album->valid_formats & MG_ASF ? ' checked="checked"' : '', 'swf_checked' => $album->valid_formats & MG_SWF ? ' checked="checked"' : '', 'mov_checked' => $album->valid_formats & MG_MOV ? ' checked="checked"' : '', 'mp4_checked' => $album->valid_formats & MG_MP4 ? ' checked="checked"' : '', 'mpg_checked' => $album->valid_formats & MG_MPG ? ' checked="checked"' : '', 'zip_checked' => $album->valid_formats & MG_ZIP ? ' checked="checked"' : '', 'flv_checked' => $album->valid_formats & MG_FLV ? ' checked="checked"' : '', 'rflv_checked' => $album->valid_formats & MG_RFLV ? ' checked="checked"' : '', 'emb_checked' => $album->valid_formats & MG_EMB ? ' checked="checked"' : '', 'other_checked' => $album->valid_formats & MG_OTHER ? ' checked="checked"' : '', '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'], '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'], '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']));
    }
    $r = rand();
    if ($album->tn_attached) {
        list($album_last_image, $media_size) = MG_getImageUrl('covers/cover_' . $album_id);
        if ($media_size != false) {
            $T->set_var('thumbnail', '<img src="' . $album_last_image . '?r=' . $r . '" alt=""' . XHTML . '>');
        }
    }
    $filename_title_select = MG_checkbox(array('name' => 'filename_title', 'checked' => $album->filename_title, 'value' => '1'));
    // watermark stuff...
    $wm_auto_select = MG_checkbox(array('name' => 'wm_auto', 'checked' => $album->wm_auto, 'value' => '1'));
    $wm_opacity_select = MG_optionlist(array('name' => 'wm_opacity', 'current' => $album->wm_opacity, 'values' => array('10' => '10%', '20' => '20%', '30' => '30%', '40' => '40%', '50' => '50%', '60' => '60%', '70' => '70%', '80' => '80%', '90' => '90%')));
    $wm_location_select = MG_optionlist(array('name' => 'wm_location', 'current' => $album->wm_location, 'values' => array('1' => $LANG_MG01['top_left'], '2' => $LANG_MG01['top_center'], '3' => $LANG_MG01['top_right'], '4' => $LANG_MG01['middle_left'], '5' => $LANG_MG01['middle_center'], '6' => $LANG_MG01['middle_right'], '7' => $LANG_MG01['bottom_left'], '8' => $LANG_MG01['bottom_center'], '9' => $LANG_MG01['bottom_right'])));
    // 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=" . intval($_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=""' . XHTML . '>';
    for ($i = 0; $i < $nRows; $i++) {
        $row = DB_fetchArray($result);
        $wm_select .= '<option value="' . $row['filename'] . '"' . ($album->wm_id == $row['wm_id'] ? ' selected="selected"' : '') . '>' . $row['filename'] . '</option>';
        if ($album->wm_id == $row['wm_id']) {
            $wm_current = '<img src="' . $_MG_CONF['site_url'] . '/watermarks/' . $row['filename'] . '" name="myImage" alt=""' . XHTML . '>';
        }
    }
    $wm_select .= '</select>';
    $skins = MG_getFrames();
    $tmp = array();
    for ($i = 0; $i < count($skins); $i++) {
        $tmp[$skins[$i]['dir']] = $skins[$i]['name'];
    }
    $skin_select = MG_optionlist(array('name' => 'skin', 'current' => $album->image_skin, 'values' => $tmp));
    $askin_select = MG_optionlist(array('name' => 'askin', 'current' => $album->album_skin, 'values' => $tmp));
    $dskin_select = MG_optionlist(array('name' => 'dskin', 'current' => $album->display_skin, 'values' => $tmp));
    // permission template
    $usergroups = SEC_getUserGroups();
    $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 ($album->group_id == $usergroups[key($usergroups)]) {
                $groupdd .= ' selected="selected"';
            }
            if ($album->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 = MG_checkbox(array('name' => 'uploads', 'checked' => $album->member_uploads, 'value' => '1'));
    $moderate_select = MG_checkbox(array('name' => 'moderate', 'checked' => $album->moderate, 'value' => '1'));
    $child_update_select = MG_checkbox(array('name' => 'force_child_update', 'checked' => false, 'value' => '1'));
    $hidden_select = MG_checkbox(array('name' => 'hidden', 'checked' => $album->hidden, 'value' => '1'));
    $allow_download_select = MG_checkbox(array('name' => 'allow_download', 'checked' => $album->allow_download, 'value' => '1'));
    if (SEC_hasRights('mediagallery.admin')) {
        $perm_editor = SEC_getPermissionsHTML($album->perm_owner, $album->perm_group, $album->perm_members, $album->perm_anon);
    } else {
        $perm_editor = MG_getMemberPermissionsHTML($album->perm_members, $album->perm_anon);
    }
    $T->set_var(array('site_url' => $_CONF['site_url'], 'site_admin_url' => $_CONF['site_admin_url'], 'xhtml' => XHTML, 'start_block' => COM_startBlock($block_title), 'end_block' => COM_endBlock(), 'owner_username' => DB_getItem($_TABLES['users'], 'username', "uid={$album->owner_id}"), 'owner_id' => $album->owner_id, 'permissions_editor' => $perm_editor, 'old_album_id' => $oldaid, 'group_dropdown' => $groupdd, 'mod_dropdown' => $moddd, 'uploads' => $upload_select, 'moderate' => $moderate_select, 'hidden' => $hidden_select, 'force_child_update' => $child_update_select, 'owner_select' => $owner_select, 'email_mod_select' => $email_mod_select, '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, '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' => $album->title, 'album_desc' => $album->description, 'album_id' => $album_id, 'parent_select' => $album_selectbox, 'album_cover' => $album->cover, 'album_owner' => $album->owner_id, 'album_order' => $album->order, 'album_cover_filename' => $album->cover_filename, 'last_update' => $album->last_update, 'media_count' => $album->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, 's_form_action' => $actionURL, '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_msg' => $LANG_ACCESS['permmsg'], 'lang_member_upload' => $LANG_MG01['member_upload'], 'lang_moderate_album' => $LANG_MG01['mod_album'], 'lang_mod_group' => $LANG_MG01['moderation_group'], 'lang_force_child_update' => $LANG_MG01['force_child_update'], 'lang_allow_download' => $LANG_MG01['allow_download'], 'lang_email_mods_on_submission' => $LANG_MG01['email_mods_on_submission'], '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'], '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_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 (SEC_hasRights('mediagallery.admin')) {
        $T->set_var('perms_editor_admin', '1');
    } else {
        $T->set_var('perms_editor_member', '1');
    }
    if ($_MG_CONF['htmlallowed'] == 1) {
        $T->set_var('allowed_html', COM_allowedHTML());
    }
    $retval .= $T->finish($T->parse('output', 'admin'));
    return $retval;
}
Exemplo n.º 4
0
if (!isset($_MG_USERPREFS['mp3_player'])) {
    $_MG_USERPREFS['mp3_player'] = -1;
    $_MG_USERPREFS['playback_mode'] = 1;
    $_MG_USERPREFS['tn_size'] = -1;
    $_MG_USERPREFS['display_rows'] = 0;
    $_MG_USERPREFS['display_columns'] = 0;
}
$T = COM_newTemplate(MG_getTemplatePath(0));
$T->set_file('admin', 'userprefs.thtml');
$T->set_block('admin', 'prefRow', 'pRow');
$T->set_var('start_block', COM_startBlock($LANG_MG01['user_prefs_title']));
$T->set_var('end_block', COM_endBlock());
// build select boxes
$mp3_select = MG_optionlist(array('name' => 'mp3_player', 'current' => $_MG_USERPREFS['mp3_player'], 'values' => array('-1' => $LANG_MG01['system_default'], '0' => $LANG_MG01['windows_media_player'], '1' => $LANG_MG01['quicktime_player'], '2' => $LANG_MG01['flashplayer'])));
$playback_select = MG_optionlist(array('name' => 'playback_mode', 'current' => $_MG_USERPREFS['playback_mode'], 'values' => array('-1' => $LANG_MG01['system_default'], '0' => $LANG_MG01['play_in_popup'], '2' => $LANG_MG01['play_inline'], '3' => $LANG_MG01['use_mms'])));
$tn_select = MG_optionlist(array('name' => 'tn_size', 'current' => $_MG_USERPREFS['tn_size'], 'values' => array('-1' => $LANG_MG01['system_default'], '0' => $LANG_MG01['small'], '1' => $LANG_MG01['medium'], '2' => $LANG_MG01['large'])));
$display_rows_input = MG_input(array('type' => 'text', 'size' => '3', 'name' => 'display_rows', 'value' => $_MG_USERPREFS['display_rows']));
$display_columns_input = MG_input(array('type' => 'text', 'size' => '3', 'name' => 'display_columns', 'value' => $_MG_USERPREFS['display_columns']));
if ($_MG_CONF['up_display_rows_enabled']) {
    $T->set_var(array('lang_prompt' => $LANG_MG01['display_rows_prompt'], 'input_field' => $display_rows_input, 'lang_help' => $LANG_MG01['display_rows_help'], 'rowcounter' => $x++ % 2));
    $T->parse('pRow', 'prefRow', true);
}
if ($_MG_CONF['up_display_columns_enabled']) {
    $T->set_var(array('lang_prompt' => $LANG_MG01['display_columns_prompt'], 'input_field' => $display_columns_input, 'lang_help' => $LANG_MG01['display_columns_help']));
    $T->parse('pRow', 'prefRow', true);
}
if ($_MG_CONF['up_mp3_player_enabled']) {
    $T->set_var(array('lang_prompt' => $LANG_MG01['mp3_player'], 'input_field' => $mp3_select, 'lang_help' => $LANG_MG01['mp3_player_help']));
    $T->parse('pRow', 'prefRow', true);
}
if ($_MG_CONF['up_av_playback_enabled']) {