diff --git a/upload/source/function/function_magic.php b/upload/source/function/function_magic.php index b7938216cf3e10accf4c5bc5451d97b48de04e5d..5b77c789ef25e85a070a9eca94782d248fceddcb 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) {