坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

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

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

; x0 |, O2 a0 {4 c" `+ \/ c1 n修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):% y7 U# ?. w8 f6 p3 B/ |) W
打开:/upload/source/language/lang_message.php
+ c; f+ M6 B3 ~5 D1 [找到
1 b! {+ _. o0 v  }# |9 ?% \! w
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:
. S  T0 _8 V- w9 s+ ~
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码

" {' }) ]4 A4 ]' Q4 A- o* ^( i+ W4 n 打开:/upload/source/module/forum/forum_misc.php, l% T( w1 J% I/ S* 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>
复制代码
改为:' ?4 |6 w9 y8 q% ?' ?+ f  t
  1. if(defined('IN_MOBILE')) {
      X+ d% _+ |3 I  @0 l, h
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);7 G* k4 P! Z; }$ S* E4 Z
  3.                 }else{' [2 @. Z' Z2 ?$ P$ V) K* A0 \
  4.                         if(count($aids) > 1) {
    % u( l; J6 ]# Y5 g/ M
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);! a. x, b  B( F7 m0 Z! |
  6.                        } else {: c0 H* b+ u7 W/ Y4 G& B5 e1 c
  7.                                $_G['forum_attach_filename'] = $attach['filename'];
    + y. z( ]. }% m; o" g" d) N7 T+ s9 {! Z
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));. ^4 a8 q+ D9 |3 O
  9.                         }- Y+ A3 J, Q& G7 m
  10.                 }1 Y  p) l$ I  q; e2 m9 v' |
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm
, d5 L$ _' ?# h% c2 G& z: Y$ a" G, m6 f! P找到

" r/ G4 n3 `/ ^0 m9 k* n# K$ ~, K5 z. z1 _/ x
  1. <!--{if !$attach['price'] || $attach['payed']}-->
    ) S' Z: H- S+ a8 c- z2 I
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >) e1 P: S, C! Q! G
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    9 o3 U5 O  K; `$ }
  4.                         $attach[attachicon]+ T9 k9 |0 p4 K+ Y, \- h
  5.                        <!--{/if}-->- c% @& c. t( R, X, z! e  D  R% E
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->1 X9 _6 e4 _2 P$ X7 P6 g
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    4 x# Y+ A0 v3 }; K2 i9 G
  8.                        <!--{else}-->
    $ P+ h. Q# ]: f
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    9 I5 _& _3 |. M0 m
  10.                         <!--{/if}-->
    % b( f" K6 E; N0 K6 C
  11.                        <em class="xg1">($attach[attachsize])</em>
    1 c4 r8 r4 a$ ]$ A( U
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    . s8 J' r) x$ r/ w. T5 i- \
  13.                        </em>8 Y1 M" m9 x5 ?8 \3 q! i" G6 {
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
    ; I" h- d* [  [/ \2 ]" U
  15.                 </div>
    % ?7 z- E* [3 T# D  |0 b. V( c. z
  16.                <!--{/if}-->
复制代码
改为:
* U% H7 \& `# r
7 ]) p3 [" G. S5 z  y( T* r- I
  1. <div id="attach_$attach[aid]" class="box attach mbn" >6 l) E- o2 A, ~
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    - E( W  y3 M) t
  3. $attach[attachicon]2 q% p0 z5 W& E. Z, s8 J1 B
  4. <!--{/if}-->0 s! ?+ w" H+ h+ \
  5. <!--{if !$attach['price'] || $attach['payed']}--># P1 x: g8 j6 K0 w7 t. {  g7 t/ v* V3 [
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    8 l+ O& [* k' j2 [6 c: m
  7. <!--{else}-->( L2 m" Y. [: m; U9 w  W5 ?
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>  C7 Q7 E4 G; X# |( v4 N
  9. <!--{/if}-->2 m! e( h. s: k1 [
  10. <em class="xg1">($attach[attachsize])</em>
    6 k0 O1 p7 O. @
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    " H% D; b9 w. `) t6 Y) G5 N
  12. </em>
    , {( I+ m. J" l& x5 t2 X' h
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->, C) J& f4 ]+ Y6 D- ]
  14. </div>
复制代码
GBK格式需要转码
0 w3 Q0 t/ q: I- M然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可

. F8 K, \% ]8 i; V- E8 Z3 e4 d[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA ' b: Y7 F1 v) A$ J. E% [
提取码:8wg1 6 R5 z/ y7 k- A
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw
' _! S' z9 ]4 @提取码:w52u
  A8 F& n4 R* z复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
/ J2 ^; q  h, w& Z4 M: R
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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 | 显示全部楼层
支持一下
回复

使用道具 举报

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