Example #1
0
        $itemid or msg();
        $do->delete($itemid);
        dmsg('删除成功', $this_forward);
        break;
    case 'order':
        $do->order($listorder);
        dmsg('更新成功', $this_forward);
        break;
    case 'delete':
        $itemid or msg();
        $do->delete($itemid);
        dmsg('删除成功', $this_forward);
        break;
    default:
        $lists = $do->get_list("tb='{$tb}'");
        cache_fields($tb);
        include tpl('fields');
        break;
}
class fields
{
    var $itemid;
    var $db;
    var $tb;
    var $pre;
    var $table;
    var $errmsg = errmsg;
    function fields()
    {
        global $db, $DT_PRE;
        $this->pre = $DT_PRE;
Example #2
0
     cache_clear('php', 'dir', 'tpl');
     msg('模板缓存更新成功', '?action=' . $action . '&step=' . ($step + 1));
 } else {
     if ($step == 4) {
         cache_clear('cat');
         cache_category();
         msg('分类缓存更新成功', '?action=' . $action . '&step=' . ($step + 1));
     } else {
         if ($step == 5) {
             cache_clear('area');
             cache_area();
             msg('地区缓存更新成功', '?action=' . $action . '&step=' . ($step + 1));
         } else {
             if ($step == 6) {
                 cache_clear('fields');
                 cache_fields();
                 cache_clear('option');
                 msg('自定义字段更新成功', '?action=' . $action . '&step=' . ($step + 1));
             } else {
                 if ($step == 7) {
                     cache_clear_ad();
                     tohtml('index');
                     msg('全部缓存更新成功');
                 } else {
                     cache_clear('group');
                     cache_group();
                     cache_clear('type');
                     cache_type();
                     cache_clear('keylink');
                     cache_keylink();
                     cache_pay();
Example #3
0
function cache_fields($tb = '')
{
    global $db, $DT;
    if ($tb) {
        $data = array();
        $result = $db->query("SELECT * FROM {$db->pre}fields WHERE tb='{$tb}' ORDER BY listorder,itemid");
        while ($r = $db->fetch_array($result)) {
            $data[$r['itemid']] = $r;
        }
        cache_write('fields-' . $tb . '.php', $data);
    } else {
        $tbs = array();
        $result = $db->query("SELECT * FROM {$db->pre}fields");
        while ($r = $db->fetch_array($result)) {
            if (isset($tbs[$r['tb']])) {
                continue;
            }
            cache_fields($r['tb']);
            $tbs[$r['tb']] = $r['tb'];
        }
    }
}