示例#1
0
        msg("error", lang("Access Denied"), lang("You can not perform this action if you are not admin"), "#GOBACK");
    }
    if (!$selected_news) {
        msg("error", lang('Error!'), lang("You have not specified any articles"), "#GOBACK");
    }
    // --------
    $the_selected_news = array();
    list($news_file) = detect_source($source);
    $news = file($news_file);
    if (preg_match_all("~^(" . join('|', $selected_news) . ")\\|.*\$~m", join('', $news), $this, PREG_SET_ORDER)) {
        foreach ($this as $the) {
            $item = explode('|', $the[0]);
            $the_selected_news[] = array('id' => $item[NEW_ID], 'date' => date('d-m-Y H:i:s', $item[NEW_ID]), 'title' => htmlspecialchars($item[NEW_TITLE]));
        }
    }
    $CSRF = CSRFMake();
    $msg = proc_tpl('mass/chdate');
    msg('info', lang('Change Date'), $msg);
} elseif ($action == 'dochangedate') {
    CSRFCheck();
    list($news_file, $comm_file) = detect_source($source);
    $db_news_file = file($news_file);
    $db_comm_file = file($comm_file);
    // Sort by ascending
    foreach ($dates as $id => $date) {
        $dates[$id] = strtotime($date);
    }
    asort($dates);
    foreach ($dates as $id => $date) {
        if ($date <= time()) {
            // Don't touch this news: only change date
示例#2
0
        $value = ini_get('magic_quotes_gpc') ? stripslashes($value) : $value;
        fwrite($handle, "\${$name} = <<<HTML\n{$value}\nHTML;\n\n\n");
    }
    fwrite($handle, "?>");
    fclose($handle);
    add_to_log($member_db[UDB_NAME], lang('Update templates'));
    relocation($PHP_SELF . '?action=templates&mod=options&do_template=' . $do_template . '&save=success');
} elseif ($action == "syscon") {
    if ($member_db[UDB_ACL] != ACL_LEVEL_ADMIN) {
        msg("error", lang("Access Denied"), lang("You don't have permissions to access this section"), '#GOBACK');
    }
    $bc = 'main/options/options:syscon=config';
    if (isset($_REQUEST['message'])) {
        $bc .= '/=' . lang('Your Configuration Saved');
    }
    $csrf_code = CSRFMake();
    function showRow($title = "", $description = "", $field = "")
    {
        global $i;
        if ($i % 2 == 0 and $title != "") {
            $bg = "bgcolor=#F7F6F4";
        } else {
            $bg = "";
        }
        echo proc_tpl("options/syscon.row", array('bg' => $bg, 'title' => $title, 'field' => $field, 'description' => $description));
        $i++;
    }
    // Make syscon row
    function syscon($config_name, $title, $options = null)
    {
        global $counter;