From 5d1e28678a0eeee2f55ed60f61a8a10d0626b550 Mon Sep 17 00:00:00 2001 From: brotherand2 <547996854@qq.com> Date: Sun, 22 May 2022 02:49:48 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=20=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6=E6=9C=AA=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E7=A7=AF=E5=88=86=E7=AD=96=E7=95=A5=20=20=E7=94=B1?= =?UTF-8?q?=E4=BA=8Epostattachcredits=E5=8F=98=E9=87=8F=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8,=E6=89=80=E4=BB=A5=E4=B8=8A=E4=BC=A0=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E6=9C=AA=E6=8F=90=E7=A4=BA=E7=A7=AF=E5=88=86=E7=AD=96?= =?UTF-8?q?=E7=95=A5,\$=5FG['setting']['creditspolicy']=E5=8F=AA=E6=9C=89k?= =?UTF-8?q?ey=20=E4=B8=BAlowerlimit,promotion=5Fregister,promotion=5Fvisit?= =?UTF-8?q?,=E8=A1=A5=E4=B8=8A=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84policyke?= =?UTF-8?q?y,postattach,firstpid,addtrade=E5=8F=98=E9=87=8F=E4=B9=9F?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/module/forum/forum_post.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/upload/source/module/forum/forum_post.php b/upload/source/module/forum/forum_post.php index 2efcc16ad..a39d9bbcc 100644 --- a/upload/source/module/forum/forum_post.php +++ b/upload/source/module/forum/forum_post.php @@ -302,6 +302,21 @@ if($_GET['action'] == 'newthread') { } else { $policykey = ''; } +$policykeys = array('postattach', $policykey); +loadcache('creditrule'); +foreach ($policykeys as $key) { + if($key && is_array($_G['cache']['creditrule'][$key])) { + $data = []; + $creditrule = $_G['cache']['creditrule'][$key]; + for($i = 1; $i <= 8; $i++) { + if($creditrule['extcredits'.$i]) { + $data[$i] = $creditrule['extcredits'.$i]; + } + } + $_G['setting']['creditspolicy'][$key] = $data; + } +} +$postattachcredits = !empty($_G['forum']['postattachcredits']) ? $_G['forum']['postattachcredits'] : $_G['setting']['creditspolicy']['postattach']; if($policykey) { $postcredits = $_G['forum'][$policykey.'credits'] ? $_G['forum'][$policykey.'credits'] : $_G['setting']['creditspolicy'][$policykey]; } @@ -322,8 +337,8 @@ $posturl = "action=$_GET[action]&fid=$_G[fid]". (!empty($special) ? "&special=$special" : ''). (!empty($sortid) ? "&sortid=$sortid" : ''). (!empty($typeid) ? "&typeid=$typeid" : ''). - (!empty($_GET['firstpid']) ? "&firstpid=$firstpid" : ''). - (!empty($_GET['addtrade']) ? "&addtrade=$addtrade" : ''); + (!empty($_GET['firstpid']) ? "&firstpid=".$_GET['firstpid'] : ''). + (!empty($_GET['addtrade']) ? "&addtrade=".$_GET['addtrade'] : ''); if($_GET['action'] == 'reply') { check_allow_action('allowreply'); -- Gitee