<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">

观点

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

自定义 DedeCMS 友情连接 flink 标签模板编写格式

时间:2020-12-16

 在织梦dedecms系统中友情链接虽然功能不错,但大多数人使用时都觉得略显复杂,而在织梦dedecms模板制作中默认的 flink 标签实在不好用,由此我们常常希望使用 flink 标签时能像 dede:arclist 那样编写,如:
 
{dede:flink row='10' typeid='2'} 
<li>
   <a href="[field:url/]"><img src="[field:logo/]" title="[field:webname/]"/></a>
   <a href="[field:url/]">[field:webname/]</a>
</li>
{/dede:flink}
 
其实想要如此灵活的使用 flink 标签通过修改DEDECMS源文件即可。首先打开“ /include/taglib/flink.lib.php ”,找到:
 
$rbtext = preg_replace("/\[field:url([\/\s]{0,})\]/isU", $row['url'], $innertext); 
$rbtext = preg_replace("/\[field:webname([\/\s]{0,})\]/isU", $row['webname'], $rbtext); 
$rbtext = preg_replace("/\[field:logo([\/\s]{0,})\]/isU", $row['logo'], $rbtext);
 
然后将其修改成(记得先备份这个文件):
 
$rbtext = preg_replace("/\[field:url([\/\s]{0,})\]/isU", $dbrow->url, $innertext); 
$rbtext = preg_replace("/\[field:webname([\/\s]{0,})\]/isU", $dbrow->webname, $rbtext); 
$rbtext = preg_replace("/\[field:logo([\/\s]{0,})\]/isU", $dbrow->logo, $rbtext);
 
这样就完成了!当然如果你实在不喜欢修改织梦dedecms的源文件那么也可以换一种方式调用友情链接条目:
 
{dede:loop table='idea_flink' row='10'}
   <a href="[field:url/]">[field:webname/]</a>
{/dede:loop}
    0
    首页
    案例
    关于
    联系