Beispiel #1
0
                $playback_options['height'] = 200;
                $playback_options['width'] = 300;
            }
            if ($tfile == 'mp3_swf.thtml') {
                $playback_options['height'] = 365;
                $playback_options['width'] = 600;
            }
            if ($playback_options['autostart'] == 1 && $tfile == 'mp3_swf.thtml') {
                $playback_options['autostart'] = 'true';
            }
            $T->set_var(array('u_tn' => $u_tn, 'thumbnail' => $u_tn, 'u_pic' => $u_pic, 'autostart' => $playback_options['autostart'], 'enablecontextmenu' => $playback_options['enablecontextmenu'], 'stretchtofit' => $playback_options['stretchtofit'], 'showstatusbar' => $playback_options['showstatusbar'], 'uimode' => $playback_options['uimode'], 'height' => $playback_options['height'], 'width' => $playback_options['width'], 'loop' => $playback_options['loop'] ? 'true' : 'false', 'playcount' => $playback_options['loop'] ? '9999' : '1', 'site_url' => $_MG_CONF['site_url'], 'id' => $row['media_mime_ext'] . rand(), 'allow_download' => $MG_albums[$aid]->allow_download ? 'true' : 'false', 'lang_artist' => $LANG_MG03['artist'], 'lang_album' => $LANG_MG03['album'], 'lang_song' => $LANG_MG03['song'], 'lang_track' => $LANG_MG03['track'], 'lang_genre' => $LANG_MG03['genre'], 'lang_year' => $LANG_MG03['year'], 'lang_download' => $LANG_MG03['download'], 'lang_info' => $LANG_MG03['info'], 'lang_noflash' => $LANG_MG03['no_flash'], 'charset' => $LANG_CHARSET, 'title' => $row['media_title'], 'artist' => $row['artist'], 'album' => $row['album']));
            break;
        default:
            COM_errorLog("MG - Unknown video filetype found");
            die($row['mime_type'] . "Invalid Media Format");
            break;
    }
    if (!SEC_hasRights('mediagallery.admin')) {
        $media_views = $row['media_views'] + 1;
        DB_query("UPDATE " . $_TABLES['mg_media'] . " SET media_views=" . $media_views . " WHERE media_id='" . DB_escapeString($row['media_id']) . "'");
    }
    $T->parse('output', 'video');
    $video_player = $T->finish($T->get_var('output'));
    list($jsfile, $jsurl) = COM_getJSCacheLocation();
    list($cssfile, $cssurl) = COM_getStyleCacheLocation();
    $P->set_var(array('css_url' => $cssurl, 'js_url' => $jsurl));
    $P->set_var('video_player', $video_player);
    $P->parse('output', 'page');
    $display = $P->finish($P->get_var('output'));
    echo $display;
}
Beispiel #2
0
            break;
        default:
            $retval = $fieldvalue;
            break;
    }
    return $retval;
}
$forum_id = COM_applyFilter($_GET['fid'], true);
$topic_parent_id = COM_applyFilter($_GET['pid'], true);
$T = new Template($_CONF['path'] . 'plugins/forum/templates/');
$T->set_file('confirm', 'gettopic.thtml');
USES_lib_admin();
$retval = '';
list($cachefile, $cacheURL) = COM_getStyleCacheLocation();
$T->set_var('style_cache_url', $cacheURL);
list($js_cache_file, $js_cache_url) = COM_getJSCacheLocation();
$T->set_var('js_cache_url', $js_cache_url);
$T->set_var('theme', $_USER['theme']);
$forumList = array();
$categoryResult = DB_query("SELECT * FROM {$_TABLES['ff_categories']} ORDER BY cat_order ASC");
while ($A = DB_fetchArray($categoryResult)) {
    $cat_id = $A['cat_name'];
    if (SEC_inGroup('Root')) {
        $sql = "SELECT forum_id,forum_name,forum_dscp FROM {$_TABLES['ff_forums']} WHERE forum_cat =" . (int) $A['id'] . " ORDER BY forum_order ASC";
    } else {
        $sql = "SELECT * FROM {$_TABLES['ff_moderators']} a , {$_TABLES['ff_forums']} b ";
        $sql .= "WHERE b.forum_cat=" . (int) $A['id'] . " AND a.mod_forum = b.forum_id AND (a.mod_uid=" . (int) $_USER['uid'] . " OR a.mod_groupid in ({$modgroups})) ORDER BY forum_order ASC";
    }
    $forumResult = DB_query($sql);
    while ($B = DB_fetchArray($forumResult)) {
        $forumList[$cat_id][$B['forum_id']] = $B['forum_name'];
Beispiel #3
0
function _js_out()
{
    global $_CONF, $_SYSTEM, $_USER, $_PLUGINS, $themeAPI;
    $js = '';
    $file_content = '';
    $files = array();
    global $_CONF, $_SYSTEM, $_USER, $_PLUGINS;
    $outputHandle = outputHandler::getInstance();
    if (!isset($_CONF['js_cache_filename'])) {
        $_CONF['js_cache_filename'] = 'js.cache';
    }
    list($cacheFile, $cacheURL) = COM_getJSCacheLocation();
    // standard JS used by glFusion
    if (!isset($_SYSTEM['disable_jquery']) || $_SYSTEM['disable_jquery'] == false) {
        $files[] = $_CONF['path_html'] . 'javascript/jquery/jquery.min.js';
        $files[] = $_CONF['path_html'] . 'javascript/jquery/jquery-ui.min.js';
        $files[] = $_CONF['path_html'] . 'javascript/addons/jqrating.min.js';
        if (!isset($_SYSTEM['disable_jquery_tooltip']) || $_SYSTEM['disable_jquery_tooltip'] == false) {
            $files[] = $_CONF['path_html'] . 'javascript/addons/tooltipster/jquery.tooltipster.min.js';
            $files[] = $_CONF['path_html'] . 'javascript/addons/tooltipster/tooltip.min.js';
        }
        if (!isset($_SYSTEM['disable_jquery_menu']) || $_SYSTEM['disable_jquery_menu'] == false) {
            $files[] = $_CONF['path_html'] . 'javascript/addons/superfish/superfish.min.js';
            $files[] = $_CONF['path_html'] . 'javascript/addons/superfish/hoverIntent.min.js';
        }
        if (!isset($_SYSTEM['disable_jquery_slimbox']) || $_SYSTEM['disable_jquery_slimbox'] == false) {
            $files[] = $_CONF['path_html'] . 'javascript/addons/slimbox/slimbox2.min.js';
        }
        if (!isset($_SYSTEM['disable_jquery_validate']) || $_SYSTEM['disable_jquery_validate'] == false) {
            $files[] = $_CONF['path_html'] . 'javascript/addons/jquery-validate/jquery.validate.min.js';
            $files[] = $_CONF['path_html'] . 'javascript/addons/jquery-validate/additional-methods.min.js';
        }
        if (!isset($_SYSTEM['disable_jquery_slideshow']) || $_SYSTEM['disable_jquery_slideshow'] == false) {
            $files[] = $_CONF['path_html'] . 'javascript/addons/tcycle/jquery.tcycle.min.js';
        }
    }
    $files[] = $_CONF['path_html'] . 'javascript/common.min.js';
    // need to parse the outputhandler to see if there are any js scripts to load
    $headerscripts = $outputHandle->getScriptFiles();
    foreach ($headerscripts as $s) {
        $files[] = $s;
    }
    /*
     * Check to see if the theme has any JavaScript to include...
     */
    $function = 'theme_themeJS';
    if (function_exists($function)) {
        $jTheme = $function();
        if (is_array($jTheme)) {
            foreach ($jTheme as $item => $file) {
                $files[] = $file;
            }
        }
    }
    /*
     * Check to see if there are any custom javascript files to include
     */
    if (function_exists('CUSTOM_js')) {
        $jTheme = CUSTOM_js();
        if (is_array($jTheme)) {
            foreach ($jTheme as $item => $file) {
                $files[] = $file;
            }
        }
    }
    /*
     * Let the plugins add their JavaScript needs here...
     */
    if (is_array($_PLUGINS)) {
        foreach ($_PLUGINS as $pi_name) {
            if (function_exists('plugin_getheaderjs_' . $pi_name)) {
                $function = 'plugin_getheaderjs_' . $pi_name;
                $pHeader = array();
                $pHeader = $function();
                if (is_array($pHeader)) {
                    foreach ($pHeader as $item => $file) {
                        $files[] = $file;
                    }
                }
            }
        }
    }
    /*
     * Let the plugins add any global JS variables
     */
    if (is_array($_PLUGINS)) {
        foreach ($_PLUGINS as $pi_name) {
            if (function_exists('plugin_getglobaljs_' . $pi_name)) {
                $function = 'plugin_getglobaljs_' . $pi_name;
                $globalJS = array();
                $globalJS = $function();
                if (is_array($globalJS)) {
                    foreach ($globalJS as $name => $value) {
                        $pluginJSvars[$name] = $value;
                    }
                }
            }
        }
    }
    if (js_cacheok($cacheFile, $files)) {
        return $cacheURL;
    }
    // add some global variables
    $urlparts = parse_url($_CONF['site_url']);
    if (isset($urlparts['path'])) {
        $fileroot = $urlparts['path'];
    } else {
        $fileroot = '';
    }
    $js .= "var glfusionSiteUrl = '" . $_CONF['site_url'] . "';" . LB;
    $js .= "var glfusionFileRoot = '" . $fileroot . "';" . LB;
    $js .= "var glfusionLayoutUrl = '" . $_CONF['layout_url'] . "';" . LB;
    $js .= "var site_admin_url = '" . $_CONF['site_admin_url'] . "';" . LB;
    if (isset($_SYSTEM['use_direct_style_js']) && $_SYSTEM['use_direct_style_js']) {
        $js .= "var glfusionStyleCSS      = '" . $_CONF['site_url'] . '/' . $_CONF['css_cache_filename'] . $_USER['theme'] . '.css?t=' . $_USER['theme'] . "';" . LB;
    } else {
        $js .= "var glfusionStyleCSS      = '" . $_CONF['site_url'] . "/css.php?t=" . $_USER['theme'] . "';" . LB;
    }
    // send any global plugin JS vars
    if (isset($pluginJSvars) && is_array($pluginJSvars)) {
        foreach ($pluginJSvars as $name => $value) {
            $js .= "var " . $name . " = '" . $value . "';";
        }
    }
    if (is_array($files)) {
        foreach ($files as $file) {
            $file_content = @file_get_contents($file);
            if ($file_content === false) {
                COM_errorLog("ERROR: Unable to retrieve JS file: " . $file);
            } else {
                $js .= $file_content;
            }
            $js .= LB;
        }
    }
    $js .= LB;
    // https://bugzilla.mozilla.org/show_bug.cgi?id=316033
    $rc = writeFile_lck($cacheFile, '', $js, 'glfusion_js.lck');
    if ($rc === false) {
        writeFile_lck($cacheFile, '', $js, 'glfusion_js.lck');
    }
    return $cacheURL;
}