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

罗码gitluo

 找回密码
 立即注册

QQ登录

只需一步,快速开始

微信登录

微信扫一扫,快速登录

手机动态码快速登录

手机号快速注册登录

搜索
开启左侧

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

[复制链接]
罗码男神 实名认证 官方 发表于 2019-4-16 23:21:16 | 显示全部楼层 |阅读模式
手机触屏版,收费附件,用户未登录时可以看到附件并有“登录后可见”的字样,但是等到登陆后却踪迹全无。有些站长反馈说在PC端购买过这个附件的,在手机端才能显示附件。8 S. U& b5 H0 W7 t- J" A: i/ S
这样导致手机端的附件平白无故的消失了~ 应该算是一个比较大的功能上的bug,由于不影响安全,所以官方并未急于修复。/ W+ J" @; b; d, ~1 [" r

4 H- {+ S1 N7 c2 S  v修复起来倒是不很复杂,过程如下(如果懒得了解,可以直接拉到底部,下载懒人包,覆盖到根目录即可):
9 v* g8 T) q" c打开:/upload/source/language/lang_message.php$ j  }/ u1 b: q% Q- Y" e1 ?, g
找到- K$ ~. J1 d+ {& l* @% J' P4 l
  1. 'attachment_buyall' => '本帖所有附件购买成功 ',
复制代码
改为:6 o% w/ b. Q/ e- C) V3 c
  1. 'attachment_mobile_buy' => '附件购买成功',
复制代码
: L3 X( ]4 M% N2 ^+ D: L/ s7 ]
打开:/upload/source/module/forum/forum_misc.php
3 y' |6 d) a6 f* Y9 f" z找到
  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>
复制代码
改为:
# [# b5 s6 o* f4 X, I* @) a
  1. if(defined('IN_MOBILE')) {" k! ~& j" n7 l1 C, n5 E
  2.                         showmessage('attachment_mobile_buy', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    3 h. O3 A; N; @3 y( G
  3.                 }else{
    0 L8 C0 Q' K! i
  4.                         if(count($aids) > 1) {; Y9 e9 O5 ~) ^. N) q1 X/ j
  5.                                showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid='.$attach['tid'].'&pid='.$attach['pid']);
    / J* S3 u8 |5 I8 x# u, p0 {; q
  6.                        } else {
    ' D$ x; r. q. ?8 Y
  7.                                $_G['forum_attach_filename'] = $attach['filename'];
    8 W: `/ Z& E" T2 _. l- w8 R) z: |$ ~
  8.                                 showmessage('attachment_buy', "forum.php?mod=attachment&aid=$aidencode", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
    & k4 ^$ E% H7 j1 L1 g, w
  9.                         }# I: l0 F, X  P; P* c) q5 R: b
  10.                 }1 i; O+ t  r1 p+ {- a
复制代码
打开:/upload/template/default/touch/forum/discuzcode.htm( j6 ~/ i# t6 H; Z+ t2 V7 \
: Y$ a" G, m6 f! P找到
5 f9 j# p) e8 K+ N9 l! q3 h

; B" g2 A: X, r0 S3 D& \
  1. <!--{if !$attach['price'] || $attach['payed']}-->6 \- Z# h% d2 s0 g9 ?
  2.                 <div id="attach_$attach[aid]" class="box attach mbn" >6 i: J$ e# q- L+ Y' s2 G: h
  3.                        <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->2 n' e4 o2 p( _
  4.                         $attach[attachicon]! _* z9 b1 q# F. w" k
  5.                        <!--{/if}-->$ e$ o  }8 ?7 S7 R" m1 @
  6.                        <!--{if !$attach['price'] || $attach['payed']}-->
    ' E+ F. z0 `4 Z% j* J  L
  7.                                 <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>% n) r* A* Y9 G+ D
  8.                        <!--{else}-->
    , f# g1 [- T; L6 H# `( m
  9.                                <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    - V& [" ?/ q- k3 ]$ A; F! j
  10.                         <!--{/if}-->
    ( w. Q: I" f' Z$ j! z, w
  11.                        <em class="xg1">($attach[attachsize])</em>
    , j6 f  c: m9 ]4 r
  12.                        <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})
    ( b. j' q, u, r, J( r4 g
  13.                        </em>9 u* i' j( J% i8 a$ s
  14.                        <!--{if !$attach['attachimg'] && $_G['getattachcredits']}--><p>{lang attachcredits}: $_G[getattachcredits]</p><!--{/if}-->
    : w9 z, I% L* z% j$ ^% G' v# a
  15.                 </div>
    9 ]2 v+ e# l- k# v6 x( m7 h' ^. ?
  16.                <!--{/if}-->
复制代码
改为:! p! L' `5 O" o% c. @
0 h5 f2 b* A" t' T8 m( ^6 E# O
  1. <div id="attach_$attach[aid]" class="box attach mbn" >, j) i5 e) M  ]
  2. <!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->  v  J8 y, ?1 J
  3. $attach[attachicon]
    - f6 U" H. ^4 `7 V: }5 I
  4. <!--{/if}-->
    ( ~# L" Y, S: p
  5. <!--{if !$attach['price'] || $attach['payed']}-->
    3 n4 J3 w. [$ M; _2 ~
  6. <a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode" target="_blank">$attach[filename]</a>
    & t+ D4 J. N# G& ^
  7. <!--{else}-->
    4 ?6 X7 T( M+ H: t8 L' [
  8. <a href="forum.php?mod=misc&action=attachpay&aid=$attach[aid]&tid=$attach[tid]" target="_blank">$attach[filename]</a>
    , {" L  B) [, R
  9. <!--{/if}-->+ R3 Z. I5 D0 J6 E8 ^, Z+ \
  10. <em class="xg1">($attach[attachsize])</em>  Y  c& N+ ], i
  11. <em class="xg1"><br />({lang downloads}: $attach[downloads], $attach[dateline] {lang upload})& e( S' z9 A* J; J; V* L
  12. </em>: x  @; r! e2 ~' B& W, W
  13. <!--{if !$attach['attachimg'] && $_G['getattachcredits']}-->{lang attachcredits}: $_G[getattachcredits]<!--{/if}-->
    6 M6 R2 C4 m. K2 |$ i! x
  14. </div>
复制代码
GBK格式需要转码, w. U5 `& a5 u3 H- j9 B
然后将下列附件attachpay.htm 复制到 template/default/touch/forum/ 即可

; c* H& s" g, T+ t  }8 G  p7 }[sell=1]链接:https://pan.baidu.com/s/1IK7xP9A0sVKvxIIB1qOYkA " X2 T! c1 [: ~3 f
提取码:8wg1
* w# a. i( x4 R9 M/ K) Y复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
直接复制到网站根目录即可
[sell=1]链接:https://pan.baidu.com/s/1QOodnF-tAUo11jN-vsphUw 7 z+ P2 r4 T5 h( A9 g7 ~6 _) D
提取码:w52u 1 ?% u' j/ e' c' z4 o$ B
复制这段内容后打开百度网盘手机App,操作更方便哦[/sell]
8 h; n# f& ]4 f2 J3 A

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

Powered by 罗码网络! X3.4

© 2001-2017

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