坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

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

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。+ s/ a; w( l9 R( \% B6 Q. O
这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。1 v( a' ~- K3 U8 U9 u8 h& e

6 \, q) D, F, m5 n3 s# Z修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):
" y$ Q7 m" |' c& M4 W! b5 \打开:/upload/source/language/lang_message.php1 w% j) ]  {7 S% _+ R
找到
3 U. [4 n; k) D! Q
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:  k. L$ O( n2 C5 Z
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码
) i8 Q2 [( i6 |) O; Q) k- M/ y1 \
打开:/upload/source/module/forum/forum_misc.php' |1 ~  D# m' V; D' P
找到
  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>
复制代码
改为:$ B% A, k! y; \2 x" U$ b5 a7 H! w% W8 q) Z
  1. if(defined('IN_MOBILE')) {
    ; ]0 L% X7 d+ G
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    4 E$ V+ ~% K# q" h" T3 R; D2 p3 H
  3.                 }else{
    / ?" q1 o. j+ M1 a0 t0 a4 T
  4.                         if(count($aids) > 1) {! M7 \: q% {! |. Q$ ~5 X! K; P0 a9 J
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    3 U" {. `7 N0 m  D# V
  6.                        } else {
    + s0 F! Q; N2 a. W
  7.                                $_G['forum_attach_filename'] = $attach['filename'];
    5 V7 v) H9 S, {# b  c
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
    5 S* c% {4 D) a- J% t+ v  R! ~: p
  9.                         }" S( Y5 C3 e5 M5 V% z8 W  K
  10.                 }; C5 ]& {0 ]- a  A( ^( b! R
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm$ ~/ g. h8 l  _$ v; O3 `0 c
: Y$ a" G, m6 f! P找到

8 d) A- s2 q" ]" e0 D- y
6 R, |9 J5 g7 w; X( b; [: m
  1. <!--{if !$attach['price'] || $attach['payed']}-->
    + p/ S. C/ H9 r3 g- x4 m# q
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >
    6 c3 ^8 m+ m7 U2 R
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    / Q' T5 @6 K8 E
  4.                         $attach[attachicon]% p* e. I1 W3 C. a7 C; ?4 I
  5.                        <!--{/if}-->& t3 X3 r  e6 q
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->
    : B, a" h1 J0 A. N
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>/ Y2 z( R. [8 f9 H- F  E
  8.                        <!--{else}-->
    - _2 z9 a" i7 B: g$ C4 c3 D
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
      h' Z  H/ Z2 N; P/ |" H8 v3 e
  10.                         <!--{/if}-->
    ' n8 q* B. E5 ^6 Q5 G
  11.                        <em class="xg1">($attach[attachsize])</em>0 Q- g3 L+ H( t# X" }6 u
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload}); G2 n7 n8 Y+ c9 ~& Q/ Z  t
  13.                        </em>
    # J6 j/ {0 I+ s5 u, _6 |
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
    7 L* r9 u- V: Y# L  a0 U5 |
  15.                 </div>: _, l# g$ Y# m
  16.                <!--{/if}-->
复制代码
改为:8 u2 u4 n5 L! I0 [+ k: n

9 j+ n# O- G* P( y) ]& x
  1. <div id="attach_$attach[aid]" class="box attach mbn" >/ A' o: @, w; e- D+ _* u
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    3 g0 a- ~2 p8 c/ C$ l
  3. $attach[attachicon]
    : p! n+ B3 O" a% K0 }% L
  4. <!--{/if}-->) c7 E  @  ~3 w
  5. <!--{if !$attach['price'] || $attach['payed']}-->
    3 V8 w8 G( Y0 e1 x% G! B# e
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>& B: B2 U9 K) d, f
  7. <!--{else}-->
    2 Y9 S- _5 d' y" v' X3 n4 M- [+ F
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>- f: V. H5 t6 J1 ?, c* ~+ H% ~$ w
  9. <!--{/if}-->
    . M6 k9 m0 H1 [2 Y3 r3 ?+ r
  10. <em class="xg1">($attach[attachsize])</em>) Q' }6 ?1 x( E" g
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    % d% [5 f+ z! h6 K1 e: Q* `; U! l( p
  12. </em>! L. j  y/ x% U" @9 {# k. D
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
    0 b( Q4 ^4 F( G. g* a* A1 q$ A: r
  14. </div>
复制代码
GBK格式需要转码7 h) i: J3 ^$ G8 ]
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可

3 z0 D0 A' V! Z" k* e[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA
" T$ o- @3 |% n' A提取码:8wg1 ) Q# W% T3 X2 Z+ V3 K
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw
# d( J# H! e" P提取码:w52u 6 G3 @' ]' A( j2 W1 `: M( `6 W, |
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]

& N9 @, M5 R. S! i9 c/ p
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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 | 显示全部楼层
支持一下
回复

使用道具 举报

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