Example #1
0
function atBlockLoad($location = "", $title = "")
{
    if (!defined('BLOCK_FILE')) {
        define('BLOCK_FILE', true);
    }
    $runningconfig = atGetRunningConfig();
    $blocklist = $runningconfig['blocklist'];
    if ($location) {
        foreach ($blocklist as $block) {
            if ($block['position'] == $location && $block['active'] == 1) {
                $blocks[] = $block;
            }
        }
    } elseif ($title) {
        if ($blocklist[$title]['active'] == 1) {
            $blocks[] = $blocklist[$title];
        }
    }
    if (is_array($blocks)) {
        foreach ($blocks as $theblock) {
            atRunningSetVar("block", $theblock);
            extract($theblock);
            if ($bkey == "admin") {
                adminblock();
            } elseif ($bkey == "userbox") {
                userblock();
            } elseif ($bkey == "") {
                $displaythis = 0;
                if ($view == 0) {
                    $displaythis = 1;
                } elseif ($view == 1 && atIsLoggedIn() || atIsAdminUser()) {
                    $displaythis = 1;
                } elseif ($view == 2 && atIsAdminUser()) {
                    $displaythis = 1;
                } elseif ($view == 3 && !atIsLoggedIn() || atIsAdminUser()) {
                    $displaythis = 1;
                }
                if ($displaythis) {
                    if ($url == "") {
                        if ($blockfile == "") {
                            themesidebox($title, $content);
                        } else {
                            blockfileinc($title, $blockfile);
                        }
                    } else {
                        headlines($bid);
                    }
                }
            }
        }
    }
}
Example #2
0
function atCommandBuild2($name, $commands, $prefix = "")
{
    if (!$prefix) {
        $prefix = strtolower(atGetModName());
    }
    ${$name} = $commands;
    $commands = compact("{$name}");
    atRunningSetVar($prefix, $commands);
    foreach ($commands as $key => $val) {
        foreach ($val as $num => $cmd) {
            foreach ($cmd as $cname => $action) {
                atCommandAdd("{$prefix}:{$key}:{$cname}", 'echo $' . $prefix . '["' . $key . '"][$i]["' . $cname . '"];');
            }
        }
    }
}
Example #3
0
$autoprint = atAutoGetVar("autoprint");
$atpath = atAutoGetVar("atpath");
$theme = $autoprint["theme"];
if (!$theme) {
    $theme = "AutoPrint";
}
$thispage = $_SERVER['PHP_SELF'];
if ($_SERVER['PHP_SELF'] == "modules.php") {
    $thispage = "index.php";
}
$urlend = $_SERVER['QUERY_STRING'] ? "?" . $_SERVER['QUERY_STRING'] . "&" : "?";
$thisurl = $thispage . $urlend . "theme={$theme}";
$thisurl = htmlentities($thisurl);
if (file_exists($themepath . "images/print.gif")) {
    $thisimage = $themepath . "images/print.gif";
}
if (file_exists($atpath . "images/print.gif")) {
    $thisimage = $atpath . "images/print.gif";
}
if (isset($thisimage)) {
    $printimage = '<img src="' . $thisimage . '" alt="' . _AT_PRINTERFRIENDLYPAGE . '" border="0"> ';
} else {
    $printimage = "";
}
atRunningSetVar("printimage", $printimage);
atRunningSetVar("thisurl", $thisurl);
// How to register extra commands
//
// $extracmd['applies to users'] = array ( 'command-name' => "action to perform, PHP, HTML whatever" );
//
$extracmd['all'] = array('print-link' => 'echo "<a target=\\"_blank\\" href=\\"$thisurl\\">$printimage"._AT_PRINTERFRIENDLYPAGE."</a>";');
Example #4
0
function at_rendertime_start($vars)
{
    $mtime = explode(" ", microtime());
    $renderstart = $mtime[1] + $mtime[0];
    atRunningSetVar("renderstart", $renderstart);
}