坏蛋网络

用户名  找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

帖子

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

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。  S0 }! s6 O3 }$ R7 d6 D
这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。
3 ?; C/ r: H4 v5 Z+ r/ }' S3 C, f3 W3 z2 k
修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):
8 j) l! {/ Q; y" l1 q$ ]1 b) y打开:/upload/source/language/lang_message.php
0 w  {4 C" }. O, w" ^+ i* {找到
0 `' m1 i) ^; w7 F
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:
" f7 z# J) }3 h* I8 J
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码

3 y* N6 e' s6 d  x+ r 打开:/upload/source/module/forum/forum_misc.php" e" d5 k# b1 L0 n- A6 R
找到
  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>
复制代码
改为:
. P. S/ Y) w8 ~7 x* c
  1. if(defined('IN_MOBILE')) {
    : g) D  c# t4 v2 R
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);# N( q* U0 i) n: q8 d/ K1 ], a
  3.                 }else{
    8 J' W( |- P# @" g9 R6 m0 z
  4.                         if(count($aids) > 1) {0 ]: C; N7 e% ]" S
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);$ `& Y+ A; m) V6 c( N
  6.                        } else {
    / h/ Z7 B4 t+ A/ F& O5 Q
  7.                                $_G['forum_attach_filename'] = $attach['filename'];) O4 l! V& B/ Q; o, E: b
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
      t, S1 y  [7 |: O  N2 |* L
  9.                         }
    ' K" B0 O1 J9 y$ b  f
  10.                 }
    ! n$ V1 M7 [3 a* s/ m! v& J2 O
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm: c- v; _3 s3 r* t. L$ P
: Y$ a" G, m6 f! P找到
+ W  \* {' k5 ~, P9 {7 Q: r
$ `9 k) q: b0 M$ J1 S1 Z
  1. <!--{if !$attach['price'] || $attach['payed']}-->
    5 h0 [/ m1 R3 V: `+ @
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >
    9 C; P2 B9 X  R; ]
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->* \7 [1 Q# b7 f) k' s9 x( {
  4.                         $attach[attachicon]/ ]3 W/ S0 l! e" c# P0 o
  5.                        <!--{/if}-->
    5 H' N+ g3 x  b* K- T. D  C
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->. i7 l; N9 C/ p3 K
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>7 {3 E- k# Q) Y
  8.                        <!--{else}-->
    # K2 A% k& C0 U' Y! H& |$ }5 b2 p- F/ O
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>0 B% w8 I& b, f$ v; Z: V
  10.                         <!--{/if}-->* l% p) b; F* }
  11.                        <em class="xg1">($attach[attachsize])</em>
    0 K9 Z# O- A9 h& p4 @9 d' d
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    + Y) K! G: H3 g1 y' G2 c
  13.                        </em>
    - }  \! L0 W2 @6 u/ g
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
    : T7 y& E  M7 g; I7 n2 Z
  15.                 </div>
    # I9 ]$ D6 ]4 i$ x9 K$ Z
  16.                <!--{/if}-->
复制代码
改为:
3 o1 C' f2 J4 [
( s( F( z5 ^+ H, d5 i8 d
  1. <div id="attach_$attach[aid]" class="box attach mbn" >2 f  o( W. d0 H/ e
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    , O, Q9 N! Q" _; w- m
  3. $attach[attachicon]
    $ Z( ~' A4 o5 G) `' \8 S: k
  4. <!--{/if}-->0 Q5 \6 J8 @" P3 Q
  5. <!--{if !$attach['price'] || $attach['payed']}-->
    9 l+ O1 G" |0 j$ _
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    8 W# d: _7 V8 c* Y
  7. <!--{else}-->' R( v% e7 k6 Y5 r; c5 W# Q5 ^: e
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>9 `8 y$ ~7 J  I" _7 i! y' N) K
  9. <!--{/if}-->6 Z) ?3 ^+ v( b+ Z( l/ @
  10. <em class="xg1">($attach[attachsize])</em>5 b! @( \$ Q& b+ f2 ?3 ]8 p" Z
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    & H# Z) b$ l7 _3 f7 C
  12. </em>9 F* g. N( G# M  X. m
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->$ v6 `& l; ^  A0 A) s
  14. </div>
复制代码
GBK格式需要转码" \* k) z# R2 m9 R0 S' S7 [3 v% B
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可

4 U1 M0 h9 j8 k% A0 f* U6 E; X6 O[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA
+ ~" L/ C5 y- E  N7 @提取码:8wg1 5 n8 Y9 |% p: E
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw & N. L5 L7 t0 z
提取码:w52u
' e$ R5 Y2 |  D7 F复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]

1 _' d1 ~; C3 u. v3 |8 A* F8 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 | 显示全部楼层
支持一下
回复

使用道具 举报

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