public function zt_show(){
$specialid = isset($_GET['specialid']) ? intval($_GET['specialid']) : 0;
if (!$specialid) {
showmessage('参数错误',HTTP_REFERER);
}
$this->special_content_db = pc_base::load_model('special_content_model');
$this->html = pc_base::load_app_class('html');
$curl = $this->special_content_db->select("specialid='$specialid'","catid,curl");
$ids = '';
foreach ($curl as $k => $v) {
$v['curl'] = str_replace("|".$v['catid'], '', $v['curl']);
$ids[] = $v['curl'];
}
$ids = implode(",", $ids);//该专题包含的所有内容id
$siteid = param::get_cookie("siteid") ? param::get_cookie("siteid") : 1;//当前站点
$modelid = ($siteid == 1) ? 12 : 14;//根据当前站点得出对应模型
if($modelid) {
//设置模型数据表名
$this->db->set_model($modelid);
$table_name = $this->db->table_name;
$rs = $this->db->query("SELECT * FROM `$table_name` where id in($ids) ORDER BY `id` DESC ");
$data = $this->db->fetch_array($rs);
$tablename = $this->db->table_name.'_data';
$this->url = pc_base::load_app_class('url');
foreach($data as $r) {
if($r['islink']) continue;
$this->db->table_name = $tablename;
$r2 = $this->db->get_one(array('id'=>$r['id']));
if($r) $r = array_merge($r,$r2);
if($r['upgrade']) {
$urls[1] = $r['url'];
} else {
$urls = $this->url->show($r['id'], '', $r['catid'],$r['inputtime']);
}
$this->html->show($urls[1],$r,0,'edit',$r['upgrade']);
}
showmessage('生成该专题内容页成功',HTTP_REFERER);
}
}
|