Esempio n. 1
0
function updatecache($array = '')
{
    if (empty($array) || !is_array($array)) {
        updatecache_i(1);
        if (R_P == D_P || !file_exists(D_P . 'data/bbscache/config.php') || !file_exists(D_P . 'data/bbscache/dbreg.php')) {
            updatecache_c();
        }
        updatecache_p(1);
        updatecache_w();
        updatecache_sy();
        updatecache_g();
        updatecache_bk();
        updatecache_df();
        updatecache_ol();
        updatecache_mddb(1);
        updatecache_ml();
        updatecache_f(1);
        updatecache_l(1);
        updatecache_gr(1);
        updatecache_inv();
        updatecache_plan();
        updatecache_ftp();
        updatecache_field(1);
        updatecache_form();
        updatecache_help();
        cache_read();
        updatecache_hotforum();
        updatecache_openforum();
        updatecache_topic();
        updatecache_postcate();
        updateCacheActivity();
        updatecache_conf('nf', false, 'newinfo_config.php');
        //updateStampCache();
        //updateBlockCache();
    } else {
        foreach ($array as $value) {
            $value();
        }
    }
}
Esempio n. 2
0
                if (is_numeric($val)) {
                    $viewright .= $viewright ? ',' . $val : $val;
                }
            }
        }
        $db->update("UPDATE pw_customfield" . " SET " . pwSqlSingle(array('title' => $title, 'maxlen' => $maxlen, 'vieworder' => $vieworder, 'type' => $type, 'state' => $state, 'required' => $required, 'viewinread' => $viewinread, 'editable' => $editable, 'descrip' => $descrip, 'viewright' => $viewright, 'options' => $options)) . " WHERE id=" . pwEscape($id));
        updatecache_field();
        adminmsg('operate_success');
    }
} elseif ($_POST['action'] == 'del') {
    InitGP(array('selid'), 'P');
    if (!($selids = checkselid($selid))) {
        $basename = "javascript:history.go(-1);";
        adminmsg('operate_error');
    }
    $dropfield = '';
    foreach ($selid as $key => $val) {
        if (is_numeric($val)) {
            $colums = $db->get_one("SHOW COLUMNS FROM pw_memberinfo LIKE " . pwEscape('field_' . $val));
            if ($colums['Field'] == 'field_' . $val) {
                $dropfield .= $dropfield ? ",DROP field_{$val}" : "DROP field_{$val}";
            }
        }
    }
    if ($dropfield) {
        $db->query("ALTER TABLE pw_memberinfo {$dropfield}");
    }
    $db->update("DELETE FROM pw_customfield WHERE id IN({$selids})");
    updatecache_field();
    adminmsg('operate_success');
}