当使用软件模型而且只有一个下载地址时,我们都喜欢用本地地址,在列表页时直接输出这个地址,方便访客下载。
打开 /include/extend.func.php 在文件最下面添加个方法
05 | * @param string $aid 文章 id |
08 | if (!function_exists( 'GetDownLink' )) |
10 | function GetDownLink($aid) |
13 | $row= $dsql->GetOne( "SELECT softlinks FROM `#@_addonsoft` WHERE aid = {$aid}" ); |
18 | $dtp = new DedeTagParse(); |
19 | $dtp->LoadSource($row[ 'softlinks' ]); |
20 | foreach($dtp->CTags as $ctag) |
22 | if ($ctag->GetName()== 'link' ) |
24 | $link = trim($ctag->GetInnerText()); |
|
前台模板中调用标签写法
首页/列表页
[field:id function=GetDownLink(@me)/]
内容页
{dede:field.id function=GetDownLink(@me)/}
发表评论
评论列表(0条)