<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

织梦DEDECMS5.7 LOOP标签调用文档地址arcurl的方法

时间:2020-12-15

DEDECMS帮助手册提供的loop万能循环标签,不支持[field:arcurl/]直接调用,也就是[field:arcurl/]链接标签没法被解析生成。

先看看loop万能循环标签代码:

{dede:loop table='dede_archives' sort='' row='4' if=''}

<a href='[field:arcurl/]'>[field:title/]</a>
{/dede:loop}
自己动手,添加一个函数
一、打开Include/common.func.php,找到54行,再这里添加一个函数代码如下:
function IDReturnURL($ID)
{
global $dsql;
$query = "Select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,
tp.defaultname,tp.namerule,tp.moresite,tp.siteurl,tp.sitepath 
from dede_archives arc left join dede_arctype tp on arc.typeid=tp.id where arc.id = ".$ID;
$row = $dsql->GetOne($query);
$ReturnURL = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
    $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
return $ReturnURL;

二、模板中的调用写法,代码如下:

 {dede:loop table='dede_archives' sort='' row='4' if=''}

<li>·<a href='[field:id function=IDReturnURL(@me)/]'>[field:title function=cn_substrR(@me,44)/]</a></li>
{/dede:loop}
另外,如果你要用自定义sql 标签里,代码如下:
 [field:id runphp='yes']$arcRow=GetOneArchive(@me);@me=$arcRow['arcurl'];[/field:id]
0
首页
案例
关于
联系