坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

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

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
7 E# |$ O8 w+ b0 f3 ~1 ^这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。7 ]2 t2 ~- X* Z. z7 h" v

, i( `2 m* G; J% ~0 @修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):
& [+ g6 q) s6 q" C/ x2 V" ~打开:/upload/source/language/lang_message.php# f$ d9 K: b7 |1 {
找到
9 a3 z% d. ~4 P+ n) p
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:
9 o6 A* [( ~( G2 a* d/ c
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码

/ ?, a, R. \! ?; r: V 打开:/upload/source/module/forum/forum_misc.php
% P' r7 S8 t) k  J找到
  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 C/ ]  h1 L( |, O% u- `# i
  1. if(defined('IN_MOBILE')) {
    9 J3 N& A6 T" G2 v4 w3 c
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    8 Z, O9 L. ]( @' G5 z
  3.                 }else{: `3 y" Q. D4 b  [0 L
  4.                         if(count($aids) > 1) {
    . J5 ^' [/ ^# e) E% `
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);2 f0 `9 j$ L/ t0 X1 Q- R
  6.                        } else {4 {2 w, b1 `5 A* k; Q
  7.                                $_G['forum_attach_filename'] = $attach['filename'];# F% q! v& a) P: |
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
    & C" ~$ o/ k- `1 c1 O: L: D6 M$ U
  9.                         }% |: ?; m! z, z: P6 r
  10.                 }
    * c; h( |* x. h
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm
5 S1 s' _  h4 V8 m: Y$ a" G, m6 f! P找到
! S2 T8 M) W, [. E4 m, d( T

6 I$ h1 t4 H+ v; D* q
  1. <!--{if !$attach['price'] || $attach['payed']}-->
    ( v+ k9 |- m- `$ E  X
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >2 @" A" E( M9 h! f% P6 B0 m
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->/ F- H# f: e3 ?% F1 O) n  R
  4.                         $attach[attachicon]3 a! E5 k1 x( s9 K6 y, m* ?
  5.                        <!--{/if}-->
    . T% u: U* |" m. y/ R! r# B0 S
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->% N. h8 I+ m0 a3 ?! b& `  U
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>: @! @3 ]# v7 s8 k$ J9 E
  8.                        <!--{else}-->
    1 {1 G$ s6 S& t8 N  `3 p8 [4 X
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>8 f& U7 ?5 @( ^6 t2 o5 ^$ T
  10.                         <!--{/if}-->. Q8 f3 B9 d& F* Q& j
  11.                        <em class="xg1">($attach[attachsize])</em>6 m+ D' `: K1 e$ ~
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload}): z, V* G' |! h, o, s
  13.                        </em>
    * L, R) ]1 l6 _5 _
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->. ~1 x* {, H( p3 u' w
  15.                 </div>3 l9 P; F: @. l
  16.                <!--{/if}-->
复制代码
改为:
9 I& q# }$ V6 p; w4 B' n( h
* \7 k' m; x, A7 \# Z/ A$ }. f
  1. <div id="attach_$attach[aid]" class="box attach mbn" >6 w. e& m" o" P
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    8 J; r2 Y( u0 |( S
  3. $attach[attachicon]
    - O: B5 E0 _7 u3 u
  4. <!--{/if}-->( t& f8 F. t9 a# E% b
  5. <!--{if !$attach['price'] || $attach['payed']}-->! l! b8 @% O# ^2 v
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>' a0 E$ C5 @$ M0 m
  7. <!--{else}-->% @# D/ q4 \" f% f' y
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    8 ]3 F: i7 W; m; k& E( }6 e% z
  9. <!--{/if}-->
    5 `; m2 ^1 ^; q
  10. <em class="xg1">($attach[attachsize])</em>
      F& L3 R: C- R9 [
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})8 V2 y, E7 [* s  A" y& D
  12. </em>+ O2 B, l0 T0 n) W
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->" L' {+ k) y9 Y) I8 Q. G3 V
  14. </div>
复制代码
GBK格式需要转码% S0 n+ y( ^  B9 X5 B8 H' m' R
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可

6 b# \, h0 b  q2 c: R( C[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA % @. s) S( {& V- l* \
提取码:8wg1 ( x8 h) E* ], w3 ?- [7 e8 F5 l: O
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw & Y  o& T5 o" F# R
提取码:w52u
+ P9 w; A* B7 A复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]

% N; V; B, N  n# h8 ~  Y4 s
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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 | 显示全部楼层
支持一下
回复

使用道具 举报

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