当前位置: 首页>>代码示例>>PHP>>正文


PHP uploader::return_error方法代码示例

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


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

示例1: array

     }
 } else {
     $insertuploads = array();
     $inserterrors = array();
     require "classes/class.upload.php";
     for ($i = 0; $i < $config['tpcmaxuploads']; $i++) {
         if (empty($_FILES['upload_' . $i]['name'])) {
             continue;
         }
         $my_uploader = new uploader();
         $my_uploader->max_filesize($config['tpcfilesize']);
         $my_uploader->max_image_size($config['tpcwidth'], $config['tpcheight']);
         if ($my_uploader->upload('upload_' . $i, explode('|', $config['tpcfiletypes']), 1)) {
             $my_uploader->save_file('uploads/topics/', '2');
         }
         if ($my_uploader->return_error()) {
             array_push($inserterrors, $my_uploader->return_error());
         }
         array_push($insertuploads, $my_uploader->file['name']);
     }
     if (count($inserterrors) > 0) {
         error($inserterrors, 'attachments.php?type=' . $_GET['type'] . '&amp;id=' . $_GET['id'] . SID2URL_x);
     }
     if ($_GET['type'] == 'edit' && ($my->mp[0] == 1 || $upinfo['name'] == $my->id)) {
         $upper = $upinfo['name'];
         $tid = $upinfo['id'];
     } else {
         $upper = $my->id;
         $tid = 0;
     }
     if (count($insertuploads) > 0 && count($insertuploads) <= $config['tpcmaxuploads']) {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:attachments.php

示例2: implode

        $filesystem->file_put_contents('data/feedcreator.inc.php', implode("\n", $n));
    }
    viscacha_header('Location: admin.php?action=misc&job=feedcreator');
} elseif ($job == 'feedcreator_add') {
    echo head();
    $name = $gpc->get('name', str);
    $class = $gpc->get('class', str);
    $active = $gpc->get('active', str);
    $dl = $gpc->get('dl', str);
    $dir = realpath('./classes/feedcreator/');
    $inserterrors = array();
    require "classes/class.upload.php";
    $my_uploader = new uploader();
    $my_uploader->max_filesize(200 * 1024);
    if ($my_uploader->upload('upload', array('.php'))) {
        if (strlen($my_uploader->return_error()) > 0) {
            array_push($inserterrors, $my_uploader->return_error());
        }
        $my_uploader->save_file($dir, 2);
        $file = $my_uploader->file['name'];
    } else {
        if (strlen($my_uploader->return_error()) > 0) {
            array_push($inserterrors, $my_uploader->return_error());
        } else {
            if (count($inserterrors) == 0) {
                array_push($inserterrors, 'An unexpected error occurred');
            }
        }
    }
    if (count($inserterrors) > 0) {
        error('admin.php?action=misc&job=feedcreator', $inserterrors);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:misc.php

示例3: elseif

    $inner['smileys'] = $bbcode->getsmileyhtml($config['smileysperrow']);
    $mymodules->load('editprofile_about_top');
    echo $tpl->parse("editprofile/about");
} elseif ($_GET['action'] == "pic2") {
    $pic = $gpc->get('pic', none);
    if ($my->p['usepic'] == 0) {
        errorLogin($lang->phrase('not_allowed'), "editprofile.php");
    } elseif (isset($_FILES) && is_array($_FILES['upload']) && !empty($_FILES['upload']['name'])) {
        require "classes/class.upload.php";
        $my_uploader = new uploader();
        $my_uploader->max_filesize($config['avfilesize']);
        $my_uploader->max_image_size($config['avwidth'], $config['avheight']);
        if ($my_uploader->upload('upload', explode('|', $config['avfiletypes']))) {
            $my_uploader->save_file('uploads/pics/', '2');
        }
        if ($my_uploader->return_error()) {
            error($my_uploader->return_error(), 'editprofile.php?action=pic');
        } else {
            if (file_exists($my->pic)) {
                @unlink($my->pic);
            }
            $ext = $my_uploader->rename_file('uploads/pics/', $my_uploader->file['name'], $my->id);
        }
        $my->pic = 'uploads/pics/' . $my->id . $ext;
    } elseif (!empty($pic) && preg_match('/^(http:\\/\\/|www.)([\\wהצ�ִײ�@\\-_\\.]+)\\:?([0-9]*)\\/(.*)$/', $pic, $url_ary)) {
        $my->pic = checkRemotePic($pic, $url_ary, $my->id);
    } else {
        removeOldImages('uploads/pics/', $my->id);
    }
    $db->query("UPDATE {$db->pre}user SET pic = '{$my->pic}' WHERE id = '{$my->id}' LIMIT 1", __LINE__, __FILE__);
    ok($lang->phrase('editprofile_pic_success'), "editprofile.php?action=pic" . SID2URL_x);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:editprofile.php

示例4: foot

  <tr> 
   <td class="ubox" width="100%" colspan="2" align="center"><input type="submit" name="Submit" value="Upload"></td> 
  </tr>
 </table>
</form> 
	<?php 
    echo foot();
} elseif ($job == 'com_add2') {
    echo head();
    if (isset($_FILES) && is_array($_FILES['upload']) && $_FILES['upload']['name']) {
        require "classes/class.upload.php";
        $my_uploader = new uploader();
        if ($my_uploader->upload('upload', array('.zip'))) {
            $my_uploader->save_file('temp/', '2');
        }
        if ($my_uploader->return_error()) {
            error('admin.php?action=cms&job=com_add', $my_uploader->return_error());
        } else {
            $tdir = "temp/" . time();
            $filesystem->mkdir($tdir);
            if (!is_dir($tdir)) {
                error('admin.php?action=cms&job=com_add', 'Directory could not be created for extraction.');
            }
            include 'classes/class.zip.php';
            $archive = new PclZip('temp/' . $my_uploader->file['name']);
            if ($archive->extract(PCLZIP_OPT_PATH, $tdir) == 0) {
                error('admin.php?action=cms&job=com_add', $archive->errorInfo(true));
            }
            if (file_exists($tdir . '/components.ini')) {
                $cfg = $myini->read($tdir . '/components.ini');
            } else {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:cms.php

示例5: array

 $insertuploads = array();
 $inserterrors = array();
 require "classes/class.upload.php";
 $success = 0;
 for ($i = 0; $i < $ups; $i++) {
     if (empty($_FILES['upload_' . $i]['name'])) {
         continue;
     }
     $my_uploader = new uploader();
     $my_uploader->max_filesize($filesize);
     if (isset($imgwidth) && isset($imgheight)) {
         $my_uploader->max_image_size($imgwidth, $imgheight);
     }
     if ($my_uploader->upload('upload_' . $i, $filetypes)) {
         $my_uploader->save_file($dir, 2);
         $errstr = $my_uploader->return_error();
         if (!empty($errstr)) {
             array_push($inserterrors, $my_uploader->return_error());
         }
     } else {
         array_push($inserterrors, $my_uploader->return_error());
     }
     $file = $dir . DIRECTORY_SEPARATOR . $my_uploader->file['name'];
     if (!file_exists($file)) {
         $inserterrors[] = 'File (' . $file . ') does not exist.';
     } else {
         $success++;
     }
 }
 echo head();
 if ($success == 0) {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:explorer.php

示例6: uploader

     $folders2[] = $row['smileyfolder'];
 }
 $folders = array_unique($folders);
 $folders2 = array_unique($folders2);
 for ($i = 0; $i < $ups; $i++) {
     if (empty($_FILES['upload_' . $i]['name'])) {
         continue;
     }
     $my_uploader = new uploader();
     $my_uploader->max_filesize($filesize);
     if (isset($imgwidth) && isset($imgheight)) {
         $my_uploader->max_image_size($imgwidth, $imgheight);
     }
     if ($my_uploader->upload('upload_' . $i, $filetypes)) {
         $my_uploader->save_file($dir, 2);
         if ($my_uploader->return_error()) {
             $error[] = $my_uploader->return_error();
         } else {
             $has_upload = $gpc->save_str($my_uploader->fileinfo('name'));
         }
     } else {
         $error[] = $my_uploader->return_error();
     }
 }
 if (strlen($gpc->get('code', str)) < 2) {
     $error[] = 'Code ist zu kurz';
 }
 if (!$has_upload && strlen($img) < 5) {
     $error[] = 'Imagepfad zu kurz';
 }
 if (strlen($gpc->get('show', int)) != 1 && $gpc->get('show', int) != 0) {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:bbcodes.php


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