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

罗码gitluo

 找回密码
 立即注册

QQ登录

只需一步,快速开始

微信登录

微信扫一扫,快速登录

手机动态码快速登录

手机号快速注册登录

搜索
开启左侧

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

[复制链接]
罗码男神 实名认证 官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
4 M  r  B5 z7 `: M1 g8 z. [3 D这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。! x1 {2 E! m9 _; x! z7 v6 t$ H! L
, K8 V, R) u/ ~4 l& |2 y/ I
修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):6 k( x2 B/ r3 @/ M
打开:/upload/source/language/lang_message.php, c& I3 f1 c  ]% t# W7 e
找到
) {; P. `, x, S5 i& l! h% R
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:4 Z1 {0 I8 y: f0 ]
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码
0 q1 V% C; ^3 J6 w8 \* S$ k
打开:/upload/source/module/forum/forum_misc.php, x# k( r: \$ F- D$ _8 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>
复制代码
改为:
7 g# l. ?) v, V! J
  1. if(defined('IN_MOBILE')) {0 |8 A- D, a; e
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);* G; }1 ], t7 B! g5 f
  3.                 }else{
    , D7 d( ]: J' P* X
  4.                         if(count($aids) > 1) {
    ! l+ }+ b& ^' T
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    ( ~# R9 ~$ y1 S1 t6 _% D8 @
  6.                        } else {
    * F8 R. Y0 f/ V2 B1 J2 L
  7.                                $_G['forum_attach_filename'] = $attach['filename'];) {5 t5 m5 z5 ~1 X' S: k5 u( X4 D
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
    5 ~' G: ~; {$ f* p! `% I' L9 G/ t4 Z
  9.                         }2 d7 b" e3 ~% [7 e- _
  10.                 }' a7 v4 I$ U% t1 N* f) m
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm
) Z' o* q4 E/ I7 C: Y$ a" G, m6 f! P找到
2 a& d9 U2 W( ~' a5 @4 f; A
! I# f; U6 z- H  k
  1. <!--{if !$attach['price'] || $attach['payed']}-->& w+ c- j5 o$ Z& s% a9 I4 i4 [
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >
    3 ]) n2 A+ H  I; I' F
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    " y# d" l; Z7 T- H
  4.                         $attach[attachicon]
    * f1 {5 C7 ?+ ^$ m' Y8 ]: t* ?! m
  5.                        <!--{/if}-->9 b7 c. ?5 Q! K4 C7 e6 }+ W% L
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->8 _- x: R6 f3 R7 J
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    . D# {+ w6 Q( J# \+ f) q
  8.                        <!--{else}-->
    * t* e) K+ r  ~- I5 U) P! s* w% c4 q
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    ( A# W8 w3 D5 q9 J, u5 l7 K/ B
  10.                         <!--{/if}-->
      K* H. m3 c4 s! A4 F) A
  11.                        <em class="xg1">($attach[attachsize])</em>
    2 C, N4 a" t! m% T+ ~" \
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})% y0 T( l. d$ y" Z, b( Z
  13.                        </em>
    ! v$ h! k* n; B: A
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
    9 V+ }6 _* }( H. k. Q+ ~# q) Q* s
  15.                 </div>) T# ?# B$ R* C/ S! K3 W" s
  16.                <!--{/if}-->
复制代码
改为:4 i+ R; i# C. ]) A
# r( J$ G, d% @  i& B1 n
  1. <div id="attach_$attach[aid]" class="box attach mbn" >2 q3 R# Z' m& b+ Z& \' ?) S4 r2 A
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
    % X! i2 J2 t( o9 C. j- ~
  3. $attach[attachicon]; `4 l. p% H9 R# J
  4. <!--{/if}-->
    ' Z( ?/ D4 l. y) X: t' W. G- a
  5. <!--{if !$attach['price'] || $attach['payed']}-->
    1 E3 ^/ k2 k6 t/ D8 |& `( _0 ?7 e
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    ' V& ^5 m; [. P4 e: _* \0 `* t
  7. <!--{else}-->  i* h0 v' Y% p" ]1 n
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>5 k8 G8 T' L. D5 V7 n, X! M% [
  9. <!--{/if}-->* n* Z4 N9 z& g
  10. <em class="xg1">($attach[attachsize])</em>/ T8 B) l' k6 E
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})0 i7 n1 Y2 S8 w4 x" e, g  T  S
  12. </em>; U) ~$ l8 ]: X/ k# i: m
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->) P* c' J: J9 H3 F& Z+ A
  14. </div>
复制代码
GBK格式需要转码
6 E0 ]4 V) n. o7 r2 `& t然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可
# d4 N" f+ o$ \2 b0 D, F
[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA
7 T% M2 o9 U$ \* @0 i提取码:8wg1
& w- T' R8 ?$ J( J) F2 ]4 c5 K8 m复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw
( b1 }) v" t# {3 K- ^' {提取码:w52u
) G. s; C* Y6 t+ h- T复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
: W$ R* a+ L4 Z8 q4 D+ i+ {

想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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-1-8 13:40 , Processed in 0.139598 second(s), 60 queries .

Powered by 罗码网络! X3.4

© 2001-2017

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