坏蛋网络

 找回密码
 立即注册

微信登录

只需一步,快速开始

手机动态码快速登录

手机号快速注册登录

搜索

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

[复制链接]
坏蛋网络官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
6 A6 F7 \/ v/ w* D+ \这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。4 B& I$ Y! y$ ]) X9 x" M

) Z- U8 A+ R) U& C( Z修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):  C! Y+ Q* y9 c  i/ a" L" L
打开:/upload/source/language/lang_message.php  T' f9 l" l1 e: m4 C* v: K$ y
找到2 a9 i0 r% d1 J; u
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:' `/ \. Q* V6 v7 p3 ^6 a
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码
* ~# a3 {" x: y* f6 z$ o
打开:/upload/source/module/forum/forum_misc.php
+ g5 W$ @, C9 Y- |8 Q找到
  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>
复制代码
改为:
3 C3 `) d! o, V
  1. if(defined('IN_MOBILE')) {0 v, V' j# B' Z% L- m3 e$ }! w
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);3 t1 W/ P9 W& R! N& N' X
  3.                 }else{6 j6 ~0 l, J2 l7 B7 f7 \
  4.                         if(count($aids) > 1) {
    ! Y. ^* s: d( @: \
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    5 y9 _$ D; W( L, g/ ]
  6.                        } else {
    8 k" W: {6 F: [1 b% J/ W/ I5 a
  7.                                $_G['forum_attach_filename'] = $attach['filename'];
    : w4 z/ c- C5 ~  B: d* U
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));5 A( J. I  w6 q6 M0 k
  9.                         }/ S3 X5 _. t/ D5 I+ O7 F; h' N4 [) u% B
  10.                 }* n: }0 N+ q+ V- C' D
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm
1 M: n1 D2 ~  t& F! b# S# p: Y$ a" G, m6 f! P找到
1 o  |+ U4 @2 A; J! p+ K# U8 r0 n
2 o4 h( n. n( _& N" z
  1. <!--{if !$attach['price'] || $attach['payed']}-->
    7 R+ Y& p  n9 V. N
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >
    " m5 z4 |$ {  ~7 l: L
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->! a5 b/ Y2 g4 j7 n1 p
  4.                         $attach[attachicon]3 ^8 ], S, G7 _7 b! D; R  X
  5.                        <!--{/if}-->
    $ o( p  }/ C$ g/ g
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->* q' r2 P. }0 g! |/ \* b2 `
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    0 l, m6 j  T) [: L  _( d+ \
  8.                        <!--{else}-->' W( a2 L! U. D* k
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    ( {! h: Y% [8 a  [9 B! i
  10.                         <!--{/if}-->
    ( l  g: M5 S& g8 I  l
  11.                        <em class="xg1">($attach[attachsize])</em>
    ) `( H* G& a  t  p
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload}). g7 ?% E! I) e; l2 P
  13.                        </em>
    1 m7 \' |  g: m% c6 B/ M
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->2 q$ F+ X& G8 Z. L8 g
  15.                 </div>4 J) e& c- L9 a6 U( g$ O, Q
  16.                <!--{/if}-->
复制代码
改为:
8 D/ r- Q; [- T- S: A
8 R! y0 {- t. W
  1. <div id="attach_$attach[aid]" class="box attach mbn" >
    . D4 V- V% B/ [/ }
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->9 D3 j/ V5 V; g' V
  3. $attach[attachicon]! D6 \! Q/ U5 z
  4. <!--{/if}-->
    ( E! P4 L; ?9 c
  5. <!--{if !$attach['price'] || $attach['payed']}-->6 j5 |. O# A1 [6 j6 B& \' ]
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    0 h- q$ E: w- I9 R' D2 t2 ]
  7. <!--{else}-->- Y* Z7 b+ I$ Y$ J# q' L2 ]* Z
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    4 D# z% C; J# s* B% m
  9. <!--{/if}-->
    1 ?( Q7 R" B6 f/ H; y
  10. <em class="xg1">($attach[attachsize])</em>" t2 `: n. _1 u/ D
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    - v7 u6 P1 Y$ y- K3 _5 ~
  12. </em>
    ( Z* m2 d# a8 T. ]8 ?: I
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->% u+ Z3 }, q# }' l. w9 L
  14. </div>
复制代码
GBK格式需要转码2 W8 W! Z8 i' C5 o! K$ ^# c
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可

; n/ c8 F* r! G9 t: h2 n  m[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA
( z" \/ c. H9 j0 r9 O/ E# I提取码:8wg1
& W0 C7 D" b% [2 u& t' q复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw
9 c0 t0 I+ O# Z提取码:w52u
. z: Z0 v# N" S! ~. e/ O8 K复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
7 Z2 X2 G) s- g3 x
想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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 | 显示全部楼层
支持一下
回复

使用道具 举报

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