require_once 'include/keywords.class.php'; session_start(); $name = $_GET["name"]; if (strpos($name, "http://") === 0) { header('HTTP/1.1 301 Moved Permanently'); header("Location:" . $name); } if (!preg_match("/^.{1,100}\$/", $name)) { header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found"); } $uid = $_SESSION["adminid"]; $uid = isset($uid) && is_numeric($uid) ? $uid : 0; $cururl = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; $article = null; if ($uid > 0) { $article = $articledata->GetArticleByName($name, true); } else { $article = $articledata->GetArticleByName($name, false); } if ($article == null) { header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found"); } $article->content = mixkeyword($article->content); $tempinfo->assign("article", $article); if (!$tempinfo->template_exists($article->templets)) { exit("没有找到合适的模板,请与管理员联系!"); } $articledata->UpdateCount($article->aid); $tempinfo->display($article->templets);
exit("指定的文件名已经存在"); } } $producttemplets = str_replace("{style}/", "", $producttemplets); $nowdate = date("Y-m-d H:i:s"); if (empty($productadddate)) { $productadddate = $nowdate; } $sql = "INSERT INTO yiqi_product (pid ,name ,cid ,thumb,seotitle ,seokeywords ,seodescription,content ,adddate ,lasteditdate,filename ,templets,status)" . "VALUES (NULL, '{$productname}', '{$productcategory}', '{$productthumb}','{$productseotitle}', '{$productkeywords}', '{$productdescription}', '{$productcontent}', '{$productadddate}', '{$nowdate}','{$productfilename}', '{$producttemplets}', 'ok')"; $result = $yiqi_db->query(CheckSql($sql)); if ($result == 1) { $pid = $yiqi_db->insert_id; $genehtml = getset("urlrewrite")->value; if ($genehtml == "html") { $product = $productdata->GetProduct($pid); $product->content = mixkeyword($product->content); $tempinfo->assign("product", $product); if (!$tempinfo->template_exists($product->templets)) { exit("没有找到文章模板,请与管理员联系!"); } $source = $tempinfo->fetch($product->templets); $urlparam = array('name' => $productfilename, 'type' => 'product', 'generatehtml' => 1); $fileurl = formaturl($urlparam); $cachedata->WriteFileCache(YIQIROOT . "/" . $fileurl, $source, true); } //添加附加属性 $idarr = $_POST["chk"]; if (count($idarr) > 0) { foreach ($idarr as $id) { $varname = $_POST["extname"]; $varvalue = $_POST["extvalue"];