坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

[DZ教程] discuz3.4 手机版收费附件不显示的bug修复

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
( j2 P, F0 J8 X$ P$ b这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。
) T. s0 g. V; f, o8 S2 I/ R
" H$ _# o/ w6 T# D! ^8 g& w" R% x修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):% ?/ r0 k# c+ W  W& V! Y2 b
打开:/upload/source/language/lang_message.php( R6 o- V1 D$ a5 R
找到
1 c, _# ~; c# `
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:
- v3 T% N, t0 Y7 C6 k
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码

% \3 d+ j0 q5 a# Y 打开:/upload/source/module/forum/forum_misc.php
2 ]% Y, i* q! f找到
  1. <ol><li>if(count($aids) > 1) {</li><li>                        showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);</li><li>                } else {</li><li>                        $_G['forum_attach_filename'] = $attach['filename'];</li><li>                        showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));</li><li>                }</li></ol>
复制代码
改为:
0 ~/ i1 I# V2 n3 A4 q' F
  1. if(defined('IN_MOBILE')) {
    8 C5 P6 d' u6 N
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    9 ?: B; {  }, G' C! i- M' N
  3.                 }else{
    0 h  `* J1 m4 _% t
  4.                         if(count($aids) > 1) {6 ~9 k1 b5 _+ N5 a
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);% G# y' ?1 N$ `0 |! T8 p1 q' K
  6.                        } else {
    8 e7 Z& D8 Q5 n+ h& s
  7.                                $_G['forum_attach_filename'] = $attach['filename'];# w) ?+ c& `% T% U
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
    - n) ~9 y6 }& A9 |4 F6 b
  9.                         }. I  z* g# ~" S! ~) c
  10.                 }
    / H8 c8 f, M# ]: O$ \
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm# z. v7 [) u: x+ O9 H' I# {5 c
: Y$ a" G, m6 f! P找到
+ o0 r4 `7 p  _/ @
5 A+ U; _' E7 r( I
  1. <!--{if !$attach['price'] || $attach['payed']}-->
    ( l# P/ A: w. o+ ?) ^% a0 ]
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >5 r+ `, j" A8 W( G( e, G
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    + i# s$ g: A$ S; R+ s5 f4 Q" {
  4.                         $attach[attachicon]
    4 `' B. ]0 p2 W( r
  5.                        <!--{/if}--># w* d1 o. b1 p& r- S4 J
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->9 C6 k! l8 k8 l- r' _2 M; f0 X
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    % ]6 m0 n0 y4 `8 }( o7 t
  8.                        <!--{else}-->* ~0 E# x, K% H, B8 W/ V  J& y
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    * p/ G" h- e& b+ y
  10.                         <!--{/if}-->  M: K+ i5 V; u4 y" w( P4 ~
  11.                        <em class="xg1">($attach[attachsize])</em>) L& @3 [% s/ {4 R6 [0 J7 f
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})3 f& T# P. y7 k' d: C( l" m+ c8 A6 Z
  13.                        </em>6 L  J! f. [, i8 y5 M
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
    5 `7 l# u# A8 j
  15.                 </div>
    ) ~. J- p2 [! G+ A( i
  16.                <!--{/if}-->
复制代码
改为:  q+ y) {4 p$ N& g- L. F* B6 l
4 e; w2 F9 W0 L) k9 [
  1. <div id="attach_$attach[aid]" class="box attach mbn" >
    1 k# `  X) f& G! M
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->/ `' s2 P2 X/ |0 P9 [
  3. $attach[attachicon]# s/ l! {6 J3 L8 f
  4. <!--{/if}-->
    & u# }. I. V; x3 U: r4 B; ~# _9 {
  5. <!--{if !$attach['price'] || $attach['payed']}-->
    9 i  ^0 a  x' B
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>6 f3 j4 l" S" y" c: D  I, A
  7. <!--{else}-->" S0 W9 b# V0 M8 r8 |
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    " U1 c0 z  F# J+ {7 F
  9. <!--{/if}-->
    & n' D' C/ _# j- w, P( b
  10. <em class="xg1">($attach[attachsize])</em>$ d% x4 g6 W+ _7 w/ p3 ~4 e8 z' I
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})6 {: h4 V; l- `9 B7 E
  12. </em>* J' c5 X1 @5 d3 F$ ]6 k
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
      X6 w( G5 f+ e0 V# j3 A
  14. </div>
复制代码
GBK格式需要转码
1 }3 h0 a" y4 c0 Z3 @! F- r然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可
6 L' P0 P. m" U+ k, T9 [! X
[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA ( ~+ q( b' P1 j& u! m  v8 [8 z
提取码:8wg1
8 s& S. F' g* {. y: L0 O复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw ' D/ P; l! U. s
提取码:w52u ! P6 }) \- n& F( \; C6 b
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]

1 E, M# u& Q: Z9 Z
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
jjj111 发表于 2019-6-12 00:47:24 | 显示全部楼层
我是个凑数的。。。
回复

使用道具 举报

杨晨女神 发表于 2019-6-15 04:05:42 | 显示全部楼层
我是来刷分的,嘿嘿
回复

使用道具 举报

bogewl 发表于 2019-6-16 00:17:16 | 显示全部楼层
回复

使用道具 举报

66666 发表于 2019-6-17 03:57:44 | 显示全部楼层
谢谢楼主,共同发展
回复

使用道具 举报

 shu1332725 发表于 2019-6-18 02:03:36 | 显示全部楼层
前排支持下
回复

使用道具 举报

foryun 发表于 2019-6-18 03:43:22 | 显示全部楼层
有竞争才有进步嘛
回复

使用道具 举报

123男神 发表于 2019-6-21 00:59:39 | 显示全部楼层
沙发!沙发!
回复

使用道具 举报

hgfhgf 发表于 2019-6-21 18:03:46 | 显示全部楼层
找到好贴不容易,我顶你了,谢了
回复

使用道具 举报

全村的希望 发表于 2019-6-22 23:24:35 | 显示全部楼层
支持一下
回复

使用道具 举报

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