public function _list($id) { preg_match("/^list\_(\d+).html$/i",$id,$url); $catid = isset($url[1])?$url[1]:0; $catIdList = $this->db->fetch("select cat_id from ".WEBMENG_CONMENG."category_article where sort_path like '%,".$catid.",%'"); $catListOR = array(); foreach ($catIdList as $catId) { $catListOR[] = " catid = ". $catId['cat_id']." "; } // var_dump($catListOR); $sql = "select * from ".WEBMENG_CONMENG."article where status>'0' and (".implode("or", $catListOR).") order by id desc"; // var_dump($sql); $result = page_for_db_extend($sql); $data['info_reslut'] = $result['data']; $data['showpage'] = $result['page']; // $sql = "select * from ".WEBMENG_CONMENG."goods where lid='cn' and catid='".$catid."' and status>'0' "; // $result = page_for_db_extend($sql); // $data['info_reslut'] = $result['data']; // $data['showpage'] = $result['page']; $sort_path = $this->db->fetch("select sort_path from ".WEBMENG_CONMENG."category_article where cat_id = ".$catid,true); // var_dump($sort_path); // var_dump(rtrim($sort_path['sort_path'],",")); $catNavigationList = $this->db->fetch("select cat_id,cat_name from ".WEBMENG_CONMENG."category_article where cat_id in (".rtrim($sort_path['sort_path'],",").")"); // var_dump($catNavigation); $data['catNavigation'] = $catNavigationList; // var_dump($sort_path); // var_dump($catNavigationList); // exit; $data['category_name'] = $this->db->fetch("select a.*,b.* from ".WEBMENG_CONMENG."article a left join ".WEBMENG_CONMENG."category_article b on a.catid=b.cat_id where a.catid='".$catid."' ",true); $data['info_comment'] = $this->get_info_comment(); $data['notice'] = $this->get_notice(); $data['news_recommend'] = $this->get_news_recommend(); $data['article_recommend'] = $this->get_article_recommend(); $data['article_new'] = $this->get_article_new(); $data['news_new'] = $this->get_news_new(); $data['photo_new'] = $this->get_photo_new(); $data['news_hit'] = $this->get_news_hit(); $data['article_hit'] = $this->get_article_hit(); $data['photo_hit'] = $this->get_photo_hit(); $data['article_images'] = $article_images; $this->display('cn/article/list.html',$data); }
/////分类标签,模板
4397 阅读
4084 阅读
4093 阅读
4619 阅读
4595 阅读
5330 阅读
4141 阅读
4484 阅读
5426 阅读
4962 阅读
5293 阅读
5243 阅读
4626 阅读
4633 阅读
8913 阅读
5093 阅读
5676 阅读
9819 阅读
5912 阅读
6733 阅读
阅读
public function _list($id)
{
preg_match("/^list\_(\d+).html$/i",$id,$url);
$catid = isset($url[1])?$url[1]:0;
$catIdList = $this->db->fetch("select cat_id from ".WEBMENG_CONMENG."category_article where sort_path like '%,".$catid.",%'");
$catListOR = array();
foreach ($catIdList as $catId) {
$catListOR[] = " catid = ". $catId['cat_id']." ";
}
// var_dump($catListOR);
$sql = "select * from ".WEBMENG_CONMENG."article where status>'0' and (".implode("or", $catListOR).") order by id desc";
// var_dump($sql);
$result = page_for_db_extend($sql);
$data['info_reslut'] = $result['data'];
$data['showpage'] = $result['page'];
// $sql = "select * from ".WEBMENG_CONMENG."goods where lid='cn' and catid='".$catid."' and status>'0' ";
// $result = page_for_db_extend($sql);
// $data['info_reslut'] = $result['data'];
// $data['showpage'] = $result['page'];
$sort_path = $this->db->fetch("select sort_path from ".WEBMENG_CONMENG."category_article where cat_id = ".$catid,true);
// var_dump($sort_path);
// var_dump(rtrim($sort_path['sort_path'],","));
$catNavigationList = $this->db->fetch("select cat_id,cat_name from ".WEBMENG_CONMENG."category_article where cat_id in (".rtrim($sort_path['sort_path'],",").")");
// var_dump($catNavigation);
$data['catNavigation'] = $catNavigationList;
// var_dump($sort_path);
// var_dump($catNavigationList);
// exit;
$data['category_name'] = $this->db->fetch("select a.*,b.* from ".WEBMENG_CONMENG."article a left join ".WEBMENG_CONMENG."category_article b on a.catid=b.cat_id where a.catid='".$catid."' ",true);
$data['info_comment'] = $this->get_info_comment();
$data['notice'] = $this->get_notice();
$data['news_recommend'] = $this->get_news_recommend();
$data['article_recommend'] = $this->get_article_recommend();
$data['article_new'] = $this->get_article_new();
$data['news_new'] = $this->get_news_new();
$data['photo_new'] = $this->get_photo_new();
$data['news_hit'] = $this->get_news_hit();
$data['article_hit'] = $this->get_article_hit();
$data['photo_hit'] = $this->get_photo_hit();
$data['article_images'] = $article_images;
$this->display('cn/article/list.html',$data);
}
/////分类标签,模板
{webmeng:foreach from=$catNavigation item=v/}
>> <a href="/goods/list_{webmeng:$v.cat_id/}.html">{webmeng:$v.cat_name/}
</a>
{webmeng:/foreach/}