dedecms列表页首页调用下载地址的办法总结

2022/11/26 09:03    5G收录网    已浏览186次

直接在include/helpers/extends.helps.php  最下面加个函数:

01 if ( ! function_exists('getlink'))
02 {
03     function getlink($dedetag){ //获得链接
04     $tmp = preg_split("/{*}/",$dedetag,-1,PREG_SPLIT_DELIM_CAPTURE);
05     return substr($tmp[1],0,-11);
06      
07     }
08 }
09  
10 页面调用:
11 {dede:arclist orderby='pubdate' orderway="desc" typeid='102,103,104,105' row='6' channelid="3" addfields='softlinks'}
12 <li><a href="[field:softlinks function='getlink(@me)'/]" class="down">Download</a><a href="[field:softlinks/]">[field:title/]</a></li>
13 {/dede:arclist}