Example #1
0
function loadSchemeList($pretty, $theme = null, $media = null)
{
    if ($theme === null) {
        list($theme, $media) = getActualTheme();
    }
    $ret = array('(use default scheme)');
    if (file_exists(GREGARIUS_HOME . RSS_THEME_DIR . "/{$theme}/{$media}/schemes")) {
        if ($checkDir = opendir(GREGARIUS_HOME . RSS_THEME_DIR . "/{$theme}/{$media}/schemes")) {
            while ($file = readdir($checkDir)) {
                if ($file != "." && $file != ".." && $file != ".svn") {
                    if (file_exists(GREGARIUS_HOME . RSS_THEME_DIR . "/{$theme}/{$media}/schemes/" . $file) && is_dir(GREGARIUS_HOME . RSS_THEME_DIR . "/{$theme}/{$media}/schemes/" . $file)) {
                        if ($pretty) {
                            $theme_info = getThemeInfo("{$theme}/{$media}/schemes/{$file}");
                        }
                        if ($pretty && isset($theme_info['name']) && $theme_info['name'] !== '') {
                            $ret[] = str_replace(",", "_", $theme_info['name']);
                        } else {
                            $ret[] = str_replace(",", "_", $file);
                        }
                    }
                }
            }
        }
    }
    return $ret;
}
Example #2
0
<?php

require_once dirname(__FILE__) . "/../include/common.inc.php";
$typeid = 0;
require_once SLINEINC . "/view.class.php";
if (empty($tid)) {
    return '';
}
$themeid = Helper_Archive::pregReplace($tid, 2);
$seoarr = getThemeInfo($themeid);
$seoarr['keyword'] = !empty($seoarr['keyword']) ? "<meta name=\"keywords\" content=\"" . $seoarr['keyword'] . "\"/>" : "";
$seoarr['description'] = "<meta name=\"description\" content=\"" . $seoarr['description'] . "\"/>";
//各栏目数量
$seoarr['linenum'] = getThemeCount(1, $themeid);
$seoarr['hotelnum'] = getThemeCount(2, $themeid);
$seoarr['carnum'] = getThemeCount(3, $themeid);
$seoarr['raidernum'] = getThemeCount(4, $themeid);
$seoarr['spotnum'] = getThemeCount(5, $themeid);
$seoarr['photonum'] = getThemeCount(6, $themeid);
//是否显示条件.
if ($seoarr['hotelnum'] != 0) {
    $GLOBALS['condition']['_hasthemehotel'] = 1;
}
if ($seoarr['carnum'] != 0) {
    $GLOBALS['condition']['_hasthemecar'] = 1;
}
if ($seoarr['raidernum'] != 0) {
    $GLOBALS['condition']['_hasthemeraider'] = 1;
}
if ($seoarr['spotnum'] != 0) {
    $GLOBALS['condition']['_hasthemespot'] = 1;
Example #3
0
function theme_options()
{
    if (!array_key_exists('theme', $_REQUEST) || array_key_exists('admin_theme_options_cancel_changes', $_REQUEST)) {
        themes();
        return;
    }
    $theme = $_REQUEST['theme'];
    $theme_output = "";
    if (preg_match('/([a-zA-Z0-9_\\/\\-]+)/', $theme, $matches)) {
        $theme = $matches[1];
        // sanitize input
        $theme_info = getThemeInfo($theme);
        extract($theme_info);
        if (file_exists("../" . RSS_THEME_DIR . "/{$fsname}/config.php")) {
            ob_start();
            rss_theme_options_rendered_buttons(false);
            rss_require(RSS_THEME_DIR . "/{$fsname}/config.php");
            $theme_output = ob_get_contents();
            ob_end_clean();
            rss_invalidate_cache();
        }
        if ($theme_output) {
            // Let us set up a form
            echo "<h2\n            class=\"trigger\">" . __('Theme Options') . " " . TITLE_SEP . " " . $name . "</h2>\n" . "<div id=\"admin_theme_options\">\n";
            echo "<form method=\"post\" ";
            if (rss_theme_options_form_class() !== null) {
                echo "class='" . rss_theme_options_form_class() . "' ";
            }
            echo "action=\"" . $_SERVER['PHP_SELF'] . "\">\n";
            echo "<p><input type=\"hidden\" name=\"" . CST_ADMIN_DOMAIN . "\" value=\"" . CST_ADMIN_DOMAIN_THEME_OPTIONS . "\" /></p>\n";
            echo $theme_output;
            echo "<p><input type=\"hidden\" name=\"theme\" value=\"" . $theme . "\"/>\n";
            echo "<input type=\"hidden\" name=\"" . CST_ADMIN_METAACTION . "\" value=\"ACT_ADMIN_SUBMIT_CHANGES\"/>\n";
            if (isset($_REQUEST['mediaparam'])) {
                $mediaparam = sanitize($_REQUEST['mediaparam'], RSS_SANITIZER_CHARACTERS);
                echo "<input type=\"hidden\" name=\"mediaparam\" value=\"{$mediaparam}\">\n";
            }
            if (!rss_theme_options_rendered_buttons()) {
                echo "<input type=\"submit\" name=\"admin_theme_options_submit_changes\" value=\"" . __('Submit Changes') . "\" />\n";
                echo "<input type=\"submit\" name=\"admin_theme_options_cancel_changes\"\n                value=\"" . __('Cancel') . "\" />\n";
            }
            echo "</p></form>\n";
            echo "</div>";
        } else {
            themes();
        }
    }
}