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

罗码gitluo

 找回密码
 立即注册

QQ登录

只需一步,快速开始

微信登录

微信扫一扫,快速登录

手机动态码快速登录

手机号快速注册登录

搜索
开启左侧

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

[复制链接]
罗码男神 实名认证 官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。% x) C' Z5 F, {( `3 I3 y
这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。
& ?5 o6 `2 w+ a* p* n+ X4 F+ ^
* W6 t- b0 S7 c9 {) O9 p修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):
  N) R4 b+ T. J打开:/upload/source/language/lang_message.php  U8 x. Z7 n6 \* W0 [8 o
找到4 w1 L* j6 H) J( X
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:' w$ ^: _9 ^1 a2 _% \2 z
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码

, h/ k' M! {: k, P' Q% G( B: D 打开:/upload/source/module/forum/forum_misc.php$ y1 n. F' R' h5 R
找到
  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>
复制代码
改为:6 x% N& P, e* N3 S
  1. if(defined('IN_MOBILE')) {# [2 J+ ]) [; l) @
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    " b5 W, o8 y" d' \5 a
  3.                 }else{
    * Z& w* N# ^% T+ y9 d; \; ~9 ]: U' x
  4.                         if(count($aids) > 1) {
    ! L! ?9 U" T8 G; L! W
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    3 u! e3 w1 I# F4 ]: F" }# T/ X/ }  V9 a
  6.                        } else {' h; P4 {# E+ ^4 V* ?  k* o
  7.                                $_G['forum_attach_filename'] = $attach['filename'];9 P/ Y0 T7 a+ J0 v0 }
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));3 u$ T, w2 g  @& V
  9.                         }
    $ A7 V9 Z$ d' |1 y6 B) L# z
  10.                 }
    - R. |& `) o+ d$ L  B
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm8 j) I5 |  s* X
: Y$ a" G, m6 f! P找到
( W& [5 T; g3 F8 ]% h5 H
$ j' O" L4 a3 y$ W; y5 y8 Y
  1. <!--{if !$attach['price'] || $attach['payed']}-->- p2 M+ y- ~. c7 `( K, w
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >
    : _( i/ C+ j8 a  g  v
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->! H8 H9 j: X9 H. p6 f5 j
  4.                         $attach[attachicon]2 J8 n8 k0 g; `0 k) c+ h" X3 T
  5.                        <!--{/if}-->
    9 V# i/ K$ E. j) p+ a
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->
    2 i3 {1 F: Q- Q& K
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>3 v5 I+ z, [6 ~" |% o1 P- ^
  8.                        <!--{else}-->
    6 f- }) ^9 M" |( u4 r  o& q
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>  ?# z* j/ y( C7 Y; k
  10.                         <!--{/if}--># Y# j& P8 I4 e) F, S
  11.                        <em class="xg1">($attach[attachsize])</em>
    9 A' |: I; M2 S) _2 P  P
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload}), u; a4 G( O! u* H! n' x
  13.                        </em>
    . Q2 y  }7 P( R+ N& M" K
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->+ O# y4 ?. Q) W1 g- D
  15.                 </div>1 l* G1 Q; ^0 @, J
  16.                <!--{/if}-->
复制代码
改为:5 |/ w, I: L$ }' h) N& u* S, k

4 g6 L5 D( F( [' O
  1. <div id="attach_$attach[aid]" class="box attach mbn" >
    5 m" k2 E' W4 K8 D
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->2 i; P: l! {+ P8 N( K5 S1 W
  3. $attach[attachicon]
    4 r- w' s+ B3 o9 J' y% V8 Y2 C
  4. <!--{/if}-->
    4 E& `4 a# u- F3 e
  5. <!--{if !$attach['price'] || $attach['payed']}-->
    ; a; I8 h' e  [9 z  f
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>' d5 W" M% y4 q+ b& E9 @  q$ M  B6 q
  7. <!--{else}-->8 z% M- J1 |/ e9 U
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    ' K  R9 q2 f# K5 L
  9. <!--{/if}-->( s* m/ f9 r# P
  10. <em class="xg1">($attach[attachsize])</em>
    $ S5 t; W, j0 C" M6 L
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})- @  N4 X0 e/ d1 |4 {+ q! m
  12. </em>
    ( ?" G9 j  k7 N- \) V2 a( E0 y
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
    9 m0 N( C2 H# c# g
  14. </div>
复制代码
GBK格式需要转码7 V8 ]; W5 i6 r& ?& H; V% t1 P4 w
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可
1 \- D7 k+ P2 K$ Q# H: {) P' E
[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA
( `, j5 v" @  Z" C提取码:8wg1
" s4 `9 l# x5 ]( c1 h2 G! X复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw
. v; _  N/ _% ~/ w! j) Q提取码:w52u
# [2 m# ^$ R+ g; P复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]

9 E2 E+ p# u: Q4 v+ H& {

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

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-12 09:31 , Processed in 0.120613 second(s), 58 queries .

Powered by 罗码网络! X3.4

© 2001-2017

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