示例#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();
        }
    }
}
示例#2
0
            }
            $checked = strpos($postcate['viewright'], ',' . $key . ',') !== false ? 'checked' : '';
            $htm_tr = '';
            $num++;
            $num % 5 == 0 ? $htm_tr = '</tr><tr>' : '';
            $viewrighthtml .= "<td><input class='input' type='checkbox' name='viewright[]' value='" . $key . "' " . $checked . ">" . $value['grouptitle'] . "</td>" . $htm_tr;
        }
        $viewrighthtml .= "</tr></table>";
        include PrintEot('postcate');
        exit;
    } else {
        InitGP(array('viewright', 'adminright'));
        $viewrights = ',' . implode(',', $viewright) . ',';
        $adminrights = ',' . implode(',', $adminright) . ',';
        $db->update("UPDATE pw_postcate" . " SET " . pwSqlSingle(array('viewright' => $viewrights, 'adminright' => $adminrights)) . " WHERE pcid=" . pwEscape($pcid));
        updatecache_postcate();
        adminmsg('operate_success', $basename . "&action=rightset&pcid={$pcid}");
    }
}
function getFieldSqlByType($type)
{
    if (in_array($type, array('number', 'calendar'))) {
        $sql = "INT(10) UNSIGNED NOT NULL default '0'";
    } elseif (in_array($type, array('radio', 'select'))) {
        $sql = "TINYINT(3) UNSIGNED NOT NULL default '0'";
    } elseif ($type == 'textarea') {
        $sql = "TEXT NOT NULL";
    } else {
        $sql = "VARCHAR(255) NOT NULL";
    }
    return $sql;