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


PHP DedeTagParse类代码示例

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


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

示例1: lib_mynews

function lib_mynews(&$ctag, &$refObj)
{
    global $dsql, $envs;
    //属性处理
    $attlist = "row|1,titlelen|24";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    if (empty($row)) {
        $row = 1;
    }
    if (empty($titlelen)) {
        $titlelen = 30;
    }
    if (empty($innertext)) {
        $innertext = GetSysTemplets('mynews.htm');
    }
    $idsql = '';
    if ($envs['typeid'] > 0) {
        $idsql = " where typeid='" . GetTopid($this->TypeID) . "' ";
    }
    $dsql->SetQuery("Select * from #@__mynews {$idsql} order by senddate desc limit 0,{$row}");
    $dsql->Execute();
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    $ctp->LoadSource($innertext);
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        foreach ($ctp->CTags as $tagid => $ctag) {
            @$ctp->Assign($tagid, $row[$ctag->GetName()]);
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:35,代码来源:mynews.lib.php

示例2: GetOneImgUrl

function GetOneImgUrl($img, $ftype = 1)
{
    if ($img != '') {
        $dtp = new DedeTagParse();
        //var_dump($img);
        $dtp->LoadSource($img);
        //var_dump($img);
        if (is_array($dtp->CTags)) {
            foreach ($dtp->CTags as $ctag) {
                var_dump($ctag->GetName());
                if ($ctag->GetName() == 'img') {
                    $width = $ctag->GetAtt('width');
                    $height = $ctag->GetAtt('height');
                    $imgurl = trim($ctag->GetInnerText());
                    $img = '';
                    //var_dump($imgurl);
                    if ($imgurl != '') {
                        if (1 == 1) {
                            $img .= $imgurl;
                            //var_dump($img);
                        } else {
                            $img .= '<img src="' . $imgurl . '" width="' . $width . '" height="' . $height . '" />';
                        }
                    }
                }
            }
        }
        $dtp->Clear();
        return $img;
    }
}
开发者ID:kevins1022,项目名称:xdd,代码行数:31,代码来源:extend.func.php

示例3: lib_feedback

/**
 * 调用最新评论
 *
 * @param int row 12
 * int infolen 10
 * @param int titlelen 100
 * @return unknown
 */
function lib_feedback(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|12,titlelen|24,infolen|100";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $totalrow = $row;
    $revalue = '';
    if (empty($innertext)) {
        $innertext = GetSysTemplets('tag_feedback.htm');
    }
    $wsql = " where ischeck=1 ";
    $equery = "SELECT * FROM `#@__feedback` {$wsql} ORDER BY id DESC LIMIT 0 , {$totalrow}";
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    $ctp->LoadSource($innertext);
    $dsql->Execute('fb', $equery);
    while ($arr = $dsql->GetArray('fb')) {
        $arr['title'] = cn_substr($arr['arctitle'], $titlelen);
        $arr['msg'] = jstrim($arr['msg'], $infolen);
        foreach ($ctp->CTags as $tagid => $ctag) {
            if (!empty($arr[$ctag->GetName()])) {
                $ctp->Assign($tagid, $arr[$ctag->GetName()]);
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:38,代码来源:feedback.lib.php

示例4: lib_memberlist

function lib_memberlist(&$ctag, &$refObj)
{
    global $dsql, $sqlCt;
    $attlist = "row|6,iscommend|0,orderby|logintime,signlen|50";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $revalue = '';
    $innerText = trim($ctag->GetInnerText());
    if (empty($innerText)) {
        $innerText = GetSysTemplets('memberlist.htm');
    }
    $wheresql = ' WHERE mb.spacesta>-1 AND mb.matt<10 ';
    if ($iscommend > 0) {
        $wheresql .= " AND  mb.matt='{$iscommend}' ";
    }
    $sql = "SELECT mb.*,ms.spacename,ms.sign FROM `#@__member` mb\r\n        LEFT JOIN `#@__member_space` ms ON ms.mid = mb.mid\r\n        {$wheresql} order by mb.{$orderby} DESC LIMIT 0,{$row} ";
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    $ctp->LoadSource($innerText);
    $dsql->Execute('mb', $sql);
    while ($row = $dsql->GetArray('mb')) {
        $row['spaceurl'] = $GLOBALS['cfg_basehost'] . '/member/index.php?uid=' . $row['userid'];
        if (empty($row['face'])) {
            $row['face'] = $row['sex'] == '女' ? $GLOBALS['cfg_memberurl'] . '/templets/images/dfgirl.png' : $GLOBALS['cfg_memberurl'] . '/templets/images/dfboy.png';
        }
        foreach ($ctp->CTags as $tagid => $ctag) {
            if (isset($row[$ctag->GetName()])) {
                $ctp->Assign($tagid, $row[$ctag->GetName()]);
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:iabing,项目名称:mzzyc,代码行数:34,代码来源:memberlist.lib.php

示例5: lib_likesgpage

function lib_likesgpage(&$ctag, &$refObj)
{
    global $dsql;
    //把属性转为变量,如果不想进行此步骤,也可以直接从 $ctag->CAttribute->Items 获得,这样也可以支持中文名
    $attlist = "row|8";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $aid = isset($refObj->Fields['aid']) ? $refObj->Fields['aid'] : 0;
    $revalue = '';
    if ($innertext == '') {
        $innertext = GetSysTemplets("part_likesgpage.htm");
    }
    $likeid = empty($refObj->Fields['likeid']) ? 'all' : $refObj->Fields['likeid'];
    $dsql->SetQuery("SELECT aid,title,filename FROM `#@__sgpage` WHERE likeid LIKE '{$likeid}' LIMIT 0,{$row}");
    $dsql->Execute();
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    $ctp->LoadSource($innertext);
    while ($row = $dsql->GetArray()) {
        if ($aid != $row['aid']) {
            $row['url'] = $GLOBALS['cfg_cmsurl'] . '/' . $row['filename'];
            foreach ($ctp->CTags as $tagid => $ctag) {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                }
            }
            $revalue .= $ctp->GetResult();
        } else {
            $revalue .= '<dd class="cur"><span>' . $row['title'] . '</span></dd>';
        }
    }
    return $revalue;
}
开发者ID:ahmatjan,项目名称:cmf2,代码行数:34,代码来源:likesgpage.lib.php

示例6: lib_infoguide

function lib_infoguide(&$ctag, &$refObj)
{
    global $dsql, $nativeplace, $infotype, $hasSetEnumJs, $cfg_cmspath, $cfg_mainsite;
    //属性处理
    //$attlist="row|12,titlelen|24";
    //FillAttsDefault($ctag->CAttribute->Items,$attlist);
    //extract($ctag->CAttribute->Items, EXTR_SKIP);
    $cmspath = empty($cfg_cmspath) || preg_match('#[/$]#', $cfg_cmspath) ? $cfg_cmspath . '/' : $cfg_cmspath;
    if (empty($refObj->Fields['typeid'])) {
        $row = $dsql->GetOne("SELECT id FROM `#@__arctype` WHERE channeltype='-8' And reid = '0' ");
        $typeid = is_array($row) ? $row['id'] : 0;
        if (empty($typeid)) {
            return '请指定一个栏目类型为“分类信息”,否则无法使用这个搜索表单!';
        }
    } else {
        $typeid = $refObj->Fields['typeid'];
    }
    $innerText = trim($ctag->GetInnerText());
    if (empty($innerText)) {
        $innerText = GetSysTemplets("info_guide.htm");
    }
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    $ctp->LoadSource($innerText);
    $revalue = $seli = '';
    $fields = array('nativeplace' => '', 'infotype' => '', 'typeid' => $typeid);
    if ($hasSetEnumJs != 'has') {
        $revalue .= '<script language="javascript" type="text/javascript" src="' . $cfg_mainsite . $cmspath . 'images/enums.js"></script>' . "\r\n";
        $GLOBALS['hasSetEnumJs'] = 'hasset';
    }
    $fields['nativeplace'] = $fields['infotype'] = '';
    if (empty($nativeplace)) {
        $nativeplace = 0;
    }
    if (empty($infotype)) {
        $infotype = 0;
    }
    $fields['nativeplace'] .= "<input type='hidden' id='hidden_nativeplace' name='nativeplace' value='{$nativeplace}' />\r\n";
    $fields['nativeplace'] .= "<span class='infosearchtxt'>地区:</span><span id='span_nativeplace'></span>\r\n";
    $fields['nativeplace'] .= "<span id='span_nativeplace_son'></span>\r\n<span id='span_nativeplace_sec'></span><br />\r\n";
    $fields['nativeplace'] .= "<script language='javascript' type='text/javascript' src='{$cfg_mainsite}{$cmspath}data/enums/nativeplace.js'></script>\r\n";
    $fields['nativeplace'] .= '<script language="javascript">MakeTopSelect("nativeplace", ' . $nativeplace . ');</script>' . "\r\n";
    $fields['infotype'] .= "<input type='hidden' id='hidden_infotype' name='infotype' value='{$infotype}' />\r\n";
    $fields['infotype'] .= "<span class='infosearchtxt'>类型:</span><span id='span_infotype'></span>\r\n";
    $fields['infotype'] .= "<span id='span_infotype_son'></span><span id='span_infotype_sec'></span><br />\r\n";
    $fields['infotype'] .= "<script language='javascript' type='text/javascript' src='{$cfg_mainsite}{$cmspath}data/enums/infotype.js'></script>\r\n";
    $fields['infotype'] .= '<script language="javascript">MakeTopSelect("infotype", ' . $infotype . ');</script>' . "\r\n";
    if (is_array($ctp->CTags)) {
        foreach ($ctp->CTags as $tagid => $ctag) {
            if (isset($fields[$ctag->GetName()])) {
                $ctp->Assign($tagid, $fields[$ctag->GetName()]);
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:iabing,项目名称:mzzyc,代码行数:57,代码来源:infoguide.lib.php

示例7: getListImgSrc

function getListImgSrc($url)
{
    $dtp = new DedeTagParse();
    $dtp->LoadSource($url);
    if ($url != '') {
        if (preg_match("/<[img|IMG].*?src=[\\'|\"](.*?(?:[\\.gif|\\.jpg|\\.png|\\.jpeg]))[\\'|\"].*?[\\/]?>/", $url, $arr)) {
            return $arr[1];
        }
    }
}
开发者ID:healen,项目名称:dsCMS,代码行数:10,代码来源:extend.func.php

示例8: lib_sonchannel

function lib_sonchannel(&$ctag, &$refObj)
{
    global $_sys_globals, $dsql;
    $attlist = "row|100,nosonmsg|,col|1";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = $ctag->GetInnerText();
    $typeid = $_sys_globals['typeid'];
    if (empty($typeid)) {
        return $ctag->GetAtt('nosonmsg');
    }
    $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,{$row}";
    //And id<>'$typeid'
    $dtp2 = new DedeTagParse();
    $dtp2->SetNameSpace("field", "[", "]");
    $dtp2->LoadSource($innertext);
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $line = $row;
    $GLOBALS['autoindex'] = 0;
    $likeType = '';
    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['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);
                if (is_array($dtp2->CTags)) {
                    foreach ($dtp2->CTags as $tagid => $ctag) {
                        if (isset($row[$ctag->GetName()])) {
                            $dtp2->Assign($tagid, $row[$ctag->GetName()]);
                        }
                    }
                }
                $likeType .= $dtp2->GetResult();
            }
            if ($col > 1) {
                $likeType .= "</dd>\r\n";
            }
            $GLOBALS['autoindex']++;
        }
        //Loop Col
        if ($col > 1) {
            $i += $col - 1;
            $likeType .= "    </dl>\r\n";
        }
    }
    //Loop for $i
    $dsql->FreeResult();
    return $likeType;
}
开发者ID:iabing,项目名称:mzzyc,代码行数:55,代码来源:sonchannel.lib.php

示例9: getFieldList

 function getFieldList()
 {
     $dtp = new DedeTagParse();
     $dtp->SetNameSpace("field", "<", ">");
     $dtp->LoadSource($this->info);
     $fields = array();
     if (is_array($dtp->CTags)) {
         foreach ($dtp->CTags as $tagid => $tag) {
             $fields[$tag->GetName()] = array($tag->GetAtt('itemname'), $tag->GetAtt('type'));
         }
     }
     return $fields;
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:13,代码来源:diyform.cls.php

示例10: lib_flinktype

function lib_flinktype(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|24,titlelen|24";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $totalrow = $row;
    $revalue = '';
    $equery = "SELECT * FROM #@__flinktype order by id asc limit 0,{$totalrow}";
    if (trim($ctag->GetInnerText()) == '') {
        $innertext = "<li>[field:typename /]</li>";
    } else {
        $innertext = $ctag->GetInnerText();
    }
    if (!isset($type)) {
        $type = '';
    }
    $dtp = new DedeTagParse();
    $dtp->SetNameSpace("dede", "{", "}");
    $dtp->LoadString($innertext);
    $dsql->SetQuery($equery);
    $dsql->Execute();
    $rs = '';
    $row = array();
    while ($dbrow = $dsql->GetObject()) {
        $row[] = $dbrow;
    }
    $dedecms = false;
    $dedecms->id = 999;
    $dedecms->typename = '织梦链';
    if ($type == 'dedecms') {
        $row[] = $dedecms;
    }
    foreach ($row as $key => $value) {
        if (is_array($dtp->CTags)) {
            $GLOBALS['envs']['flinkid'] = $value->id;
            foreach ($dtp->CTags as $tagid => $ctag) {
                $tagname = $ctag->GetName();
                if ($tagname == "flink") {
                    $dtp->Assign($tagid, lib_flink($ctag, $refObj));
                }
            }
        }
        $rs = $dtp->GetResult();
        $rs = preg_replace("/\\[field:id([\\/\\s]{0,})\\]/isU", $value->id, $rs);
        $rs = preg_replace("/\\[field:typename([\\/\\s]{0,})\\]/isU", $value->typename, $rs);
        $revalue .= $rs;
    }
    return $revalue;
}
开发者ID:ahmatjan,项目名称:cmf2,代码行数:50,代码来源:flinktype.lib.php

示例11: lib_asktype

/**
 * 问答调用标签
 *
 * @version        $Id: ask.lib.php 1 9:29 2010年7月6日Z tianya $
 * @package        DedeCMS.Taglib
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
function lib_asktype(&$ctag, &$refObj)
{
    global $dsql, $envs, $cfg_dbprefix, $cfg_cmsurl, $cfg_ask_directory, $cfg_ask_isdomain, $cfg_ask_domain;
    //属性处理
    $attlist = "tid|0,reid|0,name|24";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if (!$dsql->IsTable("{$cfg_dbprefix}ask")) {
        return '没安装问答模块';
    }
    //启用二级域名
    if ($cfg_ask_isdomain == 'Y') {
        $weburl = $cfg_ask_domain . '/';
    } else {
        $weburl = $cfg_ask_directory . '/';
    }
    $innertext = $ctag->GetInnerText();
    if (trim($innertext) == '') {
        $innertext = GetSysTemplets("asks.htm");
    }
    if ($tid > 0) {
        $qtypeQuery = "WHERE reid={$tid} ";
    } else {
        $qtypeQuery = '';
    }
    if ($reid > 0) {
        $qtypeQuery = "WHERE reid > 0 ";
    }
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    $solvingask = '';
    $query = "SELECT id,name,reid FROM `#@__asktype` {$qtypeQuery}";
    $dsql->Execute('me', $query);
    while ($rs = $dsql->GetArray('me')) {
        $ctp->LoadSource($innertext);
        if ($rs['reid'] != '') {
            $rs['typeurl'] = $weburl . "?ct=browser&tid2=" . $rs['id'];
        } else {
            $rs['typeurl'] = $weburl . "?ct=browser&tid=" . $rs['id'];
        }
        foreach ($ctp->CTags as $tagid => $ctag) {
            if (!empty($rs[strtolower($ctag->GetName())])) {
                $ctp->Assign($tagid, $rs[$ctag->GetName()]);
            }
        }
        $solvingask .= $ctp->GetResult();
    }
    return $solvingask;
}
开发者ID:hensonvip,项目名称:ymroad,代码行数:58,代码来源:asktype.lib.php

示例12: lib_autochannel

function lib_autochannel(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = 'partsort|0,typeid=-1';
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $topid = $typeid;
    $sortid = $partsort;
    if ($topid == '-1' || $topid == '') {
        $topid = isset($refObj->TypeLink->TypeInfos['id']) ? $refObj->TypeLink->TypeInfos['id'] : 0;
    }
    if (empty($sortid)) {
        $sortid = 1;
    }
    $getstart = $sortid - 1;
    $row = $dsql->GetOne("SELECT id,typename FROM `#@__arctype` WHERE reid='{$topid}' AND \n                          ispart<2 AND ishidden<>'1' ORDER BY sortrank asc limit {$getstart},1");
    if (!is_array($row)) {
        return '';
    } else {
        $typeid = $row['id'];
    }
    if (trim($innertext) == '') {
        $innertext = GetSysTemplets('part_autochannel.htm');
    }
    $row = $dsql->GetOne("SELECT id,typedir,isdefault,defaultname,ispart,namerule2,typename,moresite,siteurl,sitepath \n                          FROM `#@__arctype` WHERE id='{$typeid}' ");
    if (!is_array($row)) {
        return '';
    }
    $dtp = new DedeTagParse();
    $dtp->SetNameSpace('field', '[', ']');
    $dtp->LoadSource($innertext);
    if (!is_array($dtp->CTags)) {
        unset($dtp);
        return '';
    } else {
        $row['typelink'] = GetTypeUrl($row['id'], MfTypedir($row['typedir']), $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['siteurl'], $row['sitepath']);
        foreach ($dtp->CTags as $tagid => $ctag) {
            if (isset($row[$ctag->GetName()])) {
                $dtp->Assign($tagid, $row[$ctag->GetName()]);
            }
        }
        $revalue = $dtp->GetResult();
        unset($dtp);
        return $revalue;
    }
}
开发者ID:hensonvip,项目名称:ymroad,代码行数:47,代码来源:autochannel.lib.php

示例13: __construct

 function __construct($cid, $aid = 0)
 {
     $this->ChannelInfos = '';
     $this->ChannelFields = '';
     $this->AllFieldNames = '';
     $this->SplitPageField = '';
     $this->ChannelID = $cid;
     $this->ArcID = $aid;
     $this->dsql = $GLOBALS['dsql'];
     $sql = " Select * from `#@__channeltype` where id='{$cid}' ";
     $this->ChannelInfos = $this->dsql->GetOne($sql);
     if (!is_array($this->ChannelInfos)) {
         echo '读取频道信息失败,无法进行后续操作!';
         exit;
     }
     $dtp = new DedeTagParse();
     $dtp->SetNameSpace('field', '<', '>');
     $dtp->LoadSource($this->ChannelInfos['fieldset']);
     if (is_array($dtp->CTags)) {
         $tnames = array();
         foreach ($dtp->CTags as $ctag) {
             $tname = $ctag->GetName();
             if (isset($tnames[$tname])) {
                 break;
             }
             $tnames[$tname] = 1;
             if ($this->AllFieldNames != '') {
                 $this->AllFieldNames .= ',' . $tname;
             } else {
                 $this->AllFieldNames .= $tname;
             }
             if (is_array($ctag->CAttribute->Items)) {
                 $this->ChannelFields[$tname] = $ctag->CAttribute->Items;
             }
             $this->ChannelFields[$tname]['value'] = '';
             $this->ChannelFields[$tname]['innertext'] = $ctag->GetInnerText();
             if (empty($this->ChannelFields[$tname]['itemname'])) {
                 $this->ChannelFields[$tname]['itemname'] = $tname;
             }
             if ($ctag->GetAtt('page') == 'split') {
                 $this->SplitPageField = $tname;
             }
         }
     }
     $dtp->Clear();
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:46,代码来源:channelunit.class.php

示例14: lib_groupthread

function lib_groupthread(&$ctag, &$refObj)
{
    global $dsql, $envs, $cfg_dbprefix, $cfg_cmsurl;
    //属性处理
    $attlist = "gid|0,orderby|dateline,orderway|desc,row|12,titlelen|30";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if (!$dsql->IsTable("{$cfg_dbprefix}groups")) {
        return '没安装圈子模块';
    }
    if (!preg_match("#\\/\$#", $cfg_cmsurl)) {
        $cfg_group_url = $cfg_cmsurl . "/group";
    } else {
        $cfg_group_url = $cfg_cmsurl . "group";
    }
    $innertext = $ctag->GetInnerText();
    if (trim($innertext) == '') {
        $innertext = GetSysTemplets('groupthreads.htm');
    }
    $WhereSql = " WHERE t.closed=0 ";
    $orderby = 't.' . $orderby;
    if ($gid > 0) {
        $WhereSql .= " AND t.gid='{$gid}' ";
    }
    $query = "SELECT t.subject,t.gid,t.tid,t.lastpost,g.groupname FROM `#@__group_threads` t \r\n             LEFT JOIN `#@__groups` g ON g.groupid=t.gid\r\n             {$WhereSql} ORDER BY {$orderby} {$orderway} LIMIT 0,{$row}";
    $dsql->SetQuery($query);
    $dsql->Execute();
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    if (!isset($list)) {
        $list = '';
    }
    while ($rs = $dsql->GetArray()) {
        $ctp->LoadSource($innertext);
        $rs['subject'] = cn_substr($rs['subject'], $titlelen);
        $rs['url'] = $cfg_group_url . "/viewthread.php?id={$rs['gid']}&tid={$rs['tid']}";
        $rs['groupurl'] = $cfg_group_url . "/group.php?id={$rs['gid']}";
        foreach ($ctp->CTags as $tagid => $ctag) {
            if (!empty($rs[strtolower($ctag->GetName())])) {
                $ctp->Assign($tagid, $rs[$ctag->GetName()]);
            }
        }
        $list .= $ctp->GetResult();
    }
    return $list;
}
开发者ID:iabing,项目名称:mzzyc,代码行数:46,代码来源:groupthread.lib.php

示例15: ch_specialtopic

/**
 * 专题主题调用标签
 *
 * @version        $Id: arclist.lib.php 2 8:29 2010年7月8日Z tianya $
 * @package        DedeCMS.Taglib
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
function ch_specialtopic($noteinfo, $arcTag, $refObj, $fname = '')
{
    require_once DEDEINC . '/taglib/arclist.lib.php';
    if ($noteinfo == '') {
        return '';
    }
    $noteid = $arcTag->GetAtt('noteid');
    $rvalue = '';
    $tempStr = GetSysTemplets('channel_spec_note.htm');
    $dtp = new DedeTagParse();
    $dtp->LoadSource($noteinfo);
    if (is_array($dtp->CTags)) {
        foreach ($dtp->CTags as $k => $ctag) {
            $notename = $ctag->GetAtt('name');
            //指定名称的专题节点
            if ($noteid != '' && $ctag->GetAtt('noteid') != $noteid) {
                continue;
            }
            $isauto = $ctag->GetAtt('isauto');
            $idlist = trim($ctag->GetAtt('idlist'));
            $rownum = trim($ctag->GetAtt('rownum'));
            $keywords = '';
            $stypeid = 0;
            if (empty($rownum)) {
                $rownum = 40;
            }
            //通过关键字和栏目ID自动获取模式
            if ($isauto == 1) {
                $idlist = '';
                $keywords = trim($ctag->GetAtt('keywords'));
                $stypeid = $ctag->GetAtt('typeid');
            }
            $listTemplet = trim($ctag->GetInnerText()) != '' ? $ctag->GetInnerText() : GetSysTemplets('spec_arclist.htm');
            $idvalue = lib_arclistDone($refObj, $ctag, $stypeid, $rownum, $ctag->GetAtt('col'), $ctag->GetAtt('titlelen'), $ctag->GetAtt('infolen'), $ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), 'all', 'default', $keywords, $listTemplet, 0, $idlist, $ctag->GetAtt('channel'), '', $ctag->GetAtt('att'));
            $notestr = str_replace('~notename~', $notename, $tempStr);
            $notestr = str_replace('~spec_arclist~', $idvalue, $notestr);
            $rvalue .= $notestr;
            if ($noteid != '' && $ctag->GetAtt('noteid') == $noteid) {
                break;
            }
        }
    }
    $dtp->Clear();
    return $rvalue;
}
开发者ID:iabing,项目名称:mzzyc,代码行数:54,代码来源:specialtopic.lib.php


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