Example #1
0
function lib_getcarbygroup(&$ctag, &$refObj)
{
    global $dsql, $sys_webid;
    $attlist = "row|8,flag|0,limit|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = $ctag->GetInnerText();
    $dtp2 = new STTagParse();
    $dtp2->SetNameSpace('field', '[', ']');
    $dtp2->LoadSource($innertext);
    //加目的地页面显示条件
    if ($flag == 'bystyle') {
        $styleid = $refObj->Fields['styleid'];
        $sqlstr = "select * from sline_car where carkindid='{$styleid}' limit {$limit},{$row}";
    }
    if (empty($sqlstr)) {
        return '';
    }
    $dsql->SetQuery($sqlstr);
    $dsql->Execute();
    $totalRow = $dsql->GetTotalRow();
    $likeType = '';
    $GLOBALS['autoindex'] = 0;
    //??
    for ($i = 0; $i < $totalRow; $i++) {
        $GLOBALS['autoindex']++;
        if ($tablerow = $dsql->GetArray()) {
            $url = GetWebURLByWebid($tablerow['webid']);
            $tablerow['url'] = $url . "/cars/show_{$tablerow['aid']}.html";
            $tablerow['title'] = $tablerow['title'];
            $tablerow['lit240'] = getUploadFileUrl(str_replace('litimg', 'lit240', $tablerow['litpic']));
            $tablerow['lit160'] = getUploadFileUrl(str_replace('litimg', 'lit160', $tablerow['litpic']));
            $tablerow['litpic'] = getUploadFileUrl($tablerow['litpic']);
            $real = getCarNewRealPrice($tablerow['aid'], $tablerow['webid']);
            $tablerow['minprice'] = $real ? $real : $tablerow['minprice'];
            $tablerow['sellprice'] = $real ? $real : 0;
            $tablerow['price'] = empty($tablerow['minprice']) ? '电询' : $tablerow['minprice'];
            $tablerow['price2'] = empty($tablerow['minprice']) ? '电询' : '<span>&yen;</span><strong>' . $tablerow['minprice'] . '</strong><i>起</i>';
            //目的地页面用
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                }
            }
            $likeType .= $dtp2->GetResult();
        }
    }
    //Loop for $i
    $dsql->FreeResult();
    //print_r($likeType);
    return $likeType;
}
Example #2
0
function lib_getarctaglist(&$ctag, &$refObj)
{
    global $dsql, $sys_webid;
    $attlist = "row|8";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $tagword = isset($refObj->Fields['tagword']) ? $refObj->Fields['tagword'] : '';
    if ($tagword == '') {
        return '';
    }
    $tagword = RemoveEmpty(explode(",", $tagword));
    $i = 1;
    $where = '';
    foreach ($tagword as $key => $value) {
        if ($i == 1) {
            $where .= "tagword like '%{$value}%'";
        } else {
            $where .= " or tagword like '%{$value}%'";
        }
        $i++;
    }
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $sql = "select aid,title,shownum,attrid,webid from #@__article  where {$where} limit 0,{$row}";
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        $weburl = GetWebURLByWebid($row['webid']);
        if ($row['webid'] == 0) {
            $row['url'] = $GLOBALS['cfg_cmsurl'] . "/raiders/show_{$row['aid']}.html";
            $row['litpic'] = !empty($row['litpic']) ? $GLOBALS['cfg_cmsurl'] . $row['litpic'] : $GLOBALS['cfg_cmsurl'] . "/templets/default/images/pic_tem.gif";
        } else {
            $row['url'] = GetWebURLByWebid($row['webid']) . "/raider/show_{$row['aid']}.html";
            $row['litpic'] = !empty($row['litpic']) ? $weburl . $row['litpic'] : $GLOBALS['cfg_cmsurl'] . "/templets/default/images/pic_tem.gif";
        }
        $row['title'] = $row['title'];
        $row['attrname'] = Getarctype($row['attrid']);
        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()]);
                }
            }
        }
        $revalue .= $ctp->GetResult();
        $GLOBALS['autoindex']++;
    }
    return $revalue;
}
Example #3
0
function getLitpic($imgurl, $webid, $row)
{
    $litpic = '';
    $linkurl = getUrl($row['aid'], $row['webid'], $row['tablename'], $row['tag']);
    if (!empty($imgurl)) {
        $url = GetWebURLByWebid($webid);
        $litpic = $url . $imgurl;
        $litpic = " <li class=\"search_img_1\"><a href=\"{$linkurl}\" target=\"blank\"><img src=\"{$litpic}\" width=\"112\" height=\"84\" /></a></li>";
    }
    return $litpic;
}
Example #4
0
function getLitpic($kindid)
{
    global $dsql;
    $sql = "select frontpic,webid from #@__spot where FIND_IN_SET({$kindid},kindlist) and frontpic!='' order by boutique desc,isjian desc,addtime desc";
    $row = $dsql->GetOne($sql);
    if (is_array($row)) {
        $litpic = GetWebURLByWebid($row['webid']) . $row['frontpic'];
    } else {
        $litpic = $GLOBALS['cfg_cmsurl'] . "/templets/default/images/pic_tem.gif";
    }
    return $litpic;
}
Example #5
0
/**
 * 调用文章显示数据标签
 *
 * @version        $Id: getarclist.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getarcbyattr(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,attrid|,offset|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    //
    $where = " find_in_set({$attrid},attrid)" . lib_getsubattrid($attrid);
    $sql = "select a.* from #@__article a where {$where} order by a.isding desc,a.displayorder asc,a.addtime desc limit {$offset},{$row}";
    $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['commnum']=GetArcCommNum($row['webid'],$row['aid']);
        if ($row['webid'] == 0) {
            $row['url'] = $GLOBALS['cfg_cmsurl'] . "/raiders/show_{$row['aid']}.html";
        } else {
            $row['url'] = GetWebURLByWebid($row['webid']) . "/raider/show_{$row['aid']}.html";
        }
        $row['lit240'] = getPicByName($row['litpic'], 'lit240');
        $row['lit160'] = getPicByName($row['litpic'], 'lit160');
        $row['litpic'] = !empty($row['litpic']) ? $GLOBALS['cfg_cmsurl'] . $row['litpic'] : $GLOBALS['cfg_cmsurl'] . "/templets/" . $GLOBALS['cfg_df_style'] . "/images/" . $GLOBALS['cfg_df_img'];
        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'] = getAttrname2($row['attrid']);
        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;
}
Example #6
0
function getChildHtml($kindid)
{
    global $dsql;
    $orderby = ' order by c.isjian desc,case when c.displayorder is null then 9999 end,c.displayorder asc';
    $where = "where  FIND_IN_SET({$kindid},a.kindlist) {$orderby}  limit 0,4";
    $sql = "select a.* from #@__spot as a left join #@__kindorderlist as c on (c.classid={$kindid} and a.id=c.aid and c.typeid=5)  {$where}";
    $result = $dsql->getAll($sql);
    foreach ($result as $re) {
        $webroot = GetWebURLByWebid($re['webid']);
        $litpic = getUploadFileUrl($re['litpic']);
        $str .= '<a href="' . $webroot . '/spots/show_' . $re['aid'] . '.html"><img src="' . $litpic . '" alt="' . $re['title'] . '" width="140" height="90" /></a>';
    }
    return $str;
}
Example #7
0
function GetIncFeedBack($postid, $typeid, $name, $webid)
{
    global $dsql;
    $weburl = GetWebURLByWebid($webid);
    //获取站点url
    if ($GLOBALS['cfg_py_open'] == 0) {
        return '';
    }
    $sql = "select * from #@__allcomments where webid=0 and postid={$postid} and typeid='{$typeid}' order by replydate desc limit 0,5 ";
    //查询单个
    $res = $dsql->getAll($sql);
    $str = "<div id=\"pinglun\">";
    $str .= "<ul id=\"pllist\">";
    foreach ($res as $row) {
        $str .= "<li class=\"plyk\"><span class=\"pl_time\">评论时间:" . date("Y-m-d", $row['replydate']) . "</span><span class=\"pl_name\">网友" . $row['nickname'] . "评论:</span></li><li class=\"plnr\"><p>" . $row['replycontent'] . "</p></li>";
    }
    $str .= "</ul>";
    $str .= "<div id=\"havequestion\"><a href=\"/questions/#postion\" target=\"_blank\">" . "<img src=\"" . $GLOBALS['cfg_templets_skin'] . "/images/question2_btn.gif\" border=\"0\" /></a></div><ul class=\"plfb\">" . "<form action=\"" . $weburl . "/feedback.php?dopost=post\" method=\"post\">" . "<li class=\"clear fbts\"><span id=\"#postion\">我来说两句</span></li>" . "<li class=\"textbox fl\">" . "<input name=\"yinyong\" type=\"hidden\" id=\"yinyong\" value=\"0\" />" . "<textarea name=\"leaveinfo\" cols=\"80\" rows=\"5\" id=\"leaveinfo\"></textarea>" . "<input type=\"hidden\" name=\"aid\" value=\"" . $postid . "\">" . "<input type=\"hidden\" name=\"typeid\" value=\"" . $typeid . "\">" . "<input type=\"hidden\" name=\"posttitle\" value=\"" . $name . "\">" . "</li><li class=\"plxx\"><span class=\"tjpl\"><input name=\"tj\" type=\"image\" src=\"" . $GLOBALS['cfg_templets_skin'] . "/images/pinglun.gif\" onclick=\"return checkpl()\" /></span>匿名&nbsp;<input name=\"noname\" type=\"checkbox\" id=\"ishidden\" value=\"1\" /><span class=\"nicheng\">昵称<input name=\"leavename\" type=\"text\" id=\"leavename\" size=\"15\" maxlength=\"20\" /></span><span class=\"yzm\"><img src= \"" . $weburl . "/include/vdimgck.php\" id=\"checkcode\" style=\"cursor:pointer\" onclick=\"this.src=this.src+'?'\" title=\"点击我更换图片\" alt=\"点击我更换图片\" /><span>=验证码<input type=\"text\" name=\"checkcode\" size=\"4\"  style=\"text-transform:uppercase;\"/></span></span></li></form></ul></div>";
    return $str;
}
Example #8
0
function GetProductInfo($typeid, $productid)
{
    global $dsql;
    $tablearr = array('1' => '#@__line', '2' => '#@__hotel', '3' => '#@__car', '4' => '#@__article', '5' => '#@__spot', '6' => '#@__photo', '13' => '#@__tuan');
    $table = $tablearr[$typeid];
    if (empty($table)) {
        return null;
    }
    $row = $dsql->GetOne("select * from {$table} where id={$productid}");
    if (!empty($row)) {
        $weburl = GetWebURLByWebid($row['webid']);
        switch ($typeid) {
            case 1:
                $row['title'] = $row['title'];
                $row['url'] = $weburl . "/lines/show_{$row['aid']}.html";
                break;
            case 2:
                $row['title'] = $row['title'];
                $row['url'] = $weburl . "/hotels/show_{$row['aid']}.html";
                break;
            case 3:
                $row['title'] = $row['title'];
                $row['url'] = $weburl . "/cars/show_{$row['aid']}.html";
                break;
            case 4:
                $row['title'] = $row['title'];
                $row['url'] = $weburl . "/raiders/show_{$row['aid']}.html";
                break;
            case 5:
                $row['title'] = $row['title'];
                $row['url'] = $weburl . "/spots/show_{$row['aid']}.html";
                break;
            case 13:
                $row['title'] = $row['title'];
                $row['url'] = $weburl . "/tuan/show_{$row['aid']}.html";
                break;
        }
    }
    return $row;
}
Example #9
0
function getProductName($id, $typeid, $productname = '')
{
    global $dsql;
    $channeltable = array("1" => "#@__line", "2" => "#@__hotel", "3" => "#@__car", "4" => "#@__article", "5" => "#@__spot", "6" => "#@__photo", "7" => "#@__theme", "8" => "#@__visa", "9" => "#@__ticket", "10" => "#@__leave", "11" => "#@__advertise", "12" => "#@__allcomments", "13" => "#@__tuan");
    $tablename = $channeltable[$typeid];
    $fields = array('1' => array('field' => 'title', 'link' => 'lines'), '2' => array('field' => 'title', 'link' => 'hotels'), '3' => array('field' => 'title', 'link' => 'cars'), '4' => array('field' => 'title', 'link' => 'article'), '5' => array('field' => 'title', 'link' => 'spots'), '8' => array('field' => 'title', 'link' => 'visa'), '13' => array('field' => 'title', 'link' => 'tuan'));
    $field = $fields[$typeid]['field'];
    $link = $fields[$typeid]['link'];
    //如果为空,则是通用模块
    if (empty($field)) {
        $moduleinfo = Helper_Archive::getModuleInfo($typeid);
        $field = 'title';
        $link = $moduleinfo['pinyin'];
        $tablename = 'sline_model_archive';
    }
    $sql = "select aid,{$field} as title,webid from {$tablename} where id='{$id}'";
    $row = $dsql->GetOne($sql);
    $title = !empty($productname) ? $productname : $row['title'];
    $weburl = GetWebURLByWebid($row['webid']);
    $out = "<a href=\"{$weburl}/{$link}/show_{$row['aid']}.html\" target=\"_blank\">{$title}</a>";
    return $out;
}
Example #10
0
/**
 * 热搜词调用
 *
 * @version        $Id: getsearchkey.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getsearchkey(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $sql = "select keyword as title from #@__search_keyword where isopen = 1 order by keynumber desc limit 0,{$row}";
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $url = GetWebURLByWebid(0);
        //这里获取主域名
        $row['url'] = $url . "/cloudsearch.php?keyword={$row['title']}";
        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;
}
Example #11
0
require_once dirname(__FILE__) . "/spot.func.php";
$typeid = 5;
//景点栏目
require_once SLINEINC . "/view.class.php";
$pv = new View($typeid);
if (!isset($aid)) {
    exit('Wrong Id');
}
$aid = RemoveXSS($aid);
//防止跨站攻击
updateVisit($aid, $typeid);
$row = getSpotInfo($aid);
if (empty($row['id'])) {
    head404();
}
$webroot = GetWebURLByWebid($row['webid']);
//查询所属景点分类
$row['seotitle'] = !empty($row['seotitle']) ? $row['seotitle'] : $row['title'];
$row['seodescription'] = !empty($row['description']) ? "<meta name=\"description\" content=\"" . $row['description'] . "\"/>" : "";
$row['seokeyword'] = !empty($row['keyword']) ? "<meta name=\"keywords\" content=\"" . $row['keyword'] . "\"/>" : "";
$row['litpic'] = getUploadFileUrl($row['litpic']);
$row['level'] = getSpotAttr($row['attrid'], '等级');
$row['theme'] = getSpotAttr($row['attrid']);
$row['price'] = !empty($row['price']) ? "¥{$row['price']}" : '电询';
$row['commenthomeid'] = $row['id'];
$row['pkname'] = get_par_value($row['kindlist'], $typeid);
$row['typename'] = GetTypeName($typeid);
foreach ($row as $k => $v) {
    $pv->Fields[$k] = $v;
}
//支付方式
Example #12
0
 public static function getLineInfo($lineid)
 {
     global $dsql;
     $out = '';
     if (!empty($lineid) && $lineid != 'null') {
         $sql = "select * from sline_line where id='{$lineid}'";
         $row = $dsql->GetOne($sql);
         $webroot = GetWebURLByWebid($row['webid']);
         $url = $webroot . '/lines/show_' . $row['aid'] . '.html';
         $litpic = getUploadFileUrl($row['litpic']);
         $price = getLineRealPrice($row['aid'], $row['webid']);
         $out = '';
         $out .= '<dl>';
         $out .= '<dt><a class="fl" href="' . $url . '"><img class="fl" src="' . $litpic . '"  width="174" height="129" /></a></dt>';
         $out .= '<dd>';
         $out .= '<span class="tit"><a href="' . $url . '" target="_blank">' . $row['title'] . '</a></span>';
         $out .= '<span class="txt">' . $row['sellpoint'] . '</span>';
         $out .= '<span class="price">参考价:<em>¥' . $price . '</em>/人</span>';
         $out .= '<span class="more-btn"><a href="' . $url . '" target="_blank">查看详情</a></span>';
         $out .= '</dd>';
         $out .= '</dl>';
     }
     return $out;
 }
Example #13
0
/**
 * 车务功能函数
 *
 * @param     int  $tagword  tag词
 * @return    string
 */
function GetDataHandle($type, $tablerow, $dtp2)
{
    //echo $type;
    $likeType = "";
    $webid = !empty($tablerow['webid']) ? $tablerow['webid'] : 0;
    $weburl = GetWebURLByWebid($webid);
    $tablerow['smallcarpic'] = GetPicture($tablerow['smallcarpic']);
    $tablerow['carpic'] = GetPicture($tablerow['carpic']);
    if ($type != "priceforcar") {
        //$url=($tablerow['webid']==0) ? "/cars/show_{$tablerow['aid']}.html" : "/cars/brief_{$tablerow['aid']}_{$tablerow['webid']}.html";
        $url = "/cars/show_{$tablerow['aid']}.html";
    } else {
        $url = $tablerow['webid'] == 0 ? "/lines/show_{$tablerow['aid']}.html" : "/lines/brief_{$tablerow['aid']}_{$tablerow['webid']}.html";
    }
    switch ($type) {
        case 'hot':
            //热门?暂时以istop排序?
            $tablerow['url'] = $GLOBALS['cfg_cmsurl'] . $url;
            $tablerow['title'] = $tablerow['title'];
            $tablerow['price'] = empty($tablerow['nowprice']) || $tablerow['nowprice'] == 0 ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>¥</span>" . $tablerow['nowprice'] . "<span class=\"qi_1\">起</span>";
            if (!empty($tablerow['smallcarpic'])) {
                $tablerow['litpic'] = $weburl . $tablerow['smallcarpic'];
            }
            if ($tablerow['litpic'] == "") {
                $tablerow['litpic'] = $GLOBALS['cfg_cmsurl'] . "/templets/default/images/pic_tem.gif";
            }
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                }
            }
            $likeType = $dtp2->GetResult();
            break;
        case 'recommend':
            //
            if (!empty($tablerow['smallcarpic'])) {
                $tablerow['litpic'] = $weburl . $tablerow['smallcarpic'];
            }
            if ($tablerow['litpic'] == "") {
                $tablerow['litpic'] = $GLOBALS['cfg_cmsurl'] . "/templets/default/images/pic_tem.gif";
            }
            $tablerow['url'] = $GLOBALS['cfg_cmsurl'] . $url;
            $tablerow['title'] = $tablerow['title'];
            $tablerow['price'] = empty($tablerow['nowprice']) || $tablerow['nowprice'] == 0 ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>¥</span>" . $tablerow['nowprice'] . "<span class=\"qi_1\">起</span>";
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                }
            }
            $likeType = $dtp2->GetResult();
            break;
        case 'stylelist':
            $tablerow['title'] = $tablerow['kindname'];
            $tablerow['typename'] = $tablerow['kindname'];
            $tablerow['price'] = empty($tablerow['nowprice']) || $tablerow['nowprice'] == 0 ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>¥</span>" . $tablerow['nowprice'] . "<span class=\"qi_1\">起</span>";
            $tablerow['url'] = $GLOBALS['cfg_cmsurl'] . "/cars/search_" . $tablerow['aid'] . '_0_0.html';
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    //if(isset($tablerow[$ctag->GetName()])) $dtp2->Assign($tagid,$tablerow[$ctag->GetName()]);
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        //if(isset($tablerow[$ctag->GetName()])) $dtp2->Assign($tagid,$tablerow[$ctag->GetName()]);
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                    //echo $tagid.$row[$ctag->GetName()].'---';
                }
            }
            $likeType = $dtp2->GetResult();
            break;
        case 'brandlist':
            //$tablerow['typelink'] = $GLOBALS['cfg_cmsurl'].$tablerow['url'];
            $tablerow['title'] = $tablerow['kindname'];
            $tablerow['url'] = $GLOBALS['cfg_cmsurl'] . "/cars/search_0_" . $tablerow['aid'] . '_0.html';
            $tablerow['typename'] = $tablerow['kindname'];
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                }
            }
            $likeType = $dtp2->GetResult();
            break;
        case 'listofkind':
            $tablerow['title'] = $tablerow['title'];
            $tablerow['price'] = empty($tablerow['nowprice']) || $tablerow['nowprice'] == 0 ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>¥</span>" . $tablerow['nowprice'] . "<span class=\"qi_1\">起</span>";
            $tablerow['url'] = $GLOBALS['cfg_cmsurl'] . $url;
            if (!empty($tablerow['smallcarpic'])) {
                $tablerow['litpic'] = $weburl . $tablerow['smallcarpic'];
            }
            if ($tablerow['litpic'] == "") {
                $tablerow['litpic'] = $GLOBALS['cfg_cmsurl'] . "/templets/default/images/pic_tem.gif";
            }
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                }
            }
            $likeType = $dtp2->GetResult();
            break;
        case 'right_hot':
            $tablerow['title'] = $tablerow['title'];
            $tablerow['url'] = $GLOBALS['cfg_cmsurl'] . $url;
            $tablerow['modtime'] = date('Y-m-d H:i:s', $tablerow['modtime']);
            if (!empty($tablerow['smallcarpic'])) {
                $tablerow['litpic'] = $weburl . $tablerow['smallcarpic'];
            }
            if ($tablerow['litpic'] == "") {
                $tablerow['litpic'] = $GLOBALS['cfg_cmsurl'] . "/templets/default/images/pic_tem.gif";
            }
            $tablerow['price'] = empty($tablerow['nowprice']) || $tablerow['nowprice'] == 0 ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>¥</span>" . $tablerow['nowprice'] . "<span class=\"qi_1\">起</span>";
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                }
            }
            $likeType = $dtp2->GetResult();
            break;
        case "pricerange":
            if ($tablerow['min'] != '' && $tablerow['max'] != '') {
                $tablerow['typename'] = $tablerow['min'] . '元~' . $tablerow['max'] . '元';
            }
            if ($tablerow['min'] == '') {
                $tablerow['typename'] = $tablerow['max'] . '元以下';
                $tablerow['min'] = 0;
            }
            if ($tablerow['max'] == '') {
                $tablerow['typename'] = $tablerow['min'] . '元以上';
                $tablerow['max'] = 99999999;
            }
            $tablerow['title'] = $tablerow['typename'];
            $tablerow['url'] = $GLOBALS['cfg_cmsurl'] . "/cars/search_0_0_" . $tablerow['aid'] . '.html';
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                }
            }
            $likeType = $dtp2->GetResult();
            break;
        case 'priceforline':
            $tablerow['title'] = $tablerow['title'];
            $tablerow['url'] = $weburl . $url;
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                }
            }
            $likeType = $dtp2->GetResult();
            break;
        case 'priceforcar':
            $tablerow['title'] = $tablerow['title'];
            $tablerow['url'] = $weburl . $url;
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                }
            }
            $likeType = $dtp2->GetResult();
            break;
    }
    //echo $likeType;
    return $likeType;
}
Example #14
0
function getSearchUrl($row)
{
    $typeid = $row['typeid'];
    $webid = $row['webid'];
    $aid = $row['aid'];
    $headimgid = $row['headimgid'];
    if ($typeid == 1) {
        $typename = "lines";
    } else {
        if ($typeid == 2) {
            $typename = "hotels";
        } else {
            if ($typeid == 3) {
                $typename = "cars";
            } else {
                if ($typeid == 4 && $webid == 0) {
                    $typename = "raiders";
                } else {
                    if ($typeid == 4 && $webid != 0) {
                        $typename = "raider";
                    } else {
                        if ($typeid == 5) {
                            $typename = "spots";
                        } else {
                            if ($typeid == 6) {
                                $typename = "photos";
                            } else {
                                if ($typeid == 8) {
                                    $typename = "visa";
                                } else {
                                    if ($typeid == 13) {
                                        $typename = "tuan";
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    $weburl = GetWebURLByWebid($webid);
    $headimgid = $headimgid ? "_{$headimgid}" : '';
    $url = $weburl . "/" . $typename . "/show_{$aid}{$headimgid}.html";
    return $url;
}
Example #15
0
/**
 * 调用相册显示数据标签
 *
 * @version        $Id: getphotolist.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getphotolist(&$ctag, &$refObj)
{
    global $dsql, $cfg_indexphoto;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|10,flag|,type|top,limit|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $basefield = 'a.aid,a.title,a.seotitle,a.litpic,a.content,a.title as littitle,a.alt,a.author,a.shownum,a.webid,a.headimgid';
    $revalue = '';
    //加目的地页面显示条件
    $destwhere = isset($refObj->Fields['kindid']) ? "and FIND_IN_SET({$refObj->Fields['kindid']},kindlist) " : '';
    //用于聚合页面
    if ($type == 'mdd') {
        if (isset($refObj->Fields['kindid'])) {
            $sonid = $refObj->Fields['kindid'];
            $number = isset($refObj->Fields['shownumber']) ? $refObj->Fields['shownumber'] : $row;
            //如果模块设置了显示数量则使用.
            $sql = "select {$basefield} from #@__photo as a left join #@__kindorderlist as c on (c.classid={$sonid} and a.id=c.aid and c.typeid=6) where  FIND_IN_SET({$sonid},a.kindlist) order by c.isding desc,case when c.displayorder is null then 9999 end,c.displayorder asc,a.addtime desc limit {$limit},{$number}";
        } else {
            return '';
        }
    } else {
        if ($type == 'sonhot') {
            if (isset($refObj->Fields['kindid'])) {
                $sonid = $refObj->Fields['kindid'];
                $sql = "select {$basefield} from #@__photo a where FIND_IN_SET({$sonid},kindlist)  order by shownum desc limit {$limit},{$row}";
            } else {
                return '';
            }
        } else {
            if ($type == 'attr') {
                if (isset($attrid)) {
                    $sql = "select {$basefield} from #@__photo a where FIND_IN_SET({$attrid},attrid)  order by displayorder asc,shownum desc limit {$limit},{$row}";
                } else {
                    return '';
                }
            } else {
                if ($type == 'relative') {
                    $kindlist = $refObj->Fields['kindlist'];
                    $maxkindid = array_remove_value($kindlist);
                    //最后一级.
                    $where = " FIND_IN_SET({$maxkindid},kindlist) ";
                    $sql = "select {$basefield} from #@__photo a where {$where} order by modtime desc,addtime desc limit {$limit},{$row}";
                } else {
                    if ($type == 'sonj') {
                        if (isset($refObj->Fields['sonid'])) {
                            $sonid = $refObj->Fields['sonid'];
                            $sql = "select aid,title,seoname,headimg,content,title as littitle,alt,author,shownum,webid,headimgid from #@__photo  where webid!='' {$destwhere} and   photokind={$sonid} order by modtime desc,addtime desc limit {$limit},{$row}";
                        } else {
                            return '';
                        }
                    } else {
                        if ($flag == 'recommend') {
                            $sql = "select {$basefield} ,b.isjian,b.isding ,b.displayorder from #@__photo a left join #@__allorderlist b on(a.id=b.aid and b.typeid=6) 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 == 'isding') {
                                $sql = "select {$basefield} from #@__photo where webid={$sys_webid}  and isding=1 order by addtime desc limit {$limit},{$row}";
                            } else {
                                if ($flag == 'roll') {
                                    //首页相册显示方式
                                    if ($GLOBALS['cfg_indexphoto'] == "0") {
                                        $sql = "select {$basefield} from #@__photo where webid={$sys_webid} order by modtime desc,addtime desc";
                                    } else {
                                        if ($GLOBALS['cfg_indexphoto'] == "-1") {
                                            $sql = "select id,pictname as photoname,litpic as headimg,pid as aid  from #@__photo_picture where webid={$sys_webid} order by modtime desc";
                                        } else {
                                            $sql = "select id,pictname as photoname,litpic as headimg,pid as aid  from #@__photo_picture where webid={$sys_webid}  and pid={$GLOBALS['cfg_indexphoto']} order by modtime desc";
                                        }
                                    }
                                } 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']++;
        $weburl = GetWebURLByWebid($row['webid']);
        $row['url'] = $weburl . "/photos/show_{$row['aid']}.html";
        $row['title'] = !empty($row['seotitle']) ? $row['seotitle'] : $row['photoname'];
        $row['litpic'] = !empty($row['litpic']) ? $row['litpic'] : getDefaultImage();
        $row['lit240'] = getPicByName($row['litpic'], 'lit240');
        $row['lit160'] = getPicByName($row['litpic'], 'lit160');
        $row['alt'] = !empty($row['alt']) ? $row['alt'] : $row['photoname'];
        /*if($row['littitle']!="")
        		{
        		  $row['imgtitle']="title='".$row['littitle']."'";
        		}*/
        //$row['headimg']=!empty($row['headimg'])?$row['headimg']:"sdfsf";
        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()]);
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
Example #16
0
function lib_getcarlist(&$ctag, &$refObj)
{
    global $dsql, $sys_webid;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,limit|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = $ctag->GetInnerText();
    $dtp2 = new STTagParse();
    $dtp2->SetNameSpace('field', '[', ']');
    $dtp2->LoadSource($innertext);
    //加目的地页面显示条件
    $destwhere = isset($refObj->Fields['kindid']) ? "and FIND_IN_SET({$refObj->Fields['kindid']},a.kindlist) " : '';
    if ($type == 'mdd') {
        $pid = $refObj->Fields['kindid'];
        //这里增加子站的判断
        if ($GLOBALS['sys_child_webid'] != 0) {
            $dest_id = $GLOBALS['sys_child_webid'];
        }
        $pid = $pid ? $pid : $dest_id;
        $sqlstr = "select a.* from sline_car a left join sline_kindorderlist b on (a.id=b.aid and b.typeid=3) where find_in_set({$pid},a.kindlist) order by case when a.displayorder is null then 9999 end asc limit {$limit},{$row}";
    } else {
        if ($type == 'kind') {
            $kindid = $refObj->Fields['kindid'];
            $sqlstr = "select distinct a.id, a.*,b.minprice  from #@__car a left join(select min(price) as minprice,carid from #@__car_suit group by carid) as b on a.id=b.carid left join #@__kindorderlist as c on (a.id=c.aid  and c.typeid=3) where a.carkindid = {$kindid} and a.webid=0 group by a.title order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}";
        } else {
            if ($type == 'theme') {
                $themeid = $refObj->Fields['themeid'];
                if (empty($themeid)) {
                    return '';
                }
                $sqlstr = "select a.*,b.minprice,c.kindname as brand,d.kindname as kind   from #@__car a left join (select min(price) as minprice,carid from #@__car_suit group by carid) as b on a.id=b.carid left join #@__car_brand c on c.aid=a.carbrandid and a.webid=c.webid left join #@__car_kind d on d.aid=a.carkindid and a.webid=d.webid where a.ishidden=0 and a.webid=0 and FIND_IN_SET({$themeid},a.themelist) order by a.modtime desc,a.addtime desc limit {$limit},{$row}";
            } else {
                switch ($flag) {
                    case 'hot':
                        //热门?暂时以istop排序? 查询a结果可以优化
                    //热门?暂时以istop排序? 查询a结果可以优化
                    case 'recommend':
                        $sqlstr = "select a.* from #@__car a left join sline_allorderlist b on (a.id=b.aid and b.typeid=3) where a.ishidden=0 and a.webid='{$GLOBALS['sys_child_webid']}'  order by ifnull(b.displayorder,9999) asc, a.addtime desc,a.modtime desc limit {$limit},{$row}";
                        break;
                    case 'listofkind':
                        $pid = $refObj->Fields['sonid'];
                        $getmonth = GetMonthHandle();
                        $sqlstr = "select a.*,b.minprice   from #@__car a left join (select min(price) as minprice,carid from #@__car_suit group by carid) as b on a.id=b.carid  where FIND_IN_SET({$pid},kindlist) and a.webid=0 order by a.modtime desc,a.addtime desc limit {$limit},{$row}";
                        break;
                    case 'relative':
                        $tagword = isset($refObj->Fields['tagword']) ? $refObj->Fields['tagword'] : '';
                        //获取指定tagword
                        if ($tagword == '') {
                            return '';
                        }
                        $tagword = explode(",", $tagword);
                        $i = 1;
                        $where = '';
                        foreach ($tagword as $key => $value) {
                            if ($i == 1) {
                                $where .= "a.tagword like '%{$value}%'";
                            } else {
                                $where .= "or a.tagword like '%{$value}%'";
                            }
                            $i++;
                        }
                        $getmonth = GetMonthHandle();
                        //排序顺序:置顶+tag关联》排序+ tag关联》最新更新+tag关联
                        $sqlstr = "select a.*,b.minprice,c.kindname as brand,d.kindname as kind   from #@__car a left join (select min(price) as minprice,carid from #@__car_suit group by carid) as b on a.id=b.carid left join #@__car_brand c on c.aid=a.carbrandid and c.webid=a.webid left join #@__car_kind d on d.aid=a.carkindid and d.webid=a.webid  where  {$where} and a.ishidden=0 and a.webid=0  order by a.modtime desc,a.addtime desc limit {$limit},{$row}";
                        break;
                }
            }
        }
    }
    if (empty($sqlstr)) {
        return '';
    }
    $dsql->SetQuery($sqlstr);
    $dsql->Execute();
    $totalRow = $dsql->GetTotalRow();
    $likeType = '';
    $GLOBALS['autoindex'] = 0;
    //??
    for ($i = 0; $i < $totalRow; $i++) {
        $GLOBALS['autoindex']++;
        if ($tablerow = $dsql->GetArray()) {
            $url = GetWebURLByWebid($tablerow['webid']);
            $tablerow['url'] = $url . "/cars/show_{$tablerow['aid']}.html";
            $tablerow['title'] = $tablerow['title'];
            $tablerow['lit240'] = getUploadFileUrl(str_replace('litimg', 'lit240', $tablerow['litpic']));
            $tablerow['lit160'] = getUploadFileUrl(str_replace('litimg', 'lit160', $tablerow['litpic']));
            $tablerow['litpic'] = getUploadFileUrl($tablerow['litpic']);
            $real = getCarNewRealPrice($tablerow['aid'], $tablerow['webid']);
            $tablerow['minprice'] = $real ? $real : $tablerow['minprice'];
            $tablerow['sellprice'] = $real ? $real : 0;
            $tablerow['price'] = empty($tablerow['minprice']) ? '电询' : $tablerow['minprice'];
            $tablerow['price2'] = empty($tablerow['minprice']) ? '电询' : '<span>&yen;</span><strong>' . $tablerow['minprice'] . '</strong><i>起</i>';
            //目的地页面用
            if (is_array($dtp2->CTags)) {
                foreach ($dtp2->CTags as $tagid => $ctag) {
                    if ($ctag->GetName() == 'array') {
                        $dtp2->Assign($tagid, $tablerow);
                    } else {
                        $value = empty($tablerow[$ctag->GetName()]) ? '' : $tablerow[$ctag->GetName()];
                        $dtp2->Assign($tagid, $value);
                    }
                }
            }
            $likeType .= $dtp2->GetResult();
        }
    }
    //Loop for $i
    $dsql->FreeResult();
    //print_r($likeType);
    return $likeType;
}
Example #17
0
/**
 * 调用文章显示数据标签
 *
 * @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;
}
Example #18
0
 /**
  *  获得一个单列的文档列表
  *
  * @access    public
  * @param     int  $limitstart  限制开始  
  * @param     int  $row  行数 
  * @param     string  $typname  列表类型
  * @param     string  $innertext  底层模板
  * @return    string
  */
 function GetArcList($limitstart = 0, $row = 10, $typename = 'lines', $innertext = "")
 {
     if ($row == '') {
         $row = 10;
     }
     if ($limitstart == '') {
         $limitstart = 0;
     }
     $innertext = trim($innertext);
     if ($innertext == '') {
         return '';
     }
     $this->sql .= " limit {$limitstart},{$row}";
     $this->dsql->SetQuery($this->sql);
     $this->dsql->Execute('al');
     $artlist = '';
     $this->dtp2->LoadSource($innertext);
     $GLOBALS['autoindex'] = 0;
     for ($i = 0; $i < $row; $i++) {
         if ($row = $this->dsql->GetArray("al")) {
             $GLOBALS['autoindex']++;
             //处理一些特殊字段
             /* if($row['linepic'] == '')
                {
                    $row['linepic'] = $GLOBALS['cfg_templets_skin'].'/images/defaultpic.gif';
                }*/
             $webroot = GetWebURLByWebid($row['webid']);
             if ($row['webid'] == '0') {
                 $row['url'] = $webroot . "/{$typename}/show_{$row['aid']}.html";
             } else {
                 if ($this->TypeID == 4) {
                     $typename = 'raiders';
                 }
                 $row['url'] = $webroot . "/{$typename}/show_{$row['aid']}.html";
             }
             $row['lit240'] = getUploadFileUrl(str_replace('litimg', 'lit240', $row['litpic']));
             $row['lit160'] = getUploadFileUrl(str_replace('litimg', 'lit160', $row['litpic']));
             if (is_array($this->dtp2->CTags)) {
                 foreach ($this->dtp2->CTags as $k => $ctag) {
                     if ($ctag->GetName() == 'array') {
                         //传递整个数组,在runphp模式中有特殊作用
                         $this->dtp2->Assign($k, $row);
                     } else {
                         if (isset($row[$ctag->GetName()])) {
                             $this->dtp2->Assign($k, $row[$ctag->GetName()]);
                         } else {
                             $this->dtp2->Assign($k, '');
                         }
                     }
                 }
             }
             $artlist .= $this->dtp2->GetResult();
         }
         //if hasRow
     }
     //Loop Line
     //echo ($t3-$t2);
     $this->dsql->FreeResult('al');
     return $artlist;
 }
Example #19
0
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'>&yen;</span><span class='rmb_2'>" . $row['lineprice'] . '</span>';
        $row['price2'] = empty($row['lineprice']) ? '<span>电询</span>' : '<span>&yen;</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\">&yen;</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']) ? '&yen;' . $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;
}
Example #20
0
 public static function getProductName($id, $typeid)
 {
     $row = QueryOrder::getProductInfo($id, $typeid);
     $links = array('1' => array('link' => 'lines'), '2' => array('link' => 'hotels'), '3' => array('link' => 'cars'), '4' => array('link' => 'article'), '5' => array('link' => 'spots'), '8' => array('link' => 'visa'), '13' => array('link' => 'tuan'));
     if ($typeid > 13) {
         $module_info = Helper_Archive::getModuleInfo($typeid);
         $link = $module_info['pinyin'];
     } else {
         $link = $links[$typeid]['link'];
     }
     $weburl = GetWebURLByWebid($row['webid']);
     $out = "<a href=\"{$weburl}/{$link}/show_{$row['aid']}.html\" target=\"_blank\">{$row['title']}</a>";
     return $out;
 }
Example #21
0
/**
 * 调用帮助数据标签
 *
 * @version        $Id: gethleplist.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_gethelplist(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,type|top,sonid|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    if ($type == 'top' && empty($flag)) {
        return '';
    }
    $typeid = isset($refObj->Fields['typeid']) ? $refObj->Fields['typeid'] : 0;
    //如果网页没有指定typeid则获取所有网站帮助.
    //如果调用二级栏目则必须在显示类里指定sonid
    if ($type == 'son') {
        if (isset($refObj->Fields['sonid']) || !empty($sonid)) {
            $sonid = empty($refObj->Fields['sonid']) ? $sonid : $refObj->Fields['sonid'];
            $str = "and" . " (FIND_IN_SET({$typeid},type_id) or FIND_IN_SET('-1',type_id))";
            $sql = "select aid,title,addtime,modtime from #@__help where webid=0 and   kindid={$sonid} {$str} order by displayorder asc,addtime desc limit 0,{$row}";
        } else {
            return '';
        }
    } else {
        if ($type == 'kind') {
            if (isset($refObj->Fields['sonid']) || !empty($sonid)) {
                $sonid = empty($refObj->Fields['sonid']) ? $sonid : $refObj->Fields['sonid'];
                $sql = "select aid,title,addtime,modtime from #@__help where webid=0 and   kindid={$sonid} order by displayorder asc,addtime desc limit 0,{$row}";
            } else {
                return '';
            }
        } else {
            if ($type == 'top') {
                $sql = "select aid,title,addtime,modtim from #@__help where webid=0 order by displayorder asc,addtime desc limit 0,{$row}";
            }
        }
    }
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $row['url'] = GetWebURLByWebid(0) . "/help/show_{$row['aid']}.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;
}
Example #22
0
function lib_getspotlist(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,flag|,type|top,sonid|,limit|0,kindid|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $basefield = 'a.aid,a.id,a.title,a.litpic,a.area,a.tagword,a.kindlist,a.webid,a.attrid,a.shownum,a.want,a.went,a.sellpoint,a.iconlist';
    if ($type == 'top' && empty($flag)) {
        return '';
    }
    //如果调用二级栏目则必须在显示类里指定sonid
    //加目的地页面显示条件
    $destwhere = isset($refObj->Fields['kindid']) ? "and FIND_IN_SET({$refObj->Fields['kindid']},kindlist) " : '';
    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 {
                $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc';
            }
        }
        $orderby .= ",a.modtime desc,a.addtime desc";
        //这里增加子站的判断
        if ($GLOBALS['sys_child_webid'] != 0) {
            $dest_id = $GLOBALS['sys_child_webid'];
        }
        if (!empty($refObj->Fields['kindid']) || $dest_id) {
            $sonid = $refObj->Fields['kindid'];
            $sonid = empty($sonid) ? $dest_id : $sonid;
            $where = "where  FIND_IN_SET({$sonid},a.kindlist) {$orderby}  limit {$limit},{$row}";
            $sql = "select a.* from #@__spot as a left join #@__kindorderlist as c on (c.classid={$sonid} and a.id=c.aid and c.typeid=5)  {$where}";
            //echo $sql;
        } else {
            $sql = "select {$basefield},b.isding as isding,b.isjian,b.displayorder from #@__spot as a left join #@__allorderlist b on (a.id=b.aid and b.typeid=5) 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 ($type == 'aroundspot') {
            $kindid = array_remove_value($refObj->Fields['kindlist']);
            $sql = "select * from #@__spot where FIND_IN_SET({$kindid},kindlist) order by modtime desc,addtime desc limit {$limit},{$row}";
        } else {
            if ($type == 'top') {
                if ($flag == 'recommend') {
                    $sql = "select a.ishidden,{$basefield},b.isding as isding,b.isjian,b.displayorder from #@__spot as a left join #@__allorderlist b on (a.id=b.aid and b.typeid=5) 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 == 'hot') {
                        $sql = "select {$basefield} from #@__spot a where webid is not null {$destwhere}  order by a.modtime desc,a.addtime desc,a.shownum desc limit {$limit},{$row}";
                    } else {
                        if ($flag == 'want') {
                            $sql = "select {$basefield} from #@__spot a where a.webid is not null {$destwhere}  order by a.want desc,a.shownum desc limit {$limit},{$row}";
                        } else {
                            if ($flag == 'went') {
                                $sql = "select {$basefield} from #@__spot a where a.webid is not null {$destwhere}  order by a.went  desc limit {$limit},{$row}";
                            } else {
                                if ($flag == 'attr') {
                                    $attrid = $refObj->Fields['attrid'];
                                    $sql = "select {$basefield} from #@__spot a where FIND_IN_SET({$attrid},a.attrid) order by a.modtime desc,a.addtime desc limit {$limit},{$row}";
                                } else {
                                    if ($flag == 'relative') {
                                        $kindlist = $refObj->Fields['kindlist'];
                                        $maxkindid = array_remove_value($kindlist);
                                        //最后一级.
                                        $where = " FIND_IN_SET({$maxkindid},a.kindlist) ";
                                        $sql = "select {$basefield} from #@__spot a where {$where}  order by a.modtime desc,a.addtime desc,a.shownum desc limit {$limit},{$row}";
                                    } else {
                                        return '';
                                    }
                                }
                            }
                        }
                    }
                }
            } else {
                if ($type == 'theme') {
                    $themeid = $refObj->Fields['themeid'];
                    if (empty($themeid)) {
                        return '';
                    }
                    $sql = "select {$basefield} from #@__spot a where FIND_IN_SET({$themeid},a.themelist) order by a.modtime desc,a.addtime desc limit {$limit},{$row}";
                }
            }
        }
    }
    $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']);
        $url = $webroot . "/spots/show_{$row['aid']}.html";
        $row['url'] = $url;
        $price = getSpotPrice($row['id']);
        //本站的价格
        $sellprice = getSpotsellPrice($row['id']);
        //票面价格
        $row['title'] = $row['title'];
        $row['lit240'] = getUploadFileUrl(str_replace('litpic', 'lit240', $row['litpic']));
        $row['lit160'] = getUploadFileUrl(str_replace('litpic', 'lit160', $row['litpic']));
        $row['litpic'] = getUploadFileUrl($row['litpic']);
        $row['sellprice'] = $price;
        $row['oldprice'] = $sellprice;
        $row['price'] = !empty($price) ? "<b>&yen;" . $price . "</b>起" : '电询';
        $row['price2'] = empty($price) ? '电询' : '<span>&yen;</span><strong>' . $price . '</strong><i>起</i>';
        //目的地页面用
        $row['price3'] = $price;
        $row['satisfyscore'] = Helper_Archive::getSatisfyScore($row['id'], 5);
        //满意度
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()]) || $row[$ctag->GetName()] == '0') {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                } else {
                    $ctp->Assign($tagid, '');
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
Example #23
0
function getOrderName2($id, $typeid, $productname = '', $commentid)
{
    global $dsql;
    $channeltable = array("1" => "#@__line", "2" => "#@__hotel", "3" => "#@__car", "5" => "#@__spot", "8" => "#@__visa", "13" => "#@__tuan");
    $tablename = $typeid < 14 ? $channeltable[$typeid] : '#@__model_archive';
    $fields = array('1' => array('field' => 'title', 'link' => 'lines'), '2' => array('field' => 'title', 'link' => 'hotels'), '3' => array('field' => 'title', 'link' => 'cars'), '5' => array('field' => 'title', 'link' => 'spots'), '8' => array('field' => 'title', 'link' => 'visa'), '13' => array('field' => 'title', 'link' => 'tuan'));
    $field = $fields[$typeid]['field'];
    $link = $fields[$typeid]['link'];
    if ($typeid > 13) {
        $model_info = getExtendModelInfo($typeid);
        $link = $model_info['pinyin'];
        $field = 'title';
    }
    $sql = "select aid,{$field} as title,webid from {$tablename} where id='{$id}'";
    $row = $dsql->GetOne($sql);
    if (empty($row)) {
        $sql_del = "delete from #@__comment where id={$commentid}";
        //$dsql->ExecuteNoneQuery($sql_del);
        return mysql_error();
    }
    $title = !empty($productname) ? $productname : $row['title'];
    $url = GetWebURLByWebid($row['webid']);
    $out = "<a href=\"{$url}/{$link}/show_{$row['aid']}.html\" target=\"_blank\">{$title}</a>";
    return $out;
}
Example #24
0
/**
 * 调用团购显示数据标签
 *
 * @version        $Id: gettuanlist.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_gettuanlist(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,flag|,type|top,limit|0,haspic|1,day|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $basefield = 'a.*';
    $time = time();
    if ($type == 'mdd') {
        if ($flag == 'recommend') {
            $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.addtime desc';
        } else {
            if ($flag == 'hot') {
                $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.addtime desc';
            } else {
                if ($flag == 'new') {
                    $orderby = 'order by a.addtime desc';
                } else {
                    $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.addtime desc';
                }
            }
        }
        if (isset($refObj->Fields['kindid'])) {
            $sonid = $refObj->Fields['kindid'];
            $number = isset($refObj->Fields['shownumber']) ? $refObj->Fields['shownumber'] : $row;
            //如果模块设置了显示数量则使用.
            $where = "a.ishidden=0 and FIND_IN_SET({$sonid},a.kindlist) and a.endtime>{$time} and a.starttime<={$time}";
            $where .= !empty($haspic) ? " and a.litpic is not null" : '';
            $sql = "select {$basefield} from #@__tuan 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 == 'daytime') {
            if (!empty($day)) {
                $day = date('Y-m-d', strtotime($day));
                $day = strtotime($day);
                $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and starttime={$day} and endtime!='' order by a.addtime asc,a.endtime asc limit {$limit},{$row}";
            } else {
                $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime>{$time}   order by a.starttime asc,a.addtime desc limit {$limit},{$row}";
            }
        } else {
            if ($flag == 'recommend') {
                $sql = "select {$basefield},b.isjian,b.isding as isding,b.displayorder from #@__tuan a left join #@__allorderlist b on (a.id=b.aid and b.typeid=13) where a.ishidden=0 and a.endtime>{$time}  order by case when b.displayorder is null then 9999 end,b.displayorder asc,a.addtime desc limit {$limit},{$row}";
            } else {
                if ($flag == 'new') {
                    $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime<={$time}   order by a.addtime desc limit {$limit},{$row}";
                } else {
                    if ($flag == 'hot') {
                        $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime<={$time}   order by a.shownum desc,a.addtime desc limit {$limit},{$row}";
                    } else {
                        if ($flag == 'byendtime') {
                            $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime<={$time}   order by a.endtime asc,a.addtime desc limit {$limit},{$row}";
                        } else {
                            if ($flag == 'photo') {
                                $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and a.litpic !='' and endtime>{$time} and endtime!='' and a.starttime<={$time} order by a.addtime desc limit {$limit},{$row}";
                            } else {
                                if ($flag == 'nostart') {
                                    $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime>{$time}   order by a.starttime asc,a.addtime desc limit {$limit},{$row}";
                                } else {
                                    if ($flag == 'relative') {
                                        $kindlist = $refObj->Fields['kindlist'];
                                        $maxkindid = get_exist_kind($kindlist);
                                        //最后一级.
                                        $maxkindid = empty($maxkindid) ? 0 : $maxkindid;
                                        $where = " FIND_IN_SET({$maxkindid},a.kindlist) ";
                                        //排序顺序:置顶+tag关联》排序+ tag关联》最新更新+tag关联
                                        $sql = "select a.* from #@__tuan a where find_in_set('{$attrid}',a.attrid) where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime<={$time}  order by a.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row} ";
                                    } else {
                                        if ($type == 'theme') {
                                            $themeid = $refObj->Fields['themeid'];
                                            if (empty($themeid)) {
                                                return '';
                                            }
                                            $sql = "select a.* from #@__tuan a where a.ishidden=0 and FIND_IN_SET({$themeid},a.themelist) and endtime>{$time} and endtime!='' and a.starttime<={$time}  order by a.displayorder asc,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']++;
        $webroot = GetWebURLByWebid($row['webid']);
        $sonid = $refObj->Fields['sonid'];
        $row['url'] = $webroot . "/tuan/show_{$row['aid']}.html";
        $row['litpic'] = getUploadFileUrl($row['litpic']);
        $row['lit240'] = str_replace('litimg', 'lit240', $row['litpic']);
        $row['lit160'] = str_replace('litimg', 'lit160', $row['litpic']);
        $row['attrname'] = getTuanAttrname($row['attrid']);
        $row['attrnamearr'] = getTuanAttrname($row['attrid'], true);
        $row['destname'] = Helper_Archive::getBelongDestName($row['kindlist']);
        //所属目的地
        $row['destid'] = array_remove_value($row['kindlist']);
        $row['discount'] = floor($row['price'] / $row['sellprice'] * 100) / 10;
        //折扣
        $row['booknum'] = Helper_Archive::getSellNum($row['id'], 13) + $row['virtualnum'];
        $row['satisfyscore'] = Helper_Archive::getSatisfyScore($row['id'], 13);
        //满意度
        $row['price'] = $row['price'];
        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;
}
Example #25
0
    $str .= ' ]}';
    if ($hasbook) {
        echo $str;
    }
    exit;
}
//根据目的地id获取相应的线路(线路首页用)
if ($dopost == 'getLineByDestId') {
    $where = " where a.ishidden=0 and FIND_IN_SET({$dest_id},a.kindlist)";
    $leftjoin = "left join #@__kindorderlist b on(a.id = b.aid and b.classid = {$dest_id} and b.typeid=1)";
    $sql = "select a.* from #@__line a {$leftjoin} {$where} order by b.isding desc,b.isjian desc,case when b.displayorder is null then 9999 end,b.displayorder asc,a.addtime desc limit 0,6";
    $arr = $dsql->getAll($sql);
    $out = $left = $right = '';
    $k = 1;
    foreach ($arr as $row) {
        $url = GetWebURLByWebid($row['webid']) . '/lines/show_' . $row['aid'] . '.html';
        $litpic = getUploadFileUrl($row['litpic']);
        $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">
Example #26
0
/**
 * 调用酒店数据标签
 *
 * @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']) ? '电询' : '&yen;' . $row['price'] . '起';
        //样式2
        $row['price3'] = empty($row['price']) ? '电询' : '<strong>&yen;' . $row['price'] . '</strong><span>起</span>';
        $row['price4'] = empty($row['price']) ? '电询' : '<span>&yen;</span><strong>' . $row['price'] . '</strong><i>起</i>';
        //目的地页面用
        $row['price'] = empty($row['price']) ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>&yen;</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;
}
Example #27
0
/**
 * 获取目的地标签
 *
 * @version        $Id: getcategory.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2014, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getdest(&$ctag, &$refObj)
{
    global $dsql, $outlist;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,flag|0,limit|0,item|0,destid|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    //$destid = empty($destid) ? $GLOBALS['sys_destid'] : $destid;//如果未指定当前目的地id,则获取全局目的地id
    //if(empty($destid)) return '';
    $table_array = array("line" => "#@__line_kindlist", "hotel" => "#@__hotel_kindlist", "car" => "#@__car_kindlist", "article" => "#@__article_kindlist", "spot" => "#@__spot_kindlist", "photo" => "#@__photo_kindlist", "tuan" => "#@__tuan_kindlist");
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $table = '#@__destinations';
    //获取目的地下级分类(未指定item时);
    if ($item == '0') {
        if ($flag == 'top') {
            $sql = "select a.* from {$table} a where a.pid = '0' and a.isopen=1 order by a.displayorder asc limit {$limit},{$row}";
        }
        if ($flag == 'next') {
            $parentid = !empty($refObj->Fields['parentid']) ? $refObj->Fields['parentid'] : 0;
            $parentid = empty($parentid) ? $refObj->Fields['kindid'] : $parentid;
            $sql = "select a.* from {$table} a where a.pid = '{$parentid}' and a.isopen=1 order by a.displayorder asc limit {$limit},{$row}";
        }
        if ($flag == 'hot') {
            $sql = "select a.* from {$table} a where a.ishot = 1 and a.isopen = 1 order by a.displayorder asc limit {$limit},{$row}";
        }
        if ($flag == 'mdd_hot') {
            $parentid = !empty($refObj->Fields['parentid']) ? $refObj->Fields['parentid'] : 0;
            $parentid = empty($parentid) ? $refObj->Fields['kindid'] : $parentid;
            $child_list = array();
            getChildNode($parentid, $child_list);
            //获取子级
            $child_list_str = implode(',', $child_list);
            $where = " and id in ({$child_list_str}) ";
            $sql = "select a.* from {$table} a where a.ishot = 1 and a.isopen = 1 {$where} order by a.displayorder asc limit {$limit},{$row}";
        }
    } else {
        //普通排序
        if ($flag == 0) {
            $sql = "select a.kindname,a.id,a.pinyin from {$table} a left join {$table_array[$item]} b on a.id=b.kindid where a.isopen=1 order by b.displayorder,a.pinyin asc limit {$limit},{$row}";
        }
        //热门排序
        if ($flag == 'hot') {
            $sql = "select a.kindname,a.id,a.pinyin from {$table} a left join {$table_array[$item]} b on a.id=b.kindid where b.ishot = 1  and a.isopen=1 order by b.ishot desc,b.displayorder,a.pinyin asc limit {$limit},{$row}";
        }
        if ($flag == 'nav') {
            $sql = "select a.kindname,a.id,a.pinyin,b.* from {$table} a left join {$table_array[$item]} b on a.id=b.kindid where b.isnav = 1  and a.isopen=1 order by b.isnav desc,b.displayorder,a.pinyin asc limit {$limit},{$row}";
        }
        if ($flag == 'next') {
            $parentid = !empty($refObj->Fields['parentid']) ? $refObj->Fields['parentid'] : 0;
            $parentid = empty($parentid) ? $refObj->Fields['kindid'] : $parentid;
            $sql = "select a.kindname,a.id,a.pinyin from {$table} a left join {$table_array[$item]} b on a.id=b.kindid where  a.isopen=1  and a.pid={$parentid} order by b.isnav desc,b.displayorder,a.pinyin asc limit {$limit},{$row}";
        }
        if ($flag == 'mdd_hot') {
            $table = $table_array[$item];
            $parentid = !empty($refObj->Fields['parentid']) ? $refObj->Fields['parentid'] : 0;
            $parentid = empty($parentid) ? $refObj->Fields['kindid'] : $parentid;
            $child_list = array();
            getChildNode($parentid, $child_list);
            //获取子级
            $child_list_str = implode(',', $child_list);
            $where = " and b.kindid in ({$child_list_str}) ";
            $sql = "select a.* from #@__destinations a left join {$table} b on(a.id=b.kindid) where b.ishot = 1  {$where} order by b.displayorder asc limit {$limit},{$row}";
        }
    }
    $rows = null;
    $rows = $dsql->getAll($sql);
    $GLOBALS['autoindex'] = 0;
    foreach ($rows as $row) {
        $GLOBALS['autoindex']++;
        $lit = explode('||', $row['litpic']);
        $litpic = $lit[0];
        $row['lit240'] = getUploadFileUrl(str_replace('litimg', 'lit240', $litpic));
        //getPicByName($row['litpic'],'lit240');
        $row['lit160'] = getUploadFileUrl(str_replace('litimg', 'lit160', $litpic));
        $row['litpic'] = getUploadFileUrl($litpic);
        $row['kindid'] = $row['id'];
        $row['title'] = $row['kindname'];
        $row['pinyin'] = !empty($row['pinyin']) ? $row['pinyin'] : $row['id'];
        $desturl = GetWebURLByWebid(0);
        $row['url'] = $desturl . '/' . $row['pinyin'] . '/';
        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()]);
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
Example #28
0
//获取目的地列表
$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']));
    $photolist[$k]['url'] = $weburl . '/photos/show_' . $v['aid'] . '.html';
}
$destname = !empty($dest_id) ? Helper_Archive::getDestName($dest_id) : '全部';
foreach ($attrid_arr as $k => $v) {
    $attrname .= !empty($v) ? getPhotoAttrName($v) . '-' : '';
}
$attrname = trim($attrname, '-');
$seotitle = $pageno > 1 ? "第{$pageno}页" : '';
if ((!empty($destname) || !empty($attrname)) && $destname != '全部') {
    $seotitle .= $attrname;
    $pv->Fields['seotitle'] .= '-' . $seotitle;
}
//模板选择
$templet = Helper_Archive::getUseTemplet('photo_index');
Example #29
0
function getSpotPic($spotinfo, $spotid, $webid)
{
    $picarr = explode(',', $spotinfo['piclist']);
    $url = GetWebURLByWebid($spotinfo['webid']) . '/spots/show_' . $spotinfo['aid'] . '.html';
    $k = 1;
    foreach ($picarr as $pic) {
        if ($k <= 3) {
            $p = explode('||', $pic);
            $picname = !empty($p[1]) ? $p[1] : $spotinfo['title'];
            //图片名称
            $litpic = !empty($p[0]) ? getUploadFileUrl($p[0]) : getUploadFileUrl($spotinfo['litpic']);
            //图片地址
            //array_push($out,array('picname'=>$picname,'litpic'=>$litpic));
            $out .= '<li><a class="sl_a1" href="' . $url . '" target="_blank"><img class="fl" src="' . $litpic . '" width="245" height="175" alt="' . $picname . '" title="' . $picname . '" /></a><a class="sl_a2" href="' . $url . '" target="_blank">' . $picname . '</a></li>';
            $k++;
        }
    }
    return $out;
}
Example #30
0
    if (!empty($weblist)) {
        $url = $_SERVER['HTTP_HOST'];
        //当前域名
        $uarr = explode('.', $url);
        $prefix = $uarr[0];
        //域名前辍
        if (!array_key_exists($prefix, $weblist) && $prefix != $sys_webprefix) {
            if (!isset($GLOBALS['is404'])) {
                head404();
                //如果域名不匹配,则跳转到404页面.
                exit;
            }
        } else {
            if ($prefix != $sys_webprefix) {
                $sys_child_webid = $weblist[$prefix]['webid'];
                //当前站点id
                $sys_child_webname = $weblist[$prefix]['kindname'];
                //站点名称
                $sys_webprefix = $prefix;
                //当前站点域名前辍.
                $cfg_df_style = 'sline';
                //子站模板皮肤
                $cfg_templets_skin = empty($cfg_df_style) ? $cfg_mainsite . $cfg_templets_dir . "/smore" : $cfg_mainsite . $cfg_templets_dir . "/{$cfg_df_style}";
                //子站系统配置文件
                require_once SLINEDATA . "/config/config." . $prefix . ".php";
                $cfg_base_url = GetWebURLByWebid(0);
                //主域名
            }
        }
    }
}