坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

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

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
6 v9 J$ M9 k. W: K. d这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。5 ?4 g: |; p! J" ]% X1 I, t# f

0 w$ V' t$ x/ P7 J  }修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):
- `$ z2 L# R6 g4 O2 i打开:/upload/source/language/lang_message.php
. U, i# K5 b+ i# q# Z, H( T3 ^% L找到
$ v% w: T1 C' u
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:
, Q& X2 ~1 [+ T  i
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码
. \, M4 m& L/ X
打开:/upload/source/module/forum/forum_misc.php$ r, I% F& d1 e
找到
  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>
复制代码
改为:! [$ m$ v4 ?( i
  1. if(defined('IN_MOBILE')) {) _- h  `  J8 A2 U/ ?) _
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);/ k# H) n6 S& f" X7 Y4 e6 W+ I5 p
  3.                 }else{5 Z* B# ~: B+ B' f
  4.                         if(count($aids) > 1) {  J' W3 j+ |5 m3 e
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    9 H* q6 U3 ^3 Z+ w0 w4 Q+ J7 ]
  6.                        } else {
    $ V5 w9 q, D) \( D
  7.                                $_G['forum_attach_filename'] = $attach['filename'];* g! g3 U  R/ T; q& R
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
    7 w! h  F9 @. q
  9.                         }/ U3 v/ c/ [7 O! e+ U: N9 ~+ v# w
  10.                 }0 ]- `+ U- w3 t7 w. @& ?, i$ k
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm
8 O* m2 O" z/ o" |& \& L: Y$ a" G, m6 f! P找到

5 ^% \  g% e# ^. {# V4 s" o0 ~! ^) q1 h( J
  1. <!--{if !$attach['price'] || $attach['payed']}-->8 p0 R/ P0 c3 o6 _; P7 Z2 S
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" ># }: O% Q* K# W. k& \+ x, m1 {
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    2 a6 \1 u3 a3 J; T: R) ~# u0 Z( S
  4.                         $attach[attachicon]/ p" h9 I6 s6 i
  5.                        <!--{/if}-->
    ' ~) L0 G  H: w! F
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->
    4 ^* [3 h! d0 a
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    0 h& K: ?+ B3 s: q* a4 f8 M
  8.                        <!--{else}-->2 d5 ~  ?( u1 x! D0 z, h# `
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>1 R8 r# X$ q9 O* m, `: [; ^+ Q
  10.                         <!--{/if}-->
    9 X5 [! d6 Q* A4 s) m
  11.                        <em class="xg1">($attach[attachsize])</em>* u8 ]# a# {: d* z7 U' }9 @
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    ! {, F' G+ w1 V3 a
  13.                        </em>
    $ ]- w9 K4 C! z. k
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
    # @7 ~. k- \6 @2 i. G
  15.                 </div>
    ( B$ j) I/ k: w2 `7 i2 [8 U
  16.                <!--{/if}-->
复制代码
改为:
% B! T% A+ G) ]" V+ U& o# S# S1 _7 U  c/ p2 j4 v8 e* \% E8 a  N7 Y
  1. <div id="attach_$attach[aid]" class="box attach mbn" >
    3 l, Z8 V  x% Q) N, E3 q
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->% R  ?1 S) V/ G: V: t  c) Z
  3. $attach[attachicon]
    2 |1 H0 `0 B4 E
  4. <!--{/if}-->
    4 a+ s! g) }9 f- T
  5. <!--{if !$attach['price'] || $attach['payed']}-->
    # m) \. g" T6 |' e
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    2 `, S* }, u6 {  C
  7. <!--{else}-->
    7 m$ ?3 ~4 Q* F2 |2 _" ]1 W' @  |
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>& [+ F: L8 I0 f& a  N9 w" }+ ^, C
  9. <!--{/if}-->' {/ s) m$ Y" I: c0 z- o
  10. <em class="xg1">($attach[attachsize])</em>" m6 ^8 L1 j- U
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    5 V; u; C% \$ K6 W
  12. </em>
    , n& R9 O& Z8 z. D1 r1 H
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
    ' @( H, o$ V) [4 I5 d1 J' |
  14. </div>
复制代码
GBK格式需要转码3 \2 S; I, h! D. H& H, c
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可
* b1 D! ?8 A1 R0 }6 f% o
[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA
& K; y$ c0 J& p- x. ^6 X9 x提取码:8wg1 * w0 B: O6 J9 P, I! i: w* T- ?
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw
; Y  ^. K2 Z: t9 _* m提取码:w52u 1 A! E8 l9 {5 W& y
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]

5 w* o$ d& w2 H1 d
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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 | 显示全部楼层
支持一下
回复

使用道具 举报

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