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

罗码gitluo

 找回密码
 立即注册

QQ登录

只需一步,快速开始

微信登录

微信扫一扫,快速登录

手机动态码快速登录

手机号快速注册登录

搜索
开启左侧

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

[复制链接]
罗码男神 实名认证 官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。
) M  `$ X# ?2 D0 E# V这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。% i' r& n( j& I& r; v! a" [
. ]0 t; k9 s) [: U7 ^9 g* |
修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):
6 D- b; G$ m3 j  B% [; H' h打开:/upload/source/language/lang_message.php4 G" g: G7 k+ T, K( O' A+ f& b
找到4 s0 Y4 q' C0 i7 n9 ]
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:0 v0 r/ J- v* R2 ]6 a' I
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码

* _5 i5 Y/ S4 ], H  I3 p 打开:/upload/source/module/forum/forum_misc.php
* G9 ?' p% _8 D' A/ i2 [找到
  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>
复制代码
改为:9 T$ n7 ?1 ~4 b) q  z2 ~! e4 _
  1. if(defined('IN_MOBILE')) {, F4 Z! }; K* n' y3 X0 o
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    ( K8 P7 U9 J, \) c: B! \9 q, I
  3.                 }else{  F: @* H- L$ k) r* d8 ]6 S& q" r
  4.                         if(count($aids) > 1) {
    $ s. n$ H6 \  m- X& _5 h
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    0 ~* R1 i( q/ @- T
  6.                        } else {
    8 s/ b' N( U6 [. o6 |
  7.                                $_G['forum_attach_filename'] = $attach['filename'];
    6 b( O' _* k, `- F& v2 C
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
    - N  h: D1 C- X) L$ Q; _  _8 w( I
  9.                         }7 i$ B* C0 Z. G; e
  10.                 }
    9 }+ ?, D' H+ E& s& A, f4 j3 o
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm9 D0 v9 l5 K. _5 E! O
: Y$ a" G, m6 f! P找到

% Y; `& c9 e1 V1 c6 M" c; a
- b' h+ o# a& n5 t* x7 N
  1. <!--{if !$attach['price'] || $attach['payed']}-->% h  w4 _& r3 P
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >
    * B3 R) b$ V3 \6 |, E0 d- `
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->4 A9 M# o  c6 S/ P+ f& w* o  v: F
  4.                         $attach[attachicon]) S/ ]) s; ]8 }6 ^2 `  T) i4 m& K
  5.                        <!--{/if}-->3 L. @6 Q+ T4 H+ o
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->
    ' b% x( T* M* C# |& y. B
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>  Y+ k& N9 `, Y' E4 [- v" w% P
  8.                        <!--{else}-->1 H. ^  M8 F7 E6 |9 R9 x
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    / t, Q4 z+ t6 n
  10.                         <!--{/if}-->
    4 ^% R; c# w: o! F0 S6 [
  11.                        <em class="xg1">($attach[attachsize])</em>
    1 a- D- t4 q  F: \' _
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})8 b* {# F) {" x9 y& C
  13.                        </em>
    + N: w: l7 B& t9 e# [5 g
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->& x) m) E# _9 I* S8 c/ _
  15.                 </div>7 \: r- f1 {7 K! ]. [; Y1 A) t
  16.                <!--{/if}-->
复制代码
改为:0 V' P# W/ g% X. C, B5 W
" q# w" C9 n. F3 \4 t. Q
  1. <div id="attach_$attach[aid]" class="box attach mbn" >
    9 V6 ^. |/ [; w# V% @
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->9 t6 s' A7 P5 }3 X* ^0 I( Z
  3. $attach[attachicon]2 [/ P/ l( n, D0 Y
  4. <!--{/if}-->
    1 j( }% E1 p, g* i+ X/ u
  5. <!--{if !$attach['price'] || $attach['payed']}-->6 E2 s1 H$ J0 k# A2 U
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>% c8 x$ ^; k" d( I* L$ K  ?! F
  7. <!--{else}-->
    # ]6 u$ n" J2 W
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    5 z, o( l) C- ], E& h, k' p- l
  9. <!--{/if}-->! F- \& l/ K/ g  h
  10. <em class="xg1">($attach[attachsize])</em>) _( [* Q7 i6 G4 e9 U2 Y
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})) q8 R! k4 t7 ~
  12. </em>/ M- U  i5 K; r, X# L
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
    5 ^/ c  d. y7 j) R4 Q! }
  14. </div>
复制代码
GBK格式需要转码
4 ]4 {) t4 b* [* p3 V" P" D然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可
! L" ]% M* m9 F2 K
[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA $ d# |4 m0 C3 Z, D& \! P/ _
提取码:8wg1
! q9 b$ Q8 W* n! |复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw
. r1 X# Y7 m" o9 P% U提取码:w52u $ K1 c0 H* R/ C7 N2 o5 a$ F, p
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]

/ r' q& U, s( K' ~5 e

想说又不敢说,说了又怕被拒绝,拒绝了又怕尴尬,就是这样的。内心很痛苦的那种。
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-4-15 10:28 , Processed in 0.144816 second(s), 61 queries .

Powered by 罗码网络! X3.4

© 2001-2017

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