amessage($a_field->error, axaction(2, M_REFERER)); } $sqlstr .= ',' . $k . "='" . $a_field->newvalue . "'"; if ($arr = multi_val_arr($a_field->newvalue, $v)) { foreach ($arr as $x => $y) { $sqlstr .= ',' . $k . '_' . $x . "='{$y}'"; } } } $c_upload->saveuptotal(1); $db->query("INSERT INTO {$tblprefix}coclass SET \n\t\t\t\t{$sqlstr0},\n\t\t\t\tcoid='{$coid}' \n\t\t\t\t{$sqlstr}\n\t\t\t\t"); if ($ccid = $db->insert_id()) { if (!empty($autocnode)) { $sids = array_merge(array(0), array_keys($subsites)); foreach ($sids as $k) { if ($cncid = relate_cncid($coid, $ccid, $coclassnew['level'], $k, 1)) { save_cnode("ccid{$coid}={$ccid}", $k, $cncid); } } } $c_upload->closure(1, $ccid, 'coclass'); $enamearr[] = $coclassnew['dirname']; $ok++; } } unset($a_field, $c_upload); if ($ok && !empty($autocnode)) { $sids = array_merge(array(0), array_keys($subsites)); foreach ($sids as $k) { updatecache('cnconfigs', '', $k); updatecache('cnodes', 1, $k);
} $sqlstr .= ',' . $k . "='" . $a_field->newvalue . "'"; if ($arr = multi_val_arr($a_field->newvalue, $v)) { foreach ($arr as $x => $y) { $sqlstr .= ',' . $k . '_' . $x . "='{$y}'"; } } } if (!empty($a_field->error)) { continue; } $c_upload->saveuptotal(1); $db->query("INSERT INTO {$tblprefix}catalogs SET \n\t\t\t\t\t\ttitle='{$catalognew['title']}', \n\t\t\t\t\t\tdirname='{$catalognew['dirname']}', \n\t\t\t\t\t\tsid='{$sid}', \n\t\t\t\t\t\tlevel='{$catalognew['level']}', \n\t\t\t\t\t\tchids='{$catalognew['chids']}', \n\t\t\t\t\t\tisframe='{$catalognew['isframe']}',\n\t\t\t\t\t\tapmid='{$catalognew['apmid']}',\n\t\t\t\t\t\trpmid='{$catalognew['rpmid']}',\n\t\t\t\t\t\tcrpmid='{$catalognew['crpmid']}',\n\t\t\t\t\t\tdpmid='{$catalognew['dpmid']}',\n\t\t\t\t\t\tawardcp='{$catalognew['awardcp']}',\n\t\t\t\t\t\ttaxcp='{$catalognew['taxcp']}',\n\t\t\t\t\t\tftaxcp='{$catalognew['ftaxcp']}',\n\t\t\t\t\t\tallowsale='{$catalognew['allowsale']}',\n\t\t\t\t\t\tallowfsale='{$catalognew['allowfsale']}',\n\t\t\t\t\t\ttpls='{$catalognew['tpls']}',\n\t\t\t\t\t\tcustomurl='{$catalognew['customurl']}',\n\t\t\t\t\t\tpid='{$catalognew['pid']}'\n\t\t\t\t\t\t{$sqlstr}\n\t\t\t\t\t\t"); //自动生成节点 if ($caid = $db->insert_id()) { if (!empty($autocnode) && ($cncid = relate_cncid(0, $caid, $catalognew['level'], $sid, 1))) { save_cnode("caid={$caid}", $sid, $cncid, $catalognew['tpls']); } $enamearr[] = $catalognew['dirname']; $ok++; } $c_upload->closure(1, $caid, 'catalogs'); } if ($ok && !empty($autocnode)) { updatecache('cnconfigs', '', $sid); updatecache('cnodes', 1, $sid); } unset($a_field, $c_upload); adminlog(lang('batch_catalog')); updatecache('catalogs', '', $sid); amessage($ok ? $ok == $i - 1 ? 'catalogaddfinish' : 'batch_catalog_some' : 'batch_catalog_bad', axaction(6, "?entry=catalogs&action=catalogedit{$param_suffix}"), $ok);