坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

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

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。5 X4 P; S- w5 {2 m
这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。
3 G. }3 Z+ `2 F* }9 Z) M$ ~, \% G
' {; Q# v" `# h3 |$ R/ W修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):: A, U7 d; n  T/ |
打开:/upload/source/language/lang_message.php4 q3 s/ k! }0 @
找到& x1 w% \2 ^. i) S  x
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:
! E: ]! {3 h: n( k
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码
4 H* q5 }& c1 d5 W
打开:/upload/source/module/forum/forum_misc.php
, \) B2 d9 o9 |+ Z  q1 n找到
  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>
复制代码
改为:! z* c7 E6 Z, X. B
  1. if(defined('IN_MOBILE')) {
    $ \/ b, Y1 F- {- M
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);+ f9 K! ^3 K- e
  3.                 }else{! M. Y3 M0 ]. v, r  a
  4.                         if(count($aids) > 1) {
    5 y' S& b- o) x$ f8 K
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    $ L7 [$ r! H4 ]
  6.                        } else {
    % [5 i# Z( b% t4 T5 I
  7.                                $_G['forum_attach_filename'] = $attach['filename'];
    / Y! F; Q! ?+ L. l3 ?6 g
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
    1 ?9 f: Z" s1 w, r
  9.                         }
    ( t2 c9 n: X  X/ G. K- m1 ]0 ~
  10.                 }& {/ H9 q6 b$ `. n, ^" E
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm* W9 d% o1 \# P& E  c% A& ~6 Q7 c
: Y$ a" G, m6 f! P找到

5 `' T. O: w0 N, x& I4 J
; o$ d# R( B  F
  1. <!--{if !$attach['price'] || $attach['payed']}-->& Q- l1 Q% t( c
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >8 f9 Y3 [" w7 N+ O; \* t
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->; y" F' w$ G* F& G* R; A
  4.                         $attach[attachicon]( A7 F3 d% [* H  I2 `  N( N
  5.                        <!--{/if}-->. G' w- N' a# b- G/ U& s
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->
    - `$ v/ D6 X* t) h
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    * l$ K7 J+ ?) x% |
  8.                        <!--{else}-->
    - F( o4 j; r) Q/ _) s% K: [% Y
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    6 p) |% r* C0 I& c  B
  10.                         <!--{/if}--># q3 ~1 K4 Y8 P0 q* C* Q* J7 p% Z
  11.                        <em class="xg1">($attach[attachsize])</em>$ f  ?; _$ u( U
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    # u. d+ H6 f( m4 T! s
  13.                        </em>7 ]/ }1 X: ^& a, t3 z5 F
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
    ' ~8 A; q4 b3 Y, q" v8 b# R
  15.                 </div>
    8 D5 G. T$ _  p( ]* [: |' {
  16.                <!--{/if}-->
复制代码
改为:
$ r) }4 T8 d8 T) J0 m; a  B1 Y
5 s5 {8 ^- z  ~2 e% Q# H; Z% ?" p
  1. <div id="attach_$attach[aid]" class="box attach mbn" >6 D$ Y! v9 s) f# g& k1 q& H
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->! ?  J1 E4 P3 S+ y; p6 m& U
  3. $attach[attachicon]$ r  i$ D8 _  C: C3 ?
  4. <!--{/if}-->* c7 N. l6 a* s5 P% O6 Q
  5. <!--{if !$attach['price'] || $attach['payed']}-->6 p4 Q: |/ R. _+ A8 F- ?5 ]
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>8 W  P) }" X: A0 x( W
  7. <!--{else}-->$ p# O( j0 j5 S3 _
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>9 W: m7 Q8 V5 a- j; t$ T
  9. <!--{/if}-->
    * Q! G/ d/ z. z3 ~% `
  10. <em class="xg1">($attach[attachsize])</em>
    3 w  B3 z! A' t& }4 R
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    , ^+ |( ?' ^% w% H) ~# C
  12. </em>
    * {. d9 `  U1 D- J4 x8 K1 Y4 U* F
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}--># _. I# x  a. G+ C$ h  O
  14. </div>
复制代码
GBK格式需要转码
/ ^$ J2 T- E# w2 b! {然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可
2 b* S" i5 |1 G
[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA . e' m: ]; q' h& f; e; A
提取码:8wg1
  B3 z- }4 d5 D9 C3 w% W* z/ q复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw # ^6 g  U2 X# y2 W) G
提取码:w52u 6 L& S% R/ e# n7 H* O  @& |$ m
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
) ~# l7 H4 K( a# z$ |/ N7 j
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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 | 显示全部楼层
支持一下
回复

使用道具 举报

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