查看: 3947|回复: 796

Discuz论坛手机触屏版显示付费附件,并支持手机版支付购买附件

[复制链接]

10

主题

100

帖子

200

积分

大富豪

Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15

积分
200
发表于 2019-5-24 00:00:00 | 显示全部楼层 |阅读模式

手机端默认不显示收费附件,除非你在PC端购买过这个附件,之所以这样,是因为手机端不支持附件购买,所以官方干脆就不显示付费附件。

修改教程如下,增加手机触屏版显示付费附件,并支持手机端支付购买:

打开/upload/source/language/lang_message.php,找到:

  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码

底下加:

  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码

打开/upload/source/module/forum/forum_misc.php,找到:

  1. if(count($aids) > 1) {
  2.                         showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
  3.                 } else {
  4.                         $_G['forum_attach_filename'] = $attach['filename'];
  5.                         showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
  6.                 }
复制代码

改为:

  1. if(defined('IN_MOBILE')) {
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
  3.                 } else {
  4.                         if(count($aids) > 1) {
  5.                                 showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
  6.                         } else {
  7.                                 $_G['forum_attach_filename'] = $attach['filename'];
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
  9.                         }
  10.                 }
复制代码

打开/upload/template/default/touch/forum/discuzcode.htm,找到:

  1. <!--{if !$attach['price'] || $attach['payed']}-->
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >
  3.                         <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
  4.                         $attach[attachicon]
  5.                         <!--{/if}-->
  6.                         <!--{if !$attach['price'] || $attach['payed']}-->
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
  8.                         <!--{else}-->
  9.                                 <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
  10.                         <!--{/if}-->
  11.                         <em class="xg1">($attach[attachsize])</em>
  12.                         <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
  13.                         </em>
  14.                         <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
  15.                 </div>
  16.                 <!--{/if}-->
复制代码

改为:

  1. <div id="attach_$attach[aid]" class="box attach mbn" >
  2.                         <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
  3.                         $attach[attachicon]
  4.                         <!--{/if}-->
  5.                         <!--{if !$attach['price'] || $attach['payed']}-->
  6.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
  7.                         <!--{else}-->
  8.                                 <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
  9.                         <!--{/if}-->
  10.                         <em class="xg1">($attach[attachsize])</em>
  11.                         <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
  12.                         </em>
  13.                         <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
  14.                 </div>
复制代码

下载attachpay.htm

请点击此处下载

请先注册会员后在进行下载

已注册会员,请先登录后下载

attachpay.rar 
下载次数:2  文件大小:1.07 KB  售价:100金钱 [记录]
下载权限: 不限    [赞助VIP会员]   [充值金钱]     [连接失效举报]     [解压密码]  

上传到/upload/template/default/touch/forum/attachpay.htm(Discuz默认没有这个文件),量产吧论坛亲测完美解决问题。


回复

使用道具 举报

0

主题

100

帖子

0

积分

小有资产

Rank: 10Rank: 10Rank: 10

积分
0
发表于 2019-5-25 00:25:15 | 显示全部楼层
沙发~支持楼主,支持【www.guo.cc】果子社区,希望【www.guo.cc】果子社区越办越好.
回复

使用道具 举报

0

主题

100

帖子

0

积分

小有资产

Rank: 10Rank: 10Rank: 10

积分
0
发表于 2019-5-26 08:26:06 | 显示全部楼层
哈哈!楼主大人你太好笑了.【www.guo.cc】果子社区最搞笑的人莫过于你啊!
回复

使用道具 举报

0

主题

100

帖子

0

积分

小有资产

Rank: 10Rank: 10Rank: 10

积分
0
发表于 2019-5-26 19:35:01 | 显示全部楼层
楼主,【www.guo.cc】果子社区就你长得这么帅这么漂亮你家人知道吗?~
回复

使用道具 举报

0

主题

100

帖子

0

积分

小有资产

Rank: 10Rank: 10Rank: 10

积分
0
发表于 2019-5-26 20:48:12 | 显示全部楼层
沙发~支持楼主,支持【www.guo.cc】果子社区,希望【www.guo.cc】果子社区越办越好.
回复

使用道具 举报

0

主题

100

帖子

0

积分

小有资产

Rank: 10Rank: 10Rank: 10

积分
0
发表于 2019-5-27 01:31:46 | 显示全部楼层
我是路过【www.guo.cc】果子社区,拿分走人呵呵,楼下继续!
回复

使用道具 举报

0

主题

100

帖子

0

积分

小有资产

Rank: 10Rank: 10Rank: 10

积分
0
发表于 2019-5-27 07:11:26 | 显示全部楼层
大神,我被你雷到了~你是【www.guo.cc】果子社区的雷神吧.....
回复

使用道具 举报

0

主题

2048

帖子

0

积分

小有资产

Rank: 10Rank: 10Rank: 10

积分
0
发表于 2019-5-27 16:03:49 | 显示全部楼层
我是路过【www.guo.cc】果子社区,拿分走人呵呵,楼下继续!
回复

使用道具 举报

0

主题

100

帖子

0

积分

小有资产

Rank: 10Rank: 10Rank: 10

积分
0
发表于 2019-5-27 16:15:03 | 显示全部楼层
大神,我被你雷到了~你是【www.guo.cc】果子社区的雷神吧.....
回复

使用道具 举报

0

主题

100

帖子

0

积分

小有资产

Rank: 10Rank: 10Rank: 10

积分
0
发表于 2019-5-27 16:15:29 | 显示全部楼层
大神,我被你雷到了~你是【www.guo.cc】果子社区的雷神吧.....
回复

使用道具 举报

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

本版积分规则

关闭

站长推荐上一条 /1 下一条

Archiver|手机版|小黑屋|梦网资源 ( 冀ICP备20003924号-1 )

GMT+8, 2024-3-28 22:42 , Processed in 0.926662 second(s), 55 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表
联系客服1
联系客服2