當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。