Esempio n. 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);
                    }
                }
            }
        }
    }
}
Esempio n. 2
0
 function block_show($bid)
 {
     global $prefix, $db, $admin_file;
     include "header.php";
     GraphicAdmin();
     title("" . _BLOCKSADMIN . "");
     OpenTable();
     echo "<br><center>";
     $bid = intval($bid);
     $row = $db->sql_fetchrow($db->sql_query("select bid, bkey, title, content, url, active, bposition, blockfile from " . $prefix . "_blocks where bid='{$bid}'"));
     $bid = intval($row['bid']);
     $bkey = filter($row['bkey'], "nohtml");
     $title = filter($row['title'], "nohtml");
     $content = filter($row['content']);
     $url = filter($row['url'], "nohtml");
     $active = intval($row['active']);
     $bposition = filter($row['bposition'], "nohtml");
     $blockfile = filter($row['blockfile'], "nohtml");
     if ($bkey == "main") {
         mainblock();
     } elseif ($bkey == "admin") {
         adminblock();
     } elseif ($bkey == "modules") {
         modules_block();
     } elseif ($bkey == "category") {
         category();
     } elseif ($bkey == "userbox") {
         userblock();
     } elseif (empty($bkey)) {
         if (empty($url)) {
             if (empty($blockfile)) {
                 if ($bposition == "c") {
                     themecenterbox($title, $content);
                 } else {
                     themesidebox($title, $content);
                 }
             } else {
                 if ($bposition == "c") {
                     blockfileinc($title, $blockfile, 1);
                 } else {
                     blockfileinc($title, $blockfile);
                 }
             }
         } else {
             headlines($bid);
         }
     }
     echo "</center>";
     CloseTable();
     echo "<br>";
     OpenTable();
     if ($active == 1) {
         $act_chg = _DEACTIVATE;
     } elseif ($active == 0) {
         $act_chg = _ACTIVATE;
     }
     echo "<center><font class=\"option\"><b>" . _BLOCKSADMIN . ": " . _FUNCTIONS . "</b></font><br><br>" . "[ <a href=\"" . $admin_file . ".php?op=ChangeStatus&bid={$bid}\">{$act_chg}</a> | <a href=\"" . $admin_file . ".php?op=BlocksEdit&bid={$bid}\">" . _EDIT . "</a> | ";
     if (empty($bkey)) {
         echo "<a href=\"" . $admin_file . ".php?op=BlocksDelete&bid={$bid}\">" . _DELETE . "</a> | ";
     } else {
         echo "" . _DELETE . " | ";
     }
     echo "<a href=\"" . $admin_file . ".php?op=BlocksAdmin\">" . _BLOCKSADMIN . "</a> ]</center>";
     CloseTable();
     include "footer.php";
 }
Esempio n. 3
0
function render_blocks($side, $blockfile, $title, $content, $bid, $url)
{
    if (!defined('BLOCK_FILE')) {
        define('BLOCK_FILE', true);
    }
    if (empty($url)) {
        if (empty($blockfile)) {
            if ($side == "c") {
                themecenterbox($title, $content);
            } elseif ($side == "d") {
                themecenterbox($title, $content);
            } else {
                themesidebox($title, $content);
            }
        } else {
            if ($side == "c") {
                blockfileinc($title, $blockfile, 1);
            } elseif ($side == "d") {
                blockfileinc($title, $blockfile, 1);
            } else {
                blockfileinc($title, $blockfile);
            }
        }
    } else {
        if ($side == "c" or $side == "d") {
            headlines($bid, 1);
        } else {
            headlines($bid);
        }
    }
}
function render_blocks($side, $blockfile, $title, $content, $bid, $url)
{
    if ($url == '') {
        if ($blockfile == "") {
            if ($side == "c") {
                themecenterbox($title, $content);
            } else {
                themesidebox($title, $content);
            }
        } else {
            if ($side == "c") {
                blockfileinc($title, $blockfile, 1);
            } else {
                blockfileinc($title, $blockfile);
            }
        }
    } else {
        if ($side == "c") {
            headlines($bid, 1);
        } else {
            headlines($bid);
        }
    }
}
Esempio n. 5
0
 function block_show($bid)
 {
     global $prefix, $db;
     include "header.php";
     GraphicAdmin();
     title("" . _BLOCKSADMIN . "");
     OpenTable2();
     $bid = intval($bid);
     $row = $db->sql_fetchrow($db->sql_query("select bid, bkey, title, content, url, bposition, blockfile from " . $prefix . "_blocks where bid='{$bid}'"));
     $bid = intval($row['bid']);
     $bkey = $row['bkey'];
     $title = $row['title'];
     $content = $row['content'];
     $url = $row['url'];
     $bposition = $row['bposition'];
     $blockfile = $row['blockfile'];
     if ($bkey == main) {
         mainblock();
     } elseif ($bkey == admin) {
         adminblock();
     } elseif ($bkey == modules) {
         modules_block();
     } elseif ($bkey == category) {
         category();
     } elseif ($bkey == userbox) {
         userblock();
     } elseif ($bkey == "") {
         if ($url == "") {
             if ($blockfile == "") {
                 if ($bposition == "c") {
                     themecenterbox($title, $content);
                 } else {
                     themesidebox($title, $content);
                 }
             } else {
                 if ($bposition == "c") {
                     blockfileinc($title, $blockfile, 1);
                 } else {
                     blockfileinc($title, $blockfile);
                 }
             }
         } else {
             headlines($bid);
         }
     }
     CloseTable2();
     echo "<br>";
     OpenTable();
     echo "<center><font class=\"option\"><b>" . _BLOCKSADMIN . ": " . _FUNCTIONS . "</b></font><br><br>" . "[ <a href=\"admin.php?op=ChangeStatus&bid={$bid}\">" . _ACTIVATE . "</a> | <a href=\"admin.php?op=BlocksEdit&bid={$bid}\">" . _EDIT . "</a> | ";
     if ($bkey == "") {
         echo "<a href=\"admin.php?op=BlocksDelete&bid={$bid}\">" . _DELETE . "</a> | ";
     } else {
         echo "" . _DELETE . " | ";
     }
     echo "<a href=\"admin.php?op=BlocksAdmin\">" . _BLOCKSADMIN . "</a> ]</center>";
     CloseTable();
     include "footer.php";
 }