Пример #1
0
function lib_leftnav(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|20,";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $table = "#@__destinations";
    $sql = "select id,kindname,pinyin from {$table} where pid= 0 and isopen=1 order by displayorder asc";
    $kindnames = array();
    $ids = $pinyin = array();
    $arr = $dsql->getAll($sql);
    for ($i = 0; isset($arr[$i]['id']); $i++) {
        $ids[] = $arr[$i]['id'];
        $kindname[] = $arr[$i]['kindname'];
        $pinyin[] = $arr[$i]['pinyin'];
    }
    $GLOBALS['autoindex'] = 0;
    for ($k = 0; isset($ids[$k]); $k++) {
        $GLOBALS['autoindex']++;
        $pv = new View(0);
        $pv->Fields['kindname'] = $kindnames[$k];
        $pv->Fields['kindid'] = $ids[$k];
        $pv->Fields['pinyin'] = $pinyin[$k];
        $pv->SetTemplet($innertext, 'string');
        $revalue .= $pv->GetResult();
    }
    return $revalue;
}
Пример #2
0
function lib_helplist(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|5,helpkindid|,flag|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $artlist = '';
    $helpkindid = isset($refObj->Fields['helpkindid']) ? $refObj->Fields['helpkindid'] : '';
    //针对指定kindid只查询一个分类的信息.
    $typeid = isset($refObj->Fields['typeid']) ? $refObj->Fields['typeid'] : '0';
    if ($innertext == '') {
        return '';
    }
    //获得类别ID总数的信息
    $ids = array();
    $kindnames = array();
    if ($flag == 'all') {
        $sql = "select id,kindname,litpic from #@__help_kind where webid=0 and isopen=1 order by displayorder asc";
    } else {
        if ($helpkindid == '') {
            $sql = "select id,kindname,litpic from #@__help_kind where webid=0 and isopen=1 order by displayorder asc limit 0,{$row}";
        } else {
            $sql = "select id,kindname,litpic from #@__help_kind where webid=0 and isopen=1 and id={$helpkindid} order by displayorder asc limit 0,{$row}";
        }
    }
    $dsql->SetQuery($sql);
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        $ids[] = $row['id'];
        $kindnames[] = $row['kindname'];
        //获取帮助分类名称
        $imgsrc[] = $row['litpic'];
    }
    if (!isset($ids[0])) {
        return '';
    }
    //如里分类不存在则退出
    for ($i = 0; isset($ids[$i]); $i++) {
        $pv = new View($typeid);
        if ($imgsrc[$i] != '') {
            $kindname = "<img src=\"{$imgsrc[$i]}\" alt=\"{$kindnames[$i]}\">";
        } else {
            $kindname = $kindnames[$i];
        }
        $url = $GLOBALS['cfg_base_url'] . "/help/index_{$ids[$i]}.html";
        $pv->Fields['kindname'] = $kindname;
        $pv->Fields['helpkindname'] = $kindnames[$i];
        $pv->Fields['ids'] = $ids[$i];
        $pv->Fields['id'] = $ids[$i];
        $pv->Fields['sonid'] = $ids[$i];
        $pv->Fields['url'] = $url;
        $pv->Fields['litpic'] = $imgsrc[$i];
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
    }
    return $artlist;
}
Пример #3
0
function lib_attrgrouplist(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|8,flag|,filterid|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $artlist = '';
    $typeid = $typeid ? $typeid : $refObj->Fields['typeid'];
    if (empty($typeid)) {
        return '';
    }
    $tablearr = 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');
    $tablename = isset($tablearr[$typeid]) ? $tablearr[$typeid] : '#@__model_attr';
    if ($innertext == '') {
        return '';
    }
    //获得类别ID总数的信息
    $groupids = array();
    $groupnames = array();
    $w = !empty($filterid) ? " and id not in({$filterid})" : '';
    //排除不要的项
    $w .= $typeid > 13 ? " and typeid={$typeid}" : '';
    //如果是扩展模块,则增加typeid判断
    $dest_id = $GLOBALS['dest_id'] ? $GLOBALS['dest_id'] : 0;
    if ($flag == 'bydestid') {
        $w .= !empty($dest_id) ? " and FIND_IN_SET({$dest_id},destid)" : '';
    }
    $sql = "select id,attrname as groupname from {$tablename} where pid=0 and isopen=1 {$w} order by displayorder asc limit 0,{$row}";
    $dsql->SetQuery($sql);
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        $groupids[] = $row['id'];
        $groupnames[] = $row['groupname'];
        //获取组名
    }
    if (!isset($groupids[0])) {
        return '';
    }
    //如里不存在则退出
    $GLOBALS['itemindex'] = 0;
    for ($i = 0; isset($groupids[$i]); $i++) {
        $GLOBALS['itemindex']++;
        $pv = new View(0);
        $pv->Fields['groupname'] = $groupnames[$i];
        $pv->Fields['groupid'] = $groupids[$i];
        $pv->Fields['attrid'] = $groupids[$i];
        $pv->Fields['typeid'] = $typeid;
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
    }
    return $artlist;
}
Пример #4
0
function lib_logo(&$ctag, &$refObj)
{
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $a = !empty($GLOBALS['typeid']) ? $GLOBALS['typeid'] : '0';
    // $b=explode(',',$GLOBALS['cfg_logodisplay']);
    // if(in_array($a,$b) || $a=='12')
    $pv = new View(0);
    $pv->SetTemplet($innertext, 'string');
    $revalue .= $pv->GetResult();
    return $revalue;
}
Пример #5
0
function lib_getattrbygroupid(&$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}";
        $row = $dsql->GetOne($sql);
        if (is_array($row)) {
            $pid = $row['id'];
        }
    } else {
        $pid = empty($groupid) ? $refObj->Fields['attrid'] : $groupid;
    }
    if (empty($pid)) {
        return;
    }
    $sql = "select id,attrname from {$tablename} where pid='{$pid}' {$w} order by displayorder asc limit 0,{$row}";
    $dsql->SetQuery($sql);
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        $groupids[] = $row['id'];
        $groupnames[] = $row['attrname'];
        //获取组名
    }
    if (!isset($groupids[0])) {
        return '';
    }
    //如里不存在则退出
    $GLOBALS['itemindex'] = 0;
    for ($i = 0; isset($groupids[$i]); $i++) {
        $GLOBALS['itemindex']++;
        $pv = new View(0);
        $pv->Fields['groupname'] = $groupnames[$i];
        $pv->Fields['groupid'] = $groupids[$i];
        $pv->Fields['attrid'] = $groupids[$i];
        $pv->Fields['typeid'] = $typeid;
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
    }
    return $artlist;
}
Пример #6
0
function lib_getcarguide(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|8,flag|,limit|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $artlist = '';
    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;
    }
    //获得类别ID总数的信息
    $groupids = array();
    $groupnames = array();
    if (empty($sqlstr)) {
        return '';
    }
    $dsql->SetQuery($sqlstr);
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        $groupids[] = $row['id'];
        $groupnames[] = $row['kindname'];
        //获取组名
    }
    if (!isset($groupids[0])) {
        return '';
    }
    //如里不存在则退出
    $GLOBALS['itemindex'] = 0;
    for ($i = 0; isset($groupids[$i]); $i++) {
        $GLOBALS['itemindex']++;
        $pv = new View(0);
        $pv->Fields['groupname'] = $groupnames[$i];
        $pv->Fields['kindid'] = $groupids[$i];
        $pv->Fields['groupid'] = $groupids[$i];
        $pv->Fields['attrid'] = $groupids[$i];
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
    }
    return $artlist;
}
Пример #7
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;
}
Пример #8
0
function lib_arclist(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "flag|,groupname|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $artlist = '';
    if ($innertext == '') {
        return '';
    }
    //获得类别ID总数的信息
    $ids = array();
    $typenames = array();
    $pids = array();
    if ($flag == 'attrlist') {
        $sql = "select id from #@__article_attr where attrname='{$groupname}'";
        $ar = $dsql->GetOne($sql);
        $pid = $ar['id'];
        $sql = "select id,attrname from #@__article_attr where pid = '{$pid}'";
    }
    $dsql->SetQuery($sql);
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        $ids[] = $row['id'];
        $kindnames[] = $row['attrname'];
        //获取子栏目名称
    }
    if (!isset($ids[0])) {
        return '';
    }
    //如里不存在子栏目则退出
    $GLOBALS['itemindex'] = 0;
    for ($i = 0; isset($ids[$i]); $i++) {
        $GLOBALS['itemindex']++;
        $pv = new View($ids[$i]);
        $pv->Fields['attrid'] = $ids[$i];
        $pv->Fields['kindname'] = $kindnames[$i];
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
    }
    return $artlist;
}
Пример #9
0
function lib_getrightcontent(&$ctag, &$refObj)
{
    global $dsql, $sys_webid;
    include SLINEDATA . "/webinfo.php";
    $attlist = "pagename|index";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $typeid = isset($refObj->Fields['typeid']) ? $refObj->Fields['typeid'] : 0;
    //
    //if($typeid==0) return'';
    //if($pagename=="")return'';
    //$cloudlist="<div  id=\"search_right\"></div>"; //云搜索
    $webid = $GLOBALS['sys_child_webid'];
    $innertext = $cloudlist;
    $sql = "select moduleids from #@__module_config where webid={$webid} and shortname='{$pagename}' and typeid='{$typeid}'";
    $row = $dsql->GetOne($sql);
    if (is_array($row)) {
        $mids = explode(',', $row['moduleids']);
        //拆分
        for ($i = 0; isset($mids[$i]); $i++) {
            $sql = "select body from #@__module_list where aid='{$mids[$i]}' and webid={$sys_webid}";
            $dsql->SetQuery($sql);
            $dsql->Execute();
            while ($arr = $dsql->GetArray()) {
                $innertext .= $arr['body'];
            }
        }
    }
    $artlist = '';
    if ($innertext == '') {
        return '';
    }
    //如里为空则退出
    $GLOBALS['itemindex'] = 0;
    $GLOBALS['itemindex']++;
    $pv = new View($typeid);
    $pv->Fields['tagword'] = $refObj->Fields['tagword'];
    $pv->Fields['kindlist'] = $refObj->Fields['kindlist'];
    $pv->SetTemplet($innertext, 'string');
    $artlist .= $pv->GetResult();
    return $artlist;
}
Пример #10
0
function lib_slidenavlist(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|20,";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $sql = "select id,linkurl,kindname,litpic,remark,color from #@__plugin_leftnav where pid=0 and isopen=1  order by displayorder asc limit 0,{$row}";
    $kindnames = array();
    $ids = array();
    $linkurls = array();
    $litpics = array();
    $arr = $dsql->getAll($sql);
    for ($i = 0; isset($arr[$i]['id']); $i++) {
        $id = $arr[$i]['id'];
        $kindname = !empty($arr[$i]['color']) ? '<font color="' . $arr[$i]['color'] . '">' . $arr[$i]['kindname'] . '</font>' : $arr[$i]['kindname'];
        //$kindname=$arr[$i]['kindname'];
        $linkurl = $arr[$i]['linkurl'];
        $litpic = $arr[$i]['litpic'];
        $remark = $arr[$i]['remark'];
        array_push($ids, $id);
        array_push($kindnames, $kindname);
        array_push($litpics, $litpic);
        array_push($remarks, $remark);
        array_push($linkurls, $linkurl);
    }
    $GLOBALS['autoindex'] = 0;
    for ($k = 0; isset($ids[$k]); $k++) {
        $GLOBALS['autoindex']++;
        $pv = new View(0);
        $pv->Fields['kindname'] = $kindnames[$k];
        $pv->Fields['url'] = $linkurls[$k];
        $pv->Fields['kindid'] = $ids[$k];
        $pv->Fields['litpic'] = $litpics[$k];
        $pv->Fields['remark'] = $remarks[$k];
        $pv->SetTemplet($innertext, 'string');
        $revalue .= $pv->GetResult();
    }
    return $revalue;
}
Пример #11
0
function lib_if(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|20,showall|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $condition = isset($GLOBALS['condition'][$var]) ? $GLOBALS['condition'][$var] : 0;
    //
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    if ($condition) {
        $pv = new View(0);
        $pv->Fields['typeid'] = 0;
        $pv->Fields = $refObj->Fields;
        $pv->SetTemplet($innertext, 'string');
        $revalue .= $pv->GetResult();
    }
    return $revalue;
}
Пример #12
0
function lib_destlist(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|20,destid|,flag|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $artlist = '';
    $destid = isset($refObj->Fields['kindid']) ? $refObj->Fields['kindid'] : $destid;
    $destid = empty($destid) ? 0 : $destid;
    if ($innertext == '') {
        return '';
    }
    $tablename = '#@__destinations';
    //获得类别ID总数的信息
    $ids = array();
    $kindnames = array();
    $sql = "select id,kindname from {$tablename} where pid='{$destid}' and isopen=1 order by displayorder asc,pinyin asc";
    //获取下一级
    $dsql->SetQuery($sql);
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        $ids[] = $row['id'];
        $kindnames[] = $row['kindname'];
        //目的地名称
    }
    if (!isset($ids[0])) {
        return '';
    }
    //如里分类不存在则退出
    for ($i = 0; isset($ids[$i]); $i++) {
        $pv = new View(0);
        $pv->Fields['destname'] = $kindnames[$i];
        $pv->Fields['parentid'] = $ids[$i];
        $pv->Fields['kindid'] = $ids[$i];
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
    }
    return $artlist;
}
Пример #13
0
function lib_gettemplet(&$ctag, &$refObj)
{
    global $dsql, $sys_webid;
    include SLINEDATA . "/webinfo.php";
    $attlist = "pagename|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = '';
    $revalue = '';
    $sql = "select b.path from #@__site_page a left join #@__site_page_config b on a.id=b.pageid where a.pagename='{$pagename}' and b.isuse = 1 and webid='{$sys_webid}'";
    $row = $dsql->GetOne($sql);
    if (!empty($row['path'])) {
        $innertext = "{sline:include file='uploadtemplets/" . $row['path'] . "/index.htm'/}";
    } else {
        $innertext = "{sline:include file='public/" . $pagename . "_sys.htm'/}";
    }
    $pv = new View(0);
    $pv->SetTemplet($innertext, 'string');
    $revalue .= $pv->GetResult();
    return $revalue;
}
Пример #14
0
function lib_getsinglemodule(&$ctag, &$refObj)
{
    global $dsql, $sys_webid;
    include SLINEDATA . "/webinfo.php";
    $attlist = "name|index";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = '';
    $sql = "select body from #@__module_list where modulename='{$name}'";
    $row = $dsql->GetOne($sql);
    $innertext .= $row['body'];
    $out = '';
    if ($innertext == '') {
        return '';
    }
    //如里为空则退出
    $pv = new View(0);
    $pv->SetTemplet($innertext, 'string');
    $out .= $pv->GetResult();
    return $out;
}
Пример #15
0
function lib_getarcattrlist(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|8,flag|,filterid|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $artlist = '';
    $sql = "select * from #@__article_attr where isopen=1 and pid!=0 order by displayorder asc";
    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";
    }
    //获得类别ID总数的信息
    $groupids = array();
    $groupnames = array();
    $dsql->SetQuery($sql);
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        $groupids[] = $row['id'];
        $groupnames[] = $row['attrname'];
        //获取组名
    }
    if (!isset($groupids[0])) {
        return '';
    }
    //如里不存在则退出
    $GLOBALS['itemindex'] = 0;
    for ($i = 0; isset($groupids[$i]); $i++) {
        $GLOBALS['itemindex']++;
        $pv = new View(0);
        $pv->Fields['groupname'] = $groupnames[$i];
        $pv->Fields['groupid'] = $groupids[$i];
        $pv->Fields['attrid'] = $groupids[$i];
        $pv->Fields['typeid'] = $typeid;
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
    }
    return $artlist;
}
Пример #16
0
function lib_channelcheck(&$ctag, &$refObj)
{
    global $dsql, $sys_webid;
    include SLINEDATA . "/webinfo.php";
    $attlist = "typeid|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if (empty($typeid)) {
        return '';
    }
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $webid = $GLOBALS['sys_child_webid'];
    $sql = "select isopen from sline_nav where  typeid='{$typeid}' and webid='{$webid}'";
    $row = $dsql->GetOne($sql);
    if ($row['isopen'] == 1) {
        $pv = new View(0);
        $pv->SetTemplet($innertext, 'string');
        $revalue .= $pv->GetResult();
    }
    return $revalue;
}
Пример #17
0
function lib_plugincheck(&$ctag, &$refObj)
{
    global $dsql, $sys_webid;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|20,identify|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if (empty($identify)) {
        return '';
    }
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    /* $sql="select isopen from #@__plugins where  identify='$identify' and webid=$sys_webid";
    
       $row=$dsql->GetOne($sql);*/
    if ($GLOBALS[$identify] == 1) {
        $pv = new View(0);
        $pv->SetTemplet($innertext, 'string');
        $revalue .= $pv->GetResult();
    }
    return $revalue;
}
Пример #18
0
function lib_commentlist(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,flag|,typeid|1,limit|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    if ($innertext == '') {
        return '';
    }
    $id = $refObj->Fields['commenthomeid'];
    $pageno = $refObj->Fields['commentpage'];
    $pageno = empty($pageno) ? 1 : $pageno;
    if (empty($id) || empty($typeid)) {
        return '';
    }
    $offset = ($pageno - 1) * $row;
    $sql = "select * from #@__comment where articleid='{$id}' and typeid='{$typeid}' and pid=0 and isshow=1 order by addtime desc limit {$offset},{$row}";
    $result = $dsql->getAll($sql);
    $GLOBALS['itemindex'] = 0;
    foreach ($result as $k => $row) {
        $GLOBALS['itemindex']++;
        $pv = new View(0);
        $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'];
        $row['commentid'] = $row['id'];
        $row['articleid'] = $id;
        foreach ($row as $key => $val) {
            $pv->Fields[$key] = $val;
        }
        $pv->SetTemplet($innertext, 'string');
        $artlist .= $pv->GetResult();
    }
    return $artlist;
}
Пример #19
0
function getTjXianlu($destid)
{
    require_once SLINEINC . '/view.class.php';
    $out = '';
    $innertext = '  {sline:getlinelist type="mdd" flag="recommend" row="2"}
                              <dl>
                                  <dt>
                                      <a class="fl" href="[field:url/]" target="_blank"><img class="fl" src="[field:lit160/]" width="90" height="70" alt="[field:title/]" title="[field:title/]" /></a>
                                  <h4><a href="[field:url/]" target="_blank">[field:title/]</a></h4>
                                  <p><b>[field:price2/]</b><label>满意度:<span class="color_f60">[field:satisfyscore/]</span></label><label>预订量:<span class="color_f60">[field:sellnum/]</span></label></p>
                                  </dt>
                                  <dd><span class="color_f60">产品特点:</span>[field:sellpoint/]</dd>
                              </dl>
                              {/sline:getlinelist}';
    $pv = new View(0);
    $pv->Fields['kindid'] = $destid;
    $pv->SetTemplet($innertext, 'string');
    $out = $pv->GetResult();
    return $out;
}
Пример #20
0
function lib_middlenavlist(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|5,kindid|,flag|,type|,row|6,readad|1,limit|0,destid|,pid|,leftad|indexleftad,isnav|1,ishot|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $typeid = isset($refObj->Fields['typeid']) ? $refObj->Fields['typeid'] : 1;
    //首页的显示与线路一致.
    $adflag = '';
    if (!empty($flag)) {
        $tablename = array("1" => "#@__line_kindlist", "2" => "#@__hotel_kindlist", "3" => "#@__car_kindlist", "4" => "#@__article_kindlist", "5" => "#@__spot_kindlist", "6" => "#@__photo_kindlist", "13" => "#@__tuan_kindlist");
        if ($flag == 'raider') {
            $typeid = 4;
            if ($readad) {
                $adflag = "IndexRaiderMiddleNavAd";
            }
        } else {
            if ($flag == 'line') {
                $typeid = 1;
                if ($readad) {
                    $adflag = "IndexLineMiddleNav";
                }
            } else {
                if ($flag == 'hotel') {
                    $typeid = 2;
                    if ($readad) {
                        $adflag = "IndexHotelMiddleNav";
                    }
                } else {
                    if ($flag == 'car') {
                        $typeid = 3;
                    } else {
                        if ($flag == 'spot') {
                            $typeid = 5;
                        } else {
                            if ($flag == 'photo') {
                                $typeid = 6;
                            } else {
                                if ($flag == 'tuan') {
                                    $typeid = 13;
                                }
                            }
                        }
                    }
                }
            }
        }
        if (!empty($pid)) {
            $w = " and a.pid={$pid}";
        }
        $tablename = isset($tablename[$typeid]) ? $tablename[$typeid] : '#@__' . $flag . '_kindlist';
        if ($isnav == 1) {
            $sql = "select a.kindname,b.kindid,b.shownum,a.jieshao,a.pinyin,a.litpic,a.pinyin from  #@__destinations as a inner join {$tablename} as b on a.id=b.kindid where b.isnav=1 and a.isopen=1 {$w} order by b.displayorder asc limit {$limit},{$row}";
        } else {
            if ($ishot == 1) {
                $sql = "select a.kindname,b.kindid,b.shownum,a.jieshao,a.pinyin,a.litpic,a.pinyin from  #@__destinations as a inner join {$tablename} as b on a.id=b.kindid where b.ishot=1 and a.isopen=1 {$w} order by b.displayorder asc limit {$limit},{$row}";
            } else {
                $sql = "select a.kindname,b.kindid,b.shownum,a.jieshao,a.pinyin,a.litpic,a.pinyin from  #@__destinations as a inner join {$tablename} as b on a.id=b.kindid where a.isopen=1 {$w} order by b.displayorder asc limit {$limit},{$row}";
            }
        }
    }
    if ($type == 'gather') {
        $kindid = isset($refObj->Fields['kindid']) ? $refObj->Fields['kindid'] : 36;
        if ($destid) {
            $kindid = $destid;
        }
        if (isHasChild($kindid)) {
            $sql = "select id as kindid,kindname,pinyin,litpic from #@__destinations  where pid={$kindid} and isopen=1 order by displayorder asc limit 0,{$row}";
        } else {
            $sql = "select id as kindid,kindname,pinyin,litpic from #@__destinations  where id={$kindid} and isopen=1 order by displayorder asc limit 0,{$row}";
        }
    }
    //首页目的地显示
    if ($type == 'index') {
        $sql = "select a.id as kindid,a.* from #@__destinations a where a.isnav = '1' and a.isopen = 1 order by a.displayorder asc limit {$limit},{$row}";
        $adflag = "IndexMiddleAd";
    }
    //$adflag="IndexMiddleAd";
    $innertext = trim($ctag->GetInnerText());
    $artlist = '';
    if ($innertext == '') {
        return '';
    }
    //获得类别ID总数的信息
    $ids = array();
    $kindnames = array();
    $dsql->SetQuery($sql);
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        //if(Exist($row['kindid'],$typeid))
        //{
        $ids[] = $row['kindid'];
        $kindnames[] = $row['kindname'];
        //获取导航分类名称
        $shownumber[] = !empty($row['shownum']) ? $row['shownum'] : 8;
        $pinyins[] = $row['pinyin'];
        $litpic[] = getUploadFileUrl($row['litpic']);
        $jieshao[] = $row['jieshao'];
        //}
        //$numbers[]=$row['row'];//显示数量
    }
    //如里子分类不存在则取当前级(聚合页面用)
    /* if(!isset($ids[0]))
    	  {
    		  $kindid=$refObj->Fields['kindid'];
    		  $kindnames[]=$refObj->Fields['kindname'];
    		  $ids[]=$kindid;
    		   
    	  } */
    $GLOBALS['itemindex'] = 0;
    for ($i = 0; isset($ids[$i]); $i++) {
        $GLOBALS['itemindex']++;
        $newinnertext = $innertext;
        $pv = new View($typeid);
        $pv->Fields['leftad'] = getMiddleAd($leftad, $i);
        $pv->Fields['middlead'] = getMiddleAd($adflag, $i);
        $pv->Fields['kindname'] = $kindnames[$i];
        //$pv->Fields['sonid']=$ids[$i];
        //$pv->Fields['shownumber']=$numbers[$i];
        $pv->Fields['pinyin'] = !empty($pinyins[$i]) ? $pinyins[$i] : $ids[$i];
        $pv->Fields['shownum'] = $shownumber[$i];
        $pv->Fields['kindid'] = $ids[$i];
        $pv->Fields['destid'] = $ids[$i];
        $pv->Fields['kindpy'] = $pinyins[$i];
        $pv->Fields['jieshao'] = $jieshao[$i];
        //$pv->Fields['kindchild']=GetChild($ids[$i],$typeid);
        $pv->Fields['litpic'] = $litpic[$i];
        $pv->SetTemplet($newinnertext, 'string');
        $artlist .= $pv->GetResult();
    }
    return $artlist;
}