require('../include/global_start.inc.php'); if($_GET["action"]){ require("./brandlist.inc.php"); $line = 3; require("../include/recommend_brand.inc.php"); } elseif($_GET["bid"]){ require("./brandinfo.inc.php"); }else{ $template->loadtemplate("main","brandshow_index.html"); //hot images $sql = "select subject,location,newsImage from ".$tableHead."w_article where (fcid = '54' or cid = '54') and bigimg = 1 order by postDate desc limit 3"; $db->query($sql); $template->set_block("main","NewsImageList","NewsImageLists"); $i = 0; while ($i<3){ $db->next_record(); $data = $db->Record; $template->set_var(array( 'num'=>$i, 'style'=>$i?' style="display:none;"':"", 'newsimage'=>$data["newsImage"]?"":"无图片".$i, 'newsimagearturl'=>$data["location"], 'newssubject'=>strlen($data["subject"])>20?chopstring($data["subject"],10)."...":$data["subject"] )); $template->parse("NewsImageLists","NewsImageList",true); $i++; } //news list $ppddnewsid = 55; //品牌动态 $ppggnewsid = 56; //品牌故事 //ppdd news $sql = "select subject,location,newsImage from ".$tableHead."w_article where (fcid = '$ppddnewsid' or cid = '$ppddnewsid') and newsImage != '' order by bigimg desc,postDate desc limit 1"; $db->query($sql); $db->next_record(); $data = $db->Record; $template->set_var(array( 'ppddnewsimage'=>$data["newsImage"]?"":"无图片", 'ppddnewsimagearturl'=>$data["location"], 'ppddnewssubject'=>strlen($data["subject"])>20?chopstring($data["subject"],10):$data["subject"] )); $template->set_block("main","ppddlist","ppddlists"); $sql = "select location,subject from ".$tableHead."w_article where fcid = '$ppddnewsid' or cid = '$ppddnewsid' order by postDate desc limit 6"; $db->query($sql); while ($db->next_record()){ $data = $db->Record; $template->set_var(array( 'artUrl'=>$data["location"], 'subject'=>strlen($data["subject"])>34?chopstring($data["subject"],17):$data["subject"] )); $template->parse('ppddlists','ppddlist',true); } //ppgg news $sql = "select subject,location,newsImage from ".$tableHead."w_article where (fcid = '$ppggnewsid' or cid = '$ppggnewsid') and newsImage != '' order by bigimg desc,postDate desc limit 1"; $db->query($sql); $db->next_record(); $data = $db->Record; $template->set_var(array( 'ppggnewsimage'=>$data["newsImage"]?"":"无图片", 'ppggnewsimagearturl'=>$data["location"], 'ppggnewssubject'=>strlen($data["subject"])>20?chopstring($data["subject"],10):$data["subject"] )); $template->set_block("main","ppgglist","ppgglists"); $sql = "select location,subject from ".$tableHead."w_article where fcid = '$ppggnewsid' or cid = '$ppggnewsid' order by postDate desc limit 6"; $db->query($sql); while ($db->next_record()){ $data = $db->Record; $template->set_var(array( 'artUrl'=>$data["location"], 'subject'=>strlen($data["subject"])>34?chopstring($data["subject"],17):$data["subject"] )); $template->parse('ppgglists','ppgglist',true); } //pp sort for($i = 1;$i<=4;$i++){ $template->set_block("main","allDish".$i,"allDish".$i."s"); $sort1 = ($i - 1) * 2 + 1; $sort2 = $sort1 + 1; //$sql = "select id,name,logo from ".$tableHead."w_brands where sort = ".$sort1." or sort = ".$sort2." limit 8"; //按会员等级排序 $sql = "select c.id,c.name,c.logo from ".$tableHead."w_brands c,".$tableHead."w_customer d,".$tableHead."w_members m where m.uid = c.uid and d.uid=c.uid and (c.sort = ".$sort1." or c.sort = ".$sort2.") order by m.sgroupid desc,d.id desc limit 8"; $db->query($sql); $j = 0; while ($db->next_record()){ $data = $db->Record; $template->set_var(array( 'brandname'=>$data["name"], 'logo'=>$data["logo"]?"":"无图片", 'bid'=>$data["id"], 'tr'=>$j%4 == 0?"