坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

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

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
, J( c4 M. G3 j8 a  h, y) t$ |这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。
; b) ~+ G3 H( \  n: i$ r; B# Z: w4 q. i; y+ U
修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):" x/ z8 H4 z  f. P
打开:/upload/source/language/lang_message.php6 T/ O/ Y# O( g2 Z3 R
找到* z6 N% K2 d7 Q, X- X2 G
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:
4 j+ M) T' Q0 ]* t# z0 q% V9 ^- Y* q
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码

% d7 N1 P7 ~7 W: d$ f 打开:/upload/source/module/forum/forum_misc.php
4 d0 ]* L9 w3 {$ `" U( p找到
  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 }/ L  `2 b+ a8 d% D
  1. if(defined('IN_MOBILE')) {- J# ?# r8 G3 R3 w2 U
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);; e" K8 x5 O8 J& M2 E
  3.                 }else{
    * \0 x* H5 I  h: c6 i& w, N
  4.                         if(count($aids) > 1) {
    / Q0 U9 x- \' e: @3 j% u5 W
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    ; `* k$ K" H: h8 F& R
  6.                        } else {
    7 p* }# n( H: f3 K
  7.                                $_G['forum_attach_filename'] = $attach['filename'];- i1 t, j0 C% E
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));* ?- q  c, I: J$ O
  9.                         }
    9 p. Q  Y1 t% u: N" ~( o! Y) u
  10.                 }# Q# I& s: K! a6 g; P' n5 t
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm3 Y$ F9 j5 N- f7 x0 P
: Y$ a" G, m6 f! P找到

& n5 w% c/ n* ?' X& x+ i& i
) i& W; K, N/ Q9 ?7 z6 n
  1. <!--{if !$attach['price'] || $attach['payed']}-->$ q& a% i/ `  s" X& ]# [
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" ># _5 p3 w# T3 Z" P/ i
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    # r* [1 p. p7 [/ J0 O- Z1 Q* Z. U
  4.                         $attach[attachicon]* s1 k+ Y% R9 G! U! t: V; i
  5.                        <!--{/if}-->
    4 q, v8 u. u* V! G
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->4 \/ C, o% F* {, J8 K5 x' n
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    % B% v# _1 u/ Y7 E
  8.                        <!--{else}-->5 F5 o$ I  W) H+ s/ l. V& U6 r
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    6 ?9 I' g5 w* E; h& u5 M" L
  10.                         <!--{/if}-->
    1 v5 D3 n/ @) v, I+ g/ M! @. x
  11.                        <em class="xg1">($attach[attachsize])</em>
    ) C0 ]# ^$ O5 B' ?
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    : V1 N; G; L% P0 M$ B
  13.                        </em>
    , y; ]( k  e8 R+ r
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->2 r% V5 c9 r4 {9 M' E
  15.                 </div>
    : q* _0 C" m# B1 x5 J- y1 }. s3 ]4 u
  16.                <!--{/if}-->
复制代码
改为:
& z. J  P" {1 t3 i/ M& x4 y* O" |9 T) M% M! s8 O+ X
  1. <div id="attach_$attach[aid]" class="box attach mbn" >& B$ s1 h" A8 j, S2 d$ c* Z: Y
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    4 E# m2 T  S  H% [/ T
  3. $attach[attachicon]
    # h- L4 W  Q! c8 q4 t
  4. <!--{/if}-->
    ( M, |! B- `+ y' i- [: ?" ~
  5. <!--{if !$attach['price'] || $attach['payed']}-->
      I8 N8 x, r; z2 }
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>1 Y7 O& ]3 W+ J/ v- i6 j. e
  7. <!--{else}-->) V" `" S& h' C/ B9 n2 M6 [
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>" o, r% T0 m! K' D4 O. V: z  M
  9. <!--{/if}-->
    , ~2 q9 j) ?% {4 W, z$ ^, F
  10. <em class="xg1">($attach[attachsize])</em>
    ! u5 W3 T' H& K; c2 K% C
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload}): `. [& B3 B: s! b3 ~# a. H
  12. </em>
    ( E0 S/ f# _# P9 u- O7 ^# P+ L: @
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->( z; \( ~' o" G$ M
  14. </div>
复制代码
GBK格式需要转码8 \' P  F# u/ |5 ~
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可
! p* s. o) D+ U, c4 G
[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA 5 ~, m& M( H* @
提取码:8wg1 ' e8 `! L- S: p7 K2 W" D
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw
: c5 g8 R  p8 w6 u' Q4 k' b提取码:w52u 1 L0 o/ W- A# I* j; W- W) Y
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
+ e/ x- [$ O; \
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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 | 显示全部楼层
支持一下
回复

使用道具 举报

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