罗码网络discuz插件模板教程微信小程序安卓电脑软件htmlphp源码下载

罗码gitluo

 找回密码
 立即注册

QQ登录

只需一步,快速开始

微信登录

微信扫一扫,快速登录

手机动态码快速登录

手机号快速注册登录

搜索
开启左侧

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

[复制链接]
罗码男神 实名认证 官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
! {5 Q4 {5 C1 Q6 b7 t  Q这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。6 [' ]2 l& R( r5 K/ G: @+ x- L  C

8 L1 R7 ]$ Z0 ?0 y: d2 M修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):! a4 r5 ]' }8 h9 ^9 B& Y
打开:/upload/source/language/lang_message.php# t* z/ M1 K+ ?3 n6 r, Y; b
找到6 n4 `. Q5 b; A/ o1 s
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:4 |' j( f& \& H. N, }
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码

. c8 x0 x4 U2 k* W3 D) w5 q 打开:/upload/source/module/forum/forum_misc.php" j' @0 q6 W% {: U, O7 T, h
找到
  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>
复制代码
改为:
2 l- T; F$ i% l0 b
  1. if(defined('IN_MOBILE')) {
    ) R  T  }) S; E9 a+ Y3 z  o/ u
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    ! r( F$ R/ c' ?7 [5 h/ d
  3.                 }else{
    / W& m% ]7 A- M6 i) X/ L# h6 ?5 P
  4.                         if(count($aids) > 1) {5 d0 h. j' C* _" M, ~' C5 E. \% m
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);1 O8 B8 o$ W8 y# s' C' v9 q
  6.                        } else {
    5 B; t: `& K2 B" \: a" Z/ [
  7.                                $_G['forum_attach_filename'] = $attach['filename'];
    ! M9 f2 t9 O$ [
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
    9 K; Q2 [7 W0 l) t; C3 q4 I
  9.                         }
    & [8 d: ?* D/ l  z9 k' B0 Z5 m
  10.                 }
    # `- ~3 e) _$ [' E+ N# S$ I) _' t
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm
( g8 N3 _) ]4 X7 p: Y$ a" G, m6 f! P找到
4 w3 C: \8 a2 G; t

( U6 u/ Y5 C9 |6 o- e5 P
  1. <!--{if !$attach['price'] || $attach['payed']}-->
    : S4 }/ i. o- J  H) _. _1 D; a
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >
    * M6 i9 L1 S! f7 H
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    5 r) A/ u# t9 H' u% X8 ^; ]. {
  4.                         $attach[attachicon]
    & b5 Y, i4 f8 F. J7 e
  5.                        <!--{/if}-->; n4 M* Q5 Q9 `
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->3 R# S+ q& R+ U- z8 K
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    " R% k( k5 @- D2 @
  8.                        <!--{else}-->
    3 k0 t9 S, V% }* M+ B
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    ( H, Z+ h2 \0 ^
  10.                         <!--{/if}-->
    ) u' {/ c2 K  h+ G0 G& F8 _8 k
  11.                        <em class="xg1">($attach[attachsize])</em>
    * C4 K; g0 F$ t9 M2 f
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    8 J4 A* R! D, _  q
  13.                        </em>
    # G+ V$ P" r8 M2 ?2 l$ d: q
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
    / w7 W, r# ?" v7 u( j$ u# b* u
  15.                 </div>- g1 s2 p+ x8 c, S+ C. q
  16.                <!--{/if}-->
复制代码
改为:
& N7 L' y, N, ]" w# e! G# X
% S* ]6 |7 b1 N1 n1 L
  1. <div id="attach_$attach[aid]" class="box attach mbn" >
    & H- s; Z. w' _4 b
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->" p7 Z) ?6 H1 p4 Q# D, m
  3. $attach[attachicon]1 c/ m9 E5 o) N
  4. <!--{/if}-->5 e8 v# n/ Z- K9 l: R3 N
  5. <!--{if !$attach['price'] || $attach['payed']}-->
    4 c8 W+ \: V" |% J4 {5 z* {
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>/ G7 G! j! f. ?
  7. <!--{else}-->- a2 M7 [# q) p2 V$ `+ N* n
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>" v* F5 z7 w0 g9 m
  9. <!--{/if}-->
    ( s6 F/ b" g. r9 m  f
  10. <em class="xg1">($attach[attachsize])</em>9 ]) J! e' |* M: {
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    5 ~. b7 R: R$ h$ F! {1 L5 G
  12. </em>
    0 |. T9 F" W. q2 a1 G
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->0 p( U7 [$ t9 O' L; G% \* k( D
  14. </div>
复制代码
GBK格式需要转码6 ?  L# z& Y6 V
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可
% L7 E1 a/ A8 o* Y1 I
[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA
2 E9 O: K0 ?0 O3 F提取码:8wg1 0 d7 I- H# e" N: ?
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw
5 l4 q6 R3 _5 [# r# h- m, O! X9 ^提取码:w52u ; D1 ?# L; ?* u. `
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]

* H5 J# k. I6 H& `

想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
jjj111 发表于 2019-6-12 00:47:24 | 显示全部楼层
我是个凑数的。。。

回复

使用道具 举报

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 | 显示全部楼层
支持一下

回复

使用道具 举报

666男神 发表于 2019-6-23 02:02:57 | 显示全部楼层

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 微信登录 手机动态码快速登录

本版积分规则

QQ|Archiver|手机版|小黑屋|罗码 ( 粤ICP备17073043号 )https://beian.miit.gov.cn/#/home

GMT+8, 2026-7-5 14:56 , Processed in 0.155951 second(s), 61 queries .

Powered by 罗码网络! X3.4

© 2001-2017

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