本文整理汇总了PHP中PwUpload::getUploadNum方法的典型用法代码示例。如果您正苦于以下问题:PHP PwUpload::getUploadNum方法的具体用法?PHP PwUpload::getUploadNum怎么用?PHP PwUpload::getUploadNum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PwUpload
的用法示例。
在下文中一共展示了PwUpload::getUploadNum方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setAttach
/**
* 设置附件
* @param array $oldatt_desc
* @param array $keep
*/
function setAttach($flashatt, $oldatt_desc = array())
{
global $db_allowupload, $_G;
$attachs = $this->attach ? $this->attach : array();
$attachs = $this->_cookOldAttachs($attachs, $oldatt_desc);
C::loadClass('articleupload', 'upload', false);
$uploaddb = array();
if ($db_allowupload && $_G['allowupload'] && (PwUpload::getUploadNum() || $flashatt)) {
$articleUpload = new ArticleUpload();
$articleUpload->setFlashAtt($flashatt, intval($_POST['savetoalbum']), intval($_POST['albumid']));
PwUpload::upload($articleUpload);
$uploaddb = $articleUpload->getAttachs();
}
$this->attach = (array) $attachs + (array) $uploaddb;
}
示例2: array
//抢楼
$robbuildService = L::loadClass("robbuild", 'forum');
$fieldsdata = array('authorid' => $winduid, 'starttime' => $robstarttime, 'endtime' => $robendtime, 'endbuild' => $robendbuild, 'awardbuilds' => $robawardbuilds, 'postdate' => $timestamp);
if ($message = $robbuildService->checkAddData($foruminfo['allowrob'], $fieldsdata)) {
Showmsg($message);
}
$robbuildService->initData($fieldsdata);
$postdata->setStatus('2');
$postdata->setStatus('7');
}
L::loadClass('attupload', 'upload', false);
/*上传错误检查
$return = PwUpload::checkUpload();
$return !== true && Showmsg($return);
end*/
if (PwUpload::getUploadNum() || $flashatt) {
S::gp(array('savetoalbum', 'albumid'), 'P', 2);
$postdata->att = new AttUpload($winduid, $flashatt, $savetoalbum, $albumid);
$postdata->att->check();
}
$postdata->iscontinue = (int) $iscontinue;
$topicpost->execute($postdata);
$tid = $topicpost->getNewId();
// defend start
CloudWind::yunUserDefend('postthread', $winduid, $windid, $timestamp, $cloud_information[1] ? $timestamp - $cloud_information[1] : 0, $tid ? 101 : 102, '', $postdata->data['content'], '', '');
// defend end
defined('AJAX') && ($pinfo = $pinfo . $tid);
if ($postSpecial) {
$postSpecial->insertData($tid);
}
if ($postTopic) {
示例3: sendPost
function sendPost($tid, $uid, $title, $content)
{
global $winddb, $winduid, $windid, $groupid, $fid, $timestamp, $pwforum, $pwpost, $_G, $db_uploadfiletype, $uploadcredit, $uploadmoney, $manager, $isBM, $_time;
$timestamp = time();
$_time = array('hours' => get_date($timestamp, 'G'), 'day' => get_date($timestamp, 'j'), 'week' => get_date($timestamp, 'w'));
list($uid, $tid, $title, $content) = array(intval($uid), intval($tid), trim($title), trim($content));
if ($uid < 1 || $tid < 1 || !$content) {
return $this->buildResponse(THREAD_INVALID_PARAMS);
}
ACloud_Sys_Core_Common::setGlobal('customized_current_uid', $uid);
$user = $this->getCurrentUser();
if (!$user->isLogin()) {
return $this->buildResponse(USER_NOT_LOGIN);
}
if ($user->groupid == 6 || getstatus($user->info['userstatus'], PW_USERSTATUS_BANUSER)) {
return $this->buildResponse(THREAD_USER_NOT_RIGHT);
}
$user->initRight();
$winduid = $user->uid;
$groupid = $user->groupid;
$windid = $user->username;
$winddb = $user->info;
$_G = $user->_G;
if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) {
return $this->buildResponse(POST_GP_LIMIT);
}
$tpcarray = $GLOBALS['db']->get_one("SELECT t.tid,t.fid,t.locked,t.ifcheck,t.author,t.authorid,t.postdate,t.lastpost,t.ifmail,t.special,t.subject,t.type,t.ifshield,t.anonymous,t.ptable,t.replies,t.tpcstatus FROM pw_threads t WHERE t.tid=" . pwEscape($tid));
L::loadClass('forum', 'forum', false);
$pwforum = new PwForum($tpcarray['fid']);
if (!$pwforum->isForum()) {
return $this->buildResponse(THREAD_FORUM_NOT_EXIST);
}
$fid = $tpcarray['fid'];
$isBM = $pwforum->isBM($windid);
$isGM = S::inArray($windid, $manager);
if (!$isGM && $tpcarray['locked'] % 3 != 0 && !pwRights($isBM, 'replylock')) {
return $this->buildResponse(THREAD_LOCKED);
}
L::loadClass('post', 'forum', false);
require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.bbscode.php';
$pwpost = new PwPost($pwforum);
$pwpost->errMode = true;
$pwpost->forumcheck();
$pwpost->postcheck();
L::loadClass('replypost', 'forum', false);
$replypost = new replyPost($pwpost);
$replypost->setTpc($tpcarray);
$replypost->check();
$pw_posts = GetPtable($replypost->tpcArr['ptable']);
$postdata = new replyPostData($pwpost);
$postdata->setTitle($title);
$postdata->setContent($content);
$postdata->conentCheck();
if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
return $this->buildResponse(THREAD_SYSTEM_ERROR, $msg);
}
require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.attupload.php';
if (PwUpload::getUploadNum()) {
$_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']);
$db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array();
$postdata->att = new AttUpload($user->uid);
$return = $postdata->att->check();
if ($return) {
$msginfo = getLangInfo('msg', $return);
return $this->errMessage(THREAD_USER_NOT_RIGHT, $msginfo);
}
list($windVersion) = explode(',', WIND_VERSION);
if ($windVersion && $windVersion < '8.5') {
$postdata->att->transfer();
PwUpload::upload($postdata->att);
}
}
$replypost->execute($postdata);
$pid = $replypost->getNewId();
return $this->buildResponse(0, array('pid' => $pid));
}
示例4: foreach
foreach ($pintro as $k => $v) {
if (($banword = $wordsfb->comprise($v)) !== false) {
Showmsg('content_wordsfb');
}
}
$rt = $db->get_one("SELECT aname,photonum,ownerid,lastphoto,memopen FROM pw_cnalbum WHERE atype='1' AND aid=" . S::sqlEscape($aid));
if (empty($rt)) {
Showmsg('undefined_action');
} elseif ($cyid != $rt['ownerid']) {
Showmsg('colony_phototype');
} elseif ($rt['memopen'] == 0 && !$ifadmin) {
Showmsg('colony_album_memopen');
}
$rt['photonum'] >= $groupRight['maxphotonum'] && Showmsg('colony_photofull');
L::loadClass('photoupload', 'upload', false);
if ($rt['photonum'] + PwUpload::getUploadNum() > $groupRight['maxphotonum']) {
$uploadlimit = $groupRight['maxphotonum'] - $rt['photonum'];
$uploadlimit = $uploadlimit > 0 ? $uploadlimit : 0;
Showmsg('uploadphoto_leave');
}
require_once R_P . 'require/functions.php';
$img = new PhotoUpload($aid);
PwUpload::upload($img);
pwFtpClose($ftp);
if (!($photos = $img->getAttachs())) {
Showmsg('colony_uploadnull');
}
$photoNum = count($photos);
$pid = $img->getNewID();
$lastpid = getLastPid($aid, 4);
array_unshift($lastpid, $pid);
示例5: ajaxExport
if ("" == $atc_content) {
ajaxExport(array('bool' => false, 'message' => '内容不能为空'));
}
if (isset($_G['messagecontentsize']) && $_G['messagecontentsize'] > 0 && strlen($atc_content) > $_G['messagecontentsize']) {
ajaxExport(array('bool' => false, 'message' => '内容超过限定长度' . $_G['messagecontentsize'] . '字节'));
}
$filterUtil = L::loadClass('filterutil', 'filter');
$atc_content = $filterUtil->convert($atc_content);
$atc_title = $filterUtil->convert($atc_title);
$messageInfo = array('create_uid' => $winduid, 'create_username' => $windid, 'title' => $atc_title, 'content' => $atc_content);
$messageService = L::loadClass("message", 'message');
if ($messageId = $messageService->sendMessage($winduid, $usernames, $messageInfo)) {
initJob($winduid, 'doSendMessage', array('user' => $usernames));
define('AJAX', 1);
L::loadClass('messageupload', 'upload', false);
if ($db_allowupload && $_G['allowupload'] && (PwUpload::getUploadNum() || $flashatt)) {
S::gp(array('savetoalbum', 'albumid'), 'P', 2);
$messageAtt = new messageAtt($messageId);
$messageAtt->setFlashAtt($flashatt, $savetoalbum, $albumid);
PwUpload::upload($messageAtt);
}
}
ajaxExport(array('bool' => true, 'message' => '消息已发送'));
} elseif ('agree' == $action) {
/* 请求同意 */
S::gp(array('rids', 'typeid', 'fid', 'cyid', 'check'), 'GP');
empty($rids) && ajaxExport("非法操作请返回");
!is_array($rids) && ($rids = explode(',', trim($rids, ',')));
$fid && !is_array($fid) && ($fid = array($fid));
$agreeType = $messageServer->getReverseConst($typeid);
switch ($agreeType) {
示例6: postThread
function postThread($uid, $fid, $subject, $content)
{
global $winddb, $winduid, $windid, $groupid, $_G, $timestamp, $pwforum, $pwpost, $uploadcredit, $uploadmoney, $db_uploadfiletype, $_time;
$timestamp = time();
$_time = array('hours' => get_date($timestamp, 'G'), 'day' => get_date($timestamp, 'j'), 'week' => get_date($timestamp, 'w'));
list($uid, $fid, $subject, $content) = array(intval($uid), intval($fid), trim($subject), trim($content));
if ($uid < 1 || $fid < 1 || !$subject || !$content) {
return $this->buildResponse(THREAD_INVALID_PARAMS);
}
ACloud_Sys_Core_Common::setGlobal('customized_current_uid', $uid);
$user = $this->getCurrentUser();
if (!$user->isLogin()) {
return $this->buildResponse(USER_NOT_LOGIN);
}
if ($user->groupid == 6 || getstatus($user->info['userstatus'], PW_USERSTATUS_BANUSER)) {
return $this->buildResponse(THREAD_USER_NOT_RIGHT);
}
$user->initRight();
$winduid = $user->uid;
$groupid = $user->groupid;
$windid = $user->username;
$winddb = $user->info;
$_G = $user->_G;
if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) {
return $this->buildResponse(POST_GP_LIMIT);
}
L::loadClass('forum', 'forum', false);
$pwforum = new PwForum($fid);
if (!$pwforum->isForum()) {
return $this->buildResponse(THREAD_FORUM_NOT_EXIST);
}
list($uploadcredit, $uploadmoney, , ) = explode("\t", $pwforum->forumset['uploadset']);
L::loadClass('post', 'forum', false);
require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.bbscode.php';
$pwpost = new PwPost($pwforum);
$pwpost->errMode = true;
$pwpost->forumcheck();
$pwpost->postcheck();
L::loadClass('topicpost', 'forum', false);
$topicpost = new topicPost($pwpost);
$topicpost->check();
$postdata = new topicPostData($pwpost);
$postdata->setWtype('', '', $pwforum->foruminfo['t_type'], $pwforum->foruminfo['topictype']);
$postdata->setTitle($subject);
$postdata->setContent($content);
$postdata->setConvert(1, 1);
$postdata->setTags('');
$postdata->setDigest('');
$postdata->setTopped('');
$postdata->setIfsign(1, 0);
if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
return $this->buildResponse(THREAD_SYSTEM_ERROR, $msg);
}
require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.attupload.php';
if (PwUpload::getUploadNum()) {
$_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']);
$db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array();
$postdata->att = new AttUpload($user->uid);
$return = $postdata->att->check();
if ($return) {
$msginfo = getLangInfo('msg', $return);
return $this->buildResponse(THREAD_USER_NOT_RIGHT);
}
list($windVersion) = explode(',', WIND_VERSION);
if ($windVersion && $windVersion < '8.5') {
PwUpload::upload($postdata->att);
$postdata->att->transfer();
}
}
$topicpost->execute($postdata);
$tid = $topicpost->getNewId();
return $this->buildResponse(0, array('tid' => $tid));
}
示例7: array
$keep = array();
$deleteAtt = array();
foreach ($attachs as $key => $value) {
$kname = "keep" . $key;
if (!$_POST["keep" . $key]) {
$deleteAtt[$key] = $value;
}
}
if ($deleteAtt) {
require_once R_P . 'require/functions.php';
require_once R_P . 'require/updateforum.php';
delete_att($deleteAtt);
}
}
require_once W_P . 'include/wapupload.php';
if (PwUpload::getUploadNum()) {
$ext = strtolower(substr(strrchr($_FILES['attachment_']['name'], '.'), 1));
$imageType = array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'swf');
$_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']);
$db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array();
foreach ($db_uploadfiletype as $key => $var) {
if (!in_array($key, $imageType)) {
unset($db_uploadfiletype[$key]);
}
}
if (!array_key_exists($ext, $db_uploadfiletype)) {
wap_msg('非法图片类型', $returnedit);
}
$filesize = $db_uploadfiletype[$ext];
if ($_FILES['attachment_']['size'] < 1 || $_FILES['attachment_']['size'] > $filesize * 1024) {
wap_msg('pro_loadimg_limit_wap', $returnedit);