|
phpcms v9在list_download.html页面中给图片加下载连接的方法
实现代码如下:
复制代码代码如下:
{pc:get sql="SELECT s.id,downfiles,title,inputtime FROM phpcms_download s,phpcms_download_data d WHERE s.id = d.id AND catid = $catid " page="$page" return="data"}
{loop $data $r}
{php $files = String2Array($r['downfiles',)}
{php $file = $files[0]['fileurl',}
{php $pc_auth_key = md5(pc_base::load_config('system','auth_key').$_SERVER['HTTP_USER_AGENT',);}
{php $a_k =urlencode(sys_auth("i=$r[id,&d=1&s=&t=".SYS_TIME."&ip=".ip()."&m=1&f=$file&modelid=".$modelid, 'ENCODE', $pc_auth_key));}
[url=?m=content&c=down&a=download&a_k={$a_k},
[/url]
{/loop}
{/pc} |
|