本文整理汇总了PHP中DedeTagParse::GetTag方法的典型用法代码示例。如果您正苦于以下问题:PHP DedeTagParse::GetTag方法的具体用法?PHP DedeTagParse::GetTag怎么用?PHP DedeTagParse::GetTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DedeTagParse
的用法示例。
在下文中一共展示了DedeTagParse::GetTag方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: GetFormItemValue
function GetFormItemValue($ctag, $fvalue)
{
$fieldname = $ctag->GetName();
$formitem = "\r\n\t\t<table width=\"800\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n <tr>\r\n <td width=\"80\">~name~</td>\r\n <td width=\"720\">~form~</td>\r\n </tr>\r\n </table>\r\n";
$innertext = trim($ctag->GetInnerText());
if ($innertext != "") {
if ($ctag->GetAtt("type") == 'select') {
$myformItem = '';
$items = explode(',', $innertext);
$myformItem = "<select name='{$fieldname}' style='width:150px'>";
foreach ($items as $v) {
$v = trim($v);
if ($v != '') {
if ($fvalue == $v) {
$myformItem .= "<option value='{$v}' selected>{$v}</option>\r\n";
} else {
$myformItem .= "<option value='{$v}'>{$v}</option>\r\n";
}
}
}
$myformItem .= "</select>\r\n";
$formitem = str_replace("~name~", $ctag->GetAtt('itemname'), $formitem);
$formitem = str_replace("~form~", $myformItem, $formitem);
return $formitem;
} else {
if ($ctag->GetAtt("type") == 'radio') {
$myformItem = '';
$items = explode(',', $innertext);
foreach ($items as $v) {
$v = trim($v);
if ($v != '') {
if ($fvalue == $v) {
$myformItem .= "<input type='radio' name='{$fieldname}' class='np' value='{$v}' checked>{$v}\r\n";
} else {
$myformItem .= "<input type='radio' name='{$fieldname}' class='np' value='{$v}'>{$v}\r\n";
}
}
}
$formitem = str_replace("~name~", $ctag->GetAtt('itemname'), $formitem);
$formitem = str_replace("~form~", $myformItem, $formitem);
return $formitem;
} else {
$formitem = str_replace('~name~', $ctag->GetAtt('itemname'), $formitem);
$formitem = str_replace('~form~', $innertext, $formitem);
$formitem = str_replace('@value', $fvalue, $formitem);
return $formitem;
}
}
}
//文本数据的特殊处理
if ($ctag->GetAtt("type") == "textdata") {
if (is_file($GLOBALS['cfg_basedir'] . $fvalue)) {
$fp = fopen($GLOBALS['cfg_basedir'] . $fvalue, 'r');
$okfvalue = "";
while (!feof($fp)) {
$okfvalue .= fgets($fp, 1024);
}
fclose($fp);
} else {
$okfvalue = "";
}
$formitem = "<table width=\"800\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"80\">" . $ctag->GetAtt('itemname') . "</td>\r\n";
$formitem .= "<td>\r\n" . GetEditor($fieldname, $okfvalue, 350, 'Basic', 'string') . "</td>\r\n";
$formitem .= "</tr></table>\r\n";
$formitem .= "<input type='hidden' name='{$fieldname}_file' value='{$fvalue}'>\r\n";
return $formitem;
} else {
if ($ctag->GetAtt("type") == "htmltext") {
$formitem = "<table width=\"800\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"80\">" . $ctag->GetAtt('itemname') . "</td>\r\n";
$formitem .= "<td>\r\n" . GetEditor($fieldname, $fvalue, 350, 'Basic', 'string') . "</td>\r\n";
$formitem .= "</tr></table>\r\n";
return $formitem;
} else {
if ($ctag->GetAtt("type") == "multitext") {
$innertext = "<textarea name='{$fieldname}' id='{$fieldname}' style='width:100%;height:80'>{$fvalue}</textarea>\r\n";
$formitem = str_replace("~name~", $ctag->GetAtt('itemname'), $formitem);
$formitem = str_replace("~form~", $innertext, $formitem);
return $formitem;
} else {
if ($ctag->GetAtt("type") == "datetime") {
$nowtime = GetDateTimeMk($fvalue);
$innertext = "<input name=\"{$fieldname}\" value=\"{$nowtime}\" type=\"text\" id=\"{$fieldname}\" style=\"width:200\">";
$innertext .= "<input name=\"selPubtime\" type=\"button\" id=\"selkeyword\" value=\"选择\" onClick=\"showCalendar('{$fieldname}', 'Y-m-d H:i:00', '24');\">";
$formitem = str_replace("~name~", $ctag->GetAtt('itemname'), $formitem);
$formitem = str_replace("~form~", $innertext, $formitem);
return $formitem;
} else {
if ($ctag->GetAtt("type") == "img") {
$ndtp = new DedeTagParse();
$ndtp->LoadSource($fvalue);
if (!is_array($ndtp->CTags)) {
$ndtp->Clear();
$fvalue = "";
}
$ntag = $ndtp->GetTag("img");
$fvalue = trim($ntag->GetInnerText());
$innertext = "<input type='text' name='{$fieldname}' value='{$fvalue}' id='{$fieldname}' style='width:300'><input name='" . $fieldname . "_bt' type='button' value='浏览...' onClick=\"SelectImage('form1.{$fieldname}','big')\">\r\n";
$formitem = str_replace("~name~", $ctag->GetAtt('itemname'), $formitem);
$formitem = str_replace("~form~", $innertext, $formitem);
return $formitem;
//.........这里部分代码省略.........
示例3: GetImgLinks
function GetImgLinks($fvalue)
{
$revalue = "";
$dtp = new DedeTagParse();
$dtp->LoadSource($fvalue);
if(!is_array($dtp->CTags)){
$dtp->Clear();
return "无图片信息!";
}
$ptag = $dtp->GetTag("pagestyle");
if(is_object($ptag)){
$pagestyle = $ptag->GetAtt('value');
$maxwidth = $ptag->GetAtt('maxwidth');
$ddmaxwidth = $ptag->GetAtt('ddmaxwidth');
$irow = $ptag->GetAtt('row');
$icol = $ptag->GetAtt('col');
if(empty($maxwidth)) $maxwidth = $GLOBALS['cfg_album_width'];
}else{
$pagestyle = 2;
$maxwidth = $GLOBALS['cfg_album_width'];
$ddmaxwidth = 200;
}
if($pagestyle == 3){
if(empty($irow)) $irow = 4;
if(empty($icol)) $icol = 4;
}
//遍历图片信息
$mrow = 0;
$mcol = 0;
$photoid = 0;
$images = array();
$sysimgpath = $GLOBALS['cfg_templeturl']."/sysimg";
foreach($dtp->CTags as $ctag){
if($ctag->GetName()=="img"){
$iw = $ctag->GetAtt('width');
$ih = $ctag->GetAtt('heigth');
$alt = str_replace("'","",$ctag->GetAtt('text'));
$src = trim($ctag->GetInnerText());
$ddimg = $ctag->GetAtt('ddimg');
if($iw > $maxwidth) $iw = $maxwidth;
$iw = (empty($iw) ? "" : "width='$iw'");
//全部列出式或分页式图集
if($pagestyle<3){
if($revalue==""){
if($pagestyle==2){
$playsys = "
<div class='butbox'>
<a href='$src' target='_blank' class='c1'>原始图片</a>\r\n
<a href='javascript:dPlayPre();' class='c1'>上一张</a>\r\n
<a href='javascript:dPlayNext();' class='c1'>下一张</a>\r\n
<a href='javascript:dStopPlay();' class='c1'>自动 / 暂停播放</a>\r\n
</div>\r\n";
$revalue = " {$playsys}
<div class='imgview'>\r\n
<center>
<a href='javascript:dPlayNext();'><img src='$src' alt='$alt'/></a>\r\n
</center>
</div>\r\n
<script language='javascript'>dStartPlay();</script>\r\n";
}
else $revalue = "
<div class='imgview'>\r\n
<center>
<a href='$src' target='_blank'><img src='$src' alt='$alt' /></a>\r\n
</center>
</div>\r\n";
}else{
if($pagestyle==2){
$playsys = "
<div class='butbox'>
<a href='$src' target='_blank' class='c1'>原始图片</a>\r\n
<a href='javascript:dPlayPre();' class='c1'>上一张</a>\r\n
<a href='javascript:dPlayNext();' class='c1'>下一张</a>\r\n
<a href='javascript:dStopPlay();' class='c1'>自动 / 暂停播放</a>\r\n
</div>\r\n";
$revalue .= "#p#分页标题#e# {$playsys}
<div class='imgview'>\r\n
<center>
<a href='javascript:dPlayNext();'><img src='$src' alt='$alt'/></a>\r\n
</center>
</div>\r\n
<script language='javascript'>dStartPlay();</script>\r\n";
}
else $revalue .= "
<div class='imgview'>\r\n
<center>
<a href='$src' target='_blank'><img src='$src' alt='$alt' /></a>\r\n
</center>
</div>\r\n";
}
//多列式图集
}else if($pagestyle==3){
$images[$photoid][0] = $src;
$images[$photoid][1] = $alt;
$images[$photoid][2] = $ddimg;
$photoid++;
}
}
}
//.........这里部分代码省略.........
示例4: GetlitImgLinks
/**
* 获取缩略图链接
*
* @access public
* @param string $fvalue 表单值
* @return string
*/
function GetlitImgLinks($fvalue)
{
if ($GLOBALS["htmltype"] == "dm") {
if (empty($GLOBALS["pageno"])) {
$NowPage = 1;
} else {
$NowPage = intval($GLOBALS["pageno"]);
}
} else {
if (empty($GLOBALS["stNowPage"])) {
$NowPage = 1;
} else {
$NowPage = intval($GLOBALS["stNowPage"]);
}
}
$revalue = "";
$dtp = new DedeTagParse();
$dtp->LoadSource($fvalue);
if (!is_array($dtp->CTags)) {
$dtp->Clear();
return "无图片信息!";
}
$ptag = $dtp->GetTag("pagestyle");
if (is_object($ptag)) {
$pagestyle = $ptag->GetAtt('value');
$maxwidth = $ptag->GetAtt('maxwidth');
$ddmaxwidth = $ptag->GetAtt('ddmaxwidth');
$irow = $ptag->GetAtt('row');
$icol = $ptag->GetAtt('col');
if (empty($maxwidth)) {
$maxwidth = $GLOBALS['cfg_album_width'];
}
} else {
$pagestyle = 2;
$maxwidth = $GLOBALS['cfg_album_width'];
$ddmaxwidth = 200;
}
if ($pagestyle == 3) {
if (empty($irow)) {
$irow = 4;
}
if (empty($icol)) {
$icol = 4;
}
}
$mrow = 0;
$mcol = 0;
$photoid = 1;
$images = array();
$TotalPhoto = sizeof($dtp->CTags);
foreach ($dtp->CTags as $ctag) {
if ($ctag->GetName() == "img") {
$iw = $ctag->GetAtt('width');
$ih = $ctag->GetAtt('heigth');
$alt = str_replace("'", "", $ctag->GetAtt('text'));
$src = trim($ctag->GetInnerText());
$ddimg = $ctag->GetAtt('ddimg');
if ($iw > $maxwidth) {
$iw = $maxwidth;
}
$iw = empty($iw) ? "" : "width='{$iw}'";
if ($GLOBALS["htmltype"] == "dm") {
$imgurl = "view.php?aid={$this->ArcID}&pageno={$photoid}";
} else {
if ($photoid == 1) {
$imgurl = $GLOBALS["fileFirst"] . ".html";
} else {
$imgurl = $GLOBALS["fileFirst"] . "_" . $photoid . ".html";
}
}
$imgcls = "image" . ($photoid - 1);
$revalue .= "<dl><dt>{$alt}<dd>{$ddimg}<dd>{$ddimg}<dd>{$ddimg}<dd><dd><div></div><div></div><dd><dd>{$photoid}</dd></dl>\r\n";
$photoid++;
}
}
unset($dtp);
unset($images);
return $revalue;
}
示例5: GetFormItemValue
//.........这里部分代码省略.........
}
$myformItem .= $fvalue == $v ? "<input type='radio' name='{$fieldname}' class='np' value='{$v}' checked='checked' />{$v}\r\n" : "<input type='radio' name='{$fieldname}' class='np' value='{$v}' />{$v}\r\n";
}
}
$innertext = $myformItem;
} else {
if ($ftype == 'checkbox') {
$myformItem = '';
$fvalues = explode(',', $fvalue);
if (is_array($items)) {
foreach ($items as $v) {
$v = trim($v);
if ($v == '') {
continue;
}
if (in_array($v, $fvalues)) {
$myformItem .= "<input type='checkbox' name='{$fieldname}[]' class='np' value='{$v}' checked='checked' />{$v}\r\n";
} else {
$myformItem .= "<input type='checkbox' name='{$fieldname}[]' class='np' value='{$v}' />{$v}\r\n";
}
}
}
$innertext = $myformItem;
} else {
if ($ftype == "textdata") {
if (is_file($cfg_basedir . $fvalue)) {
$fp = fopen($cfg_basedir . $fvalue, 'r');
$okfvalue = '';
while (!feof($fp)) {
$okfvalue .= fgets($fp, 1024);
}
fclose($fp);
} else {
$okfvalue = '';
}
if ($admintype == 'admin') {
$myformItem = GetEditor($fieldname, $okfvalue, 350, 'Basic', 'string') . "\r\n <input type='hidden' name='{$fieldname}_file' value='{$fvalue}' />\r\n ";
} else {
$myformItem = GetEditor($fieldname, $okfvalue, 350, 'Member', 'string') . "\r\n <input type='hidden' name='{$fieldname}_file' value='{$fvalue}' />\r\n ";
}
$innertext = $myformItem;
} else {
if ($ftype == "htmltext") {
if ($admintype == 'admin') {
$myformItem = GetEditor($fieldname, $fvalue, 350, 'Basic', 'string') . "\r\n ";
} else {
$myformItem = GetEditor($fieldname, $fvalue, 350, 'Member', 'string') . "\r\n ";
}
$innertext = $myformItem;
} else {
if ($ftype == "multitext") {
$innertext = "<textarea name='{$fieldname}' id='{$fieldname}' style='width:90%;height:80px'>{$fvalue}</textarea>\r\n";
} else {
if ($ftype == "datetime") {
$nowtime = GetDateTimeMk($fvalue);
$innertext = "<input name=\"{$fieldname}\" value=\"{$nowtime}\" type=\"text\" id=\"{$fieldname}\" style=\"width:250px\" class=\"intxt\" />";
$innertext .= " <script language=\"javascript\" type=\"text/javascript\">\r\n Calendar.setup({\r\n inputField : \"{$fieldname}\",\r\n ifFormat : \"%Y-%m-%d %H:%M\",\r\n showsTime : true,\r\n timeFormat : \"24\"\r\n });\r\n </script>";
} else {
if ($ftype == "img") {
$ndtp = new DedeTagParse();
$ndtp->LoadSource($fvalue);
if (!is_array($ndtp->CTags)) {
$ndtp->Clear();
$fvalue = "";
} else {
$ntag = $ndtp->GetTag("img");
$fvalue = trim($ntag->GetInnerText());
}
$innertext = "<input type='text' name='{$fieldname}' value='{$fvalue}' id='{$fieldname}' style='width:300px' class='text' /> <input name='" . $fieldname . "_bt' class='inputbut' type='button' value='浏览...' onClick=\"SelectImage('form1.{$fieldname}','big')\" />\r\n";
} else {
if ($ftype == "imgfile") {
$innertext = "<input type='text' name='{$fieldname}' value='{$fvalue}' id='{$fieldname}' style='width:300px' class='text' /> <input name='" . $fieldname . "_bt' class='inputbut' type='button' value='浏览...' onClick=\"SelectImage('form1.{$fieldname}','big')\" />\r\n";
} else {
if ($ftype == "media") {
$innertext = "<input type='text' name='{$fieldname}' value='{$fvalue}' id='{$fieldname}' style='width:300px' class='text' /> <input name='" . $fieldname . "_bt' class='inputbut' type='button' value='浏览...' onClick=\"SelectMedia('form1.{$fieldname}')\" />\r\n";
} else {
if ($ftype == "addon") {
$innertext = "<input type='text' name='{$fieldname}' id='{$fieldname}' value='{$fvalue}' style='width:300px' class='text' /> <input name='" . $fieldname . "_bt' class='inputbut' type='button' value='浏览...' onClick=\"SelectSoft('form1.{$fieldname}')\" />\r\n";
} else {
if ($ftype == "int" || $ftype == "float") {
$innertext = "<input type='text' name='{$fieldname}' id='{$fieldname}' style='width:100px' class='intxt' value='{$fvalue}' /> (填写数值)\r\n";
} else {
$innertext = "<input type='text' name='{$fieldname}' id='{$fieldname}' style='width:250px' class='intxt' value='{$fvalue}' />\r\n";
}
}
}
}
}
}
}
}
}
}
}
}
}
$formitem = str_replace('~name~', $ctag->GetAtt('itemname'), $formitem);
$formitem = str_replace('~form~', $innertext, $formitem);
return $formitem;
}
示例6: GetFormItemValue
//.........这里部分代码省略.........
//文本数据的特殊处理
if($ftype=="textdata")
{
if(is_file($cfg_basedir.$fvalue)){
$fp = fopen($cfg_basedir.$fvalue,'r');
$okfvalue = "";
while(!feof($fp)){ $okfvalue .= fgets($fp,1024); }
fclose($fp);
}else{
$okfvalue = '';
}
if($admintype=='admin') $myformItem = GetEditor($fieldname,$okfvalue,350,'Basic','string')."\r\n <input type='hidden' name='{$fieldname}_file' value='{$fvalue}'>\r\n ";
else $myformItem = GetEditor($fieldname,$okfvalue,350,'Member','string')."\r\n <input type='hidden' name='{$fieldname}_file' value='{$fvalue}'>\r\n ";
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$myformItem,$formitem);
return $formitem;
}
else if($ftype=="htmltext")
{
if($admintype=='admin') $myformItem = GetEditor($fieldname,$fvalue,350,'Basic','string')."\r\n ";
else $myformItem = GetEditor($fieldname,$fvalue,350,'Member','string')."\r\n ";
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$myformItem,$formitem);
return $formitem;
}
else if($ftype=="multitext")
{
$innertext = "<textarea name='$fieldname' id='$fieldname' style='width:100%;height:80px'>$fvalue</textarea>\r\n";
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$innertext,$formitem);
return $formitem;
}
else if($ftype=="datetime")
{
$nowtime = GetDateTimeMk($fvalue);
$innertext = "<input name=\"$fieldname\" value=\"$nowtime\" type=\"text\" id=\"$fieldname\" style=\"width:250px\">";
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$innertext,$formitem);
return $formitem;
}
else if($ftype=="img")
{
$ndtp = new DedeTagParse();
$ndtp->LoadSource($fvalue);
if(!is_array($ndtp->CTags)){
$ndtp->Clear();
$fvalue = "";
}else
{
$ntag = $ndtp->GetTag("img");
//$fvalue = trim($ntag->GetInnerText());
$fvalue = trim($ndtp->InnerText);
}
$innertext = "<input type='text' name='$fieldname' value='$fvalue' id='$fieldname' style='width:300px'> <input name='".$fieldname."_bt' class='inputbut' type='button' value='浏览...' onClick=\"SelectImage('form1.$fieldname','big')\">\r\n";
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$innertext,$formitem);
return $formitem;
}
else if($ftype=="imgfile")
{
$innertext = "<input type='text' name='$fieldname' value='$fvalue' id='$fieldname' style='width:300px'> <input name='".$fieldname."_bt' class='inputbut' type='button' value='浏览...' onClick=\"SelectImage('form1.$fieldname','big')\">\r\n";
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$innertext,$formitem);
return $formitem;
}
else if($ftype=="media")
{
$innertext = "<input type='text' name='$fieldname' value='$fvalue' id='$fieldname' style='width:300px'> <input name='".$fieldname."_bt' class='inputbut' type='button' value='浏览...' onClick=\"SelectMedia('form1.$fieldname')\">\r\n";
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$innertext,$formitem);
return $formitem;
}
else if($ftype=="addon")
{
$innertext = "<input type='text' name='$fieldname' id='$fieldname' value='$fvalue' style='width:300px'> <input name='".$fieldname."_bt' class='inputbut' type='button' value='浏览...' onClick=\"SelectSoft('form1.$fieldname')\">\r\n";
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$innertext,$formitem);
return $formitem;
}
else if($ftype=="int"||$ftype=="float")
{
$innertext = "<input type='text' name='$fieldname' id='$fieldname' style='width:100px' value='$fvalue'> (填写数值)\r\n";
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$innertext,$formitem);
return $formitem;
}
else
{
$innertext = "<input type='text' name='$fieldname' id='$fieldname' style='width:250px' value='$fvalue'>\r\n";
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$innertext,$formitem);
return $formitem;
}
}
示例7: DedeSql
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/inc_typelink.php");
require_once(dirname(__FILE__)."/../include/pub_dedetag.php");
$dsql = new DedeSql(false);
$aid = ereg_replace("[^0-9]","",$aid);
$row = $dsql->GetOne("Select * From #@__freelist where aid='$aid' ");
$dtp = new DedeTagParse();
$dtp->SetNameSpace("dede","{","}");
$dtp->LoadSource("--".$row['listtag']."--");
$ctag = $dtp->GetTag('list');
require_once(dirname(__FILE__)."/templets/freelist_edit.htm");
ClearAllLink();
?>
示例8: ch_img
/**
* 图像标签
*
* @version $Id:img.lib.php 1 9:33 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_img($fvalue, &$arcTag, &$refObj, $fname = '')
{
global $cfg_album_width, $cfg_album_row, $cfg_album_col, $cfg_album_pagesize, $cfg_album_style, $cfg_album_ddwidth, $cfg_basehost, $cfg_multi_site;
$dtp = new DedeTagParse();
$dtp->LoadSource($fvalue);
if (!is_array($dtp->CTags)) {
$dtp->Clear();
return "无图片信息!";
}
$pagestyle = $cfg_album_style;
$maxwidth = $cfg_album_width;
$ddmaxwidth = $cfg_album_ddwidth;
$pagepicnum = $cfg_album_pagesize;
$row = $cfg_album_row;
$icol = $cfg_album_col;
$ptag = $dtp->GetTag('pagestyle');
if (is_object($ptag)) {
$pagestyle = $ptag->GetAtt('value');
$maxwidth = $ptag->GetAtt('maxwidth');
$ddmaxwidth = $ptag->GetAtt('ddmaxwidth');
$pagepicnum = $ptag->GetAtt('pagepicnum');
$irow = $ptag->GetAtt('row');
$icol = $ptag->GetAtt('col');
if (empty($maxwidth)) {
$maxwidth = $cfg_album_width;
}
}
//遍历图片信息
$mrow = 0;
$mcol = 0;
$images = array();
$innerTmp = $arcTag->GetInnerText();
if (trim($innerTmp) == '') {
$innerTmp = GetSysTemplets("channel_article_image.htm");
}
if ($pagestyle == 1) {
$pagesize = $pagepicnum;
} else {
if ($pagestyle == 2) {
$pagesize = 1;
} else {
$pagesize = $irow * $icol;
}
}
if (is_object($arcTag) && $arcTag->GetAtt('pagesize') > 0) {
$pagesize = $arcTag->GetAtt('pagesize');
}
if (empty($pagesize)) {
$pagesize = 12;
}
$aid = $refObj->ArcID;
$row = $refObj->dsql->GetOne("SELECT title FROM `#@__archives` WHERE `id` = '{$aid}';");
$title = $row['title'];
$revalue = '';
$GLOBAL['photoid'] = 0;
foreach ($dtp->CTags as $ctag) {
if ($ctag->GetName() == "img") {
$fields = $ctag->CAttribute->Items;
$fields['text'] = str_replace("'", "", $ctag->GetAtt('text'));
$fields['title'] = $title;
$fields['imgsrc'] = trim($ctag->GetInnerText());
$fields['imgsrctrue'] = $fields['imgsrc'];
if (empty($fields['ddimg'])) {
$fields['ddimg'] = $fields['imgsrc'];
}
if ($cfg_multi_site == 'Y') {
//$cfg_basehost)
if (!preg_match('#^http:#i', $fields['imgsrc'])) {
$fields['imgsrc'] = $cfg_basehost . $fields['imgsrc'];
}
if (!preg_match('#^http:#i', $fields['ddimg'])) {
$fields['ddimg'] = $cfg_basehost . $fields['ddimg'];
}
}
if (empty($fields['width'])) {
$fields['width'] = $maxwidth;
}
//if($fields['text']=='')
//{
//$fields['text'] = '图片'.($GLOBAL['photoid']+1);
//}
$fields['alttext'] = str_replace("'", '', $fields['text']);
$fields['pagestyle'] = $pagestyle;
$dtp2 = new DedeTagParse();
$dtp2->SetNameSpace("field", "[", "]");
$dtp2->LoadSource($innerTmp);
if ($GLOBAL['photoid'] > 0 && $GLOBAL['photoid'] % $pagesize == 0) {
$revalue .= "#p#分页标题#e#";
}
if ($pagestyle == 1) {
$fields['imgwidth'] = '';
//.........这里部分代码省略.........