坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

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

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
& b7 O% W* `% h  N$ H3 o这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。
6 ?! R/ A/ t# d! M9 G1 @. A* ~1 N4 a/ r6 e: Y
修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):
8 B9 \5 ^! N* Y& j. U: S+ c7 g打开:/upload/source/language/lang_message.php
6 v. M% N0 \( R& y( D) P找到# q, _3 N& k) ~! a4 {+ |
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:
$ l9 V) q5 I! C& j
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码
3 r; O" a: c, N, _8 n& ]
打开:/upload/source/module/forum/forum_misc.php
& H$ J; H. c- ?. z找到
  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>
复制代码
改为:
1 A6 \; Q+ g  p: }" i
  1. if(defined('IN_MOBILE')) {! y: c9 `7 G4 `- r5 `
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);; Y9 O9 ]: @8 @) m
  3.                 }else{/ T8 f5 R  N0 D( |2 l9 B
  4.                         if(count($aids) > 1) {
    ' ]; Q3 n1 j- B5 O
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);" {( ~. `4 w+ g$ X4 A: l0 Y- t0 r
  6.                        } else {, c  N! W% k: w! p' Z/ ?& s
  7.                                $_G['forum_attach_filename'] = $attach['filename'];. {; M5 J6 I" G
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));: v$ z" G6 k" ]2 k
  9.                         }
    * G9 h3 G9 {, n& K
  10.                 }3 x8 f- R2 i* C. S* [
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm! O  i; y' P6 I0 e
: Y$ a" G, m6 f! P找到

' d$ d0 U2 R& Y. V8 Z
& f" \0 f( n1 `) O" H
  1. <!--{if !$attach['price'] || $attach['payed']}-->( n. M  I* z$ x4 c
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >
    8 ^7 U$ G( h) L+ @* I( L
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->3 @/ }" C* o) l0 D7 `
  4.                         $attach[attachicon], n% x6 t& z" X% ~" ?( u
  5.                        <!--{/if}-->
      l/ j0 ]& |9 v* G3 ^7 n$ C
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->
    ! b: w: S1 o# p$ S
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    9 ^8 B$ Z, a, e* y% H
  8.                        <!--{else}-->
    4 t' r! f, ~1 [% ~  R2 H4 U* ^: F
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>7 p/ Q, L* e8 Q, g( R7 J* c1 f5 d
  10.                         <!--{/if}-->  v' B: N$ b  {% v' d+ ~# E2 p$ F
  11.                        <em class="xg1">($attach[attachsize])</em>: |* T! H6 X7 {9 @$ b6 n& I3 F  l
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})7 A6 N8 c' a: y2 O- }% M! x. s" ^* w, T5 t
  13.                        </em>% x: n& [; @: ]. Y
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->& w" x- [5 u0 a; \# l& Y, Y9 I  P( q  m; ?
  15.                 </div>$ i; e2 U3 p; ^, _: L0 R- d: z
  16.                <!--{/if}-->
复制代码
改为:
0 f, W9 I4 T3 v% e0 i) t" G) i& m/ o
  1. <div id="attach_$attach[aid]" class="box attach mbn" >$ `+ C  ?8 {( G4 P1 `3 K
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->5 N; l; C8 `$ p# m' R# u! u3 V
  3. $attach[attachicon]
    7 S/ ?9 ?' M2 X0 m! F% H
  4. <!--{/if}-->: \' E7 e$ O+ n9 R3 }
  5. <!--{if !$attach['price'] || $attach['payed']}-->
    2 w. X: g8 @3 s2 J
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>, k- D# b6 g8 \  n* V
  7. <!--{else}--># I, ?/ t* h7 S0 a9 z8 N5 }
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>' A9 L: s, Y, D/ j/ V- l
  9. <!--{/if}-->
    . h* M. C; h' s% E( ]
  10. <em class="xg1">($attach[attachsize])</em>
      U# @  U/ w- x# C; ^/ D, J+ _: d  w
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    8 _- b3 v/ G! f2 U' Z( t' y
  12. </em>
    ; S( B. _; W2 I2 h0 ~- j2 _) J
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
    & T1 p, M% q0 X7 \9 Q
  14. </div>
复制代码
GBK格式需要转码6 k8 h3 o3 k" o" i
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可
' ~, q8 T3 k  o! R! S8 w" ^
[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA 1 Z$ E8 a! K# v! i7 T
提取码:8wg1 3 R) y) _" v4 S
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw ; ]' i" |+ N( K1 K# {- K3 o. j2 ^
提取码:w52u $ X- w- ~# h: w0 `( B8 H* P
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]

+ f9 ~# ?( I8 i* O3 H3 U
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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 | 显示全部楼层
支持一下
回复

使用道具 举报

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