POST TIME:2020-03-31 11:52
在dedecms里有個下載地址鏈接,理論上就是給個軟件下載鏈接就可以,但是太單調了,所以為了方便用戶的下載,今天給大家分享dedecms5.7實現迅雷下載鏈接。
1、首先獲取聯盟的代碼
<!-- PHP專用鏈代碼二 --><div src="http://pstatic.xunlei.com/js/webThunderDetect.js" _ue_org_tagname="script" _ue_div_script="1" _ue_script_data="" _ue_custom_node_="1"></div><!--?php--><!--?php thunderurl="ThunderEncode("http://資源實際下載地址");"--><!--?php--><!--?php-->
2、軟件頻道設置 設置連接顯示方式為要求進入下載地址列表頁
3、修改 templets/plus/download_links_templet.htm
head區域加入
然后下載地址的代碼哪里
改為
<table align="center" border="0" cellspacing="2" width="100%"><tbody><tr><td height="30" bgcolor="#F2F7E6">下載地址列表:</td></tr><tr><td height="78"><!--?php--><a href="<?php echo $thunderUrl; ?>" data_ue_src="<?php echo $thunderUrl; ?>">迅雷專用下載地址</a><!--?php--></td></tr></tbody></table>
4、再修改 plus/download.php
require_once(dirname(__FILE__)."/../include/common.inc.php"); require_once(DEDEINC."/channelunit.class.php"); require(DEDEINC."/encode.inc");
引入inc文件
把解壓到的inc上傳到 include目錄
最后找到
$ctag = '';
$downlinks = ch_softlinks($row[$vname], $ctag, $cu, '', TRUE);
require_once(DEDETEMPLATE.'/plus/download_links_templet.htm');
exit();
改為 即加上
$ctag = ''; $downlinks = ch_softlinks($row[$vname], $ctag, $cu, '', TRUE); $turelinks = trim($ctag->GetInnerText()); if(strpos("$turelinks","http") > -1 ) { $turelink = $turelinks; } else { $phppath = $GLOBALS['cfg_basehost']; $turelink = $phppath.$turelinks; } $thunderUrl = ThunderEncode("$turelink"); echo "<div _ue_org_tagname="script" _ue_div_script="1" _ue_script_data="OnDownloadClick('%22.%24thunderUrl.%22'%2C''%2Clocation.href%2C'132243'%2C2%2C''%2C4)" _ue_custom_node_="1"></div>"; require_once(DEDETEMPLATE.'/plus/download_links_templet.htm'); exit();
一切完畢后,在添加軟件的時候就可以看到迅雷的填寫框,前臺就可以看到迅雷的下載地址。