找回密码
 立即注册

QQ登录

只需一步,快速开始

Discuz!x3.3 手机版支持付费附件购买

由于discuz!x3.4以下的版本不支持 手机版购买附件功能,特此修改兼容下

1.打开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']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/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']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
  14.                 </div>
  15.                
复制代码


2.打开source/language/lang_message.php

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

下面添加:
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码


3.打开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.                 }
复制代码


上传一个文件 到 template/default/touch/forum/attachpay.htm
附件下载通道1: attachpay.zip (1.11 KB, 下载次数: 0)
附件下载通道2:云盘下载 提取码:KAii

本教程由无限星辰工作室CRX349独家整理和提供,转载请注明地址,谢谢。本文地址:https://www.xmspace.net/thread-946-1-1.html
无限星辰工作室  好集导航 Discuz全集下载  星辰站长网  集热爱361  一品文学  手机小游戏合集   海外空间网 星辰api  星辰支付二维码管理平台 阿里云服务器 腾讯云服务器
服务Discuz!建站|DiscuzQ配置|二开|小程序|APP|搬家|挂马清理|防护|Win/Linux环境搭建|优化|运维|
服务理念:专业 诚信 友好QQ842062626 服务项目 Q群315524225

发表于 2022-10-20 16:21:58 | 显示全部楼层 |阅读模式

回复 | 使用道具 举报

该帖共收到 0 条回复!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

美图秀

    • fastadmin 后台界面使用字段数组类型
    • Discuz!x3.5 修改标题高亮颜色
    • Discuz!x3.5 应用中心 下载应用一直下载中
    • 帖子定时显示
    • 论坛辅助审核
拖动客服框
Online Service
点击这里给我发消息
点击这里联系我们
微信扫一扫
在线客服
快速回复 返回顶部 返回列表