} $aid = RemoveXSS($id); //防止跨站攻击 updateVisit($aid, $typeid); $row = getPhotoInfo($aid); if (empty($row['id'])) { head404(); } $photoid = $row['id']; $destlist = getPhotoChildDest($dest_id); if (is_array($row)) { $row['num'] = getPhotoNum($aid); $row['subname'] = $row['title']; $row['litpic'] = !empty($row['litpic']) ? $row['litpic'] : getDefaultImage(); //获取目的地 $destlist = $destlist = getPhotoChildDest($row['kindlist'], true); //SEO优化信息 $row['seodescription'] = !empty($row['description']) ? "<meta name=\"description\" content=\"" . $row['description'] . "\"/>" : ""; $row['seokeyword'] = !empty($row['keyword']) ? "<meta name=\"keywords\" content=\"" . $row['keyword'] . "\"/>" : ""; $row['seotitle'] = !empty($row['seotitle']) ? $row['seotitle'] : $row['title']; $row['commenthomeid'] = $row['id']; //图片 $picturelist = getPhotoPictures($row['id'], 'lit240'); //列表 if (empty($imgid)) { $firstpic = $picturelist[0]; } else { $firstpic = $dsql->GetOne("select * from #@__photo_picture where id={$imgid}"); $prevpic = $dsql->GetOne("select * from #@__photo_picture where pid='{$row['id']}' and id<'{$imgid}' order by id desc"); $nextpic = $dsql->GetOne("select * from #@__photo_picture where pid='{$row['id']}' and id>'{$imgid}' order by id asc"); }
$pv->Fields['seokeyword'] = !empty($destinfo['keyword']) ? "<meta name=\"keywords\" content=\"" . $destinfo['keyword'] . "\"/>" : ""; $pv->Fields['seodescription'] = !empty($destinfo['description']) ? "<meta name=\"description\" content=\"" . $destinfo['description'] . "\"/>" : ""; $pv->Fields['seotitle'] = !empty($destinfo['seotitle']) ? $destinfo['seotitle'] : $destinfo['shortname']; } else { $join = " #@__allorderlist b on(a.id = b.aid and b.typeid='6') "; $tableorder = " ifnull(b.isding,0) desc,ifnull(b.isjian,0) desc,ifnull(b.displayorder,9999) asc,a.modtime desc,a.addtime desc"; } if (!empty($attrid)) { $attrid_arr = explode('_', $attrid); foreach ($attrid_arr as $k => $v) { $where .= !empty($v) ? " and FIND_IN_SET({$v},a.attrid)" : ''; } } $_photoModule = new CommonModule('sline_photo as a'); //获取目的地列表 $destlist = getPhotoChildDest($dest_id); //获取目的地面包屑 $mianbao = getPhotoMianbao($dest_id); //获取结果集 $pagesize = 12; //每页数量 $pageno = empty($pageno) ? 1 : $pageno; //第几页 $offset = ($pageno - 1) * $pagesize; $count = $_photoModule->getCount($where); $photolist = $_photoModule->getAll($where, $tableorder, "{$offset},{$pagesize}", "a.*", $join); $page = getPhotoPage($count, $pageno, $pagesize, array('dest_id' => $dest_id, 'attrid' => $attrid)); //获取分页结果 foreach ($photolist as $k => $v) { $weburl = GetWebURLByWebid($v['webid']); $photolist[$k]['pic'] = getUploadFileUrl(str_replace('litimg', 'allimg', $v['litpic']));