Example #1
0
/**
 * 获取线路子级id标签代码
 *
 * @version        $Id: linechild.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2013, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_linechild(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "typeid|0,row|5";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $pid = isset($refObj->Fields['kindid']) ? $refObj->Fields['kindid'] : 0;
    $pname = isset($refObj->Fields['kindname']) ? $refObj->Fields['kindname'] : '';
    $pshownum = isset($refObj->Fields['shownum']) ? $refObj->Fields['shownum'] : 5;
    $ppy = isset($refObj->Fields['pinyin']) ? $refObj->Fields['pinyin'] : '';
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $sql = "select distinct a.kindname,a.kindname,a.id,a.pinyin,b.shownum from #@__destinations as a inner join  #@__line_kindlist as b on a.id=b.kindid where a.pid={$pid} and a.isopen=1 order by b.displayorder asc limit 0,{$row}";
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $kindnames = $ids = $shownumber = array();
    while ($row = $dsql->GetArray()) {
        if (ExistLine($row['id'], 1)) {
            $ids[] = $row['id'];
            $kindnames[] = $row['kindname'];
            //获取导航分类名称
            $shownumber[] = !empty($row['shownum']) ? $row['shownum'] : 8;
            $pinyin[] = $row['pinyin'];
        }
    }
    //这里增加一个当没有子级时判断,将直接读取父级列表.
    if (empty($ids[0])) {
        $ids[] = $pid;
        $kindnames[] = $pname;
        $shownumber[] = $pshownum;
        $pinyin[] = $ppy;
    }
    for ($i = 0; isset($ids[$i]); $i++) {
        $pv = new View();
        $pv->Fields['kindname'] = $kindnames[$i];
        $pv->Fields['kindid'] = $ids[$i];
        $pv->Fields['pinyin'] = $pinyin[$i];
        $pv->Fields['shownum'] = $shownumber[$i];
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
    }
    return $artlist;
}
/**
 * 通用模块产品调用标签
 *
 * @version        $Id: gettongyongsuit.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2015, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_gettongyonglist(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|10,pinyin|0,limit|0,type|byorder";
    $webid = 0;
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if (empty($pinyin)) {
        return '';
    }
    $sql = "select id as typeid,addtable from sline_model where pinyin='{$pinyin}'";
    $ar = $dsql->GetOne($sql);
    $sql = '';
    if (!empty($ar['typeid'])) {
        $addtable = 'sline_' . $ar['addtable'];
        $typeid = $ar['typeid'];
        if ($type == 'byorder') {
            $sql = "select a.id as realid,a.*,b.* from sline_model_archive a left join {$addtable} b on(a.id=b.productid)  left join sline_allorderlist c on(a.id=c.id and c.typeid={$typeid}) where a.typeid={$typeid} order by ifnull(c.displayorder,9999) asc,a.addtime desc limit {$limit},{$row} ";
        } else {
            if ($type == 'mdd') {
                $sonid = isset($definekind) ? $definekind : $refObj->Fields['kindid'];
                //这里增加子站的判断
                if ($GLOBALS['sys_child_webid'] != 0) {
                    $dest_id = $GLOBALS['sys_child_webid'];
                }
                $sonid = $sonid ? $sonid : $dest_id;
                $sql = "select a.id as realid,a.*,b.* from sline_model_archive a left join {$addtable} b on(a.id=b.productid)  left join sline_allorderlist c on(a.id=c.id and c.typeid={$typeid}) where a.typeid={$typeid} and FIND_IN_SET({$sonid},a.kindlist) order by ifnull(c.displayorder,9999) asc,a.addtime desc limit {$limit},{$row} ";
            }
        }
    }
    if (empty($sql)) {
        return '';
    }
    $innertext = trim($ctag->GetInnertext());
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $row['url'] = $GLOBALS['cfg_basehost'] . '/' . $pinyin . '/' . 'show_' . $row['aid'] . '.html';
        $row['price'] = TagTongYong::getProductMinPrice($row['realid']);
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                } else {
                    $ctp->Assign($tagid, '');
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
function lib_getcarguidelist(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = $ctag->GetInnerText();
    $dtp2 = new STTagParse();
    $dtp2->SetNameSpace('field', '[', ']');
    $dtp2->LoadSource($innertext);
    //echo $idselected;
    switch ($flag) {
        case 'stylelist':
            $sqlstr = "select * from #@__car_kind  order by displayorder asc";
            break;
        case 'brandlist':
            $sqlstr = "select * from #@__car_brand where webid=0";
            break;
        case "pricerange":
            $sqlstr = "select * from #@__car_pricelist where webid=0";
            break;
    }
    if (empty($sqlstr)) {
        return '';
    }
    $dsql->SetQuery($sqlstr);
    $dsql->Execute();
    $totalRow = $dsql->GetTotalRow();
    //echo $totalRow;
    $likeType = '';
    $GLOBALS['autoindex'] = 0;
    //??
    for ($i = 0; $i < $totalRow; $i++) {
        $GLOBALS['autoindex']++;
        if ($row = $dsql->GetArray()) {
            $likeType .= GetDataHandle($flag, $row, $dtp2);
        }
        //$GLOBALS['autoindex']++;
    }
    //Loop for $i
    $dsql->FreeResult();
    //print_r($likeType);
    return $likeType;
}
Example #4
0
/**
 * 内容详细页调用标签
 *
 * @version        $Id: detailcontent.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2015, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_detailcontent(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|10,typeid|";
    $webid = 0;
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $tables = array('1' => 'sline_line_content', '2' => 'sline_hotel_content', '3' => 'sline_car_content', '5' => 'sline_spot_content', '8' => 'sline_visa_content', '13' => 'sline_tuan_content');
    $extend_tables = array('1' => 'sline_line_extend_field', '2' => 'sline_hotel_extend_field', '3' => 'sline_car_extend_field', '5' => 'sline_spot_extend_field', '8' => 'sline_visa_extend_field', '13' => 'sline_tuan_extend_field');
    $table = $tables[$typeid];
    $extend_tables = $extend_tables[$typeid];
    if (empty($table)) {
        return '';
    }
    $sql = "select columnname,chinesename,isrealfield from {$table}  where webid=0 and isopen=1 order by displayorder asc";
    $innertext = trim($ctag->GetInnertext());
    $arr = $dsql->getAll($sql);
    //扩展表数据
    $productid = $refObj->Fields['id'];
    $sql = "select * from {$extend_tables} where productid='{$productid}'";
    $extend_row = $dsql->GetOne($sql);
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    foreach ($arr as $row) {
        $GLOBALS['autoindex']++;
        $row['productid'] = $refObj->Fields['id'];
        //产品id
        $content = '';
        if (isset($refObj->Fields[$row['columnname']])) {
            $content = $refObj->Fields[$row['columnname']];
        } else {
            if (isset($extend_row[$row['columnname']])) {
                $content = $extend_row[$row['columnname']];
            }
        }
        $row['content'] = $row['isrealfield'] == 0 && empty($content) ? $row['productid'] : $content;
        // if(empty($row['content'])) continue;
        $row['content'] = detailcontent_filter($typeid, $row['columnname'], $row['content']);
        if ($row['content'] === false) {
            continue;
        }
        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 #5
0
/**
 * 获取签证分类标签
 *
 * @version        $Id: visatype.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_visatype(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "typeid|0,row|5,flag|kind,limit|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    //签证类型
    if ($flag == 'kind') {
        $sql = "select * from #@__visa_kind where isopen=1 order by displayorder asc";
    } else {
        if ($flag == 'city') {
            $sql = "select * from #@__visa_city order by displayorder asc";
        } else {
            if ($flag == 'country') {
                $sql = "select * from #@__visa_area where isopen = 1 and pid!=0 order by displayorder asc limit {$limit},{$row}";
            } else {
                if ($flag == 'hotcountry') {
                    $sql = "select * from #@__visa_area where isopen = 1 and pid!=0 and ishot=1 order by displayorder asc limit {$limit},{$row}";
                } else {
                    if ($flag == 'getcountrybypid') {
                        $pid = $refObj->Fields['areaid'] ? $refObj->Fields['areaid'] : 0;
                        if (empty($pid)) {
                            exit;
                        }
                        $sql = "select * from #@__visa_area where isopen = 1 and pid='{$pid}' order by displayorder,pinyin asc 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']++;
        $row['title'] = $row['kindname'];
        $row['litpic'] = isset($row['litpic']) ? $row['litpic'] : getDefaultImage();
        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 #6
0
/**
 * 获取结伴标签代码
 *
 * @version        $Id: getjieban.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2015, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getjieban(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|6,flag|new,limit|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    if ($flag == 'new') {
        $sql = "select * from sline_jieban where status=1 order by addtime desc limit {$limit},{$row}";
    } else {
        if ($flag == 'finish') {
            $sql = "select * from sline_jieban where status=2 order by addtime desc limit {$limit},{$row}";
        } else {
            if ($flag == 'join') {
                $jiebanid = $refObj->Fields['id'];
                $sql = "select * from sline_jieban_join  where jiebanid='{$jiebanid}' group by memberid order by addtime desc";
            }
        }
    }
    $arr = $dsql->getAll($sql);
    foreach ($arr as $row) {
        $GLOBALS['autoindex']++;
        if ($flag != 'join') {
            $row['title'] = TagJB::getJiebanTitle($row);
            $row['kindnamelist'] = TagJB::getKindnameList($row, '-');
            $row['posttime'] = TagJB::formatViewTime($row['addtime']);
            $row['membername'] = TagJB::getMemberName($row['memberid']);
            $row['url'] = $GLOBALS['cfg_cmsurl'] . '/jieban/show_' . $row['id'] . '.html';
            $row['attrlist'] = TagJB::getAttrList($row['attrid']);
            $row['joinnum'] = TagJB::getJoinNumber($row['id']);
        } else {
            $memberinfo = Helper_Archive::getMemberInfo($row['memberid']);
            $row['membername'] = $memberinfo['nickname'];
            $row['litpic'] = $memberinfo['litpic'] ? $memberinfo['litpic'] : '/templets/smore/images/member_default.gif';
            $row['joinnum'] = TagJB::getSingleJoinNumber($row['jiebanid'], $row['memberid']);
        }
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                } else {
                    $ctp->Assign($tagid, '');
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
function lib_getslidenavbyid(&$ctag, &$refObj)
{
    global $dsql, $outlist;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,kindid|0,";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $sql = "select id,kindname as categoryname,linkurl as url,color from #@__plugin_leftnav where pid='{$kindid}' and isopen=1 order by displayorder asc limit 0,{$row}";
    $arr = $dsql->getAll($sql);
    for ($i = 0; isset($arr[$i]); $i++) {
        $row = $arr[$i];
        $ctp = new STTagParse();
        $ctp->SetNameSpace("field", "[", "]");
        $ctp->LoadSource($innertext);
        $outlist = '';
        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 #8
0
function lib_licenselist(&$ctag, &$refObj)
{
    global $dsql;
    $sql = "select picurl,litpic,licenseurl as url,licensename as title from #@__license where webid='0' order by displayorder asc";
    $innertext = trim($ctag->GetInnertext());
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        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 #9
0
/**
 * 单独广告调用
 *
 * @version        $Id: singlead.lib.php 1 9:29 2013.05.03 netman $
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2010, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_singlead(&$ctag, &$refObj)
{
    global $dsql, $sys_webid;
    $attlist = "typeid|0,name|,row|3";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if ($name == '') {
        return '';
    }
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $webid = $GLOBALS['sys_child_webid'];
    //webid赋值
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $sql = "SELECT * FROM sline_advertise WHERE tagname = '{$name}' and webid='{$webid}' limit 1  ";
    $row = $dsql->GetOne($sql);
    //$row['picurl']=getUploadFileUrl($row['picurl']);
    if (is_array($row)) {
        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 #10
0
/**
 * 访问历史标签代码
 *
 * @version        $Id: gethistory.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2014, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_gethistory(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|6";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    if (isset($_COOKIE['St']['line'])) {
        $list = unserialize($_COOKIE['St']['line']);
        $arr = getLineList($list);
    } else {
        return;
    }
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    foreach ($arr as $row) {
        $GLOBALS['autoindex']++;
        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 #11
0
function lib_serverlist(&$ctag, &$refObj)
{
    global $dsql;
    $sql = "select aid,servername from #@__serverlist where webid='0' and isdisplay=1 order by displayorder asc";
    $innertext = trim($ctag->GetInnertext());
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $row['url'] = "{$GLOBALS['cfg_base_url']}/servers/index_{$row['aid']}.html";
        $row['title'] = $row['servername'];
        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 #12
0
/**
 * 线路套餐调用标签
 *
 * @version        $Id: getlinesuit.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2014, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getlinesuit(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|10,lineid|0";
    $webid = 0;
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $lineid = $lineid ? $lineid : $refObj->Fields['id'];
    //线路id
    $sql = "select a.* from #@__line_suit a where a.lineid='{$lineid}' order by a.displayorder asc";
    $innertext = trim($ctag->GetInnertext());
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $row['title'] = $row['suitname'];
        //价格名称.
        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 #13
0
/**
 * 调用分类标签(景点首页调用)
 *
 * @version        $Id: getcategory.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getdestbypid(&$ctag, &$refObj)
{
    global $dsql, $outlist;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,pid|,limit|0,flag|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $kindid = $refObj->Fields['kindid'];
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    if ($flag == 'spot') {
        $sql = "select a.kindname,a.id,b.displayorder,a.jieshao,a.pinyin from #@__destinations a inner join #@__spot_kindlist as b on a.id=b.kindid and a.pid={$kindid} order by b.displayorder limit {$limit},{$row}";
    } else {
        $sql = "select id,kindname,pinyin from #@__destinations where pid={$kindid} and isopen=1 order by displayorder limit {$limit},{$row}";
    }
    $rows = $dsql->getAll($sql);
    foreach ($rows as $row) {
        $row['kindid'] = $row['id'];
        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 #14
0
/**
 * 线路分类详细页调用标签
 *
 * @version        $Id: getlinecontent.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getlinecontent(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|10,flag|";
    $webid = 0;
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $sql = "select columnname,chinesename from #@__line_content where webid=0 and isopen=1 and columnname!='booking' and columnname!='linespot' and columnname!='pinglun'  and columnname !='zuche' order by displayorder asc";
    $innertext = trim($ctag->GetInnertext());
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $row['lineid'] = $refObj->Fields['id'];
        //线路
        $row['content'] = isset($refObj->Fields[$row['columnname']]) ? $refObj->Fields[$row['columnname']] : '';
        if ($row['columnname'] == "payment") {
            if (empty($refObj->Fields[$row['columnname']])) {
                $row['content'] = $GLOBALS['cfg_payment'];
            }
        } else {
            if ($row['columnname'] == 'jieshao') {
                /*  if($refObj->Fields['isstyle']==1)
                    {
                        $row['content'] = isset($refObj->Fields['jieshao']) ? $refObj->Fields['jieshao'] : '';
                    }
                    else
                    {
                        $row['content'] = isset($refObj->Fields['id']) ? $refObj->Fields['id'] : '';
                    }*/
                $row['content'] = $refObj->Fields['id'];
            }
        }
        /* else if($row['columnname']=="jieshao")
           {
               $row['content']= $style == 1 ? $refObj->Fields['jieshao'] : $refObj->Fields['txtjieshao'];
           }*/
        if (empty($row['content'])) {
            continue;
        }
        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 #15
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 #16
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 #17
0
/**
 * 属性分类调用标签与attrgrouplist配合使用.
 *
 * @version        $Id: getattrbygroup.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getattrbygroup(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|80,typeid|,groupname|,groupid|,filterid|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $attrtable = array('1' => '#@__line_attr', '2' => '#@__hotel_attr', '3' => '#@__car_attr', '4' => '#@__article_attr', '5' => '#@__spot_attr', '6' => '#@__photo_attr', '11' => '#@__jieban_attr', '13' => '#@__tuan_attr');
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $typeid = empty($typeid) ? $refObj->Fields['typeid'] : $typeid;
    $tablename = isset($attrtable[$typeid]) ? $attrtable[$typeid] : '#@__model_attr';
    $w = !empty($filterid) ? " and id not in({$filterid})" : '';
    //排除不要的项
    $w .= $typeid > 13 ? " and typeid={$typeid}" : '';
    //如果是扩展模块,则增加typeid判断
    if (!empty($groupname)) {
        $sql = "select id from {$tablename} where  attrname='{$groupname}' {$w}";
        $ar = $dsql->GetOne($sql);
        if (is_array($ar)) {
            $pid = $ar['id'];
        }
    } else {
        $pid = empty($groupid) ? $refObj->Fields['attrid'] : $groupid;
    }
    if (empty($pid)) {
        return;
    }
    //$sql="select id,attrname from {$tablename} where pid='$pid' and isopen=1 {$w} order by id asc limit 0,{$row}";
    // 增加了属性判断是否开启
    $sql = "select id,attrname,isopen from {$tablename} where pid='{$pid}' {$w} and isopen=1 order by id asc limit 0,{$row}";
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        $row['title'] = $row['attrname'];
        $row['attrid'] = $row['id'];
        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 #18
0
/**
 * 线路左侧滑动导航标签(与leftnav配合使用)
 *
 * @version        $Id: getleftnav.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2014, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getleftnav(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|8,";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $pid = $refObj->Fields['kindid'];
    //上级导航
    $innertext = trim($ctag->GetInnertext());
    $table = "#@__destinations";
    $revalue = '';
    $sql = "select id,kindname,pinyin from {$table} where pid='{$pid}' and isopen=1 order by displayorder asc";
    $arr = $dsql->getAll($sql);
    $GLOBALS['autoindex'] = 0;
    for ($i = 0; isset($arr[$i]); $i++) {
        $GLOBALS['autoindex']++;
        $row = $arr[$i];
        $hotdest = getHotDest($row['id']);
        $row['categoryname'] = $arr[$i]['kindname'];
        $row['categorychild4'] = getCategoryChild($row['id']);
        //左侧显示的内容
        $row['childleft'] = getHoverHtml($row['id']);
        //指向弹出的内容
        $row['childpre'] = $hotdest[0];
        $row['childnextall'] = $hotdest[1];
        $row['childall'] = getCategoryChildAll($row['id']);
        //全部子级,右侧模块用
        $row['youwanshijian'] = getYwTime($row['id']);
        //获取游玩时间
        $row['shuxin'] = getShuXin($row['id']);
        //获取属性.
        $row['jiage'] = getJiaGe($row['id']);
        //获取价格
        $row['tjxianlu'] = getTjXianlu($row['id']);
        //获取推荐线路
        $row['pinyin'] = !empty($row['pinyin']) ? $row['pinyin'] : $row['id'];
        $ctp = new STTagParse();
        $ctp->SetNameSpace("field", "[", "]");
        $ctp->LoadSource($innertext);
        $outlist = '';
        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 #19
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 #20
0
/**
 * 获取某条产品问答信息标签
 *
 * @version        $Id: getquestion.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2013, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getquestion(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|,typeid|,row|8,productid|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $productid = isset($refObj->Fields['id']) ? $refObj->Fields['id'] : $productid;
    $typeid = isset($refObj->Fields['typeid']) ? $refObj->Fields['typeid'] : 0;
    $where = $typeid == 0 ? '' : "and typeid={$typeid}";
    $typenamelist = array('1' => 'lines', '2' => 'hotels', '3' => 'cars', '4' => 'raider', '5' => 'spots', '6' => 'photos');
    //if($postid==''||$typeid=='')return;//如果文章id为空则返回
    $revalue = '';
    if (!empty($productid)) {
        $sql = "select * from #@__question where replycontent is not null and productid='{$productid}' {$where} order by replytime desc limit 0,{$row} ";
        //查询单个
    } else {
        $sql = "select * from #@__question where  replycontent is not null {$where} order by replytime 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']++;
        if ($row['questype'] == 0) {
            $productinfo = GetProductInfo($row['typeid'], $row['productid']);
            $row['productname'] = $productinfo['title'];
            $row['producturl'] = $productinfo['url'];
        } else {
            $row['productname'] = $row['title'];
        }
        $row['nickname'] = empty($row['nickname']) ? '匿名' : $row['nickname'];
        foreach ($ctp->CTags as $tagid => $ctag) {
            $row['replycontent'] = preg_replace('/<p>(.*)<\\/p>/', '$1', $row['replycontent']);
            //替换到P标签
            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 #21
0
function lib_getspotguide(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|15,flag|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    if (!isset($flag)) {
        return '';
    }
    $kindid = $refObj->Fields['kindid'];
    $kindtable = $tablename[$typeid];
    if ($flag == 'price') {
        $sql = "select id,aid,min,max from #@__spot_pricelist where webid='0' 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']++;
        if ($flag == 'price') {
            if ($row['min'] != '' && $row['max'] != '') {
                $row['title'] = $row['min'] . '元~' . $row['max'] . '元';
            } else {
                if ($row['min'] == '') {
                    $row['title'] = $row['max'] . '元以下';
                } else {
                    if ($row['max'] == '') {
                        $row['title'] = $row['min'] . '元以上';
                    }
                }
            }
        }
        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 #22
0
/**
 * 文章属性调用标签
 *
 * @version        $Id: getarcattr.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getarcattr(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|8,limit|0,flag|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $kindid = $refObj->Fields['kindid'];
    $sql = "select * from #@__article_attr where isopen=1 and pid!=0 order by displayorder asc limit {$limit},{$row}";
    if ($flag == 'mdd') {
        $sql = "select a.*,count(b.id) as num from #@__article_attr as a inner join #@__article as b on find_in_set(a.id,b.attrid) where find_in_set({$kindid},b.kindlist) group by a.id limit {$limit},{$row}";
    }
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        if (checkExist($row['id'])) {
            $destid = isset($GLOBALS['destid']) ? $GLOBALS['destid'] : 0;
            $py = Helper_Archive::getDestPinyin($destid);
            $py = !empty($py) ? $py : 'all';
            //$row['url'] = $GLOBALS['cfg_cmsurl']."/raiders/search.php?attrid={$row['id']}&destid={$destid}";
            $row['url'] = $GLOBALS['cfg_cmsurl'] . "/raiders/" . $py . '-' . $row['id'];
            $row['title'] = $row['attrname'];
            $row['number'] = getCount($row['id']);
            if ($flag == 'mdd') {
                $row['number'] = $row['num'];
            }
            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']++;
        } else {
            continue;
        }
    }
    return $revalue;
}
Example #23
0
function lib_getvisalist(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    //导入网站id
    $attlist = "row|5,type|area,limit|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if ($type == 'area') {
        $areaid = isset($refObj->Fields['kindid']) ? $refObj->Fields['kindid'] : 0;
        if ($areaid != 0) {
            $where = "where a.areaid='{$areaid}'";
        }
    } else {
        if ($type == 'nation') {
            $nationid = isset($refObj->Fields['kindid']) ? $refObj->Fields['kindid'] : 0;
            $where = "where a.nationid='{$nationid}'";
        }
    }
    $sql = "select a.* from #@__visa a left join #@__allorderlist b on (a.id=b.aid and b.typeid=8) {$where} order by case when b.displayorder is null then 9999 end,b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}";
    $innertext = trim($ctag->GetInnertext());
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $row['url'] = "{$GLOBALS['cfg_cmsurl']}/visa/show_{$row['aid']}.html";
        $row['letter'] = $row['needletter'] == 1 ? '需要' : '不需要';
        $row['interview'] = $row['needinterview'] == 1 ? '需要' : '不需要';
        $row['visatype'] = getVisaTypeName($row['visatype']);
        $row['litpic'] = getUploadFileUrl($row['litpic']);
        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 #24
0
/**
 * 调用任意表的数据标签
 *
 * @version        $Id: loop.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2014, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_loop(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "table|,tablename|,row|8,sort|,sorttype|desc,if|,ifcase|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    if (!empty($table)) {
        $tablename = $table;
    }
    if ($tablename == '' || $innertext == '') {
        return '';
    }
    if ($if != '') {
        $ifcase = $if;
    }
    if ($sort != '') {
        $sort = " ORDER BY {$sort} {$sorttype} ";
    }
    if ($ifcase != '') {
        $ifcase = " WHERE {$ifcase} ";
    } else {
        $ifcase = "WHERE webid={$sys_webid}";
    }
    $dsql->SetQuery("SELECT * FROM {$tablename} {$ifcase} {$sort} LIMIT 0,{$row}");
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        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 #25
0
function lib_getstartplace(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|20,flag|top,limit|0,pname|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if ($flag == 'top') {
        $sql = "select * from #@__startplace where isopen=1 and pid!=0 order by displayorder asc limit {$limit},{$row}";
    } else {
        if ($flag == 'son') {
            if (empty($pname)) {
                return '';
            }
            $sqld = "select id from #@__startplace where cityname='{$pname}'";
            $_field = $dsql->GetOne($sqld);
            if (empty($_field)) {
                return '';
            }
            $sql = "select * from #@__startplace where pid={$_field['id']} where isopen=1 order by displayorder asc limit {$limit},{$row}";
        }
    }
    $innertext = trim($ctag->GetInnertext());
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        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 #26
0
/**
 * 云搜索调用标签(废弃)
 *
 * @version        $Id: cloudsearch.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_cloudsearch(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|20,";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $ResultList = isset($refObj->Fields['ResultList']) ? $refObj->Fields['ResultList'] : '';
    $keyword = $refObj->Fields['keyword'];
    //print_r($ResultList);
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    for ($i = 0; isset($ResultList[$i]); $i++) {
        $GLOBALS['autoindex']++;
        $row = $ResultList[$i];
        $row['description'] = setColor($keyword, cutstr_html($row['content'], 90));
        $row['channelname'] = getChannelName($row['tablename']);
        $row['title'] = setColor($keyword, $row['title']);
        $row['litpic'] = getLitpic($row['imgurl'], $row['webid'], $row);
        $row['website'] = GetWebURLByWebid($row['webid']);
        $row['weburl'] = $row['website'];
        $row['url'] = getUrl($row['aid'], $row['webid'], $row['tablename'], $row['tag']);
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                } else {
                    $ctp->Assign($tagid, '');
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
function lib_getchildcomment(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|8,typeid|,groupname|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $commentid = $refObj->Fields['commentid'];
    $articleid = $refObj->Fields['articleid'];
    if (empty($commentid)) {
        return '';
    }
    $sql = "select * from #@__comment where dockid='{$commentid}' and isshow=1 order by addtime asc";
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        $userinfo = $GLOBALS['User']->getInfoByMid($row['memberid']);
        $row['litpic'] = $userinfo['litpic'] ? $userinfo['litpic'] : '/templets/smore/images/member_default.gif';
        $row['nickname'] = empty($userinfo['nick']) ? '匿名' : $userinfo['nickname'];
        $replymember = loc_getCommentMemberInfo($row['pid']);
        $row['replylitpic'] = getUploadFileUrl($replymember['litpic']);
        $row['replynickname'] = empty($replymember['nickname']) ? '匿名' : $replymember['nickname'];
        $row['replymemberid'] = $replymember['id'];
        $row['articleid'] = $articleid;
        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 #28
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 #29
0
/**
 * 友情链接调用标签
 *
 * @version        $Id: flink.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2013, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_flink(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|20,showall|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $typeid = isset($refObj->Fields['typeid']) ? $refObj->Fields['typeid'] : 0;
    //如果网页没有指定typeid则获取所有友情链接.
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $webid = $GLOBALS['sys_child_webid'];
    //webid赋值
    if ($showall == "all") {
        $sql = "select sitename,siteurl from #@__yqlj where webid='{$webid}'   order by addtime desc limit 0,{$row}";
    } else {
        $sql = "select sitename,siteurl from #@__yqlj where webid='{$webid}' and locate({$typeid},address) order by 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']++;
        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 #30
0
/**
 * 首页轮播广告调用
 *
 * @version        $Id: rolling.lib.php 1 9:29 2011.05.03 netman $
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2010, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_rollingad(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "typeid|0,name|IndexSpotRollingAd,row|30,limit|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if ($name == '') {
        return '';
    }
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $webid = $GLOBALS['sys_child_webid'];
    //webid赋值
    $sql = "SELECT * FROM #@__advertise WHERE tagname = '{$name}' and typeid=0 and webid='{$webid}'  ORDER BY displayorder asc limit {$limit},{$row}";
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['step'] = 0;
    while ($row = $dsql->GetArray()) {
        $GLOBALS['step']++;
        $row['picurl'] = $GLOBALS['cfg_cmsurl'] . $row['picurl'];
        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;
}