浏览代码

分类信息infoguide支持global字段

tags/6.5.8
tianya 1周前
父节点
当前提交
41481c8165
共有 1 个文件被更改,包括 18 次插入1 次删除
  1. +18
    -1
      src/system/taglib/infoguide.lib.php

+ 18
- 1
src/system/taglib/infoguide.lib.php 查看文件

@@ -1,5 +1,5 @@
<?php
if (!defined('DEDEINC')) exit ('dedebiz');
if (!defined('DEDEINC')) exit('dedebiz');
/**
* 分类信息地区搜索标签
*
@@ -24,6 +24,23 @@ function lib_infoguide(&$ctag, &$refObj)
}
$innerText = trim($ctag->GetInnerText());
if (empty($innerText)) $innerText = GetSysTemplets("info_guide.htm");
$dtp = new DedeTagParse();
$dtp->SetNameSpace('dede', '{', '}');
$dtp->LoadSource($innerText);
for ($i = 0; $i <= $dtp->Count; $i++) {
$CTag = $dtp->CTags[$i];
if ($CTag->TagName == 'global') {
$str = $dtp->GetGlobals($CTag->GetAtt('name'));
if ($dtp->CTags[$i]->GetAtt('function') != '') {
//$str = $this->EvalFunc( $this->CTags[$i]->TagValue, $this->CTags[$i]->GetAtt('function'),$this->CTags[$i] );
$str = $dtp->EvalFunc($str, $dtp->CTags[$i]->GetAtt('function'), $dtp->CTags[$i]);
}
$dtp->CTags[$i]->IsReplace = TRUE;
$dtp->CTags[$i]->TagValue = $str;
}
}
$innerText = $dtp->GetResult();
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field', '[', ']');
$ctp->LoadSource($innerText);


正在加载...
取消
保存