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


PHP DedeTagParse::LoadString方法代码示例

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


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

示例1: TypeLink

 function __construct($fid)
 {
     global $dsql;
     $this->FreeID = $fid;
     $this->TypeLink = new TypeLink(0);
     $this->dsql = $dsql;
     $this->maintable = '#@__archives';
     $this->TempletsFile = '';
     $this->FLInfos = $this->dsql->GetOne("Select * From `#@__freelist` where aid='{$fid}' ");
     $liststr = $this->FLInfos['listtag'];
     $this->FLInfos['maxpage'] = empty($this->FLInfos['maxpage']) ? 100 : $this->FLInfos['maxpage'];
     //载入数据里保存的列表属性信息
     $ndtp = new DedeTagParse();
     $ndtp->SetNameSpace("dede", "{", "}");
     $ndtp->LoadString($liststr);
     $this->ListObj = $ndtp->GetTag('list');
     $this->PageSize = $this->ListObj->GetAtt('pagesize');
     if (empty($this->PageSize)) {
         $this->PageSize = 30;
     }
     $channelid = $this->ListObj->GetAtt('channel');
     /*
     if(empty($channelid))
     {
     	showmsg('必须指定频道','-1');exit();
     }
     else
     {
     	$channelid = intval($channelid);
     	$channelinfo = $this->dsql->getone("select maintable from #@__channeltype where id='$channelid'");
     	$this->maintable = $channelinfo['maintable'];
     }
     */
     $channelid = intval($channelid);
     $this->maintable = '#@__archives';
     //全局模板解析器
     $this->dtp = new DedeTagParse();
     $this->dtp->SetNameSpace("dede", "{", "}");
     $this->dtp->SetRefObj($this);
     //设置一些全局参数的值
     $this->Fields['aid'] = $this->FLInfos['aid'];
     $this->Fields['title'] = $this->FLInfos['title'];
     $this->Fields['position'] = $this->FLInfos['title'];
     $this->Fields['keywords'] = $this->FLInfos['keywords'];
     $this->Fields['description'] = $this->FLInfos['description'];
     $channelid = $this->ListObj->GetAtt('channel');
     if (!empty($channelid)) {
         $this->Fields['channeltype'] = $channelid;
         $this->ChannelUnit = new ChannelUnit($channelid);
     } else {
         $this->Fields['channeltype'] = 0;
     }
     foreach ($GLOBALS['PubFields'] as $k => $v) {
         $this->Fields[$k] = $v;
     }
     $this->PartView = new PartView();
     $this->CountRecord();
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:58,代码来源:arc.freelist.class.php

示例2: 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

示例3: lib_booklist

function lib_booklist(&$ctag, &$refObj, $getcontent = 0)
{
    global $dsql, $envs, $cfg_dbprefix, $cfg_cmsurl;
    //属性处理
    $attlist = "row|12,booktype|-1,titlelen|30,orderby|lastpost,author|,keyword|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if (!$dsql->IsTable("{$cfg_dbprefix}story_books")) {
        return '没安装连载模块';
    }
    $addquery = '';
    if (empty($innertext)) {
        if ($getcontent == 0) {
            $innertext = GetSysTemplets('booklist.htm');
        } else {
            $innertext = GetSysTemplets('bookcontentlist.htm');
        }
    }
    //图书类型
    if ($booktype != -1) {
        $addquery .= " And b.booktype='{$booktype}' ";
    }
    //推荐
    if ($orderby == 'commend') {
        $addquery .= " And b.iscommend=1 ";
        $orderby = 'lastpost';
    }
    //作者条件
    if (!empty($author)) {
        $addquery .= " And b.author like '{$author}' ";
    }
    //关键字条件
    if (!empty($keyword)) {
        $keywords = explode(',', $keyword);
        $keywords = array_unique($keywords);
        if (count($keywords) > 0) {
            $addquery .= " And (";
        }
        foreach ($keywords as $v) {
            $addquery .= " CONCAT(b.author,b.bookname,b.keywords) like '%{$v}%' OR";
        }
        $addquery = ereg_replace(" OR\$", "", $addquery);
        $addquery .= ")";
    }
    $clist = '';
    $query = "Select b.id,b.catid,b.ischeck,b.booktype,b.iscommend,b.click,b.bookname,b.lastpost,\r\n \t\tb.author,b.mid,b.litpic,b.pubdate,b.weekcc,b.monthcc,b.description,c.classname,c.classname as typename,c.booktype as catalogtype\r\n \t\tFrom `#@__story_books` b left join `#@__story_catalog` c on c.id=b.catid\r\n \t\twhere b.postnum>0 And b.ischeck>0 {$addquery} order by b.{$orderby} desc limit 0, {$row}";
    $dsql->SetQuery($query);
    $dsql->Execute();
    $ndtp = new DedeTagParse();
    $ndtp->SetNameSpace('field', '[', ']');
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $row['title'] = $row['bookname'];
        $ndtp->LoadString($innertext);
        //获得图书最新的一个更新章节
        $row['contenttitle'] = '';
        $row['contentid'] = '';
        if ($getcontent == 1) {
            $nrow = $dsql->GetOne("Select id,title,chapterid From `#@__story_content` where bookid='{$row['id']}' order by id desc ");
            $row['contenttitle'] = $nrow['title'];
            $row['contentid'] = $nrow['id'];
        }
        if ($row['booktype'] == 1) {
            $row['contenturl'] = $cfg_cmspath . '/book/show-photo.php?id=' . $row['contentid'];
        } else {
            $row['contenturl'] = $cfg_cmspath . '/book/story.php?id=' . $row['contentid'];
        }
        //动态网址
        $row['dmbookurl'] = $cfg_cmspath . '/book/book.php?id=' . $row['id'];
        //静态网址
        $row['bookurl'] = $row['url'] = GetBookUrl($row['id'], $row['bookname']);
        $row['catalogurl'] = $cfg_cmspath . '/book/list.php?id=' . $row['catid'];
        $row['cataloglink'] = "<a href='{$row['catalogurl']}'>{$row['classname']}</a>";
        $row['booklink'] = "<a href='{$row['bookurl']}'>{$row['bookname']}</a>";
        $row['contentlink'] = "<a href='{$row['contenturl']}'>{$row['contenttitle']}</a>";
        $row['imglink'] = "<a href='{$row['bookurl']}'><img src='{$row['litpic']}' width='{$imgwidth}' height='{$imgheight}' border='0' /></a>";
        if ($row['ischeck'] == 2) {
            $row['ischeck'] = '已完成连载';
        } else {
            $row['ischeck'] = '连载中...';
        }
        if ($row['booktype'] == 0) {
            $row['booktypename'] = '小说';
        } else {
            $row['booktypename'] = '漫画';
        }
        if (is_array($ndtp->CTags)) {
            foreach ($ndtp->CTags as $tagid => $ctag) {
                $tagname = $ctag->GetTagName();
                if (isset($row[$tagname])) {
                    $ndtp->Assign($tagid, $row[$tagname]);
                } else {
                    $ndtp->Assign($tagid, '');
                }
            }
        }
        $clist .= $ndtp->GetResult();
    }
    return $clist;
//.........这里部分代码省略.........
开发者ID:klr2003,项目名称:sourceread,代码行数:101,代码来源:booklist.lib.php

示例4: array

}
$usemore = $arr['usemore'];
$notename = $arr['notename'];
$notes = array();
$dsql->FreeResult();
$dtp = new DedeTagParse();
$dtp2 = new DedeTagParse();
$dtp->LoadString($arr['listconfig'] . $arr['itemconfig']);
$channelid = $arr['channelid'];
$notes['keywordtrim'] = '';
$notes['descriptiontrim'] = '';
foreach ($dtp->CTags as $tid => $ctag) {
    if ($ctag->GetName() == 'item') {
        $f = $ctag->GetAtt('field');
        $notes[$f]['item'] = $ctag;
        $dtp2->LoadString($ctag->GetInnerText());
        $notes[$f]['trim'] = '';
        foreach ($dtp2->CTags as $ctag2) {
            if ($ctag2->GetName() == 'trim') {
                $notes[$f]['trim'] .= "{dede:trim replace=\"" . $ctag2->GetAtt('replace') . "\"}" . $ctag2->GetInnerText() . "{/dede:trim}\r\n";
            } else {
                if ($ctag2->GetName() == 'match') {
                    $notes[$f]['match'] = $ctag2->GetInnerText() . "\r\n";
                } else {
                    if ($ctag2->GetName() == 'function') {
                        $notes[$f]['function'] = $ctag2->GetInnerText() . "\r\n";
                    }
                }
            }
        }
    } else {
开发者ID:iabing,项目名称:mzzyc,代码行数:31,代码来源:co_edit.php

示例5: time

$row = $dsql->GetOne("Select ex.*,n.arcsource From `#@__conote` n left join `#@__co_exrule` ex on ex.aid=n.typeid where nid='$nid'");
if(!is_array($row)){
	ShowMsg('找不到导入规则,无法完成操作!','javascript:;');
	$dsql->Close();
	exit();
}
$channelid = $row['channelid'];
$etype = $row['etype'];
$arcsource = $row['arcsource'];
$senddate = time();

$typeinfos = $dsql->GetOne("Select * From `#@__arctype` where ID='$typeid'",MYSQL_ASSOC);
//分析规则,并生成临时的SQL语句
//-------------------------------------
$dtp = new DedeTagParse();
$dtp->LoadString($row['ruleset']);
$noteinfo = $dtp->GetTagByName('note');
$tablenames = explode(",",$noteinfo->GetAtt('tablename'));
$autofield = $noteinfo->GetAtt('autofield');
$synfield = $noteinfo->GetAtt('synfield');
$tablename1 = str_replace('#@__',$cfg_dbprefix,$tablenames[0]);
$tb1SqlKey = "Insert Into `$tablename1`($autofield";
$tb1SqlValue = " Values('@$autofield@'";
if(count($tablenames)>=2){
	$tablename2 = str_replace('#@__',$cfg_dbprefix,$tablenames[1]);
	$tb2SqlKey = "Insert Into `$tablename2`(";
  $tb2SqlValue = " Values(";
  if($synfield!=''){
		$tb2SqlKey .= $synfield;
		$tb2SqlValue .= "'@$synfield@'";
  }
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:co_export_action.php

示例6: SpGetFullList

function SpGetFullList(&$dsql,$typeid=0,$channelid=0,$row=10,$titlelen=30,$infolen=160,
   $keyword='',$innertext='',$idlist='',$limitv='',$ismember=0,$orderby='',$imgwidth=120,$imgheight=120)
  {
		global $cfg_maxsearch,$cfg_al_cachetime;
		$row = AttDef($row,10);
		$line = $row;
		$titlelen = AttDef($titlelen,30);
		$infolen = AttDef($infolen,160);
    $channelid = AttDef($channelid,0);
    $ismember = AttDef($ismember,0);
    $limitv = AttDef($limitv,'');
		$keyword = trim($keyword);
		$typeid = AttDef($typeid,'');
		$innertext = trim($innertext);
		$imgwidth = AttDef($imgwidth,120);
		$imgheight = AttDef($imgheight,120);
		$orderby = trim($orderby);
		if($innertext=="") $innertext = GetSysTemplets("part_arclist.htm");
		if(empty($idlist)) $idlist = '';
		else $idlist = ereg_replace("[^,0-9]","",$idlist);

    $orwhere = '';
    $mintime = time() - ($cfg_al_cachetime * 3600);
    //指定的文档ID列表,通常是专题和相关文章,使用了idlist将不启用后面任何条件
	  $idlist = trim($idlist);
	  if($idlist!='')
	  {
	  	$orwhere .= " arcf.aid in ($idlist) And arcf.arcrank > -1 ";
	  }
    //没使用idlist才启用这些条件
    else
    {
		  //按不同情况设定SQL条件 排序方式
	    $orwhere .= " arcf.arcrank > -1 ";
		  //文档的频道模型
		  if(!empty($channelid)) $orwhere .= " And arcf.channelid = '$channelid' ";

		  //是否为会员文档
		  if($ismember==1) $orwhere .= " And arcf.memberid>0  ";

		  //指定栏目条件,如果用 "," 分开,可以指定特定类目
		  if(!empty($typeid) && empty($idlist))
		  {
		    $reids = explode(",",$typeid);
		    $ridnum = count($reids);
		    if($ridnum>1){
			    $tpsql = "";
		      for($i=0;$i<$ridnum;$i++)
		      {
				    $sonids = TypeGetSunID($reids[$i],$dsql,'arc',0,true);
				    $tpsql .= ($tpsql=='' ? $sonids : ','.$sonids);
		      }
		      $tpsql = " And arcf.typeid in ($tpsql) ";
		      $orwhere .= $tpsql;
		      unset($tpsql);
		    }else{
			    $sonids = TypeGetSunID($typeid,$dsql,'arc',0,true);
			    if(ereg(',',$sonids)) $orwhere .= " And arcf.typeid in ($sonids) ";
			    else $orwhere .= " And arcf.typeid=$sonids ";
		    }
		    unset($reids);
	    }

		  //指定了关键字条件
		  if($keyword!="")
		  {
		    $keywords = explode(",",$keyword);
		    $ridnum = count($keywords);
		    $rstr = trim($keywords[0]);
		    if($ridnum>4) $ridnum = 4;
		    for($i=1;$i < $ridnum;$i++){
			    $keywords[$i] = trim($keywords[$i]);
			    if($keywords[$i]!="") $rstr .= "|".$keywords[$i];
			  }
		    if($rstr!="") $orwhere .= " And CONCAT(arcf.title,arcf.keywords) REGEXP '$rstr' ";
		    unset($keywords);
	    }
    }//没使用idlist才启用这些条件
    
	 //文档排序的方式
		$ordersql = "";
    if($orderby=='rand') $ordersql = "  order by rand()";
    else if($orderby=='click'||$orderby=='hot') $ordersql = "  order by arcf.click desc";
    else if($orderby=='digg') $ordersql = "  order by arcf.digg desc";
    else if($orderby=='diggtime') $ordersql = "  order by arcf.diggtime desc";
		else $ordersql=" order by arcf.aid desc";

    //返回结果条数
	  if(!empty($limit)) $limitsql = " limit $limitv ";
	  else $limitsql = " limit 0,$line ";

	  //载入底层模板
	  $dtp2 = new DedeTagParse();
    $dtp2->SetNameSpace("field","[","]");
    $dtp2->LoadString($innertext);
    if(!is_array($dtp2->CTags)) return '';

		//执行SQL查询
		$query = "Select arcf.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl
		from `#@__full_search` arcf left join `#@__arctype` tp on arcf.typeid=tp.ID
//.........这里部分代码省略.........
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:101,代码来源:inc_fun_SpFullList.php

示例7: DedeSql

	   $dsql = new DedeSql(false);
	   $row = $dsql->GetOne("Select * From #@__conote where nid='$nid' ");
	   $dsql->Close();
	   $win->AddMsgItem("<textarea name='notes' style='width:100%;height:500px' rows='20'>{$row['noteinfo']}</textarea>");
	   $winform = $win->GetWindow("ok");
	   $win->Display();
     exit();
}
else
{
   	  CheckPurview('co_EditNote');
   	  require_once(dirname(__FILE__)."/../include/pub_dedetag.php");
   	  $dtp = new DedeTagParse();
   	  $dbnotes = $notes;
   	  $notes = stripslashes($notes);
      $dtp->LoadString($notes);
   	  if(!is_array($dtp->CTags)){
	      ShowMsg("该规则不合法,无法保存!","-1");
	      $dsql->Close();
	      exit();
      }
      $ctag = $dtp->GetTagByName("item");
	    $query = "
	      Update #@__conote 
	        set typeid='".$ctag->GetAtt('typeid')."',
	        gathername='".$ctag->GetAtt('name')."',
	        language='".$ctag->GetAtt('language')."',
	        lasttime=0,
	        savetime='".time()."',
	        noteinfo='".$dbnotes."'
	      where nid = $nid;
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:co_edit_text.php

示例8: trim

     }
 }
 //符合需执行条件的任务
 if ($isplay) {
     $dourl = trim($arr['dourl']);
     if (!file_exists("task/{$dourl}")) {
         echo $client == 'js' ? '' : 'notask';
         exit;
     } else {
         $getConfigStr = trim($arr['parameter']);
         $getString = '';
         if (ereg('t:', $getConfigStr)) {
             $getStrings = array();
             $dtp = new DedeTagParse();
             $dtp->SetNameSpace('t', '<', '>');
             $dtp->LoadString($getConfigStr);
             if (is_array($dtp->CTags)) {
                 foreach ($dtp->CTags as $k => $ctag) {
                     $getString .= ($getString == '' ? '' : '&') . $ctag->GetAtt('key') . '=' . urlencode($ctag->GetAtt('value'));
                 }
             }
         }
         $dsql->ExecuteNoneQuery("Update `#@__sys_task` set lastrun='" . time() . "', sta='运行' where id='{$arr['id']}' ");
         if ($getString != '') {
             $dourl .= '?' . $getString;
         }
         if ($client == 'js') {
             header("location:{$cfg_phpurl}/task/{$dourl}");
         } else {
             echo "{$cfg_phpurl}/task/{$dourl}";
         }
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:task.php

示例9: DedeInclude

    ShowMsg("成功保存一条记录!", $backurl);
    exit;
}
$dsql->SetSql("SELECT * FROM `#@__co_htmls` WHERE aid='{$aid}'");
$dsql->Execute();
$row = $dsql->GetObject();
$isdown = $row->isdown;
$nid = $row->nid;
$url = $row->url;
$dtime = $row->dtime;
$body = $row->result;
$litpic = $row->litpic;
$fields = array();
if ($isdown == 0) {
    $co = new DedeCollection();
    $co->LoadNote($nid);
    $co->DownUrl($aid, $url, $litpic);
    $co->dsql->SetSql("SELECT * FROM `#@__co_htmls` WHERE aid='{$aid}'");
    $co->dsql->Execute();
    $row = $co->dsql->GetObject();
    $isdown = $row->isdown;
    $nid = $row->nid;
    $url = $row->url;
    $dtime = $row->dtime;
    $body = $row->result;
    $litpic = $row->litpic;
}
$dtp = new DedeTagParse();
$dtp->SetNameSpace("dede", "{", "}");
$dtp->LoadString($body);
include DedeInclude('templets/co_view.htm');
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:co_view.php

示例10: SpGetArcList


//.........这里部分代码省略.........
		if($idlist!="")
		{
			$reids = explode(",",$idlist);
		  $ridnum = count($reids);
		  $idlistSql = "";
		  for($i=0;$i<$ridnum;$i++){
				if($idlistSql=="") $idlistSql .= " And ( arc.ID='".$reids[$i]."' ";
				else $idlistSql .= " Or arc.ID='".$reids[$i]."' ";
		  }
		  $idlistSql .= ") ";
		  $orwhere .= $idlistSql;
		  unset($idlistSql);
		  unset($reids);
		  $row = $ridnum;
		}
		//关键字条件
		if($keyword!="")
		{
		  $keywords = explode(",",$keyword);
		  $ridnum = count($keywords);
		  $orwhere .= " And (arc.keywords like '%".trim($keywords[0])." %' ";
		  for($i=1;$i<$ridnum;$i++){
			  if($keywords[$i]!="") $orwhere .= " Or arc.keywords like '%".trim($keywords[$i])." %' ";
		  }
		  $orwhere .= ")";
		  unset($keywords);
	  }
	  $limit = trim(eregi_replace("limit","",$limit));
	  if($limit!="") $limitsql = " limit $limit ";
	  else $limitsql = " limit 0,$line ";
		//////////////
		$query = "Select arc.ID,arc.title,arc.iscommend,arc.color,arc.typeid,arc.ismake,
		arc.description,arc.pubdate,arc.senddate,arc.arcrank,arc.click,arc.money,
		arc.litpic,tp.typedir,tp.typename,tp.isdefault,
		tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl
		from #@__archives arc left join #@__arctype tp on arc.typeid=tp.ID
		where $orwhere $ordersql $limitsql";
		 
		$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;
    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"))
         {
           //处理一些特殊字段
           $row['description'] = cn_substr($row['description'],$infolen);
           $row['id'] =  $row['ID'];
           file_put_contents("c:/ttt.txt",$row['id']); 
           if($row['litpic']=="") $row['litpic'] = $PubFields['templeturl']."/img/default.gif";
           $row['picname'] = $row['litpic'];
           $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],
                            $row['title'],$row['ismake'],$row['arcrank'],$row['namerule'],
                            $row['typedir'],$row['money'],true,$row['siteurl']);
           $row['typeurl'] = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);

           $row['info'] = $row['description'];
           $row['filename'] = $row['arcurl'];
           $row['stime'] = GetDateMK($row['pubdate']);
           $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
           $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."'>";
           $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>";
           $row['title'] = cn_substr($row['title'],$titlelen);
           $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";
           
           if($row['color']!="") $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>";
           if($row['iscommend']==5||$row['iscommend']==16) $row['title'] = "<b>".$row['title']."</b>";
           
           $row['phpurl'] = $PubFields['phpurl'];
 		       $row['templeturl'] = $PubFields['templeturl'];
           if(is_array($dtp2->CTags)){
       	      foreach($dtp2->CTags as $k=>$ctag){
       		 	    if(isset($row[$ctag->GetName()])) $dtp2->Assign($k,$row[$ctag->GetName()]);
       		 	    else $dtp2->Assign($k,"");
       	      }
       	      $GLOBALS['autoindex']++;
           }
           $artlist .= $dtp2->GetResult()."\r\n";
         }//if hasRow
         else{
         	 $artlist .= "";
         }
         if($col>1) $artlist .= "	</td>\r\n";
       }//Loop Col
       if($col>1) $i += $col - 1;
       if($col>1) $artlist .= "	</tr>\r\n";
     }//Loop Line
     if($col>1) $artlist .= "	</table>\r\n";
     $dsql->FreeResult("al");
     return $artlist;
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:101,代码来源:inc_separate_functions.php

示例11: AjaxHead

 /**
  * caijixia for dedecms
  * @version        $Id: cjx.class.php 112 2013-05-28 01:22:57Z qinjinpeng $
  * @copyright Copyright (c) 2011,caijixia for dedecms,caijixia.com.
  * @license   This is NOT a freeware, use is subject to license terms
  *
  * @param     NULL
  * @return    NULL
 */
 function ac_gettask()
 {
     AjaxHead();
     $typeid = $this->gv('typeid');
     $rs = cjxdb('kwkeyword')->where("typeid={$typeid}")->Fields('`type`,`keyword`')->select();
     $keyword = $rss = $dx = $dxs = '';
     require_once DEDEINC . "/dedetag.class.php";
     $dtp = new DedeTagParse();
     foreach ($rs as $r) {
         if ($r['type'] == 0) {
             $keyword .= empty($keyword) ? $r['keyword'] : "\r\n" . $r['keyword'];
         } else {
             if ($r['type'] == 1) {
                 $rss .= empty($rss) ? $r['keyword'] : "\r\n" . $r['keyword'];
             } else {
                 if ($r['type'] == 2) {
                     $dx .= empty($dx) ? $r['keyword'] : "``" . $r['keyword'];
                     $dtp->LoadString($r['keyword']);
                     $dxt = $dtp->GetTagByName('list') ? $dtp->GetTagByName('list')->GetInnerText() : '';
                     $dxs .= "<span><a href='javascript:void(0);' style='float:right' onclick='delpage(this);'>删除</a><a href='javascript:void(0);' style='float:right' onclick='editpage(this);'>编辑&nbsp;</a>" . $dxt . "</span>";
                 } else {
                 }
             }
         }
     }
     $note = cjxdb('co_note')->Fields('nid,notename')->where('channelid=1')->select();
     foreach ($note as $k => $v) {
         $ck = cjxdb('kwkeyword')->where("`keyword`={$v['nid']} AND `type`=3")->find();
         if ($ck) {
             if ($ck['typeid'] == $typeid) {
                 $note[$k]['btype'] = true;
             } else {
                 $note[$k]['btype'] = $ck['typeid'];
             }
         }
         $note[$k]['channelname'] = '普通文章';
     }
     $this->assign('typeid', $typeid);
     $this->assign('keyword', $keyword);
     $this->assign('rss', $rss);
     $this->assign('dx', $dx);
     $this->assign('dxs', $dxs);
     $this->assign('notelist', $note);
     $this->display();
 }
开发者ID:soonfine,项目名称:leread,代码行数:54,代码来源:cjx.class.php

示例12: ShowMsg

	 }
	 $row['channelid'] = $channelid;
	 $row['rulename'] = "{$cinfos['typename']}模型";
	 $row['etype'] = "当前系统";
	 $row['dtime'] = $ntime;
	}
}
if(empty($exrule)) $exrule = $row['aid'];
if(empty($exrule)){
	ClearAllLink();
  ShowMsg("读取规则错误,无法继续操作!","javascript:;");
	exit();
}
$ruleset = $row['ruleset'];
$dtp = new DedeTagParse();
$dtp->LoadString($ruleset);
$noteid = 0;
if(is_array($dtp->CTags))
{
	foreach($dtp->CTags as $ctag){
		if($ctag->GetName()=='field') $noteid++;
		if($ctag->GetName()=='note') $noteinfos = $ctag;
	}
}
else
{
	ShowMsg("该规则不合法,无法进行生成采集配置!","-1");
	$dsql->Close();
	exit();
}
require_once(dirname(__FILE__)."/templets/co_add.htm");
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:co_add.php

示例13: if

		$language = $ctag->GetAtt("language");
		$matchtype = $ctag->GetAtt("matchtype");
		$refurl = $ctag->GetAtt("refurl");
		$isref = $ctag->GetAtt("isref");
		$exptime = $ctag->GetAtt("exptime");
	}
	else if($ctag->GetName()=="list")
	{
		$sunnote = $ctag->GetInnerText();
		$dtp2->LoadString($sunnote);
		$source = $ctag->GetAtt('source');
		$sourcetype = $ctag->GetAtt('sourcetype');
		$varstart = $ctag->GetAtt('varstart');
		$varend = $ctag->GetAtt('varend');
		$urlTag = $dtp2->GetTagByName('url');
		$needTag = $dtp2->GetTagByName('need');
		$cannotTag = $dtp2->GetTagByName('cannot');
		$linkareaTag = $dtp2->GetTagByName('linkarea');
	}
	else if($ctag->GetName()=="art")
	{
		$sunnote = $ctag->GetInnerText();
		$dtp3->LoadString($sunnote);
		$sppageTag = $dtp3->GetTagByName('sppage');
  }
}

require_once(dirname(__FILE__)."/templets/co_edit.htm");

ClearAllLink();
?>
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:co_edit.php

示例14: LoadConfig

	function LoadConfig($configString)
	{
		$dtp = new DedeTagParse();
		$dtp->SetNameSpace("dede","{","}");
		$dtp2 = new DedeTagParse();
		$dtp2->SetNameSpace("dede","{","}");
		$dtp3 = new DedeTagParse();
		$dtp3->SetNameSpace("dede","{","}");
		$dtp->LoadString($configString);
		for($i=0;$i<=$dtp->Count;$i++)
		{
			$ctag = $dtp->CTags[$i];
			//item 配置
			//节点基本信息
			if($ctag->GetName()=="item")
			{
				$this->Item["name"] = $ctag->GetAtt("name");
				$this->Item["typeid"] = $ctag->GetAtt("typeid");
				$this->Item["imgurl"] = $ctag->GetAtt("imgurl");
				$this->Item["imgdir"] = $ctag->GetAtt("imgdir");
				$this->Item["language"] = $ctag->GetAtt("language");
				$this->Item["matchtype"] = $ctag->GetAtt("matchtype");
				$this->Item["isref"] = $ctag->GetAtt("isref");
				$this->Item["refurl"] = $ctag->GetAtt("refurl");
				$this->Item["exptime"] = $ctag->GetAtt("exptime"); 
				if($this->Item["matchtype"]=="") $this->Item["matchtype"]="string";
				//创建图片保存目录
				$updir = dirname(__FILE__)."/".$this->Item["imgdir"]."/";
				$updir = str_replace("\\","/",$updir);
				$updir = preg_replace("/\/{1,}/","/",$updir);
				if(!is_dir($updir)) MkdirAll($updir,$GLOBALS['cfg_dir_purview']);
			}
			//list 配置
			//要采集的列表页的信息
			else if($ctag->GetName()=="list")
			{
				$this->List["varstart"]= $ctag->GetAtt("varstart");
				$this->List["varend"] = $ctag->GetAtt("varend");
				$this->List["source"] = $ctag->GetAtt("source");
				$this->List["sourcetype"] = $ctag->GetAtt("sourcetype");
				$dtp2->LoadString($ctag->GetInnerText());
				for($j=0;$j<=$dtp2->Count;$j++)
				{
					$ctag2 = $dtp2->CTags[$j];
					$tname = $ctag2->GetName();
					if($tname=="need"){
						$this->List["need"] = trim($ctag2->GetInnerText());
					}else if($tname=="cannot"){
						$this->List["cannot"] = trim($ctag2->GetInnerText());
					}
					else if($tname=="linkarea"){
						$this->List["linkarea"] = trim($ctag2->GetInnerText());
				  }else if($tname=="url")
					{
						$gurl = trim($ctag2->GetAtt("value"));
						//手工指定列表网址
						if($this->List["source"]=="app")
						{
							$turl = trim($ctag2->GetInnerText());
							$turls = explode("\n",$turl);
							$l_tj = 0;
							foreach($turls as $turl){
								$turl = trim($turl);
								if($turl=="") continue;
								if(!eregi("^http://",$turl)) $turl = "http://".$turl;
								$this->List["url"][$l_tj] = $turl;
								$l_tj++;
							}
						}
						//用分页变量产生的网址
						else
						{	
							if(eregi("var:分页",trim($ctag2->GetAtt("value")))){
								if($this->List["varstart"]=="") $this->List["varstart"]=1;
								if($this->List["varend"]=="") $this->List["varend"]=10;
								$l_tj = 0;
								for($l_em = $this->List["varstart"];$l_em<=$this->List["varend"];$l_em++){
										$this->List["url"][$l_tj] = str_replace("[var:分页]",$l_em,$gurl);
										$l_tj++;
								}
							}//if set var
							else{
								$this->List["url"][0] = $gurl;
							}
						}
					}
				}//End inner Loop1
			}
			//art 配置
			//要采集的文章页的信息
			else if($ctag->GetName()=="art")
			{
				$dtp2->LoadString($ctag->GetInnerText());
				for($j=0;$j<=$dtp2->Count;$j++)
				{
					$ctag2 = $dtp2->CTags[$j];
					//文章要采集的字段的信息及处理方式
					if($ctag2->GetName()=="note"){
						$field = $ctag2->GetAtt('field');
						if($field == "") continue;
//.........这里部分代码省略.........
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:101,代码来源:pub_collection.php

示例15: lib_arclistsg


//.........这里部分代码省略.........
        $limitsql = " LIMIT {$limit} ";
    } else {
        $limitsql = " LIMIT 0,{$line} ";
    }
    $orwhere = '';
    if (isset($orwheres[0])) {
        $orwhere = join(' AND ', $orwheres);
        $orwhere = preg_replace("#^ AND#i", '', $orwhere);
        $orwhere = preg_replace("#AND[ ]{1,}AND#i", 'AND ', $orwhere);
    }
    if ($orwhere != '') {
        $orwhere = " WHERE {$orwhere} ";
    }
    $query = "SELECT {$arclistquery},tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,\n        tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n        FROM `{$maintable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n        {$orwhere} AND arc.arcrank > -1 {$ordersql} {$limitsql}";
    $md5hash = md5($query);
    $needcache = TRUE;
    if ($idlist != '') {
        $needcache = FALSE;
    } else {
        $idlist = GetArclistSgCache($md5hash);
        if ($idlist != '') {
            $needcache = FALSE;
        }
    }
    //指定了id或使用缓存中的id
    if ($idlist != '' && $_arclistEnv != 'index') {
        $query = "SELECT {$arclistquery},tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,\n            tp.moresite,tp.siteurl,tp.sitepath FROM `{$maintable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n          WHERE arc.aid IN({$idlist}) {$ordersql} {$limitsql}";
    }
    $dsql->SetQuery($query);
    $dsql->Execute("al");
    $artlist = "";
    $dtp2 = new DedeTagParse();
    $dtp2->SetNameSpace("field", "[", "]");
    $dtp2->LoadString($innertext);
    $GLOBALS['autoindex'] = 0;
    $ids = array();
    for ($i = 0; $i < $line; $i++) {
        for ($j = 0; $j < $col; $j++) {
            if ($col > 1) {
                $artlist .= "    <div>\r\n";
            }
            if ($row = $dsql->GetArray("al")) {
                $ids[] = $row['aid'];
                $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], 1, 0, $row['namerule'], $row['typedir'], 0, '', $row['moresite'], $row['siteurl'], $row['sitepath']);
                $row['typeurl'] = GetTypeUrl($row['typeid'], $row['typedir'], $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['moresite'], $row['siteurl'], $row['sitepath']);
                if ($row['litpic'] == '-' || $row['litpic'] == '') {
                    $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
                }
                if (!preg_match("#^http:\\/\\/#i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
                    $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
                }
                $row['picname'] = $row['litpic'];
                $row['image'] = "<img src='" . $row['picname'] . "' border='0' width='{$imgwidth}' height='{$imgheight}' alt='" . preg_replace("#['><]#", "", $row['title']) . "' />";
                $row['imglink'] = "<a href='" . $row['filename'] . "'>" . $row['image'] . "</a>";
                $row['stime'] = GetDateMK($row['pubdate']);
                $row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
                $row['fulltitle'] = $row['title'];
                $row['title'] = cn_substr($row['title'], $titlelen);
                $row['textlink'] = "<a href='" . $row['filename'] . "'>" . $row['title'] . "</a>";
                $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
                $row['memberurl'] = $GLOBALS['cfg_memberurl'];
                $row['templeturl'] = $GLOBALS['cfg_templeturl'];
                if (is_array($dtp2->CTags)) {
                    foreach ($dtp2->CTags as $k => $ctag) {
                        if ($ctag->GetName() == 'array') {
                            //传递整个数组,在runphp模式中有特殊作用
开发者ID:ahmatjan,项目名称:cmf2,代码行数:67,代码来源:arclistsg.lib.php


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