当前位置: 首页>>代码示例>>PHP>>正文


PHP GetSonIds函数代码示例

本文整理汇总了PHP中GetSonIds函数的典型用法代码示例。如果您正苦于以下问题:PHP GetSonIds函数的具体用法?PHP GetSonIds怎么用?PHP GetSonIds使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetSonIds函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetTotalArc

 function GetTotalArc($tid)
 {
     if (!is_array($this->CatalogNums)) {
         $this->UpdateCatalogNum();
     }
     if (!isset($this->CatalogNums[$tid])) {
         return 0;
     } else {
         $totalnum = 0;
         $ids = explode(',', GetSonIds($tid));
         foreach ($ids as $tid) {
             if (isset($this->CatalogNums[$tid])) {
                 $totalnum += $this->CatalogNums[$tid];
             }
         }
         return $totalnum;
     }
 }
开发者ID:iabing,项目名称:mzzyc,代码行数:18,代码来源:typeunit.class.admin.php

示例2: dirname

require_once dirname(__FILE__) . "/config.php";
require_once DEDEINC . "/arc.caicai.class.php";
$sort = trim(empty($sort) ? 'lastpost' : preg_replace("#[^0-9a-z]#i", '', $sort));
if (!preg_match("#^(scores|badpost|goodpost)\$#", $sort)) {
    $sort = 'lastpost';
}
$tid = isset($tid) ? intval($tid) : 0;
$t1 = ExecTime();
$typequery = '';
$menutype = 'mydede';
$menutype_son = 'cc';
//获取栏目的子类、交叉分类
if ($tid != 0) {
    $arr = $dsql->GetOne("SELECT * FROM `#@__arctype` WHERE id='{$tid}' AND corank=0 ");
    if ($cfg_list_son == 'Y') {
        $CrossID = GetSonIds($tid, $arr['channeltype']);
    } else {
        $CrossID = $tid;
    }
    if ($arr['cross'] > 0) {
        $selquery = '';
        if ($arr['cross'] == 1) {
            $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$arr['typename']}' AND id<>'{$tid}' AND topid<>'{$tid}'  ";
        } else {
            $arr['crossid'] = preg_replace("#[^0-9,]#", '', trim($arr['crossid']));
            if ($arr['crossid'] != '') {
                $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id in('{$arr['crossid']}') AND id<>'{$tid}' AND topid<>'{$tid}'  ";
            }
        }
        if ($selquery != '') {
            $dsql->SetQuery($selquery);
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:fxtg.php

示例3: CountRecord

 function CountRecord()
 {
     $this->TotalResult = -1;
     if (isset($GLOBALS['TotalResult'])) {
         $this->TotalResult = $GLOBALS['TotalResult'];
     }
     if (isset($GLOBALS['PageNo'])) {
         $this->PageNo = $GLOBALS['PageNo'];
     } else {
         $this->PageNo = 1;
     }
     $ksql = $this->GetKeywordSql();
     $ksqls = array();
     if ($this->StartTime > 0) {
         $ksqls[] = " arc.senddate>'" . $this->StartTime . "' ";
     }
     if ($this->TypeID > 0) {
         $ksqls[] = " typeid in (" . GetSonIds($this->TypeID) . ") ";
     }
     if ($this->ChannelType > 0) {
         $ksqls[] = " arc.channel='" . $this->ChannelType . "'";
     }
     if ($this->mid > 0) {
         $ksqls[] = " arc.mid = '" . $this->mid . "'";
     }
     $ksqls[] = " arc.arcrank > -1 ";
     $this->AddSql = $ksql == '' ? join(' And ', $ksqls) : join(' And ', $ksqls) . " And ({$ksql})";
     $cquery = "Select * From `#@__archives` arc where " . $this->AddSql;
     $hascode = md5($cquery);
     $row = $this->dsql->GetOne("Select * From `#@__arccache` where `md5hash`='" . $hascode . "' ");
     $uptime = time();
     if (is_array($row) && time() - $row['uptime'] < 3600 * 24) {
         $aids = explode(',', $row['cachedata']);
         $this->TotalResult = count($aids) - 1;
         $this->RsFields = $row['cachedata'];
     } else {
         if ($this->TotalResult == -1) {
             $this->dsql->SetQuery($cquery);
             $this->dsql->execute();
             $aidarr = array();
             $aidarr[] = 0;
             while ($row = $this->dsql->getarray()) {
                 $aidarr[] = $row['id'];
             }
             $nums = count($aidarr) - 1;
             $aids = implode(',', $aidarr);
             $delete = "Delete From `#@__arccache` where uptime<" . (time() - 3600 * 24);
             $this->dsql->SetQuery($delete);
             $this->dsql->executenonequery();
             $insert = "insert into `#@__arccache` (`md5hash`, `uptime`, `cachedata`)\r\n\t\t\t\t values('{$hascode}', '{$uptime}', '{$aids}')";
             $this->dsql->SetQuery($insert);
             $this->dsql->executenonequery();
             $this->TotalResult = $nums;
         }
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:56,代码来源:arc.searchview.class.php

示例4: ShowMsg

    }
    //更改子栏目属性
    if (!empty($upnext)) {
        $upquery = "Update `#@__arctype` set\r\n       issend='{$issend}',\r\n       defaultname='{$defaultname}',\r\n       channeltype='{$channeltype}',\r\n       tempindex='{$tempindex}',\r\n       templist='{$templist}',\r\n       temparticle='{$temparticle}',\r\n       namerule='{$namerule}',\r\n       namerule2='{$namerule2}',\r\n       ishidden='{$ishidden}'\r\n     where 1=1 And {$slinks}";
        if (!$dsql->ExecuteNoneQuery($upquery)) {
            ShowMsg("更改当前栏目成功,但更改下级栏目属性时失败!", "-1");
            exit;
        }
    }
    UpDateCatCache();
    ShowMsg("成功更改一个分类!", "catalog_main.php");
    exit;
} else {
    if ($dopost == "savetime") {
        $uptopsql = '';
        $slinks = " id in (" . GetSonIds($id) . ")";
        //顶级栏目二级域名根目录处理
        if ($topid == 0 && $moresite == 1) {
            $sitepath = $typedir;
            $uptopsql = " ,sitepath='{$sitepath}' ";
            if (ereg(',', $slinks)) {
                $upquery = "Update `#@__arctype` set sitepath='{$sitepath}' where {$slinks}";
                $dsql->ExecuteNoneQuery($upquery);
            }
        }
        //如果选择子栏目可投稿,更新顶级栏目为可投稿
        if ($topid > 0 && $issend == 1) {
            $dsql->ExecuteNoneQuery("Update `#@__arctype` set issend='{$issend}' where id='{$topid}'; ");
        }
        $upquery = "Update `#@__arctype` set\r\n     issend='{$issend}',\r\n     sortrank='{$sortrank}',\r\n     typedir='{$typedir}',\r\n     typename='{$typename}',\r\n   \t isdefault='{$isdefault}',\r\n     defaultname='{$defaultname}',\r\n     ispart='{$ispart}',\r\n     corank='{$corank}' {$uptopsql}\r\n\twhere id='{$id}' ";
        if (!$dsql->ExecuteNoneQuery($upquery)) {
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:catalog_edit.php

示例5: plus_channel

/**
 * 动态模板channel标签
 *
 * @version        $Id: plus_ask.php 1 13:58 2010年7月5日Z tianya $
 * @package        DedeCMS.Tpllib
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
function plus_channel(&$atts, &$refObj, &$fields)
{
    global $dsql, $_vars;
    $attlist = "typeid=0,reid=0,row=100,type=son,currentstyle=";
    FillAtts($atts, $attlist);
    FillFields($atts, $fields, $refObj);
    extract($atts, EXTR_OVERWRITE);
    $line = empty($row) ? 100 : $row;
    $reArray = array();
    $reid = 0;
    $topid = 0;
    //如果属性里没指定栏目id,从引用类里获取栏目信息
    if (empty($typeid)) {
        if (isset($refObj->TypeLink->TypeInfos['id'])) {
            $typeid = $refObj->TypeLink->TypeInfos['id'];
            $reid = $refObj->TypeLink->TypeInfos['reid'];
            $topid = $refObj->TypeLink->TypeInfos['topid'];
        } else {
            $typeid = 0;
        }
    } else {
        $row2 = $dsql->GetOne("SELECT * FROM `#@__arctype` WHERE id='{$typeid}' ");
        $typeid = $row2['id'];
        $reid = $row2['reid'];
        $topid = $row2['topid'];
        $issetInfos = true;
    }
    if ($type == '' || $type == 'sun') {
        $type = 'son';
    }
    if ($type == 'top') {
        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n          FROM `#@__arctype` WHERE reid=0 AND ishidden<>1 ORDER BY sortrank ASC LIMIT 0, {$line} ";
    } else {
        if ($type == 'son') {
            if ($typeid == 0) {
                return $reArray;
            }
            $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n          FROM `#@__arctype` WHERE reid='{$typeid}' AND ishidden<>1 ORDER BY sortrank ASC LIMIT 0, {$line} ";
        } else {
            if ($type == 'self') {
                if ($reid == 0) {
                    return $reArray;
                }
                $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n            FROM `#@__arctype` WHERE reid='{$reid}' AND ishidden<>1 ORDER BY sortrank ASC LIMIT 0, {$line} ";
            }
        }
    }
    //检查是否有子栏目,并返回rel提示(用于二级菜单)
    $needRel = true;
    if (empty($sql)) {
        return $reArray;
    }
    $dsql->Execute('me', $sql);
    $totalRow = $dsql->GetTotalRow('me');
    //如果用子栏目模式,当没有子栏目时显示同级栏目
    if ($type == 'son' && $reid != 0 && $totalRow == 0) {
        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n            FROM `#@__arctype` WHERE reid='{$reid}' AND ishidden<>1 ORDER BY sortrank ASC LIMIT 0, {$line} ";
        $dsql->Execute('me', $sql);
    }
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        $row['currentstyle'] = $row['sonids'] = $row['rel'] = '';
        if ($needRel) {
            $row['sonids'] = GetSonIds($row['id'], 0, false);
            if ($row['sonids'] == '') {
                $row['rel'] = '';
            } else {
                $row['rel'] = " rel='dropmenu{$row['id']}'";
            }
        }
        //处理同级栏目中,当前栏目的样式
        if (($row['id'] == $typeid || $topid == $row['id'] && $type == 'top') && $currentstyle != '') {
            $row['currentstyle'] = $currentstyle;
        }
        $row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);
        $reArray[] = $row;
        $GLOBALS['autoindex']++;
    }
    //Loop for $i
    $dsql->FreeResult();
    return $reArray;
}
开发者ID:iabing,项目名称:mzzyc,代码行数:91,代码来源:plus_channel.php

示例6: exit

         exit('Error!');
     }
     require_once dirname(__FILE__) . "/include/datalistcp.class.php";
     $row = $dsql->GetOne("Select typename,ishidden From `#@__arctype` where id='{$id}' ");
     if ($row['ishidden'] == 1) {
         exit;
     }
     $typename = ConvertStr($row['typename']);
     //当前栏目下级分类
     $dsql->SetQuery("Select id,typename From `#@__arctype` where reid='{$id}' And channeltype=1 And ishidden=0 And ispart<>2 order by sortrank");
     $dsql->Execute();
     while ($row = $dsql->GetObject()) {
         $channellistnext .= "<a href='wap.php?action=list&amp;id={$row->id}'>" . ConvertStr($row->typename) . "</a> ";
     }
     //栏目内容(分页输出)
     $sids = GetSonIds($id, 1, true);
     $varlist = "cfg_webname,typename,channellist,channellistnext,cfg_templeturl";
     ConvertCharset($varlist);
     $dlist = new DataListCP();
     $dlist->SetTemplet($cfg_templets_dir . "/wap/list.wml");
     $dlist->pageSize = 10;
     $dlist->SetParameter("action", "list");
     $dlist->SetParameter("id", $id);
     $dlist->SetSource("Select id,title,pubdate,click From `#@__archives` where typeid in({$sids}) And arcrank=0 order by id desc");
     $dlist->Display();
     exit;
 } else {
     if ($action == 'article') {
         //文档信息
         $query = "\r\n\t  Select tp.typename,tp.ishidden,arc.typeid,arc.title,arc.arcrank,arc.pubdate,arc.writer,arc.click,addon.body From `#@__archives` arc \r\n\t  left join `#@__arctype` tp on tp.id=arc.typeid\r\n\t  left join `#@__addonarticle` addon on addon.aid=arc.id\r\n\t  where arc.id='{$id}'\r\n\t";
         $row = $dsql->GetOne($query, MYSQL_ASSOC);
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:wap.php

示例7: dirname

<?php

require_once dirname(__FILE__) . '/config.php';
CheckPurview('a_List,a_AccList,a_MyList');
require_once DEDEINC . '/datalistcp.class.php';
if (empty($cid)) {
    $cid = '0';
    $whereSql = '';
}
if ($cid != 0) {
    require_once DEDEINC . '/channelunit.func.php';
    $whereSql = " And arc.typeid in (" . GetSonIds($cid) . ")";
}
$query = "SELECT arc.*,tp.typename FROM `#@__archives` AS arc\r\nLEFT JOIN #@__arctype AS tp ON arc.typeid = tp.id\r\nWHERE arc.arcrank = '-2' {$whereSql} order by arc.id desc";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN . "/templets/recycling.htm");
$dlist->SetSource($query);
$dlist->display();
开发者ID:klr2003,项目名称:sourceread,代码行数:18,代码来源:recycling.php

示例8: lib_arclistDone


//.........这里部分代码省略.........
            $orwheres[] = " arc.mid = '{$wmid}' ";
        }
        //时间限制(用于调用最近热门文章、热门评论之类),这里的时间只能计算到天,否则缓存功能将无效
        if ($subday > 0) {
            $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y'));
            $limitday = $ntime - $subday * 24 * 3600;
            $orwheres[] = " arc.senddate > {$limitday} ";
        }
        //关键字条件
        if ($keyword != '') {
            $keyword = str_replace(',', '|', $keyword);
            $orwheres[] = " CONCAT(arc.title,arc.keywords) REGEXP '{$keyword}' ";
        }
        //文档属性
        if (preg_match('/commend/i', $listtype)) {
            $orwheres[] = " FIND_IN_SET('c', arc.flag)>0  ";
        }
        if (preg_match('/image/i', $listtype)) {
            $orwheres[] = " FIND_IN_SET('p', arc.flag)>0  ";
        }
        if ($att != '') {
            $flags = explode(',', $att);
            for ($i = 0; isset($flags[$i]); $i++) {
                $orwheres[] = " FIND_IN_SET('{$flags[$i]}', arc.flag)>0 ";
            }
        }
        if (!empty($typeid) && $typeid != 'top') {
            //指定了多个栏目时,不再获取子类的id
            if (preg_match('#,#', $typeid)) {
                //指定了getall属性或主页模板例外
                if ($getall == 1 || empty($refObj->Fields['typeid'])) {
                    $typeids = explode(',', $typeid);
                    foreach ($typeids as $ttid) {
                        $typeidss[] = GetSonIds($ttid);
                    }
                    $typeidStr = join(',', $typeidss);
                    $typeidss = explode(',', $typeidStr);
                    $typeidssok = array_unique($typeidss);
                    $typeid = join(',', $typeidssok);
                }
                $orwheres[] = " arc.typeid IN ({$typeid}) ";
            } else {
                //处理交叉栏目
                $CrossID = '';
                if ($ctag->GetAtt('cross') == '1') {
                    $arr = $dsql->GetOne("SELECT `id`,`topid`,`cross`,`crossid`,`ispart`,`typename` FROM `#@__arctype` WHERE id='{$typeid}' ");
                    if ($arr['cross'] == 0 || $arr['cross'] == 2 && trim($arr['crossid'] == '')) {
                        $orwheres[] = ' arc.typeid IN (' . GetSonIds($typeid) . ')';
                    } else {
                        $selquery = '';
                        if ($arr['cross'] == 1) {
                            $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$arr['typename']}' AND id<>'{$typeid}' AND topid<>'{$typeid}'  ";
                        } else {
                            $arr['crossid'] = preg_replace('#[^0-9,]#', '', trim($arr['crossid']));
                            if ($arr['crossid'] != '') {
                                $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id IN('{$arr['crossid']}') AND id<>'{$typeid}' AND topid<>'{$typeid}'  ";
                            }
                        }
                        if ($selquery != '') {
                            $dsql->SetQuery($selquery);
                            $dsql->Execute();
                            while ($arr = $dsql->GetArray()) {
                                $CrossID .= $CrossID == '' ? $arr['id'] : ',' . $arr['id'];
                            }
                        }
                    }
开发者ID:iabing,项目名称:mzzyc,代码行数:67,代码来源:arclist.lib.php

示例9: lib_arclistDone

function lib_arclistDone(&$refObj, &$ctag, $typeid = 0, $row = 10, $col = 1, $titlelen = 30, $infolen = 160, $imgwidth = 120, $imgheight = 90, $listtype = 'all', $orderby = 'default', $keyword = '', $innertext = '', $arcid = 0, $idlist = '', $channelid = 0, $limit = '', $att = '', $order = 'desc', $subday = 0, $noflag = '')
{
    global $dsql, $PubFields, $cfg_keyword_like, $cfg_index_cache, $_arclistEnv, $envs, $cfg_cache_type;
    $row = AttDef($row, 10);
    $titlelen = AttDef($titlelen, 30);
    $infolen = AttDef($infolen, 160);
    $imgwidth = AttDef($imgwidth, 120);
    $imgheight = AttDef($imgheight, 120);
    $listtype = AttDef($listtype, 'all');
    $arcid = AttDef($arcid, 0);
    $channelid = AttDef($channelid, 0);
    $orderby = AttDef($orderby, 'default');
    $orderWay = AttDef($order, 'desc');
    $subday = AttDef($subday, 0);
    $line = $row;
    $orderby = strtolower($orderby);
    $keyword = trim($keyword);
    $innertext = trim($innertext);
    $tablewidth = $ctag->GetAtt('tablewidth');
    $writer = $ctag->GetAtt('writer');
    if ($tablewidth == "") {
        $tablewidth = 100;
    }
    if (empty($col)) {
        $col = 1;
    }
    $colWidth = ceil(100 / $col);
    $tablewidth = $tablewidth . "%";
    $colWidth = $colWidth . "%";
    if ($innertext == '') {
        $innertext = GetSysTemplets('part_arclist.htm');
    }
    if (@$ctag->GetAtt('getall') == 1) {
        $getall = 1;
    } else {
        $getall = 0;
    }
    if ($att == '0') {
        $att = '';
    }
    if ($att == '3') {
        $att = 'f';
    }
    if ($att == '1') {
        $att = 'h';
    }
    $orwheres = array();
    $maintable = '#@__archives';
    //按不同情况设定SQL条件 排序方式
    if ($idlist == '') {
        if ($orderby == 'near' && $cfg_keyword_like == 'N') {
            $keyword = '';
        }
        if ($writer == 'this') {
            $wmid = isset($refObj->Fields['mid']) ? $refObj->Fields['mid'] : 0;
            $orwheres[] = " arc.mid = '{$wmid}' ";
        }
        //时间限制(用于调用最近热门文章、热门评论之类),这里的时间只能计算到天,否则缓存功能将无效
        if ($subday > 0) {
            $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y'));
            $limitday = $ntime - $subday * 24 * 3600;
            $orwheres[] = " arc.senddate > {$limitday} ";
        }
        //关键字条件
        if ($keyword != '') {
            $keyword = str_replace(',', '|', $keyword);
            $orwheres[] = " CONCAT(arc.title,arc.keywords) REGEXP '{$keyword}' ";
        }
        //文档属性
        if (eregi('commend', $listtype)) {
            $orwheres[] = " FIND_IN_SET('c', arc.flag)>0  ";
        }
        if (eregi('image', $listtype)) {
            $orwheres[] = " FIND_IN_SET('p', arc.flag)>0  ";
        }
        if ($att != '') {
            $flags = explode(',', $att);
            for ($i = 0; isset($flags[$i]); $i++) {
                $orwheres[] = " FIND_IN_SET('{$flags[$i]}', arc.flag)>0 ";
            }
        }
        if (!empty($typeid) && $typeid != 'top') {
            //指定了多个栏目时,不再获取子类的id
            if (ereg(',', $typeid)) {
                //指定了getall属性或主页模板例外
                if ($getall == 1 || empty($refObj->Fields['typeid'])) {
                    $typeids = explode(',', $typeid);
                    foreach ($typeids as $ttid) {
                        $typeidss[] = GetSonIds($ttid);
                    }
                    $typeidStr = join(',', $typeidss);
                    $typeidss = explode(',', $typeidStr);
                    $typeidssok = array_unique($typeidss);
                    $typeid = join(',', $typeidssok);
                }
                $orwheres[] = " arc.typeid in ({$typeid}) ";
            } else {
                //处理交叉栏目
                $CrossID = '';
                if ($ctag->GetAtt('cross') == '1') {
//.........这里部分代码省略.........
开发者ID:klr2003,项目名称:sourceread,代码行数:101,代码来源:arclist.lib.php

示例10: CountRecord

 /**
  *  统计列表里的记录
  *
  * @access    public
  * @return    void
  */
 function CountRecord()
 {
     global $cfg_list_son;
     //统计数据库记录
     $this->TotalResult = -1;
     if (isset($GLOBALS['TotalResult'])) {
         $this->TotalResult = $GLOBALS['TotalResult'];
     }
     if (isset($GLOBALS['PageNo'])) {
         $this->PageNo = $GLOBALS['PageNo'];
     } else {
         $this->PageNo = 1;
     }
     $this->addSql = " arc.arcrank > -1 ";
     //栏目id条件
     if (!empty($this->TypeID)) {
         if ($cfg_list_son == 'N') {
             if ($this->CrossID == '') {
                 $this->addSql .= " AND (arc.typeid='" . $this->TypeID . "') ";
             } else {
                 $this->addSql .= " AND (arc.typeid IN({$this->CrossID},{$this->TypeID})) ";
             }
         } else {
             if ($this->CrossID == '') {
                 $this->addSql .= " AND (arc.typeid IN (" . GetSonIds($this->TypeID, $this->Fields['channeltype']) . ") ) ";
             } else {
                 $this->addSql .= " AND (arc.typeid IN (" . GetSonIds($this->TypeID, $this->Fields['channeltype']) . ",{$this->CrossID}) ) ";
             }
         }
     }
     $naddQuery = '';
     //地区与信息类型条件
     if (count($this->searchArr) > 0) {
         if (!empty($this->searchArr['nativeplace'])) {
             if ($this->searchArr['nativeplace'] % 500 == 0) {
                 $naddQuery .= " AND arc.nativeplace >= '{$this->searchArr['nativeplace']}' AND arc.nativeplace < '" . ($this->searchArr['nativeplace'] + 500) . "'";
             } else {
                 $naddQuery .= "AND arc.nativeplace = '{$this->searchArr['nativeplace']}'";
             }
         }
         if (!empty($this->searchArr['infotype'])) {
             if ($this->searchArr['infotype'] % 500 == 0) {
                 $naddQuery .= " AND arc.infotype >= '{$this->searchArr['infotype']}' AND arc.infotype < '" . ($this->searchArr['infotype'] + 500) . "'";
             } else {
                 $naddQuery .= "AND arc.infotype = '{$this->searchArr['infotype']}'";
             }
         }
         if (!empty($this->searchArr['keyword'])) {
             $naddQuery .= "AND arc.title like '%{$this->searchArr['keyword']}%' ";
         }
     }
     if ($naddQuery != '') {
         $this->sAddTable = true;
         $this->addSql .= $naddQuery;
     }
     if ($this->TotalResult == -1) {
         if ($this->sAddTable) {
             $cquery = "SELECT COUNT(*) AS dd FROM `{$this->AddTable}` arc WHERE " . $this->addSql;
         } else {
             $cquery = "SELECT COUNT(*) AS dd FROM `#@__arctiny` arc WHERE " . $this->addSql;
         }
         $row = $this->dsql->GetOne($cquery);
         if (is_array($row)) {
             $this->TotalResult = $row['dd'];
         } else {
             $this->TotalResult = 0;
         }
     }
     //初始化列表模板,并统计页面总数
     $tempfile = $GLOBALS['cfg_basedir'] . $GLOBALS['cfg_templets_dir'] . "/" . $this->TypeLink->TypeInfos['templist'];
     $tempfile = str_replace("{tid}", $this->TypeID, $tempfile);
     $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile);
     if (!file_exists($tempfile)) {
         $tempfile = $GLOBALS['cfg_basedir'] . $GLOBALS['cfg_templets_dir'] . "/" . $GLOBALS['cfg_df_style'] . "/list_default_sg.htm";
     }
     if (!file_exists($tempfile) || !is_file($tempfile)) {
         echo "模板文件不存在,无法解析文档!";
         exit;
     }
     $this->dtp->LoadTemplate($tempfile);
     $ctag = $this->dtp->GetTag("page");
     if (!is_object($ctag)) {
         $ctag = $this->dtp->GetTag("list");
     }
     if (!is_object($ctag)) {
         $this->PageSize = 20;
     } else {
         if ($ctag->GetAtt('pagesize') != '') {
             $this->PageSize = $ctag->GetAtt('pagesize');
         } else {
             $this->PageSize = 20;
         }
     }
     $this->TotalPage = ceil($this->TotalResult / $this->PageSize);
//.........这里部分代码省略.........
开发者ID:cwcw,项目名称:cms,代码行数:101,代码来源:arc.sglistview.class.php

示例11: dirname

<?php

/**
 * 回收站
 *
 * @version        $Id: recycling.php 1 15:46 2010年7月20日Z tianya $
 * @package        DedeCMS.Administrator
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once dirname(__FILE__) . '/config.php';
CheckPurview('a_List,a_AccList,a_MyList');
require_once DEDEINC . '/datalistcp.class.php';
if (empty($cid)) {
    $cid = '0';
    $whereSql = '';
}
if ($cid != 0) {
    require_once DEDEINC . '/channelunit.func.php';
    $whereSql = " AND arc.typeid IN (" . GetSonIds($cid) . ")";
}
$query = "SELECT arc.*,tp.typename FROM `#@__archives` AS arc\nLEFT JOIN #@__arctype AS tp ON arc.typeid = tp.id\nWHERE arc.arcrank = '-2' {$whereSql} order by arc.id desc";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN . "/templets/recycling.htm");
$dlist->SetSource($query);
$dlist->display();
开发者ID:hensonvip,项目名称:ymroad,代码行数:27,代码来源:recycling.php

示例12: lib_channel

function lib_channel(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = $ctag->GetInnerText();
    $line = empty($row) ? 100 : $row;
    $likeType = '';
    //读取固定的缓存块
    $cacheid = trim($cacheid);
    if ($cacheid != '') {
        $likeType = GetCacheBlock($cacheid);
        if ($likeType != '') {
            return $likeType;
        }
    }
    $reid = 0;
    $topid = 0;
    //如果属性里没指定栏目id,从引用类里获取栏目信息
    if (empty($typeid)) {
        if (isset($refObj->TypeLink->TypeInfos['id'])) {
            $typeid = $refObj->TypeLink->TypeInfos['id'];
            $reid = $refObj->TypeLink->TypeInfos['reid'];
            $topid = $refObj->TypeLink->TypeInfos['topid'];
        } else {
            $typeid = 0;
        }
    } else {
        $row2 = $dsql->GetOne("Select * From `#@__arctype` where id='{$typeid}' ");
        $typeid = $row2['id'];
        $reid = $row2['reid'];
        $topid = $row2['topid'];
        $issetInfos = true;
    }
    if ($type == '' || $type == 'sun') {
        $type = 'son';
    }
    if ($innertext == '') {
        $innertext = GetSysTemplets("channel_list.htm");
    }
    if ($type == 'top') {
        $sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n\t\t  From `#@__arctype` where reid=0 And ishidden<>1 order by sortrank asc limit 0, {$line} ";
    } else {
        if ($type == 'son') {
            if ($typeid == 0) {
                return '';
            }
            $sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n\t\t  From `#@__arctype` where reid='{$typeid}' And ishidden<>1 order by sortrank asc limit 0, {$line} ";
        } else {
            if ($type == 'self') {
                if ($reid == 0) {
                    return '';
                }
                $sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n\t\t\tFrom `#@__arctype` where reid='{$reid}' And ishidden<>1 order by sortrank asc limit 0, {$line} ";
            }
        }
    }
    //And id<>'$typeid'
    $needRel = false;
    $dtp2 = new DedeTagParse();
    $dtp2->SetNameSpace('field', '[', ']');
    $dtp2->LoadSource($innertext);
    //检查是否有子栏目,并返回rel提示(用于二级菜单)
    if (ereg(':rel', $innertext)) {
        $needRel = true;
    }
    if (empty($sql)) {
        return '';
    }
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $totalRow = $dsql->GetTotalRow();
    //如果用子栏目模式,当没有子栏目时显示同级栏目
    if ($type == 'son' && $reid != 0 && $totalRow == 0) {
        $sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n\t\t\tFrom `#@__arctype` where reid='{$reid}' And ishidden<>1 order by sortrank asc limit 0, {$line} ";
        $dsql->SetQuery($sql);
        $dsql->Execute();
    }
    $GLOBALS['autoindex'] = 0;
    for ($i = 0; $i < $line; $i++) {
        if ($col > 1) {
            $likeType .= "<dl>\r\n";
        }
        for ($j = 0; $j < $col; $j++) {
            if ($col > 1) {
                $likeType .= "<dd>\r\n";
            }
            if ($row = $dsql->GetArray()) {
                $row['sonids'] = $row['rel'] = '';
                if ($needRel) {
                    $row['sonids'] = GetSonIds($row['id'], 0, false);
                    if ($row['sonids'] == '') {
                        $row['rel'] = '';
                    } else {
                        $row['rel'] = " rel='dropmenu{$row['id']}'";
                    }
                }
                //处理同级栏目中,当前栏目的样式
                if (($row['id'] == $typeid || $topid == $row['id'] && $type == 'top') && $currentstyle != '') {
//.........这里部分代码省略.........
开发者ID:klr2003,项目名称:sourceread,代码行数:101,代码来源:channel.lib.php

示例13: AND

    $flagsArr .= $frow['att'] == $flag ? "<option value='{$frow['att']}' selected>{$frow['attname']}</option>\r\n" : "<option value='{$frow['att']}'>{$frow['attname']}</option>\r\n";
}
if (!empty($userCatalogSql)) {
    $whereSql .= " AND " . $userCatalogSql;
}
if (!empty($mid)) {
    $whereSql .= " AND arc.mid = '{$mid}' ";
}
if ($keyword != '') {
    $whereSql .= " AND ( CONCAT(arc.title,arc.writer) LIKE '%{$keyword}%') ";
}
if ($flag != '') {
    $whereSql .= " AND FIND_IN_SET('{$flag}', arc.flag) ";
}
if ($cid != 0) {
    $whereSql .= ' AND arc.typeid IN (' . GetSonIds($cid) . ')';
}
if ($arcrank != '') {
    $whereSql .= " AND arc.arcrank = '{$arcrank}' ";
    $CheckUserSend = "<input type='button' class='coolbg np' onClick=\"location='catalog_do.php?cid=" . $cid . "&dopost=listArchives&gurl=content_list.php';\" value='所有文档' />";
} else {
    $CheckUserSend = "<input type='button' class='coolbg np' onClick=\"location='catalog_do.php?cid=" . $cid . "&dopost=listArchives&arcrank=-1&gurl=content_list.php';\" value='稿件审核' />";
}
$orderby = empty($orderby) ? 'id' : preg_replace("#[^a-z0-9]#", "", $orderby);
$orderbyField = 'arc.' . $orderby;
$query = "SELECT arc.id,arc.typeid,arc.senddate,arc.flag,arc.ismake,\narc.channel,arc.arcrank,arc.click,arc.title,arc.color,arc.litpic,arc.pubdate,arc.mid\nFROM `#@__archives` arc \n where arc.mid={$adminid}\nORDER BY {$orderbyField} DESC";
if (empty($f) || !preg_match("#form#", $f)) {
    $f = 'form1.arcid1';
}
//初始化
$dlist = new DataListCP();
开发者ID:puppylsy,项目名称:cms,代码行数:31,代码来源:content_list3.php

示例14: GetList

 function GetList($limitstart, $ismake = 1)
 {
     global $cfg_list_son, $cfg_needsontype;
     $col = $this->ListObj->GetAtt('col');
     if (empty($col)) {
         $col = 1;
     }
     $titlelen = $this->ListObj->GetAtt('titlelen');
     $infolen = $this->ListObj->GetAtt('infolen');
     $imgwidth = $this->ListObj->GetAtt('imgwidth');
     $imgheight = $this->ListObj->GetAtt('imgheight');
     $titlelen = AttDef($titlelen, 60);
     $infolen = AttDef($infolen, 250);
     $imgwidth = AttDef($imgwidth, 80);
     $imgheight = AttDef($imgheight, 80);
     $innertext = trim($this->ListObj->GetInnerText());
     if (empty($innertext)) {
         $innertext = GetSysTemplets("list_fulllist.htm");
     }
     $tablewidth = 100;
     if ($col == "") {
         $col = 1;
     }
     $colWidth = ceil(100 / $col);
     $tablewidth = $tablewidth . "%";
     $colWidth = $colWidth . "%";
     //按不同情况设定SQL条件
     $orwhere = " arc.arcrank > -1 And channel>-1 ";
     $typeid = $this->ListObj->GetAtt('typeid');
     $subday = $this->ListObj->GetAtt('subday');
     $listtype = $this->ListObj->GetAtt('type');
     $att = $this->ListObj->GetAtt('att');
     $channelid = $this->ListObj->GetAtt('channel');
     if (empty($channelid)) {
         $channelid = 0;
     }
     //是否指定栏目条件
     if (!empty($typeid)) {
         if ($cfg_list_son == 'N') {
             $orwhere .= " And (arc.typeid='{$typeid}') ";
         } else {
             $orwhere .= " And arc.typeid in (" . GetSonIds($typeid, 0, true) . ") ";
         }
     }
     //自定义属性条件
     if ($att != '') {
         $flags = explode(',', $att);
         for ($i = 0; isset($flags[$i]); $i++) {
             $orwhere .= " AND FIND_IN_SET('{$flags[$i]}',flag)>0 ";
         }
     }
     //文档的频道模型
     if ($channelid > 0 && !eregi("spec", $listtype)) {
         $orwhere .= " And arc.channel = '{$channelid}' ";
     }
     //推荐文档 带缩略图  专题文档
     if (eregi("commend", $listtype)) {
         $orwhere .= " And FIND_IN_SET('c',flag) > 0  ";
     }
     if (eregi("image", $listtype)) {
         $orwhere .= " And arc.litpic <> ''  ";
     }
     if (eregi("spec", $listtype) || $channelid == -1) {
         $orwhere .= " And arc.channel = -1  ";
     }
     if (!empty($subday)) {
         $starttime = time() - $subday * 86400;
         $orwhere .= " And arc.senddate > {$starttime}  ";
     }
     $keyword = $this->ListObj->GetAtt('keyword');
     if (!empty($keyword)) {
         $orwhere .= " And CONCAT(arc.title,arc.keywords) REGEXP '{$keyword}' ";
     }
     $orderby = $this->ListObj->GetAtt('orderby');
     $orderWay = $this->ListObj->GetAtt('orderway');
     //排序方式
     $ordersql = "";
     if ($orderby == "senddate") {
         $ordersql = " order by arc.senddate {$orderWay}";
     } else {
         if ($orderby == "pubdate") {
             $ordersql = " order by arc.pubdate {$orderWay}";
         } else {
             if ($orderby == "id") {
                 $ordersql = "  order by arc.id {$orderWay}";
             } else {
                 if ($orderby == "hot" || $orderby == "click") {
                     $ordersql = " order by arc.click {$orderWay}";
                 } else {
                     if ($orderby == "lastpost") {
                         $ordersql = "  order by arc.lastpost {$orderWay}";
                     } else {
                         if ($orderby == "scores") {
                             $ordersql = "  order by arc.scores {$orderWay}";
                         } else {
                             if ($orderby == "rand") {
                                 $ordersql = "  order by rand()";
                             } else {
                                 $ordersql = " order by arc.sortrank {$orderWay}";
                             }
//.........这里部分代码省略.........
开发者ID:klr2003,项目名称:sourceread,代码行数:101,代码来源:arc.freelist.class.php

示例15: lib_likearticle

function lib_likearticle(&$ctag, &$refObj)
{
    global $dsql;
    //属性处理
    $attlist = "row|12,titlelen|28,infolen|150,col|1,tablewidth|100,mytypeid|0,byabs|0,imgwidth|120,imgheight|90";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $revalue = '';
    if (empty($tablewidth)) {
        $tablewidth = 100;
    }
    if (empty($col)) {
        $col = 1;
    }
    $colWidth = ceil(100 / $col);
    $tablewidth = $tablewidth . "%";
    $colWidth = $colWidth . "%";
    $ids = array();
    $tids = array();
    if (!empty($refObj->Fields['tags'])) {
        $keyword = $refObj->Fields['tags'];
    } else {
        $keyword = !empty($refObj->Fields['keywords']) ? $refObj->Fields['keywords'] : '';
    }
    $typeid = !empty($mytypeid) ? $mytypeid : 0;
    if (empty($typeid)) {
        if (!empty($refObj->Typelink->TypeInfos['reid'])) {
            $typeid = $refObj->Typelink->TypeInfos['reid'];
        } else {
            if (!empty($refObj->Fields['typeid'])) {
                $typeid = $refObj->Fields['typeid'];
            }
        }
    }
    if (!empty($typeid) && !preg_match('#,#', $typeid)) {
        $typeid = GetSonIds($typeid);
    }
    $limitRow = $row - count($ids);
    $keyword = '';
    if (!empty($refObj->Fields['keywords'])) {
        $keywords = explode(',', trim($refObj->Fields['keywords']));
        $keyword = '';
        $n = 1;
        foreach ($keywords as $k) {
            if ($n > 3) {
                break;
            }
            if (trim($k) == '') {
                continue;
            } else {
                $k = addslashes($k);
            }
            $keyword .= $keyword == '' ? " CONCAT(arc.keywords,' ',arc.title) LIKE '%{$k}%' " : " OR CONCAT(arc.keywords,' ',arc.title) LIKE '%{$k}%' ";
            $n++;
        }
    }
    $arcid = !empty($refObj->Fields['id']) ? $refObj->Fields['aid'] : 0;
    if (empty($arcid) || $byabs == 0) {
        $orderquery = " ORDER BY arc.id desc ";
    } else {
        $orderquery = " ORDER BY ABS(arc.id - " . $arcid . ") ";
    }
    if ($keyword != '') {
        if (!empty($typeid)) {
            $typeid = " AND arc.typeid IN({$typeid}) AND arc.id<>{$arcid} ";
        }
        $query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,\r\n                  tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\r\n                  FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\r\n                  where arc.arcrank>-1 AND ({$keyword})  {$typeid} {$orderquery} limit 0, {$row}";
    } else {
        if (!empty($typeid)) {
            $typeid = " arc.typeid IN({$typeid}) AND arc.id<>{$arcid} ";
        }
        $query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,\r\n                  tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\r\n                  FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\r\n                 WHERE arc.arcrank>-1 AND  {$typeid} {$orderquery} limit 0, {$row}";
    }
    $innertext = trim($ctag->GetInnerText());
    if ($innertext == '') {
        $innertext = GetSysTemplets('part_arclist.htm');
    }
    $dsql->SetQuery($query);
    $dsql->Execute('al');
    $artlist = '';
    if ($col > 1) {
        $artlist = "<table width='{$tablewidth}' border='0' cellspacing='0' cellpadding='0'>\r\n";
    }
    $dtp2 = new DedeTagParse();
    $dtp2->SetNameSpace('field', '[', ']');
    $dtp2->LoadString($innertext);
    $GLOBALS['autoindex'] = 0;
    $line = $row;
    for ($i = 0; $i < $line; $i++) {
        if ($col > 1) {
            $artlist .= "<tr>\r\n";
        }
        for ($j = 0; $j < $col; $j++) {
            if ($col > 1) {
                $artlist .= "    <td width='{$colWidth}'>\r\n";
            }
            if ($row = $dsql->GetArray("al")) {
                $ids[] = $row['id'];
                //处理一些特殊字段
                $row['info'] = $row['infos'] = cn_substr($row['description'], $infolen);
//.........这里部分代码省略.........
开发者ID:iabing,项目名称:mzzyc,代码行数:101,代码来源:likearticle.lib.php


注:本文中的GetSonIds函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。