From d579bfb84a88d5b06f8e486ce2f96fff64753d51 Mon Sep 17 00:00:00 2001 From: AA Date: Tue, 12 Jul 2022 10:00:39 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=81=93=E5=85=B7BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/function/function_magic.php | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/upload/source/function/function_magic.php b/upload/source/function/function_magic.php index b7938216c..5b77c789e 100644 --- a/upload/source/function/function_magic.php +++ b/upload/source/function/function_magic.php @@ -44,17 +44,7 @@ function getmagicweight($uid, $magicarray) { function getpostinfo($id, $type, $colsarray = '') { global $_G; - $sql = $comma = ''; $type = in_array($type, array('tid', 'pid', 'blogid')) && !empty($type) ? $type : 'tid'; - $cols = '*'; - - if(!empty($colsarray) && is_array($colsarray)) { - $cols = ''; - foreach($colsarray as $val) { - $cols .= $comma.$val; - $comma = ', '; - } - } switch($type) { case 'tid': @@ -67,11 +57,8 @@ function getpostinfo($id, $type, $colsarray = '') { $thread['thread_author'] = $thread['author']; $thread['thread_authorid'] = $thread['authorid']; $thread['thread_status'] = $thread['status']; - unset($thread['author']); - unset($thread['authorid']); - unset($thread['dateline']); - unset($thread['status']); - $info = array_merge($info, $thread); + $thread['thread_replycredit'] = $thread['replycredit']; + $info = array_merge($thread, $info); } else { $info = array(); } @@ -84,7 +71,7 @@ function getpostinfo($id, $type, $colsarray = '') { break; } - if(!$info) { + if(empty($info)) { showmessage('magics_target_nonexistence'); } else { return daddslashes($info, 1); @@ -242,7 +229,7 @@ function magic_peroid($magic, $uid) { if($magic['useperoid']) { $dateline = 0; if($magic['useperoid'] == 1) { - $dateline = TIMESTAMP - (TIMESTAMP + $_G['setting']['timeoffset'] * 3600) % 86400 + $_G['setting']['timeoffset'] * 3600; + $dateline = TIMESTAMP - (TIMESTAMP + $_G['setting']['timeoffset'] * 3600) % 86400; } elseif($magic['useperoid'] == 4) { $dateline = TIMESTAMP - 86400; } elseif($magic['useperoid'] == 2) { -- Gitee