getuserprofile('todayattachs')); $attachremain = array(); if($allowupload) { $attachextensions = !$_G['group']['attachextensions'] ? $mobile_attachextensions : array_map('trim', explode(',', $_G['group']['attachextensions'])); $allowupload = $forummaxattachsize = array(); loadcache('attachtype'); if(isset($_G['cache']['attachtype'][$_G['forum']['fid']])) { $attachtype = $_G['cache']['attachtype'][$_G['forum']['fid']]; } elseif(isset($_G['cache']['attachtype'][0])) { $attachtype = $_G['cache']['attachtype'][0]; } else { $attachtype = array(); } if($attachtype) { foreach($attachtype as $extension => $maxsize) { $forummaxattachsize[$extension] = $maxsize; } } foreach($mobile_attachextensions as $ext) { if(in_array($ext, $attachextensions)) { if(isset($forummaxattachsize[$ext])) { if($forummaxattachsize[$ext] > 0) { $allowupload[$ext] = $forummaxattachsize[$ext] ? $forummaxattachsize[$ext] : $_G['group']['maxattachsize']; } else { $allowupload[$ext] = 0; } } else { $allowupload[$ext] = -1; } } else { $allowupload[$ext] = 0; } } $attachremain = array( 'size' => $_G['group']['maxsizeperday'] ? $_G['group']['maxsizeperday'] - getuserprofile('todayattachsize') : -1, 'count' => $_G['group']['maxattachnum'] ? $_G['group']['maxattachnum'] - getuserprofile('todayattachs') : -1, ); } else { $allowupload = array(); } $uploadhash = md5(substr(md5($_G['config']['security']['authkey']), 8).$_G['uid']); $allowperm = array(); $allowperm['allowperm'] = array(); $allowkey = array('allowpost', 'allowreply', 'allowupload', 'attachremain', 'uploadhash'); foreach($allowkey as $key) { if((!empty(${$key}) || ${$key} === 0) || !empty($_GET['debug'])) { $allowperm['allowperm'][$key] = ${$key}; } } return $allowperm; } } ?>