Ejemplo n.º 1
0
function atThemeAddHeader()
{
    $runningconfig = atGetRunningConfig();
    extract($runningconfig);
    $stylesheet = $style['stylesheet'];
    $head = "\n<!--\n************************ AutoTheme 0.87 *************************\n-->\n";
    if (atGetModName() == "AutoTheme") {
        $head .= "<script type=\"text/javascript\" src=\"modules/AutoTheme/javascript/picker.js\"></script>\n" . "<script type=\"text/javascript\">\n" . "  var JS_PATH = \"modules/AutoTheme/javascript/\";\n" . "  var PU_PATH = JS_PATH + \"popups/\";\n" . "</script>\n";
    }
    if (isset($stylesheet)) {
        if (@file_exists($themepath . $stylesheet) && !@is_dir($themepath . $stylesheet)) {
            $head .= "\n<!-- Custom Page stylesheet -->\n";
            $head .= "<link rel=\"stylesheet\" href=\"" . $themepath . $stylesheet . "\" type=\"text/css\"" . ($xhtml ? " />" : ">") . "\n";
        }
    }
    if ($system = atPlatformHeader($xhtml)) {
        $head .= "\n<!-- Head from system -->\n";
        $head .= "{$system}\n";
    }
    if ($style['head']) {
        $head .= "\n<!-- Head from config -->\n";
        $head .= trim($style['head']) . "\n";
    }
    return $head;
}
Ejemplo n.º 2
0
function open_mod_styles($vars)
{
    extract($vars);
    $modname = atGetModName();
    if (!isset($tag)) {
        $tag = "div";
    }
    $display .= "\n<!-- Open Module Styles -->\n" . "<{$tag} id=\"{$modname}\" class=\"module\">\n\n";
    echo $display;
}
Ejemplo n.º 3
0
function atGetModType()
{
    $type = "";
    if (eregi("admin.php", $_SERVER['PHP_SELF'])) {
        $type = "admin";
    } elseif (atGetModName() == "Your_Account") {
        $type = "user";
    }
    return $type;
}
Ejemplo n.º 4
0
function atModOutput($file)
{
    $globalconfig = atGetGlobalConfig();
    extract($globalconfig);
    $modname = atGetModName();
    if (file_exists($themepath . "modules/{$modname}/{$file}")) {
        $file = $themepath . "modules/{$modname}/{$file}";
    } elseif (file_exists("modules/{$modname}/templates/{$file}")) {
        $file = "modules/{$modname}/templates/{$file}";
    } else {
        return false;
    }
    $output = atTemplateCompile($file);
    ob_start();
    atTemplateDisplay($output);
    $display = ob_get_contents();
    ob_end_clean();
    return $display;
}
Ejemplo n.º 5
0
function at_transitionpages($transitionpages)
{
    atCommandAdd("page-url", 'echo $_SERVER["REQUEST_URI"];');
    $runningconfig = atGetRunningConfig();
    extract($runningconfig);
    if (is_array($transitionpages)) {
        if ($transitionpages[$modtemplate][$modops]) {
            $vars = $transitionpages[$modtemplate][$modops];
        } else {
            $vars = array_merge((array) $transitionpages['default'], (array) $transitionpages[$modtemplate][$modops]);
        }
        extract($vars);
    } else {
        return;
    }
    session_start();
    $module = atGetModName();
    if (!isset($_SESSION[$module . '_entered'])) {
        $_SESSION[$module . '_entered'] = 1;
    } else {
        $_SESSION[$module . '_entered']++;
    }
    if ($visits == 0 || $visits == 1 || $_SESSION[$module . '_entered'] % $visits) {
        return;
    }
    switch ($type) {
        case "admin":
            if (!atIsAdminUser()) {
                return;
            }
            break;
        case "anonymous":
            if (atIsLoggedin()) {
                return;
            }
            break;
        case "loggedin":
            if (!atIsLoggedin()) {
                return;
            }
            break;
    }
    if ($rotate) {
        $c = $_SESSION[$module . '_count'];
        $template = $template[$c];
        if (!isset($_SESSION[$module . '_count']) || $_SESSION[$module . '_count'] > count($template) - 1) {
            $_SESSION[$module . '_count'] = 0;
        } else {
            $_SESSION[$module . '_count']++;
        }
    } else {
        $template = $template[0];
    }
    if (!$template) {
        $template = "transitionpages.html";
    }
    if (@file_exists($themepath . $template)) {
        $file = $themepath . $template;
    } elseif (@file_exists($atdir . "templates/{$template}")) {
        $file = $atdir . "templates/{$template}";
    } else {
        return;
    }
    $HTML = atTemplatePrep($file, 1);
    $output = atCommandReplace($HTML, $command);
    atTemplateDisplay($output);
    atThemeExit();
}