• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP PwUpload类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中PwUpload的典型用法代码示例。如果您正苦于以下问题:PHP PwUpload类的具体用法?PHP PwUpload怎么用?PHP PwUpload使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了PwUpload类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: addAction

 public function addAction()
 {
     $status = $this->getInput('startup_status');
     //
     $config = new PwConfigSet('native');
     if (count($_FILES)) {
         Wind::import('SRV:upload.action.PwStartUpUpload');
         Wind::import('LIB:upload.PwUpload');
         $bhv = new PwStartUpUpload();
         $bhv->filename = 'startup';
         //
         $upload = new PwUpload($bhv);
         if ($upload->check() === true) {
             $result = $upload->execute();
         }
         if ($result !== true) {
             $this->showError($result->getError());
         }
         if (!($data = $bhv->getAttachInfo())) {
             $this->showError('upload.fail');
         }
         //
         $filepath = $upload->getStore()->getAbsolutePath($data['filename'], $data['path']);
         $filecontent = file_get_contents($filepath);
         //
         $config->set('startup.imgmd5', md5($filecontent));
         $config->set('startup.img', $data['path'] . $data['filename']);
     }
     $config->set('startup.status', $status)->flush();
     $this->showMessage('ADMIN:success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:31,代码来源:StartUpController.php


示例2: dotaoAction

 /**
  * 淘宝推广图片 
  * 
  * @access public
  * @return void
  */
 public function dotaoAction()
 {
     if (!($user = $this->_getUser())) {
         $this->showError('login.not');
     }
     $fid = $this->getInput('fid', 'post');
     //
     $this->_accpetUploadForH5();
     //
     Wind::import('SRV:upload.action.PwTaoUpload');
     Wind::import('LIB:upload.PwUpload');
     $bhv = new PwTaoUpload();
     $bhv->filename = date('YmdHis');
     //
     $upload = new PwUpload($bhv);
     if (($result = $upload->check()) === true) {
         $result = $upload->execute();
     }
     if ($result !== true) {
         $this->showError($result->getError());
     }
     if (!($data = $bhv->getAttachInfo())) {
         $this->showError('upload.fail');
     }
     $data['path'] = Pw::getPath($data['path'] . $data['filename']);
     //
     $this->setOutput($data, 'data');
     $this->showMessage('upload.success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:35,代码来源:UploadController.php


示例3: doAddAction

 /**
  * 发存修改一个发现数据 
  * 
  * @access public
  * @return void
  */
 public function doAddAction()
 {
     list($fid, $title, $href, $des, $vieworder) = $this->getInput(array('fid', 'title', 'href', 'des', 'vieworder'));
     $title = trim($title);
     $href = trim($href);
     $des = trim($des);
     $vieworder = (int) $vieworder;
     if (empty($title)) {
         $this->showError("NATIVE:fresh.title.empty");
     }
     if (empty($href)) {
         $this->showError("NATIVE:fresh.link.empty");
     }
     if (Pw::strlen($title) > 5) {
         $this->showError("名称不能超过5个字符");
     }
     if (Pw::strlen($des) > 9) {
         $this->showError("备注不能超过9个字符");
     }
     if ($fid) {
         $fname = $fid;
     } else {
         $maxId = $this->_getDao()->getMaxId();
         $fname = count($maxId) ? $maxId['fresh_id'] + 1 : 1;
     }
     if (!$fid && !$_FILES) {
         $this->showError('NATIVE:upload.empty');
     }
     if ($_FILES) {
         Wind::import('SRV:upload.action.PwFreshUpload');
         Wind::import('LIB:upload.PwUpload');
         $bhv = new PwFreshUpload();
         $bhv->filename = $fname;
         $upload = new PwUpload($bhv);
         if ($upload->check() === true) {
             $result = $upload->execute();
         }
         if ($result !== true) {
             $this->showError($result->getError());
         }
         if (!($data = $bhv->getAttachInfo())) {
             $this->showError('upload.fail');
         }
         $img = $data['path'] . $data['filename'];
     }
     $data = array('title' => $title, 'href' => $href, 'des' => $des, 'vieworder' => $order);
     if ($img && $_FILES) {
         $data['img'] = $img;
     }
     if ($fid) {
         $this->_getDao()->updateFresh($fid, $data);
     } else {
         $this->_getDao()->addFresh($data);
     }
     $this->showMessage('success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:62,代码来源:FreshController.php


示例4: dosetAction

 /**
  *
  * @access public
  * @return
  * @example
  *
  */
 public function dosetAction()
 {
     /*
     $vd = function() {
         foreach(func_get_args() as $arg) {
             error_log(var_export($arg, true));
         }
     };
     */
     $config = new PwConfigSet('notifier');
     /*
      * 如果form的class是J_ajaxForm,可以只按照count($_FILES)来判断;
      * 如果不是,需要判断具体的tmp_name是否为空来判断是否选择了文件。
      *
      */
     if (count($_FILES) && !empty($_FILES['avatar']['tmp_name'])) {
         Wind::import('SRV:upload.action.PwStartUpUpload');
         Wind::import('LIB:upload.PwUpload');
         $bhv = new PwStartUpUpload();
         $bhv->filename = 'avatar';
         $upload = new PwUpload($bhv);
         if ($upload->check() === true) {
             $result = $upload->execute();
         }
         if ($result !== true) {
             $this->showError($result->getError());
         }
         if (!($data = $bhv->getAttachInfo())) {
             $this->showError('upload.fail');
         }
         // 添加进设置项
         $config->set('avatar', $data['path'] . $data['filename']);
     }
     $nickname = $this->getInput('nickname');
     if (empty($nickname)) {
         $nickname = PwLaiWangSerivce::$defaultNotifier['nickname'];
     }
     $usertype = intval($this->getInput('usertype'));
     if ($usertype != PwLaiWangSerivce::USERTYPE_NAME && $usertype != PwLaiWangSerivce::USERTYPE_ID) {
         $usertype = PwLaiWangSerivce::USERTYPE_NAME;
     }
     $user = $this->getInput('user');
     if ($usertype == PwLaiWangSerivce::USERTYPE_NAME) {
         $userinfo = Wekit::load('user.PwUser')->getUserByName($user, PwUser::FETCH_MAIN);
     } else {
         $userinfo = Wekit::load('user.PwUser')->getUserByUid($user, PwUser::FETCH_MAIN);
     }
     if (empty($userinfo)) {
         $this->showError('NATIVE:user.notfound');
     }
     $config->set('nickname', $nickname)->set('usertype', $usertype)->set('username', $userinfo['username'])->set('userid', $userinfo['uid'])->flush();
     $this->showMessage('ADMIN:success', 'native/notifier/run/', true);
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:60,代码来源:NotifierController.php


示例5: doAddAction

 public function doAddAction()
 {
     list($bid, $title, $clickType, $href, $vieworder, $img) = $this->getInput(array('bid', 'title', 'clickType', 'href', 'vieworder', 'img'));
     $title = trim($title);
     $href = trim($href);
     $vieworder = (int) $vieworder;
     if (count($this->_getDao()->getBanner(PwBanner::BANNER_TYPE_NATIVE_INDEX)) >= 4 && !$bid) {
         $this->showError("NATIVE:banner.num.out");
     }
     if (empty($title)) {
         $this->showError("NATIVE:banner.title.empty");
     }
     if (empty($clickType)) {
         $this->showError("NATIVE:banner.clickType.empty");
     }
     if (empty($href)) {
         $this->showError("NATIVE:banner.link.empty");
     }
     if ($bid) {
         $fname = $bid;
     } else {
         $maxId = $this->_getDao()->getMaxId();
         $fname = count($maxId) ? $maxId['banner_id'] + 1 : 1;
     }
     if (count($_FILES)) {
         Wind::import('SRV:upload.action.PwBannerUpload');
         Wind::import('LIB:upload.PwUpload');
         $bhv = new PwBannerUpload();
         $bhv->filename = $fname;
         $upload = new PwUpload($bhv);
         if ($upload->check() === true) {
             $result = $upload->execute();
         }
         if ($result !== true) {
             $this->showError($result->getError());
         }
         if (!($data = $bhv->getAttachInfo())) {
             $this->showError('upload.fail');
         }
         $img = $data['path'] . $data['filename'];
     } elseif (empty($bid)) {
         $this->showError('upload.empty');
     }
     $data = array('banner_type' => PwBanner::BANNER_TYPE_NATIVE_INDEX, 'type' => $clickType, 'title' => $title, 'href' => $href, 'img' => $img, 'vieworder' => $order);
     if ($bid) {
         $this->_getDao()->updateBanner($bid, $data);
     } else {
         $this->_getDao()->addBanner($data);
     }
     $this->showMessage('success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:51,代码来源:BannerController.php


示例6: add

 function add($attach)
 {
     $upload = array('attname' => 'attachment', 'id' => intval($attach['aid']), 'name' => $attach['name'], 'size' => $attach['size'], 'type' => 'zip', 'ifthumb' => 0, 'fileuploadurl' => '');
     $upload['ext'] = strtolower(substr(strrchr($attach['attachurl'], '.'), 1));
     if (empty($upload['ext']) || !isset($this->bhv->ftype[$upload['ext']])) {
         return false;
     }
     if ($upload['size'] < 1 || $upload['size'] > $this->bhv->ftype[$upload['ext']] * 1024) {
         return false;
     }
     $dir = dirname($attach['attachurl']);
     $dir && ($dir .= '/');
     $srcfile = PwUpload::savePath($this->bhv->ifftp, basename($attach['attachurl']), $dir);
     if (!file_exists($srcfile)) {
         if ($this->bhv->ifftp) {
             $ftp =& PwUpload::getFtpObj();
             PwUpload::createFolder(dirname($srcfile));
             if (!$ftp->get($srcfile, $attach['attachurl'])) {
                 return false;
             }
         } else {
             return false;
         }
     }
     list($filename, $savedir) = $this->bhv->getFilePath($upload);
     $source = PwUpload::savePath($this->bhv->ifftp, $filename, $savedir);
     PwUpload::createFolder(dirname($source));
     if (!copy($srcfile, $source)) {
         return false;
     }
     $upload['fileuploadurl'] = $savedir . $filename;
     PwUpload::operateAttach($source, $filename, $savedir, $upload, $this->bhv);
     $this->upload[] = $upload;
     return true;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:35,代码来源:saveattach.class.php


示例7: _uploadCsv

 /**
  * 上传csv文件到服务器端
  *
  */
 function _uploadCsv()
 {
     L::loadClass('csvupload', 'upload', false);
     $csvupload = new CsvUpload($this->_uid);
     PwUpload::upload($csvupload);
     $this->_filename = $csvupload->pathname;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:11,代码来源:csv.inv.php


示例8: replaceAction

 /**
  * 暂时不用
  */
 public function replaceAction()
 {
     $aid = $this->getInput('aid');
     Wind::import('SRV:upload.action.PwAttReplaceUpload');
     Wind::import('LIB:upload.PwUpload');
     $bhv = new PwAttReplaceUpload($this->loginUser, $aid);
     $upload = new PwUpload($bhv);
     if (($result = $upload->check()) === true) {
         $result = $upload->execute();
     }
     if ($result !== true) {
         $this->showError($result->getError());
     }
     $this->setOutput($bhv->getAttachInfo(), 'data');
     $this->showMessage('upload.success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:19,代码来源:UploadController.php


示例9: _uploadFile

 private function _uploadFile()
 {
     Wind::import('SRV:upload.action.PwDesignImageUpload');
     Wind::import('SRV:upload.PwUpload');
     $bhv = new PwDesignImageUpload();
     $upload = new PwUpload($bhv);
     if (($result = $upload->check()) === true) {
         $result = $upload->execute();
     }
     if ($result !== true) {
         return $result;
     }
     $image = $bhv->getAttachInfo();
     if (!$image['filename']) {
         return '';
     }
     return Pw::getPath($image['path'] . $image['filename']);
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:18,代码来源:PwDesignImageDataService.php


示例10: updateIcon

 public function updateIcon($uid)
 {
     $userBo = Wekit::getLoginUser();
     if ($userBo->uid != $uid) {
         return $this->buildResponse(USER_NOT_LOGIN, "用户未登录");
     }
     Wind::import('SRV:upload.action.PwAvatarUpload');
     Wind::import('LIB:upload.PwUpload');
     $bhv = new PwAvatarUpload($userBo);
     $upload = new PwUpload($bhv);
     if (($result = $upload->check()) === true) {
         $result = $upload->execute();
     }
     if ($result !== true) {
         return $this->buildResponse(USER_UPDATE_ERROR, "更新头像");
     } else {
         return $this->buildResponse(0, '更新成功');
     }
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:19,代码来源:ACloudVerCustomizedUser.php


示例11: makeThumb

 public function makeThumb(PwImage $image, $thumbInfo, $store)
 {
     $quality = Wekit::C('attachment', 'thumb.quality');
     foreach ($thumbInfo as $key => $value) {
         $thumburl = $store->getAbsolutePath($value[0], $value[1]);
         PwUpload::createFolder(dirname($thumburl));
         $result = $image->makeThumb($thumburl, $value[2], $value[3], $quality, $value[4], $value[5]);
         if ($result === true && $image->filename != $thumburl) {
             $this->ifthumb |= 1 << $key;
             $this->_thumb[] = array($thumburl, $value[1] . $value[0]);
         }
     }
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:13,代码来源:AcloudVerCommonUtility.php


示例12: check

 /**
  * @see PwUploadAction.check
  */
 public function check()
 {
     if (!$this->user->isExists()) {
         return new PwError('login.not');
     }
     if (!$this->forum->isForum()) {
         return new PwError('FORUM_IS_NOT_EXISTS');
     }
     if (($result = $this->forum->allowUpload($this->user)) !== true) {
         return new PwError('BBS:forum.permissions.upload.allow', array('{grouptitle}' => $this->user->getGroupInfo('name')));
     }
     if (!$this->forum->foruminfo['allow_upload'] && !$this->user->getPermission('allow_upload')) {
         return new PwError('permission.upload.allow', array('{grouptitle}' => $this->user->getGroupInfo('name')));
     }
     if ($uploadPerday = $this->user->getPermission('uploads_perday')) {
         $count = PwUpload::countUploadedFile() + count($this->flashatt);
         $todayupload = $this->user->info['lastpost'] < Pw::getTdtime() ? 0 : $this->user->info['todayupload'];
         if ($count > 0 && $count + $todayupload > $uploadPerday) {
             return new PwError('permission.upload.nums.perday', array('{nums}' => $uploadPerday));
         }
     }
     return true;
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:26,代码来源:PwAttUpload.php


示例13: pwSqlSingle

     } else {
         $db->update("INSERT INTO pw_cnalbum SET " . pwSqlSingle(array('aname' => getLangInfo('app', 'defaultalbum'), 'atype' => 0, 'ownerid' => $winduid, 'owner' => $windid, 'lasttime' => $timestamp, 'crtime' => $timestamp)));
         $aid = $db->insert_id();
     }
 }
 !$aid && Showmsg('colony_albumclass');
 $rt = $db->get_one("SELECT aname,photonum,ownerid,private,lastphoto FROM pw_cnalbum WHERE atype='0' AND aid=" . pwEscape($aid));
 if (empty($rt)) {
     Showmsg('undefined_action');
 } elseif ($winduid != $rt['ownerid']) {
     Showmsg('colony_phototype');
 }
 $o_maxphotonum && $rt['photonum'] >= $o_maxphotonum && Showmsg('colony_photofull');
 require_once R_P . 'lib/upload/photoupload.class.php';
 $img = new PhotoUpload($aid);
 PwUpload::upload($img);
 pwFtpClose($ftp);
 if (!($photos = $img->getAttachs())) {
     refreshto("{$basename}a=upload", 'colony_uploadnull');
 }
 $photoNum = count($photos);
 $pid = $img->getNewID();
 $lastpid = getLastPid($aid, 4);
 array_unshift($lastpid, $pid);
 if (!$rt['private']) {
     $feedText = "[url={$db_bbsurl}/{$basename}space=1&a=album&aid={$aid}&u={$winduid}]{$rt[aname]}[/url]\n";
     foreach ($photos as $value) {
         $feedText .= "[url={$db_bbsurl}/{#APPS_BASEURL#}q=photos&space=1&a=view&pid={$pid}&u={$winduid}][img]" . getphotourl($value['path'], $value['ifthumb']) . "[/img][/url]&nbsp;";
     }
     pwAddFeed($winduid, 'photo', $pid, array('num' => $photoNum, 'text' => $feedText));
     //会员资讯缓存
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:index.php


示例14: intval

 }
 if ($config['width']) {
     $config['width'] = intval($config['width']) . ($config['width'][strlen($config['width']) - 1] == '%' ? '%' : '');
 }
 if ($config['height']) {
     $config['height'] = intval($config['height']) . ($config['height'][strlen($config['height']) - 1] == '%' ? '%' : '');
 }
 //广告图片上传
 if ($config['type'] == 'img') {
     //图片上传
     $newConfigUrl = $newConfigLink = array();
     L::loadClass('advupload', 'upload', false);
     foreach ($config['imgupload'] as $key => $value) {
         if ($value != 0) {
             $img = new AdvUpload($key);
             $returnImg = PwUpload::upload($img);
             if (!is_array($returnImg) || count($returnImg) == 0) {
                 continue;
             }
             list($newConfigUrl[]) = geturl($returnImg[0]['fileuploadurl'], 'lf');
             $newConfigLink[] = $config['link'][$key];
         } else {
             $newConfigUrl[] = $config['url'][$key];
             $newConfigLink[] = $config['link'][$key];
         }
     }
     unset($config['imgupload']);
     $config['link'] = $newConfigLink;
     $config['url'] = $newConfigUrl;
 }
 foreach ($config as $key => $value) {
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:setadvert.php


示例15: array

    /*
    if ($privacy && is_array($privacy)) {
    	$pwSQL = array();
    	foreach ($privacy as $key => $value) {
    		if (in_array($key, $spaceModel)) {
    			$pwSQL[] = array(
    				'uid'	=> $winduid,
    				'type'	=> 'space',
    				'key'	=> $key,
    				'value'	=> $value
    			);
    		}
    	}
    	$pwSQL && $db->update("replace INTO pw_privacy (uid, ptype, pkey, value) values " . S::sqlMulti($pwSQL));
    }
    if ($domain != $space['domain'] && $db->get_value("SELECT COUNT(*) AS sum FROM pw_space WHERE domain=" . S::sqlEscape($domain))) {
    	Showmsg('该域名已被使用!');
    }
    */
    $pwSQL = array('name' => $name, 'descript' => $descript, 'domain' => $domain, 'spacestyle' => $spacestyle, 'spacetype' => $spacetype, 'skin' => $spaceskin, 'modelset' => serialize($modelset));
    $layout && ($pwSQL['layout'] = serialize($layout));
    set_time_limit(0);
    require_once R_P . 'u/lib/spacebannerupload.class.php';
    $upload = new spaceBannerUpload($winduid);
    PwUpload::upload($upload);
    if ($img = $upload->getImgUrl()) {
        $pwSQL['banner'] = $img;
    }
    $newSpace->updateInfo($pwSQL);
    refreshto('u.php?a=set', 'operate_success');
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:set.php


示例16: 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));
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:76,代码来源:ver.customized.post.php


示例17: 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;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:20,代码来源:articlemodule.class.php


示例18: insertData

 function insertData($tid, $fid)
 {
     /*操作数据库*/
     $this->data['tid'] = $tid;
     $this->data['fid'] = $fid;
     $topicdb = unserialize($this->data['topic']);
     unset($this->data['topic']);
     foreach ($topicdb as $key => $value) {
         $this->data['field' . $key] = $value;
     }
     $tablename = GetTopcitable($this->modelid);
     $this->db->pw_update("SELECT tid FROM {$tablename} WHERE tid=" . S::sqlEscape($tid), "UPDATE {$tablename} SET " . S::sqlSingle($this->data) . "WHERE tid=" . S::sqlEscape($tid), "INSERT INTO {$tablename} SET " . S::sqlSingle($this->data));
     /*附件上传*/
     require_once R_P . 'require/functions.php';
     L::loadClass('pcupload', 'upload', false);
     $img = new PcUpload($tid, $this->modelid);
     PwUpload::upload($img);
     pwFtpClose($GLOBALS['ftp']);
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:19,代码来源:posttopic.class.php


示例19: _uploadImage

 private function _uploadImage($key = 'image')
 {
     Wind::import('SRV:upload.action.PwMedalUpload');
     Wind::import('LIB:upload.PwUpload');
     if ($key == 'image') {
         $bhv = new PwMedalUpload('image', 80, 80);
     } else {
         $bhv = new PwMedalUpload('icon', 30, 30);
     }
     $upload = new PwUpload($bhv);
     if (($result = $upload->check()) === true) {
         $result = $upload->execute();
     }
     if ($result !== true) {
         $this->showError($result->getError());
     }
     return $bhv->getAttachInfo();
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:18,代码来源:MedalController.php


示例20: defaultAvatar

 public function defaultAvatar($uid, $type = 'face')
 {
     Wind::import('LIB:upload.PwUpload');
     $_avatar = array('.jpg' => '_big.jpg', '_middle.jpg' => '_middle.jpg', '_small.jpg' => '_small.jpg');
     $defaultBanDir = Wind::getRealDir('RES:') . 'images/face/';
     $store = Wind::getComponent('storage');
     $fileDir = 'avatar/' . Pw::getUserDir($uid) . '/';
     foreach ($_avatar as $des => $org) {
         $toPath = $store->getAbsolutePath($uid . $des, $fileDir);
         $fromPath = $defaultBanDir . $type . $org;
         PwUpload::createFolder(dirname($toPath));
         PwUpload::copyFile($fromPath, $toPath);
         $store->save($toPath, $fileDir . $uid . $des);
     }
     return true;
 }
开发者ID:ccq18,项目名称:EduSoho,代码行数:16,代码来源:WindidUserService.php



注:本文中的PwUpload类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Q类代码示例发布时间:2022-05-23
下一篇:
PHP PwSeoBo类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap