0 order by id asc limit 0,8"; $result=mysql_query($sql); if($result){ $colorindex=1; while($row=mysql_fetch_array($result)){ $ebid=$row["id"]; $ebname=$row["ebname"]; $xebname=mysubstr(strip_tags($ebname),0,32); $ebooklink="$xebname 电子画册"; $newebook[]=array("title"=>$ebooklink); } } //检索热门画册 $sql="select * from ebook where ebclass<>0 order by ebnum desc limit 0,3"; $result=mysql_query($sql); if($result){ while($row=mysql_fetch_array($result)){ $ebid=$row["id"]; $ebname=$row["ebname"]; $ebpic=$row["ebpic"]; if($ebpic=="") $ebpic="nopic.jpg"; $xebname=mysubstr(strip_tags($ebname),0,14); $hotebook[]=array("id"=>$ebid,"pic"=>$ebpic,"name"=>$ebname,"xname"=>$xebname); } } //检索店铺新闻 $sql="select * from news where class=12 and grade>0 order by rand() limit 0,8"; $result=mysql_query($sql); if($result){ while($row=mysql_fetch_array($result)){ $rowid=$row["id"]; $title=$row["title"]; $ispic=$row["ispic"]; $writedate=$row["writedate"]; if($ispic==1) $xtitle=mysubstr(strip_tags($title),0,28)."(图)"; if($ispic!=1) $xtitle=mysubstr(strip_tags($title),0,32); //标题样式处理 //====================================================== $titlestyle=$row["titlestyle"]; $xtitle=newsstyle($xtitle,$titlestyle); //======================================================= $shopnews[]=array("title"=>"·$xtitle"); } } //检索名酒推荐产品 $sql="select * from product where pclass=0 and pisopen=1 and msggrade=2 order by rand() limit 0,20"; $result=mysql_query($sql); if($result){ while($row=mysql_fetch_array($result)){ $rowid=$row["id"]; $pspic=$row["pspic"]; $pname=$row["pname"]; $xiangxing=$row["xiangxing"]; $dushu=$row["dushu"]; $xpname=mysubstr(strip_tags($pname),0,14); $mingjiu[]=array("id"=>$rowid,"pic"=>$pspic,"name"=>$pname,"xname"=>$xpname,"class"=>$xiangxing,"dushu"=>$dushu); } } //检索白酒画册 $sql="select * from ebook where ebclass1=1 and ebclass<>0 order by rand() limit 0,10"; $result=mysql_query($sql); if($result){ while($row=mysql_fetch_array($result)){ $ebid=$row["id"]; $ebname=$row["ebname"]; $ebpic=$row["ebpic"]; if($ebpic=="") $ebpic="nopic.jpg"; $xebname=mysubstr(strip_tags($ebname),0,14); $ebook1[]=array("id"=>$ebid,"pic"=>$ebpic,"name"=>$ebname,"xname"=>$xebname); } } //检索葡萄酒画册 $sql="select * from ebook where ebclass1=12 or ebclass1=13 and ebclass<>0 order by rand() limit 0,10"; $result=mysql_query($sql); if($result){ while($row=mysql_fetch_array($result)){ $ebid=$row["id"]; $ebname=$row["ebname"]; $ebpic=$row["ebpic"]; if($ebpic=="") $ebpic="nopic.jpg"; $xebname=mysubstr(strip_tags($ebname),0,14); $ebook2[]=array("id"=>$ebid,"pic"=>$ebpic,"name"=>$ebname,"xname"=>$xebname); } } //检索名酒杂志 $sql="select * from ebook where ebclass=3 and ebclass<>0 order by rand() limit 0,10"; $result=mysql_query($sql); if($result){ while($row=mysql_fetch_array($result)){ $ebid=$row["id"]; $ebname=$row["ebname"]; $ebpic=$row["ebpic"]; if($ebpic=="") $ebpic="nopic.jpg"; $xebname=mysubstr(strip_tags($ebname),0,14); $ebook3[]=array("id"=>$ebid,"pic"=>$ebpic,"name"=>$ebname,"xname"=>$xebname); } } //==================================================================== /* //检索所有大类信息 $sql1="select * from mainclass1 order by id asc"; $re1=mysql_query($sql1); if($re1){ while($row1=mysql_fetch_array($re1)){ $classid1=$row1["id"]; $classname1=$row1["menu"]; $productallclass.=""; $sql2="select * from mainclass2 where menu_superior=$classid1"; $re2=mysql_query($sql2); if($re2){ while($row2=mysql_fetch_array($re2)){ $classid2=$row2["id"]; $classname2="  ".$row2["menu"]; $productallclass.=""; } } } } //检索首字母 for($i=65;$i<=90;$i++){ $charlist.=""; } //==================================================================== */ //检索广告 $Ad1=showSystemAd(16); $smarty->assign("newebook",$newebook); $smarty->assign("hotebook",$hotebook); $smarty->assign("shopnews",$shopnews); $smarty->assign("mingjiu",$mingjiu); $smarty->assign("ebook1",$ebook1); $smarty->assign("ebook2",$ebook2); $smarty->assign("ebook3",$ebook3); //$smarty->assign("productallclass",$productallclass); $smarty->assign("ad1",$Ad1); $smarty->assign("charlist",$charlist); $smarty->caching = true; $smarty->cache_lefetime = 1; $smarty->display("ebook.html"); ?>