Exemple #1
0
         $parent = $products_class->GetInfo('', ' id = ' . $parentid);
         if ($parent['parentid'] == 0) {
             $rootid = $parentid;
         } else {
             $rootid = $parent['rootid'];
         }
     }
     if (!empty($filename) && (isset($id) && $filename != $infoold['filename'])) {
         $namea = $products_class->GetInfo('', " `filename` = '" . $filename . "' ");
         if (!empty($namea)) {
             errorinfo('对不起,自定义name已经使用过了,请更换自定义name', '');
         }
     }
     $info = array('parentid' => $parentid, 'title' => $title, 'seotitle' => $seotitle, 'seokeyword' => $seokeyword, 'seointro' => $seointro, 'filename' => $filename, 'listnum' => $listnum, 'thumb' => $thumb, 'intro' => $intro, 'template' => $template, 'linkurl' => $linkurl, 'orders' => $orders, 'rootid' => $rootid);
     if (isset($id)) {
         if ($products_class->Update($info, ' id =' . $id)) {
             errorinfo('编辑成功', '');
         } else {
             errorinfo('编辑失败', '');
         }
     } else {
         if ($products_class->Add($info)) {
             errorinfo('添加成功', '');
         } else {
             errorinfo('添加失败', '');
         }
     }
 } else {
     $info = array();
     $time = time();
     if (isset($id)) {