Ejemplo n.º 1
0
     }
     if (!empty($filename) && (isset($id) && $filename != $infoold['filename'])) {
         $namea = $products->GetInfo('', " `filename` = '" . $filename . "' ");
         if (!empty($namea)) {
             errorinfo('对不起,自定义name已经使用过了,请更换自定义name', '');
         }
     }
     $info = array('productid' => $productid, 'title' => $title, 'seotitle' => $seotitle, 'seokeyword' => $seokeyword, 'seointro' => $seointro, 'filename' => $filename, 'fromtitle' => $fromtitle, 'fromlinkurl' => $fromlinkurl, 'titlecolor' => $titlecolor, 'thumb' => $thumb, 'orders' => $orders, 'intro' => $intro, 'author' => $author, 'content' => $content, 'addtime' => $addtime, 'authortime' => $authortime, 'template' => $template, 'linkurl' => $linkurl, 'clicks' => $clicks, 'isplay' => $isplay, 'ishot' => $ishot, 'istop' => $istop, 'isgood' => $isgood);
     if (isset($id)) {
         if ($products_photo->Update($info, ' id =' . $id)) {
             errorinfo('编辑成功', '');
         } else {
             errorinfo('编辑失败', '');
         }
     } else {
         if ($products_photo->Add($info)) {
             errorinfo('添加成功', '');
         } else {
             errorinfo('添加失败', '');
         }
     }
 } else {
     $info = array();
     $time = time();
     if (isset($id)) {
         $id = intval($id);
         if ($id <= 0) {
             errorinfo('变量错误', '');
         }
         $info = $products_photo->GetInfo('', ' id = ' . $id);
         if (empty($info)) {