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


PHP FileData::BuildImage方法代码示例

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


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

示例1: intval

<?php

include '../../includes/inc.main.php';
if ($_GET['action'] == 'newimage') {
    if (count($_FILES['image']) > 0) {
        $TempDir = $Admin->ImgGalDir();
        $Name = "user" . intval(rand() * rand() / rand()) . "__" . $Admin->AdminID;
        $Img = new FileData($_FILES['image'], $TempDir, $Name);
        echo $Img->BuildImage(200, 200);
        die;
    }
}
switch (strtolower($_POST['action'])) {
    //////////////////////////////////////////// NEW TEST USER ///////////////////////////////////////////////////////////////
    case 'generate':
        $curl = curl_init();
        curl_setopt_array($curl, array(CURLOPT_URL => "https://api.mercadolibre.com/users/test_user?access_token=" . $_SESSION['access_token'], CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\n    \"site_id\":\"MLA\"\n}", CURLOPT_HTTPHEADER => array("cache-control: no-cache", "conten: application/json", "content-type: application/json")));
        $response = curl_exec($curl);
        $err = curl_error($curl);
        curl_close($curl);
        if ($err) {
            echo "cURL Error #:" . $err;
        } else {
            echo $response;
            //$Data = json_decode($response,true);
            //$DB->execQuery('INSERT','test_user','id,nickname,password,site_status,email,creation_date',$Data['id']",'".$Data['nickname']."','".$Data['password']."','".$Data['site_status']."','".$Data['email']."',NOW()");
        }
        die;
        break;
        //////////////////////////////////////////// EDIT ///////////////////////////////////////////////////////////////
    //////////////////////////////////////////// EDIT ///////////////////////////////////////////////////////////////
开发者ID:javzero,项目名称:admin,代码行数:31,代码来源:process.php

示例2: Newimage

 public function Newimage()
 {
     if (count($_FILES['image']) > 0) {
         // $Images = $Admin->UserImages(); // Para cuando se requiera limitar la cantidad de imágenes.
         $TempDir = $this->ImgGalDir();
         $Name = "user" . intval(rand() * rand() / rand()) . "__" . $this->AdminID;
         $Img = new FileData($_FILES['image'], $TempDir, $Name);
         echo $Img->BuildImage(200, 200);
     }
 }
开发者ID:javzero,项目名称:admin,代码行数:10,代码来源:class.admindata.php

示例3: Newimage

 public function Newimage()
 {
     if (count($_FILES['image']) > 0) {
         if ($_POST['newimage'] != $this->GetDefaultImg() && file_exists($_POST['newimage'])) {
             unlink($_POST['newimage']);
         }
         $TempDir = $this->ImgGalDir;
         $Name = "group" . intval(rand() * rand() / rand());
         $Img = new FileData($_FILES['image'], $TempDir, $Name);
         echo $Img->BuildImage(200, 200);
     }
 }
开发者ID:javzero,项目名称:admin,代码行数:12,代码来源:class.groupdata.php

示例4: Category

     $Status = $_POST['status'] == "on" ? 'A' : 'I';
     $Insert = $DB->execQuery('insert', 'category', 'title,parent_id,status,image,creation_date', "'" . $Title . "'," . $Parent . ",'" . $Status . "','" . $Image . "',NOW()");
     $ID = $DB->GetInsertId();
     //echo $DB->lastQuery();
     die;
     break;
 case 'update':
     $ID = $_POST['id'];
     $Edit = new Category($ID);
     if (count($_FILES['img']) > 0) {
         $Name = "file" . intval(rand() * rand() / rand() + rand());
         $Img = new FileData($_FILES['img'], "../../../skin/images/categories/", $Name);
         if (file_exists($Edit->Data['image'])) {
             $Img->DeleteFile($Edit->Data['image']);
         }
         $Image = $Img->BuildImage(45, 45);
         $ImgFilter = ",img='" . $Image . "'";
     }
     $Title = htmlentities($_POST['title']);
     $Parent = $_POST['parent'];
     $Status = $_POST['status'] == "on" ? 'A' : 'I';
     $Insert = $DB->execQuery('update', 'category', "title='" . $Title . "',parent_id=" . $Parent . ",status='" . $Status . "'" . $ImgFilter, "category_id=" . $ID);
     //echo $DB->lastQuery();
     die;
     break;
 case 'delete':
     $ID = $_POST['id'];
     $DB->execQuery('update', 'category', "status = 'I'", "category_id=" . $ID);
     die;
     break;
     ///////////////////////////////////// VALIDATIONS /////////////////////////////////////////////////
开发者ID:javzero,项目名称:admin,代码行数:31,代码来源:process.php


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