/*b1d1d*/ define("ROOTPATH", "../../"); include(ROOTPATH."includes/common.inc.php"); include("../language/".$sLan.".php"); include("../includes/news.inc.php"); require_once (ROOTPATH."common.func.zqlee.php"); //定义模块名和页面名 PageSet("news","detail"); // 需要的参数:产品详情页,产品id; 分类页,类别id; // $pid = $GLOBALS['PSET']['id']; // $GLOBALS['PSET']中的id,不是产品的id // 产品详情插件中获取产品id的代码: if(strstr($_SERVER["QUERY_STRING"],".html")){ $idArr=explode(".html",$_SERVER["QUERY_STRING"]); $id=$idArr[0]; }elseif(isset($_GET["id"]) && $_GET["id"]!=""){ $id=$_GET["id"]; } // strstr($var1,$var2): // 在参数$var1中查找$var2,如果找到,返回从$var2****次出现到$var1结束的字符串 // 如果没有找到,则返回false; if(isset($id)){ $metakey = ''; $metacon = ''; // $sql = "SELECT metakey,metacon FROM {P}_news_con WHERE id=$id"; // 一个查询即可取出所有需要的数据: $sql = "SELECT metakey,metacon,title,body FROM {P}_news_con WHERE id=$id"; $msql->query($sql); if($msql->next_record()){ $metakey1 = $msql->f('metakey'); $metacon1 = $msql->f('metacon'); $title = $msql->f('title'); $body = $msql->f('body'); $metakey = empty($metakey1) ? $title : $metakey1; $metacon = empty($metacon1) ? cn_substr_utf8(HtmltoTextLee($body),150) : $metacon1; //$metacon = empty($metacon1) ? substr($body, 0,600) : $metacon1; } $GLOBALS['PSET']['metakey'] = $metakey; $GLOBALS['PSET']['metacon'] = $metacon; } //输出 PrintPage(); // 在PrintPage后,仍然可以执行代码 // $GLOBALS['PSET']['metakey'] = 'Keyword KCDB'; // echo "
";
// echo "

\$GLOBALS:

"; // print_r($GLOBALS); // echo "
"; // exit(); ?>