$startcity = getStartCityName($row['startcity']); $startcity = !empty($startcity) ? "[{$startcity}出发]" : ''; $linename = "{$startcity}{$row['linename']}"; $award2 = !empty($row['jefentprice']) ? $row['jefentprice'] : 0; $booknum = Helper_Archive::getSellNum($row['id'], 1) + $row['bookcount']; $real = getLineRealPrice($row['aid'], $row['webid']); $row['lineprice'] = $real ? $real : $row['price']; if ($k < 5) { $left .= ' <div class="list_con_sy"> <div class="sy_img"><a class="fl" href="' . $url . '" title="' . $linename . '"><img class="fl" src="' . $litpic . '" width="100" height="80" alt="' . $linename . '" /></a></div> <div class="sy_txt"> <p class="p1"><a href="' . $url . '" target="_blank">' . $linename . '</a></p> <p class="p2">' . $row['sellpoint'] . '</p> <p class="p3"> <span>销量:<b>' . $booknum . '</b>人已购买</span> <span>评论:<b>' . Helper_Archive::getCommentNum($row['id'], 1) . '</b>条评论</span> <span class="sp_star"><strong class="fl">满意度:</strong><b><s style=" width:' . Helper_Archive::getSatisfyScore($row['id'], 1) . '"></s></b></span> </p> </div> <div class="sy_price"> <p class="p1">¥<strong>' . $row['lineprice'] . '</strong><span>起</span></p> <p class="p2"><span>' . $award2 . '</span></p> </div> </div> '; } else { $right .= '<li> <div class="hot_img"><s></s><a class="fl" href="' . $url . '" title="' . $linename . '"><img class="fl" src="' . $litpic . '" width="190" height="140" alt="' . $linename . '" /></a></div> <div class="hot_tit"><a href="' . $url . '" target="_blank">' . $linename . '</a></div> <div class="hot_txt">本季惊爆价:<span>¥' . $row['lineprice'] . '</span>起</div> </li>'; }
} if (!empty($row['redirecturl'])) { head301($row['redirecturl']); } $prenext = GetPreNext($aid); //获取上一条,下一条 foreach ($prenext as $k => $v) { $pv->Fields[$k] = $v; } if (is_array($row)) { $row['litpic'] = !empty($row['litpic']) ? $row['litpic'] : getDefaultImage(); $row['taglook'] = GetTagsLink($row['tagword']); $row['description'] = !empty($row['description']) ? "<meta name=\"description\" content=\"" . $row['description'] . "\"/>" : ""; $row['keyword'] = !empty($row['keyword']) ? "<meta name=\"keywords\" content=\"" . $row['keyword'] . "\"/>" : ""; $row['subname'] = $row['title']; $row['commentnum'] = Helper_Archive::getCommentNum($row['id'], 4); $row['commenthomeid'] = $row['id']; $row['id'] = strlen($row['id']) == 1 ? "0" . $row['id'] : $row['id']; $row['pkname'] = get_par_value($row['kindlist'], $typeid); $row['yesjian'] = is_null($row['yesjian']) ? 0 : $row['yesjian']; $row['destid'] = array_remove_value($row['kindlist']); $row['pinyin'] = Helper_Archive::getDestPinyin($row['destid']); $row['destname'] = !empty($row['destid']) ? '[<a href="/raiders/' . $row['pinyin'] . '">' . Helper_Archive::getBelongDestName($row['kindlist']) . '</a>]' : ''; //所属目的地 $row['destarcnum'] = getArticleNum($row['destid']); $row['attrlist'] = getArticleAttrlist($row['attrid']); $row['summary'] = empty($row['summary']) ? cutstr_html($row['content'], 140) : $row['summary']; $row['kindid'] = $row['destid']; $row['dest_html'] = !empty($row['destid']) ? "<div class=\"page_top\">" . "<a href=\"/raiders/{$row['pinyin']}\">" . Helper_Archive::getBelongDestName($row['kindlist']) . "</a><span>旅游攻略</span>共{$row['destarcnum']}篇</div>" : ''; //是否设置了目的地条件,便于展示推荐线路 if (!empty($row['destid'])) {
/** * 调用文章显示数据标签 * * @version $Id: getarclist.lib.php netman * @package Stourweb.Taglib * @copyright Copyright (c) 2007 - 2011, Stourweb, Inc. * @link http://www.stourweb.com */ function lib_getarclist(&$ctag, &$refObj) { global $dsql; include SLINEDATA . "/webinfo.php"; $attlist = "row|8,flag|,type|top,limit|0,haspic|,attrid|0,attrname|"; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $webid = empty($sys_webid) ? 0 : $sys_webid; $innertext = trim($ctag->GetInnertext()); $revalue = ''; $basefield = 'a.id,a.aid,a.webid,a.title,a.seotitle,a.shownum,a.content,a.addtime,a.webid,a.attrid,a.litpic as litpic,a.kindlist,a.author'; //是否有图片 $picwhere = !empty($haspic) ? " and (a.litpic is not null and a.litpic!='') and a.ishidden=0 " : ''; $picwhere2 = !empty($haspic) ? " where (a.litpic is not null and a.litpic!='') and a.ishidden=0 " : ''; if ($type == 'mdd') { if ($flag == 'recommend') { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc'; } else { if ($flag == 'hot') { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc'; } else { if ($flag == 'new') { $orderby = 'order by a.addtime desc'; } else { if ($flag == 'imagehot') { $orderby = " and a.litpic!='' order by case when c.displayorder is null then 9999 end,c.displayorder asc"; } else { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc'; } } } } $orderby .= ",a.modtime desc,a.addtime desc"; $sonid = isset($definekind) ? $definekind : $refObj->Fields['kindid']; //这里增加子站的判断 if ($GLOBALS['sys_child_webid'] != 0) { $dest_id = $GLOBALS['sys_child_webid']; } $sonid = $sonid ? $sonid : $dest_id; if (isset($sonid)) { $number = isset($refObj->Fields['shownumber']) ? $refObj->Fields['shownumber'] : $row; //如果模块设置了显示数量则使用. $where = " FIND_IN_SET({$sonid},a.kindlist) and a.ishidden=0 "; $where .= !empty($haspic) ? " and a.litpic is not null" : ''; $sql = "select {$basefield} from #@__article as a left join #@__kindorderlist as c on (c.classid={$sonid} and a.id=c.aid and c.typeid=4) where {$where} {$orderby} limit {$limit},{$number}"; } else { return ''; } } else { if ($type == 'theme') { $themeid = $refObj->Fields['themeid']; if (empty($themeid)) { return ''; } $sql = "select a.* from #@__article a where FIND_IN_SET({$themeid},a.themelist) {$picwhere} order by a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($type == 'pinlun') { $sql = "select a.*,b.id as plid,b.memberid,b.content as plcontent,b.addtime as pltime from #@__article a inner join #@__comment b on (a.id = b.articleid) order by b.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'specical') { $sql = "select {$basefield} from #@__article a where ishidden=0 and isindex =1 {$picwhere} order by modtime desc,addtime desc limit {$limit},{$row}"; } else { if ($flag == 'recommend') { $sql = "select {$basefield},b.isjian,b.isding as isding,b.displayorder from #@__article a left join #@__allorderlist b on (a.id=b.aid and b.typeid=4) {$picwhere2} order by case when b.displayorder is null then 9999 end,b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'kindrecommend') { $kid = $refObj->Fields['kid']; $sql = "select {$basefield} from #@__article a where a.ishidden=0 and FIND_IN_SET({$kid},a.kindlist) {$picwhere} order by a.displayorder asc, a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'isindex') { $sql = "select {$basefield} from #@__article a where a.isindex=1 {$picwhere} order by a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'new') { $sql = "select {$basefield} from #@__article a {$picwhere2} order by a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'hot') { $sql = "select {$basefield} from #@__article a where a.webid IS NOT NULL {$picwhere} order by a.shownum desc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'photo') { $sql = "select {$basefield} from #@__article a where webid IS NOT NULL and a.litpic !='' {$picwhere} order by a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'jieban') { $getsql = "select id from #@__article_attr where aid=0 and webid=0"; $arr = $dsql->GetOne($getsql); $jiebanid = $arr['id']; //获取id $sql = "select {$basefield},b.isding,b.displayorder,b.isjian from #@__article a left join #@__attrorderlist b on a.aid=b.aid and a.webid=b.webid where FIND_IN_SET({$jiebanid},a.attrid) {$picwhere} order by b.displayorder asc, a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'relative') { $kindlist = $refObj->Fields['kindlist']; $maxkindid = array_remove_value($kindlist); //最后一级. $destid = $GLOBALS['dest_id']; if (empty($destid)) { $maxkindid = array_remove_value($kindlist); //最后一级. $maxkindid = empty($maxkindid) ? 0 : $maxkindid; } else { $maxkindid = $destid; } $where = " FIND_IN_SET({$maxkindid},a.kindlist) "; //排序顺序:置顶+tag关联》排序+ tag关联》最新更新+tag关联 $sql = "select a.* from #@__article a left join #@__kindorderlist b on (a.id=b.aid and b.typeid=4 and b.classid='{$maxkindid}') where {$where} order by ifnull(b.displayorder,9999) asc,a.modtime desc,a.addtime desc limit {$limit},{$row} "; } else { if ($flag == 'attr') { $attrid = $refObj->Fields['attrid']; $sql = "select a.* from #@__article a where FIND_IN_SET({$attrid},a.attrid) and a.ishidden=0 order by a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'byattr') { if (!empty($attrid)) { $where = " (find_in_set({$attrid},a.attrid)" . loc_getsubattrid($attrid) . ')'; $sql = "select a.* from #@__article a left join #@__attrorderlist b on a.aid=b.aid and a.webid=b.webid where {$where} {$picwhere} order by b.displayorder asc, a.modtime desc,a.modtime desc limit {$limit},{$row}"; } else { if (!empty($attrname)) { $temp_one = $dsql->GetOne("select id from #@__article_attr where attrname='{$attrname}'"); if (empty($temp_one)) { return; } else { $sql = "select a.* from #@__article a where FIND_IN_SET({$temp_one['id']},a.attrid) and a.ishidden=0 order by a.modtime desc,a.modtime desc limit {$limit},{$row}"; } } } } else { return ''; } } } } } } } } } } } } } } $dsql->SetQuery($sql); $dsql->Execute(); $ctp = new STTagParse(); $ctp->SetNameSpace("field", "[", "]"); $ctp->LoadSource($innertext); $GLOBALS['autoindex'] = 0; while ($row = $dsql->GetArray()) { $GLOBALS['autoindex']++; $webroot = GetWebURLByWebid($row['webid']); $sonid = $refObj->Fields['sonid']; $row['url'] = $webroot . "/raiders/show_{$row['aid']}.html"; $row['haspic'] = empty($row['litpic']) ? 0 : 1; $litpic = getUploadFileUrl($row['litpic']); $row['lit240'] = getUploadFileUrl(str_replace('litimg', 'lit240', $row['litpic'])); $row['lit160'] = getUploadFileUrl(str_replace('litimg', 'lit160', $row['litpic'])); $row['litpic'] = $litpic; if ($row['allow'] == "usecontentpic" && !empty($row['litpic'])) { $row['imgtitle'] = $row['title'] . '<img src="' . $GLOBALS['cfg_templets_skin'] . '/images/gl_yt.gif" />'; } else { $row['imgtitle'] = $row['title']; } $row['title'] = $row['title']; $row['attrname'] = getAttrname($row['attrid']); $row['attrnamearr'] = getAttrname($row['attrid'], true); $row['destname'] = Helper_Archive::getBelongDestName($row['kindlist']); //所属目的地 $row['destid'] = array_remove_value($row['kindlist']); $row['pinyin'] = Helper_Archive::getDestPinyin($row['destid']); //最新评论及评论数量 $row['commentnum'] = Helper_Archive::getCommentNum($row['id'], 4); if ($type == 'pinlun') { $userinfo = $GLOBALS['User']->getInfoByMid($row['memberid']); $row['commentlitpic'] = getUploadFileUrl($userinfo['litpic']); $row['commentnickname'] = empty($userinfo['nickname']) ? '匿名' : $userinfo['nickname']; $row['commentid'] = $row['plid']; $row['commentcontent'] = $row['plcontent']; $row['commentaddtime'] = $row['pltime']; } //攻略首页读取评论 if ($type == 'pinlun') { $row['pinlun'] = getArticlePinLun($row['id']); } foreach ($ctp->CTags as $tagid => $ctag) { if ($ctag->GetName() == 'array') { $ctp->Assign($tagid, $row); } else { if (isset($row[$ctag->GetName()])) { $ctp->Assign($tagid, $row[$ctag->GetName()]); } } } $revalue .= $ctp->GetResult(); } return $revalue; }
function lib_getlinelist(&$ctag, &$refObj) { global $startcity; global $dsql; include SLINEDATA . "/webinfo.php"; $attlist = "row|8,flag|,type|top,sonid|,limit|0,"; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $webid = 0; $innertext = trim($ctag->GetInnertext()); $revalue = ''; $basefield = "a.aid,a.id,a.webid,a.title,a.seotitle,a.sellpoint,a.litpic,a.storeprice,a.price,a.linedate,a.features,a.transport,a.lineday,a.startcity,a.overcity,a.shownum,a.satisfyscore,a.bookcount,a.attrid,a.kindlist,a.color,a.iconlist"; if ($type == 'top' && empty($flag)) { return ''; } //如果调用二级栏目则必须在显示类里指定sonid $limit = !empty($limit) ? $limit : 0; if ($type == 'startcity') { $sql = "select {$basefield} from #@__line as a left join #@__kindorderlist as c on (a.id=c.aid) where a.ishidden=0 and c.typeid=1 and startcity='{$startcity}' and c.classid={$sonid} and FIND_IN_SET({$sonid},a.kindlist) {$orderby} limit {$limit},{$row}"; } if ($type == 'mdd') { if ($flag == 'hot') { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc'; } else { if ($flag == 'recommend') { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc'; } else { if ($flag == 'specical') { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc '; } else { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc'; } } } $sonid = isset($definekind) ? $definekind : $refObj->Fields['kindid']; //这里增加子站的判断 if ($GLOBALS['sys_child_webid'] != 0) { $dest_id = $GLOBALS['sys_child_webid']; } $sonid = $sonid ? $sonid : $dest_id; $shownum = isset($row) ? $row : $refObj->Fields['shownum']; $shownum = empty($shownum) ? 6 : $shownum; if (isset($sonid)) { $number = isset($refObj->Fields['shownumber']) ? $refObj->Fields['shownumber'] : $row; //如果模块设置了显示数量则使用. $sql = "select {$basefield},c.isjian,c.istejia,c.isding from #@__line as a left join #@__kindorderlist as c on (c.classid={$sonid} and a.id=c.aid and c.typeid=1) where a.ishidden=0 and FIND_IN_SET({$sonid},a.kindlist) {$orderby} limit {$limit},{$shownum}"; } else { return ''; } } else { if ($type == 'searchrec') { if ($GLOBALS['childid'] != 0) { $kchild = $GLOBALS['childid']; $sql = "select distinct {$basefield} from #@__line as a left join #@__kindorderlist as c on (c.classid={$kchild} and a.id=c.aid and c.typeid=1) where a.ishidden=0 and c.isjian=1 and FIND_IN_SET({$kchild},a.kindlist) order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc limit 0,4"; } else { $sql = "select {$basefield} a from #@__line where a.ishidden=0 and a.isjian=1 order by a.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } } else { if ($type == 'destsearchrec') { if ($GLOBALS['destid'] != 0) { $kchild = $GLOBALS['destid']; $sql = "select {$basefield} from #@__line as a left join #@__kindorderlist as c on (c.classid={$kchild} and a.id=c.aid and c.typeid=1) where a.ishidden=0 and FIND_IN_SET({$kchild},a.kindlist) {$orderby} limit 0,4"; } else { $sql = "select {$basefield} from #@__line a where a.ishidden=0 and a.isjian=1 order by a.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } } else { if ($type == 'top') { if ($flag == 'recommend') { $sql = "select {$basefield},b.isding,b.istejia,b.displayorder from #@__line as a left join #@__allorderlist b on (a.id=b.aid and b.typeid=1) where a.ishidden=0 order by case when b.displayorder is null then 9999 end, b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'specical') { $sql = "select {$basefield},b.isding,b.istejia,b.displayorder from #@__line as a left join #@__allorderlist b on (a.id=b.aid and b.typeid=1) where a.ishidden=0 order by b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'hot') { $sql = "select {$basefield} from #@__line a where a.ishidden=0 order by a.shownum desc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'attribute') { if (empty($attrid)) { $attrid = $refObj->Fields['attrid']; } $sql = "select {$basefield} from #@__line a where FIND_IN_SET('{$attrid}',a.attrid) and a.ishidden=0 order by a.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'relative') { $kindlist = $refObj->Fields['kindlist']; $maxkindid = array_remove_value($kindlist); //最后一级. $maxkindid = empty($maxkindid) ? $GLOBALS['dest_id'] : $maxkindid; $maxkindid = empty($maxkindid) ? 0 : $maxkindid; $where = " FIND_IN_SET({$maxkindid},a.kindlist) "; $sql = "select {$basefield} from #@__line a where {$where} and a.ishidden=0 order by a.shownum desc,a.modtime desc,a.addtime desc limit 0,{$row}"; } else { if ($flag == 'listexcept') { $sql = "select aid from #@__line where isjian=1 and a.ishidden=0 order by isjian desc,displayorder asc limit 0,5"; $dsql->Execute("list", $sql); $a = ""; while ($str = $dsql->GetArray("list")) { $a .= $str["aid"] . ","; } $a = substr($a, 0, -1); if (!$a == "") { $a = "and aid not in ({$a})"; } $sql = "select {$basefield} from #@__line a where {$a} order by a.shownum desc limit {$limit},{$row}"; } } } } } } } else { if ($type == 'theme') { $themeid = $refObj->Fields['themeid']; if (empty($themeid)) { return ''; } $sql = "select {$basefield} from #@__line a where a.ishidden=0 and FIND_IN_SET({$themeid},a.themelist) order by a.modtime desc,a.addtime desc limit 0,{$row}"; } else { if ($type = "day") { $dayid = $refObj->Fields['groupid']; if (empty($dayid)) { return ''; } $sql = "select {$basefield} from #@__line a where a.ishidden=0 and a.lineday={$dayid} order by a.modtime desc,a.addtime desc limit 0,{$row}"; } } } } } } $dsql->SetQuery($sql); $dsql->Execute(); $ctp = new STTagParse(); $ctp->SetNameSpace("field", "[", "]"); $ctp->LoadSource($innertext); $GLOBALS['autoindex'] = 0; $num = 0; while ($row = $dsql->GetArray()) { $GLOBALS['autoindex']++; $webroot = GetWebURLByWebid($row['webid']); $url = $webroot . "/lines/show_{$row['aid']}.html"; $row['url'] = $url; $row['bookurl'] = "{$webroot}/lines/booking_{$row['aid']}.html"; $startcity = getStartCityName($row['startcity']); $startcity = !empty($startcity) ? "[{$startcity}出发]" : ''; if (!empty($GLOBALS['cfg_startcity_open'])) { $row['title'] = "{$startcity}{$row['title']}"; } else { $row['title'] = "{$row['title']}"; } $row['startcity'] = $startcity; $row['color'] = !empty($row['color']) ? "color:{$row['color']}" : ''; $real = getLineRealPrice($row['aid'], $row['webid']); $row['lineprice'] = $real ? $real : $row['price']; $row['commentnum'] = Helper_Archive::getCommentNum($row['id'], 1); //评论次数 $row['sellnum'] = Helper_Archive::getSellNum($row['id'], 1); //销售数量 //$row['satisfyscore']=Helper_Archive::getSatisfyScore($row['id'],1); //满意度 //获取后台满意度拼接% $row['satisfyscore'] = !empty($row['satisfyscore']) ? $row['satisfyscore'] . "%" : ""; if (!empty($row['lineprice']) && !empty($row['storeprice'])) { $row['discount'] = abs((int) $row['storeprice'] - (int) $row['price']); } else { $row['discount'] = 0; } $row['price'] = empty($row['lineprice']) ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>¥</span><span class='rmb_2'>" . $row['lineprice'] . '</span>'; $row['price2'] = empty($row['lineprice']) ? '<span>电询</span>' : '<span>¥</span><strong>' . $row['lineprice'] . '</strong><i>起</i>'; $row['agentprice'] = intval($row['storeprice']); $row['sellprice'] = empty($row['lineprice']) ? '0' : $row['lineprice']; //没有HTML标识的价格 $row['storeprice'] = !empty($row['storeprice']) ? "<span class=\"rmb_2\">¥</span>" . $row['storeprice'] : "<span class=\"rmb_1\">电询</span>"; $row['lineseries'] = getSeries($row['id'], '01'); //$row['lit240']=getPicByName($row['linepic'],'lit240'); //$row['lit160']=getPicByName($row['linepic'],'lit160'); $row['litpic'] = getUploadFileUrl($row['litpic']); $row['lit240'] = getUploadFileUrl(str_replace('litimg', 'lit240', $row['litpic'])); $row['lit160'] = getUploadFileUrl(str_replace('litimg', 'lit160', $row['litpic'])); $row['jifentprice'] = !empty($row['jifentprice']) ? '¥' . $row['jifentprice'] : '无'; $row['startdate'] = getLine_StartDate($row); //团期 $row['jifentprice'] = MLine::getMinTprice($row['id']); $row['list'] = $num; foreach ($ctp->CTags as $tagid => $ctag) { if ($ctag->GetName() == 'array') { $ctp->Assign($tagid, $row); } else { $ctp->Assign($tagid, $row[$ctag->GetName()]); } } $revalue .= $ctp->GetResult(); } return $revalue; }
/** * 调用酒店数据标签 * * @version $Id: gethotellist.lib.php netman * @package Stourweb.Taglib * @copyright Copyright (c) 2007 - 2011, Stourweb, Inc. * @link http://www.stourweb.com */ function lib_gethotellist(&$ctag, &$refObj) { global $dsql; $attlist = "row|8,flag|,type|top,sonid|,limit|0"; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $innertext = trim($ctag->GetInnertext()); $revalue = ''; $basefield = 'a.id,a.sellpoint,a.aid,a.kindlist,a.title,a.address,a.litpic,a.ishidden,a.hotelrankid,a.webid,a.hotelrankid as hotelrankids,a.shownum,a.iconlist'; if ($type == 'top' && empty($flag)) { return ''; } //如果调用二级栏目则必须在显示类里指定sonid $limit = !empty($limit) ? $limit : 0; //加目的地页面显示条件 $destwhere = isset($refObj->Fields['kindid']) ? "and FIND_IN_SET({$refObj->Fields['kindid']},a.kindlist) " : ''; //用于聚合页面 if ($type == 'mdd') { $sonid = $refObj->Fields['kindid']; if ($GLOBALS['sys_child_webid'] != 0) { $dest_id = $GLOBALS['sys_child_webid']; //当前级目的地id. } $sonid = $sonid ? $sonid : $dest_id; if (!isset($sonid)) { return ''; } if ($flag == 'hot') { $orderby = 'order by case when b.displayorder is null then 9999 end,b.displayorder asc'; } else { if ($flag == 'recommend') { $orderby = 'order by case when b.displayorder is null then 9999 end,b.displayorder asc'; } else { if ($flag == 'specical') { $orderby = 'case when b.displayorder is null then 9999 end,b.displayorder asc'; } else { $orderby = 'order by case when b.displayorder is null then 9999 end,b.displayorder asc'; } } } $orderby .= ",a.modtime desc,a.addtime desc"; $where = "FIND_IN_SET({$sonid},a.kindlist)"; $sql = "select {$basefield},b.isding,b.isjian,b.istejia from #@__hotel a left join #@__kindorderlist as b on (a.id=b.aid and b.classid='{$sonid}' and b.typeid='2') where " . $where . " and (a.ishidden='0' or a.ishidden is null){$orderby} limit {$limit},{$row}"; } else { if ($type == 'rank') { if (isset($refObj->Fields['sonid'])) { $sonid = $refObj->Fields['sonid']; $sql = "select a.*,b.hotelrank from #@__hotel a left join #@__hotel_rank b on a.hotelrankid=b.aid where a.webid=0 and a.hotelrankid={$sonid} and a.ishidden='0' order by a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { return ''; } } else { if ($type == 'rankhot') { $sql = "select a.*,b.hotelrank from #@__hotel a left join #@__hotel_rank b on a.hotelrankid=b.aid where a.ishidden='0' order by a.shownum desc limit {$limit},{$row}"; } else { if ($type == 'theme') { $themeid = $refObj->Fields['themeid']; if (empty($themeid)) { return ''; } $sql = "select a.*,b.hotelrank,a.price as price from #@__hotel a left join #@__hotel_rank b on (a.hotelrankid=b.aid and a.webid=b.webid) where a.ishidden='0' and FIND_IN_SET({$themeid},a.themelist) order by a.modtime desc,a.addtime desc,a.shownum desc limit {$limit},{$row}"; } else { if ($type == 'top') { if ($flag == 'recommend') { $sql = "select {$basefield},b.displayorder,b.isding,b.isjian,b.istejia,a.ishidden,a.price from #@__hotel a left join #@__allorderlist b on(a.id=b.aid and b.typeid=2) where a.ishidden='0' order by case when b.displayorder is null then 9999 end,b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'special') { $sql = "select {$basefield},b.displayorder,b.isding,b.isjian,b.istejia as istehui,a.ishidden from #@__hotel a left join #@__allorderlist b on(a.id=b.aid and b.typeid=2) order by case when b.displayorder is null then 9999 end,b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'hot') { $sql = "select a.*,b.hotelrank,a.price as price from #@__hotel a left join #@__hotel_rank b on (a.hotelrankid=b.aid and a.webid=b.webid) where a.ishidden='0' group by a.title order by a.shownum desc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'relative') { $kindlist = $refObj->Fields['kindlist']; $maxkindid = array_remove_value($kindlist); //最后一级. $maxkindid = empty($maxkindid) ? $GLOBALS['dest_id'] : $maxkindid; $maxkindid = empty($maxkindid) ? 0 : $maxkindid; $where = " FIND_IN_SET({$maxkindid},a.kindlist) "; //排序顺序:置顶+tag关联》排序+ tag关联》最新更新+tag关联 $sql = "select a.*,b.hotelrank from #@__hotel a left join #@__hotel_rank b on (a.hotelrankid=b.aid and a.webid=b.webid) where a.ishidden='0' and {$where} order by a.modtime desc,a.addtime desc limit {$limit},{$row} "; } else { return ''; } } } } } } } } } $dsql->SetQuery($sql); $dsql->Execute(); $ctp = new STTagParse(); $ctp->SetNameSpace("field", "[", "]"); $ctp->LoadSource($innertext); $GLOBALS['autoindex'] = 0; while ($row = $dsql->GetArray()) { $GLOBALS['autoindex']++; $urlname = GetPinyin($row['kindname']); $flag != "channel" ? $webroot = GetWebURLByWebid($row['webid']) : ""; $row['url'] = GetWebURLByWebid($row['webid']) . "/hotels/show_{$row['aid']}.html"; $row['title'] = $row['title']; //$row['price']=empty($row['price'])?GetHotelMinPrice($row['webid'],$row['aid']):$row['price']; $row['kindname'] = getHotelKindCity2($row['kindlist']); $row['commentnum'] = Helper_Archive::getCommentNum($row['id'], 2); //评论次数 $row['sellnum'] = Helper_Archive::getSellNum($row['id'], 2) + $row['bookcount']; //销售数量 $row['satisfyscore'] = Helper_Archive::getSatisfyScore($row['id'], 2); //满意度 $row['listingprice'] = getHotelSellPrice2($row['id']); //挂牌价 $row['price'] = Helper_Archive::getHotelMinPrice($row['id']); $row['sellprice'] = empty($row['price']) ? '0' : $row['price']; $row['price2'] = empty($row['price']) ? '电询' : '¥' . $row['price'] . '起'; //样式2 $row['price3'] = empty($row['price']) ? '电询' : '<strong>¥' . $row['price'] . '</strong><span>起</span>'; $row['price4'] = empty($row['price']) ? '电询' : '<span>¥</span><strong>' . $row['price'] . '</strong><i>起</i>'; //目的地页面用 $row['price'] = empty($row['price']) ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>¥</span>" . $row['price'] . "<span>起</span>"; $litpic = getUploadFileUrl($row['litpic']); $row['lit240'] = getUploadFileUrl(str_replace('litimg', 'lit240', $row['litpic'])); $row['lit160'] = getUploadFileUrl(str_replace('litimg', 'lit160', $row['litpic'])); $row['litpic'] = $litpic; $row['typeurl'] = $GLOBALS['cfg_cmsurl'] . "/hotels/{$urlname}_{$row['id']}.html"; foreach ($ctp->CTags as $tagid => $ctag) { if ($ctag->GetName() == 'array') { $ctp->Assign($tagid, $row); } else { if (!empty($row[$ctag->GetName()])) { $ctp->Assign($tagid, $row[$ctag->GetName()]); } else { $ctp->Assign($tagid, ''); } } } $revalue .= $ctp->GetResult(); } return $revalue; }
function getArticleNewComment($articleid) { global $dsql; $newcomment = $dsql->GetOne("select * from #@__comment where typeid=4 and articleid={$articleid} and pid=0 order by addtime desc"); $userinfo = $GLOBALS['User']->getInfoByMid($newcomment['memberid']); if (empty($newcomment)) { return ''; } //最新评论及评论数量 $row['commentnum'] = Helper_Archive::getCommentNum($row['id'], 4); $row['commentlitpic'] = getUploadFileUrl($userinfo['litpic']); $row['commentnickname'] = empty($userinfo['nick']) ? '匿名' : $userinfo['nickname']; $row['commentid'] = $newcomment['id']; $row['commentcontent'] = $newcomment['content']; $row['commentaddtime'] = $newcomment['addtime']; return $row; }