Esempio n. 1
0
        trbasic(lang('cotype_name'), '', $ucotype['cname'], '');
        $umodearr = array('0' => lang('umode0'), '1' => lang('umode1'), '2' => lang('umode2'));
        trbasic(lang('coclassumode'), '', makeradio('ucotypenew[umode]', $umodearr, empty($ucotype['umode']) ? 0 : $ucotype['umode']), '');
        $vmodearr = array('0' => lang('vmode0'), '1' => lang('vmode1'));
        trbasic(lang('coclassvmode'), '', makeradio('ucotypenew[vmode]', $vmodearr, empty($ucotype['vmode']) ? 0 : $ucotype['vmode']), '');
        trbasic(lang('is_notblank_catas'), 'ucotypenew[notblank]', $ucotype['notblank'], 'radio');
        if (in_array($ucotype['cclass'], array('comment', 'offer', 'reply'))) {
            $emodearr = array(0 => lang('emode0'), 1 => lang('emode1'), 2 => lang('emode2'));
            trbasic(lang('emode'), '', makeradio('ucotypenew[emode]', $emodearr, empty($ucotype['emode']) ? 0 : $ucotype['emode']), '', lang('agemode'));
        }
        tabfooter('bucotypedetail');
        a_guide('ucotypedetail');
    } else {
        $ucotypenew['notblank'] = empty($ucotypenew['notblank']) ? 0 : 1;
        $ucotypenew['emode'] = empty($ucotypenew['emode']) ? 0 : max(0, intval($ucotypenew['emode']));
        if (!emode_alter($ucotypenew['emode'], @$ucotype['emode'], 'uccid' . $ucoid, $tblprefix . $ucotype['cclass'] . 's')) {
            $ucotypenew['emode'] = @$ucotype['emode'];
        }
        $db->query("UPDATE {$tblprefix}ucotypes SET \n\t\t\tnotblank='{$ucotypenew['notblank']}',\n\t\t\tumode='{$ucotypenew['umode']}',\n\t\t\tvmode='{$ucotypenew['vmode']}',\n\t\t\temode='{$ucotypenew['emode']}'\n\t\t\tWHERE ucoid='{$ucoid}'");
        adminlog(lang('det_modify_ucotype'));
        updatecache('ucotypes');
        amessage('cotypemsetfinish', axaction(6, $forward));
    }
} elseif ($action == 'ucotypesdelete' && $ucoid) {
    if (!isset($confirm) || $confirm != 'ok') {
        $message = lang('del_alert') . "<br><br>";
        $message .= lang('confirmclick') . ">><a href=?entry=ucotypes&action=ucotypesdelete&ucoid={$ucoid}&confirm=ok>" . lang('delete') . "</a><br>";
        $message .= lang('giveupclick') . ">><a href=?entry=ucotypes&action=ucotypesedit>" . lang('goback') . "</a>";
        amessage($message);
    }
    if (!($ucotype = $ucotypes[$ucoid])) {
Esempio n. 2
0
        a_guide('cotypedetail');
    } else {
        $cotypenew['notblank'] = empty($cotypenew['notblank']) ? 0 : 1;
        $cotypenew['permission'] = empty($cotypenew['permission']) ? 0 : 1;
        $cotypenew['awardcp'] = empty($cotypenew['awardcp']) ? 0 : 1;
        $cotypenew['taxcp'] = empty($cotypenew['taxcp']) ? 0 : 1;
        $cotypenew['ftaxcp'] = empty($cotypenew['ftaxcp']) ? 0 : 1;
        $cotypenew['sale'] = empty($cotypenew['sale']) ? 0 : 1;
        $cotypenew['fsale'] = empty($cotypenew['fsale']) ? 0 : 1;
        $cotypenew['asmode'] = empty($cotypenew['asmode']) ? 0 : max(2, intval($cotypenew['asmode']));
        $cotypenew['emode'] = empty($cotypenew['emode']) ? 0 : max(0, intval($cotypenew['emode']));
        if (empty($cotype['self_reg'])) {
            if (!select_alter($cotypenew['asmode'], @$cotype['asmode'], 'ccid' . $coid, $tblprefix . 'archives')) {
                $cotypenew['asmode'] = @$cotype['asmode'];
            }
            if (!emode_alter($cotypenew['emode'], @$cotype['emode'], 'ccid' . $coid, $tblprefix . 'archives')) {
                $cotypenew['emode'] = @$cotype['emode'];
            }
        }
        $db->query("UPDATE {$tblprefix}cotypes SET \n\t\t\tnotblank='{$cotypenew['notblank']}',\n\t\t\tsortable='{$cotypenew['sortable']}',\n\t\t\tvmode='{$cotypenew['vmode']}',\n\t\t\tasmode='{$cotypenew['asmode']}',\n\t\t\temode='{$cotypenew['emode']}',\n\t\t\tpermission='{$cotypenew['permission']}',\n\t\t\tawardcp='{$cotypenew['awardcp']}',\n\t\t\ttaxcp='{$cotypenew['taxcp']}',\n\t\t\tftaxcp='{$cotypenew['ftaxcp']}',\n\t\t\tsale='{$cotypenew['sale']}',\n\t\t\tfsale='{$cotypenew['fsale']}'\n\t\t\tWHERE coid='{$coid}'");
        adminlog(lang('det_modify_cotype'));
        updatecache('cotypes');
        amessage('cotypemsetfinish', axaction(6, $forward));
    }
} elseif ($action == 'cotypesdelete' && $coid) {
    //删除类系,与节点的关系
    if (!isset($confirm) || $confirm != 'ok') {
        $message = lang('del_alert') . "<br><br>";
        $message .= lang('confirmclick') . ">><a href=?entry=cotypes&action=cotypesdelete&coid={$coid}&confirm=ok>" . lang('delete') . "</a><br>";
        $message .= lang('giveupclick') . ">><a href=?entry=cotypes&action=cotypesedit>" . lang('goback') . "</a>";
        amessage($message);