坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

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

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
) I. b8 {1 t3 b7 w9 \# e+ d: V3 U4 _这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。
$ Z, R( K4 ?! p, S$ y
, _7 g, G. a: V% Z7 K- R) A修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):
+ Z; d5 ]! x! R  J# w, {打开:/upload/source/language/lang_message.php' g; ]: Z# n8 f9 J* L/ P+ G
找到3 \' f8 p' J9 g7 o
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:
* M/ z0 d% |  X1 X
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码
! v" t# B& @+ @0 I" A
打开:/upload/source/module/forum/forum_misc.php2 O% ~. H  N7 c$ }) a; M5 R' 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>
复制代码
改为:! s3 {3 E1 ]* W8 v8 t# c+ s9 b8 k
  1. if(defined('IN_MOBILE')) {
    ; }' f6 {# ?% Y$ K% Z& d, Q+ H
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);9 Y0 o, }3 g+ Q4 Y1 f" O
  3.                 }else{. K) L9 u  |' k0 L6 ?/ J2 G
  4.                         if(count($aids) > 1) {
    - r- J+ N# k% \# S$ v8 G3 M
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);6 T' z6 g# o" q8 J
  6.                        } else {) k: T  u2 I- y/ U- t
  7.                                $_G['forum_attach_filename'] = $attach['filename'];
    + l" u2 v! A5 {2 [. B1 l, f
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));; z2 |6 h; K. ^; k1 I/ r4 T
  9.                         }9 ^9 K& {2 N3 U: k9 ^
  10.                 }
    + B6 u6 K# ?9 b
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm3 s7 f8 f' d$ N5 y/ b
: Y$ a" G, m6 f! P找到
& X7 D/ \' f2 m/ k" a: p
' ]9 T1 R( Z3 f+ }# Z/ q  ^
  1. <!--{if !$attach['price'] || $attach['payed']}-->. b" @+ |7 F1 i7 r  f2 {
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >1 [: S2 U4 c: h, f& H
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->3 v/ v8 }+ r# J3 c0 w. Z
  4.                         $attach[attachicon]
    & _+ g4 O4 ~  m5 y0 C5 ^9 Y* q8 [
  5.                        <!--{/if}-->
    9 \' d# Q! K  @# e* C" ?
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->: L( m+ R. r6 x/ ?. ?0 V* e
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    3 F  F9 T$ I# \* a
  8.                        <!--{else}--># G8 G. C  j. g5 w% g3 ~! t
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>, d( c4 \' i* t, n6 I; A5 H7 B
  10.                         <!--{/if}-->/ `0 q2 J' Y3 r8 n# e6 R0 p! R
  11.                        <em class="xg1">($attach[attachsize])</em>
    ) `% H. t% z6 w  w
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
      S# @3 Y7 ^) t% F( w/ X
  13.                        </em>
    ( o" U/ b; O5 @" A: h% Y: Y
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
    " O* z0 a) m# a& U" [1 Z; w
  15.                 </div>
    # D: \/ Y" I+ K7 Z) q
  16.                <!--{/if}-->
复制代码
改为:3 `0 Y2 y+ G! m3 o5 |3 x

; U/ _6 T) [- P* L% U) f; c5 k
  1. <div id="attach_$attach[aid]" class="box attach mbn" >
    # b. ]2 s) b# p* N+ X; T! U
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
      }4 ?$ f: W8 }, o0 j
  3. $attach[attachicon]: g* D% b6 S- V) u, z6 }2 y( o) ~
  4. <!--{/if}-->
      @& |% q3 z7 L
  5. <!--{if !$attach['price'] || $attach['payed']}-->
    . C% ~3 P: `- K" ~9 u' ]
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    3 j: p/ s/ F/ F4 q1 f, f
  7. <!--{else}-->
    / M5 F+ h5 ]$ B& }$ t
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>9 m& D/ \0 K8 O. }
  9. <!--{/if}-->
    # }! X3 W) }! a" g! P) z; Y& y# ^
  10. <em class="xg1">($attach[attachsize])</em>& ]7 u$ j0 G5 v* ^; M
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    % j2 D  T$ K! o$ [
  12. </em>
    ; Q# V2 [) E" ~" X
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
    9 c) ^7 e0 G$ o8 N8 \1 s! a( L9 v
  14. </div>
复制代码
GBK格式需要转码
$ E+ E6 T& O' y9 F; z0 W- c然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可

& D3 K6 g0 g7 n& {& [[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA
# z: K" C' l6 o" K提取码:8wg1 * Z7 D  K' ]% z$ M
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw 8 j# x6 Q/ m3 ~* r( Q1 _1 j7 N" l9 R
提取码:w52u
. `6 Z0 P5 a- i$ U) D- e; G$ @复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
) a  b  q! A( }3 b8 |/ F
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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 | 显示全部楼层
支持一下
回复

使用道具 举报

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