Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

DZ 7.0 点击附件在新页面打开下载 含下载页面广告及下载页面迅雷高速下载代码

[复制链接]
情あ缘 发表于 2009-1-1 03:52:23 | 显示全部楼层 |阅读模式
插件发布
插件名称: 附件新页面下载
插件来源:
适用版本: Discuz! 7.0
语言编码: GBK简体 
最后更新时间:
插件作者: Amanda
插件简介: 点击附件在新页面打开显示下载连接
本帖最后由 情あ缘 于 2010-9-26 12:30 编辑

该贴内容已失效!!!
魔卡手机网塞班塞班论坛塞班智能手机论坛


点此查看7.0演示

6.1版本下载:
https://discuz.dismall.com/viewthread.php?tid=1031924


警告:
有些朋友和我说安装这个之后论坛就不能下载附件了或者下载完都是attachment.php
这个我要说明下,这个代码在6.1是无错的,但是由于7.0程序更改太多导致迅雷代码失效。
需要在后台开启可以查看和下载附件才能恢复正常,和迅雷的技术也聊过没什么好的解决办法,只能开启游客可以查看和下载附件才有效!

需要修改的文件 attachment.php
需要添加的文件 download.htm


如果不愿意修改文件附件中也含有修改好的attachment.php  如果你没有对这个文件进行修改直接上传覆盖这个文件就好,可以掠过这步。

首先打开attachment.php
查找:

  1. if(empty($nothumb) && $attach['isimage'] && $attach['thumb']) {
复制代码
修改为:
  1. if(empty($nothumb) && $attach['isimage'] && $attach['thumb']&& !$down) {
复制代码
然后查找:
  1. if(empty($noupdate)) {
复制代码
修改为:
  1. if(empty($noupdate) && $down) {
复制代码
接着查找:
  1. dheader('location:'.$ftp['attachurl'].'/'.$attach['attachment']);
复制代码
在他下面添加:
  1.               include template('download');
复制代码
最后找:
  1.         dheader('Content-Disposition: attachment; filename='.$attach['filename']);
复制代码
修改为:
  1. if($down){
  2.         dheader('Content-Disposition: attachment; filename='.$attach['filename']);
  3. } else {
  4.         $dlink = $ftp['attachurl'].'/'.$attach['attachment'];
  5.         include template('download');
  6.         exit;
  7. }
复制代码
好了修改步奏已经完成下面是添加文件部分
下载附件解压缩上传其中的:download.htm这个文件到你正在使用模板的文件夹下就OK 了。


另外再说下download.htm模板里面的代码,里面含有我的广告代码,因为方便大家直接修改广告,我就没拿下来。

以前有人说过不会弄那个迅雷下载和怎么让中间的广告剧中,其实都很简单哈。我也是菜鸟不懂太多。




下面我说下迅雷那个代码
  1. <script src='http://pstatic.xunlei.com/js/webThunderDetect.js'></script>
  2. <script src='http://pstatic.xunlei.com/js/base64.js'></script>
  3. <script language="javascript">
  4. var thunderPid='40863';
  5. function outPutThunder(){
  6. var thunderCh=unescape("%u8FC5%u96F7%u4E13%u7528%u9AD8%u901F%u4E0B%u8F7D");
  7. var arg=arguments;
  8. var til="";
  9. if(arg[0]=="undefined") return;
  10. if(arg[1]!="undefined") til=arg[1];
  11. var th_Pid="";
  12. if(arg[3])
  13. th_Pid=arg[3];
  14. else
  15. if(!isNaN(thunderPid) && thunderPid!="")
  16. th_Pid=thunderPid;
  17. else
  18. return;
  19. var th_href=arg[0];
  20. if(th_href.indexOf("://")<=0) {
  21. if(th_href.substr(0,1)!="/") {
  22. var a=document.location.href;
  23. th_href=a.substr(0,a.lastIndexOf("/")+1)+th_href; }
  24. else {
  25. th_href="http://"+document.location.host+th_href;}
  26. }

  27. var tagEx=arguments[2]?arguments[2]:'';

  28. var thunderURL=ThunderEncode(th_href);
  29. var thunderRes="";
  30. var thunderName='<input type="button" value="迅雷高速下载">';

  31. document.write("<a href="#" thunderHref=""+thunderURL+"" thunderPid=""+th_Pid+"" thunderType="08" thunderResTitle=""+thunderRes+"" onClick="return OnDownloadClick_Simple(this,2);" oncontextmenu="ThunderNetwork_SetHref(this);" title=""+thunderCh+"" "+tagEx+">"+thunderName+"<\/a>");
  32. }
  33. </script>
  34. <TABLE cellSpacing=0 cellPadding=4 align=center border=0>
  35. <TBODY>
  36. <TR>
  37. <TD class=altbg2>
  38. <DIV Class=ad_textlink2><CENTER>

  39. <script language="javascript">
  40. outPutThunder('attachment.php?aid=$aid&down=1','高速下载');
  41. </script>
复制代码
把上面迅雷的代码修改成你的。

中间广告的代码

  1. <script type="text/javascript"><!--
  2. google_ad_client = "pub-**************";
  3. /* 728x90, 创建于 08-7-17 */
  4. google_ad_slot = "1115210134";
  5. google_ad_width = 728;
  6. google_ad_height = 90;
  7. //-->
  8. </script>
  9. <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
复制代码
把上面的广告代码修改成你的。


另外我说下哈,上面广告代码是我自己的大家自己修改就好了,可不要把我的广告代码到处贴,GG好不容易申请下来的我还真怕被封掉ID,多谢大家!
回复

使用道具 举报

chengshicheng 发表于 2009-1-1 05:08:59 | 显示全部楼层
((em:05))沙发被我抢了
回复

使用道具 举报

楼主是我 发表于 2009-1-1 06:01:59 | 显示全部楼层
顶一个,非常支持
回复

使用道具 举报

神魂颠倒 发表于 2009-1-1 06:30:34 | 显示全部楼层
地板也坐了
回复

使用道具 举报

wchm001 发表于 2009-1-1 15:38:34 | 显示全部楼层
相当支持,不过还是没完全搞懂迅雷下载的添加,我再看看。
回复

使用道具 举报

汉川水缘 发表于 2009-1-1 15:40:51 | 显示全部楼层
支持!试试!
回复

使用道具 举报

wchm001 发表于 2009-1-1 16:16:39 | 显示全部楼层
还是没搞懂怎么弄迅雷下载的代码,楼主能否再详细介绍下迅雷那段代码应该怎么修改。
回复

使用道具 举报

ssqgwyc 发表于 2009-1-1 16:24:27 | 显示全部楼层
收藏了!!
回复

使用道具 举报

 楼主| 情あ缘 发表于 2009-1-1 18:37:18 | 显示全部楼层
7# wchm001


你也可以不修改直接用就当支持我了,呵呵!
回复

使用道具 举报

↖superman↗ 发表于 2009-1-7 21:02:54 | 显示全部楼层
指导一下,我怎么用你的方法下载下来的始attachment.php呢???
哪里出错了??
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-17 08:46 , Processed in 0.142115 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表