Webmeng2024内页升级大全-访问ID分类地区留言 | 推荐

detail.html  下载 模板下载

控制器下载  控制器下载


路径

/news/details?id=188&catid=4&cid=188&areaid=1&lg=zh-CN


系统:

/news/details?id={webmeng:$new[rs].detailid/}&cid={webmeng:$new[rs].id/}&catid={webmeng:$new[rs].catid/}&lg=zh-CN


控制器:


/*detail控制器*/
  public function details($id,$cid,$catid,$areaid)
    {
   
$id= htmlspecialchars($this->input->get("id",true)); 
$cid= htmlspecialchars($this->input->get("cid",true));
$catid= htmlspecialchars($this->input->get("catid",true));
$areaid= htmlspecialchars($this->input->get("areaid",true));
  $settings = array(); 
  $sets = $this->db->fetch("select * from ".WEBMENG_CONMENG."settings  ");
 if(!empty($sets)){
 foreach ($sets as $v) {
 $webmeng[$v['variable']] = $v;
  }
  }
  $data['webmeng'] = $webmeng;   
 //print_r($data); 
 //判断用户是否登录  

 $uid = $this->uid;
 $data['account'] = $this->db->fetch("select * from ".WEBMENG_CONMENG."user where id='".$uid."'  ",true);  
//判断当前城市

$city_id = $this->city_id;
$data['city_id'] = $this->db->fetch("select * from  ".WEBMENG_CONMENG."category_area where cat_id='".$city_id."'  ",true);

// preg_match("/^detail\_(\d+).html$/i",$id,$url);
// $id =  isset($url[1])?$url[1]:0;


$sort_path = $this->db->fetch("select sort_path from ".WEBMENG_CONMENG."category_inews 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_inews 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."inews a left join ".WEBMENG_CONMENG."category_inews b on a.catid=b.cat_id  where a.catid='".$catid."' ",true);
 
 

 $data['details'] = $this->db->fetch("select a.*,b.* from ".WEBMENG_CONMENG."inews a left join ".WEBMENG_CONMENG."inews_data b on a.id=b.id  where a.detailid='".$id."' ",true);

 $this->db->query("update ".WEBMENG_CONMENG."inews set hit=hit+1 where detailid='".$id."'");

 $data['notice']= $this->db->fetch("select * from ".WEBMENG_CONMENG."notice where id order by id desc,id desc limit 10  ");
 $data['info_comment'] = $this->get_info_comment($id);  //新闻评论
 $data['new']= $this->db->fetch("select * from ".WEBMENG_CONMENG."inews where id order by id desc,id desc limit 15  ");
 $data['recommend']= $this->db->fetch("select * from ".WEBMENG_CONMENG."inews where id order by id desc,id desc limit 9  ");
      
        $this->display('cn/inews/detail.html',$data); 

  }
  




相关问题

餐厅介绍

自助餐厅

4.7分
537m | 中航城区冷死你境内呢名
停车 WiFi
  • 热情1
  • 环境好11
  • 服务好12
  • 好极了31
  • 服务热情14

暂时没有看法.. 发表看法请遵守当地法律和制度 (网友评论仅供其表达个人看法,并不表明本站立场。)