Exemplo n.º 1
0
         echo "<font class=\"option\">";
         echo "<b>" . _SURE2DELHEADLINE . "</b></font><br><br>";
     }
     echo "[ <a href=\"" . $admin_file . ".php?op=HeadlinesDel&amp;hid={$hid}&amp;ok=1\">" . _YES . "</a> | <a href=\"" . $admin_file . ".php?op=HeadlinesAdmin\">" . _NO . "</a> ]<br><br>";
     CloseTable();
     include "footer.php";
 }
 switch ($op) {
     case "BlocksAdmin":
         BlocksAdmin();
         break;
     case "BlocksAdd":
         BlocksAdd($title, $content, $url, $bposition, $active, $refresh, $headline, $blanguage, $blockfile, $view, $expire, $action, $subscription);
         break;
     case "BlocksEdit":
         BlocksEdit($bid);
         break;
     case "BlocksEditSave":
         BlocksEditSave($bid, $bkey, $title, $content, $url, $oldposition, $bposition, $active, $refresh, $weight, $blanguage, $blockfile, $view, $expire, $action, $subscription, $moretime);
         break;
     case "ChangeStatus":
         ChangeStatus($bid, $ok, $de);
         break;
     case "BlocksDelete":
         BlocksDelete($bid, $ok);
         break;
     case "BlockOrder":
         BlockOrder($weightrep, $weight, $bidrep, $bidori);
         break;
     case "HeadlinesDel":
         HeadlinesDel($hid, $ok);
Exemplo n.º 2
0
require_once CORE_PATH . 'nbbcode.php';
if (isset($_GET['change'])) {
    $bid = intval($_GET['change']);
    list($active) = $db->sql_ufetchrow('SELECT active FROM ' . $prefix . "_blocks WHERE bid={$bid}", SQL_NUM);
    if (is_numeric($active)) {
        $active = intval(!$active);
        $result = $db->sql_query('UPDATE ' . $prefix . '_blocks SET active=\'' . $active . '\' WHERE bid=' . $bid);
        Cache::array_delete('blocks_list');
    }
    URL::redirect(URL::admin('blocks'));
} else {
    if (isset($_GET['show'])) {
        block_show(intval($_GET['show']));
    } else {
        if (isset($_GET['edit'])) {
            BlocksEdit(intval($_GET['edit']));
        } else {
            if (isset($_GET['del'])) {
                $bid = intval($_GET['del']);
                list($bposition, $weight, $title) = $db->sql_ufetchrow('SELECT bposition, weight, title from ' . $prefix . '_blocks where bid=' . $bid, SQL_NUM);
                if (!isset($bposition) || isset($_POST['cancel'])) {
                    URL::redirect(URL::admin());
                }
                if (isset($_POST['confirm'])) {
                    $db->sql_uquery('UPDATE ' . $prefix . '_blocks SET weight=weight-1 WHERE bposition=\'' . $bposition . '\' AND weight>' . $weight);
                    $db->sql_uquery('DELETE FROM ' . $prefix . '_blocks WHERE bid=' . $bid);
                    $db->sql_uquery('DELETE FROM ' . $prefix . '_blocks_custom WHERE bid=' . $bid);
                    Cache::array_delete('blocks_list');
                    URL::redirect(URL::admin());
                }
                cpg_delete_msg(URL::admin('&amp;del=' . $bid), sprintf(_ERROR_DELETE_CONF, '<strong>' . (defined($title) ? constant($title) : $title) . '</strong>'));