坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

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

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
- W8 U- ?  m) T5 P* b2 E这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。3 j; L2 I! r) x

( L, X7 C, R" |) b( g# v* h! l修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):
1 G1 J7 j. c$ R% A1 {+ S" l; D5 _. o打开:/upload/source/language/lang_message.php
5 R# e4 j: d$ R9 Y找到  }9 C2 e- N1 \) g
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:6 e; R% L0 X* Z5 i0 S1 `/ B
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码
- P6 I' v( t$ U
打开:/upload/source/module/forum/forum_misc.php
2 l2 d- e8 c8 |* K找到
  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>
复制代码
改为:
/ `. ^4 c' M4 ]/ f, n
  1. if(defined('IN_MOBILE')) {5 E7 W6 i; z1 H
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    * x- l; K2 `" e& ^6 }
  3.                 }else{
    ( F7 A/ H. B# k, L
  4.                         if(count($aids) > 1) {, f% ]- i* |  @- v- `: _
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);. w8 v8 |0 c; m
  6.                        } else {5 d) y* @0 {& g/ G/ R' }8 _7 M  G
  7.                                $_G['forum_attach_filename'] = $attach['filename'];3 {0 i% Y0 R, `4 q6 v
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
    3 e# ^) e. w+ }
  9.                         }4 p2 ^$ v& F7 m3 j: u6 D
  10.                 }8 m+ b" Q. A! J& A
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm
4 F  @8 @6 {. `$ v( m( v: Y$ a" G, m6 f! P找到
+ b1 s# V/ v6 y1 X) F

6 f+ Z1 `# {! |
  1. <!--{if !$attach['price'] || $attach['payed']}-->( A7 ~6 v8 c" S! G
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >/ L7 Q" A1 p9 ]
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->& n3 Q" i# K' T1 _' T: g
  4.                         $attach[attachicon]
      @/ Q7 P, S2 S& T& c
  5.                        <!--{/if}-->
    ! L7 I8 H: I' x9 R  k
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->$ {  D% ?& `) I7 s. n$ b4 @) f: y
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>' u& j- P* h- q: d
  8.                        <!--{else}-->
    / _" N4 v( D5 p- ]2 A  h! E+ d
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>+ K* q; G( W! e! m& {5 u
  10.                         <!--{/if}-->! P& X5 T- D# [
  11.                        <em class="xg1">($attach[attachsize])</em>0 \/ z7 i) L9 h1 b# J
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})" n4 A1 x: O' c- {1 w6 g
  13.                        </em>5 ~: U3 `& S- x# g/ w- H
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->* B, J( |+ q( j. x! b
  15.                 </div>( C( ~+ K) f/ _' o
  16.                <!--{/if}-->
复制代码
改为:; B0 F, ?6 t' V, V( I' ^6 y

, p8 z8 a3 C$ u$ Y+ P; J% u) `
  1. <div id="attach_$attach[aid]" class="box attach mbn" >
    + c+ B1 c- _& V" Q) Y
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    * i7 K8 m' u3 p( z: [7 L
  3. $attach[attachicon]% Q: o* m( T( `- q( h4 C
  4. <!--{/if}-->
    3 v. T# P5 B' n% t" d9 G
  5. <!--{if !$attach['price'] || $attach['payed']}-->; b$ r) A  n: w4 @! x
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>" o0 _* }: X4 g" G, x5 f5 w
  7. <!--{else}-->
    7 U4 c, F! d5 u
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>. O4 `' b! D3 g' h, s5 I' m& _5 A
  9. <!--{/if}-->5 k7 ~/ @! H( }3 m/ L9 I2 X
  10. <em class="xg1">($attach[attachsize])</em>9 x/ ^- x: }6 f& @$ u
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    4 h5 v- c  U7 b
  12. </em>
    / @2 g1 u: Q  W" d& g, S. ?
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
    ' |4 m$ V% T! n; i- c5 R
  14. </div>
复制代码
GBK格式需要转码. z! w- H' x' Z1 H3 m  L
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可
+ U+ i# A2 Z, y0 i* Z
[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA 6 Z1 A" N5 _% C; Z8 V0 ?
提取码:8wg1
' H( D) H8 b! S复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw & F5 E2 j/ @0 Z" B( X$ S
提取码:w52u 2 L8 e! X0 g+ K8 p# @& V! b
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]

0 Q; C& I/ J& @  T4 }, y7 }
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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 | 显示全部楼层
支持一下
回复

使用道具 举报

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