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


PHP CFile::MakeFileArray方法代码示例

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


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

示例1: Authorize

	public function Authorize()
	{
		$GLOBALS["APPLICATION"]->RestartBuffer();
		$bSuccess = false;

			if(isset($_REQUEST["code"]) && $_REQUEST["code"] <> '')
			{
				if(CSocServAuthManager::CheckUniqueKey())
				{
				$redirect_uri = CSocServUtil::GetCurUrl('auth_service_id='.self::ID, array("code"));

				$appID = self::GetOption("facebook_appid");
				$appSecret = self::GetOption("facebook_appsecret");

				$fb = new CFacebookInterface($appID, $appSecret, $_REQUEST["code"]);

				if($fb->GetAccessToken($redirect_uri) !== false)
				{
					$arFBUser = $fb->GetCurrentUser();
					if(isset($arFBUser["id"]))
					{
						$arFields = array(
							'EXTERNAL_AUTH_ID' => self::ID,
							'XML_ID' => $arFBUser["id"],
							'LOGIN' => "FB_".$arFBUser["email"],
							'EMAIL' => $arFBUser["email"],
							'NAME'=> $arFBUser["first_name"],
							'LAST_NAME'=> $arFBUser["last_name"],
						);

						if(isset($arFBUser['picture']['data']['url']) && self::CheckPhotoURI($arFBUser['picture']['data']['url']))
							if ($arPic = CFile::MakeFileArray($arFBUser['picture']['data']['url']))
								$arFields["PERSONAL_PHOTO"] = $arPic;
						if(isset($arFBUser['birthday']))
							if ($date = MakeTimeStamp($arFBUser['birthday'], "MM/DD/YYYY"))
								$arFields["PERSONAL_BIRTHDAY"] = ConvertTimeStamp($date);
						if(isset($arFBUser['gender']) && $arFBUser['gender'] != '')
						{
							if ($arFBUser['gender'] == 'male')
								$arFields["PERSONAL_GENDER"] = 'M';
							elseif ($arFBUser['gender'] == 'female')
								$arFields["PERSONAL_GENDER"] = 'F';
						}
						$arFields["PERSONAL_WWW"] = "http://www.facebook.com/".$arFBUser["id"];
						$bSuccess = $this->AuthorizeUser($arFields);
					}
				}
			}
		}
		$aRemove = array("logout", "auth_service_error", "auth_service_id", "code", "error_reason", "error", "error_description", "check_key");
		$url = $GLOBALS['APPLICATION']->GetCurPageParam(($bSuccess? '':'auth_service_id='.self::ID.'&auth_service_error=1'), $aRemove);
		echo '
<script type="text/javascript">
if(window.opener)
	window.opener.location = \''.CUtil::JSEscape($url).'\';
window.close();
</script>
';
		die();
	}
开发者ID:nProfessor,项目名称:Mytb,代码行数:60,代码来源:facebook.php

示例2: __main_post_form_image_resize

function __main_post_form_image_resize(&$arCustomFile, $arParams = null)
{
    static $arResizeParams = array();
    if ($arParams !== null) {
        if (is_array($arParams) && array_key_exists("width", $arParams) && array_key_exists("height", $arParams)) {
            $arResizeParams = $arParams;
        } elseif (intVal($arParams) > 0) {
            $arResizeParams = array("width" => intVal($arParams), "height" => intVal($arParams));
        }
    }
    if (!is_array($arCustomFile) || !isset($arCustomFile['fileID'])) {
        return false;
    }
    if (array_key_exists("ID", $arCustomFile)) {
        $arFile = $arCustomFile;
        $fileID = $arCustomFile['ID'];
    } else {
        $fileID = $arCustomFile['fileID'];
        $arFile = CFile::MakeFileArray($fileID);
        $arFile1 = CFile::GetByID($fileID)->fetch();
        if (is_array($arFile) && is_array($arFile1)) {
            $arCustomFile = array_merge($arFile, $arFile1, $arCustomFile);
        }
    }
    if (CFile::CheckImageFile($arFile) === null) {
        $aImgThumb = CFile::ResizeImageGet($fileID, array("width" => 90, "height" => 90), BX_RESIZE_IMAGE_EXACT, true);
        $arCustomFile['img_thumb_src'] = $aImgThumb['src'];
        if (!empty($arResizeParams)) {
            $aImgSource = CFile::ResizeImageGet($fileID, array("width" => $arResizeParams["width"], "height" => $arResizeParams["height"]), BX_RESIZE_IMAGE_PROPORTIONAL, true);
            $arCustomFile['img_source_src'] = $aImgSource['src'];
            $arCustomFile['img_source_width'] = $aImgSource['width'];
            $arCustomFile['img_source_height'] = $aImgSource['height'];
        }
    }
}
开发者ID:Satariall,项目名称:izurit,代码行数:35,代码来源:functions.php

示例3: prepareUser

 public function prepareUser($arFBUser, $short = false)
 {
     $arFields = array('EXTERNAL_AUTH_ID' => self::ID, 'XML_ID' => $arFBUser["id"], 'LOGIN' => "FB_" . $arFBUser["id"], 'EMAIL' => $arFBUser["email"] != '' ? $arFBUser["email"] : '', 'NAME' => $arFBUser["first_name"], 'LAST_NAME' => $arFBUser["last_name"], 'OATOKEN' => $this->entityOAuth->getToken(), 'OATOKEN_EXPIRES' => $this->entityOAuth->getAccessTokenExpires());
     if (!$short && isset($arFBUser['picture']['data']['url']) && !$arFBUser['picture']['data']['is_silhouette']) {
         $picture_url = CFacebookInterface::GRAPH_URL . '/' . $arFBUser['id'] . '/picture?type=large';
         $temp_path = CFile::GetTempName('', 'picture.jpg');
         $ob = new \Bitrix\Main\Web\HttpClient(array("redirect" => true));
         $ob->download($picture_url, $temp_path);
         $arPic = CFile::MakeFileArray($temp_path);
         if ($arPic) {
             $arFields["PERSONAL_PHOTO"] = $arPic;
         }
     }
     if (isset($arFBUser['birthday'])) {
         if ($date = MakeTimeStamp($arFBUser['birthday'], "MM/DD/YYYY")) {
             $arFields["PERSONAL_BIRTHDAY"] = ConvertTimeStamp($date);
         }
     }
     if (isset($arFBUser['gender']) && $arFBUser['gender'] != '') {
         if ($arFBUser['gender'] == 'male') {
             $arFields["PERSONAL_GENDER"] = 'M';
         } elseif ($arFBUser['gender'] == 'female') {
             $arFields["PERSONAL_GENDER"] = 'F';
         }
     }
     $arFields["PERSONAL_WWW"] = $this->getProfileUrl($arFBUser['id']);
     if (strlen(SITE_ID) > 0) {
         $arFields["SITE_ID"] = SITE_ID;
     }
     return $arFields;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:facebook.php

示例4: __MPF_ImageResizeHandler

 function __MPF_ImageResizeHandler(&$arCustomFile, $arParams = null)
 {
     static $arResizeParams = array();
     if ($arParams !== null) {
         if (is_array($arParams) && array_key_exists("width", $arParams) && array_key_exists("height", $arParams)) {
             $arResizeParams = $arParams;
         } elseif (intVal($arParams) > 0) {
             $arResizeParams = array("width" => intVal($arParams), "height" => intVal($arParams));
         }
     }
     if (!is_array($arCustomFile) || !isset($arCustomFile['fileID'])) {
         return false;
     }
     $fileID = $arCustomFile['fileID'];
     $arFile = CFile::MakeFileArray($fileID);
     if (CFile::CheckImageFile($arFile) === null) {
         $aImgThumb = CFile::ResizeImageGet($fileID, array("width" => 90, "height" => 90), BX_RESIZE_IMAGE_EXACT, true);
         $arCustomFile['img_thumb_src'] = $aImgThumb['src'];
         if (!empty($arResizeParams)) {
             $aImgSource = CFile::ResizeImageGet($fileID, array("width" => $arResizeParams["width"], "height" => $arResizeParams["height"]), BX_RESIZE_IMAGE_PROPORTIONAL, true);
             $arCustomFile['img_source_src'] = $aImgSource['src'];
             $arCustomFile['img_source_width'] = $aImgSource['width'];
             $arCustomFile['img_source_height'] = $aImgSource['height'];
         }
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:26,代码来源:result_modifier.php

示例5: send

 /**
  * @param array $data
  * @return Main\Entity\AddResult
  */
 public static function send(array $data)
 {
     $manageCache = Application::getInstance()->getManagedCache();
     if (CACHED_b_event !== false && $manageCache->read(CACHED_b_event, "events")) {
         $manageCache->clean('events');
     }
     $arFiles = array();
     if (isset($data['FILE'])) {
         if (is_array($data['FILE'])) {
             $arFiles = $data['FILE'];
         }
         unset($data['FILE']);
     }
     $result = MailInternal\EventTable::add($data);
     if ($result->isSuccess()) {
         $id = $result->getId();
         foreach ($arFiles as $file) {
             $arFile = \CFile::MakeFileArray($file);
             $arFile["MODULE_ID"] = "main";
             $fid = \CFile::SaveFile($arFile, "main");
             $dataAttachment = array('EVENT_ID' => $id, 'FILE_ID' => $fid);
             MailInternal\EventAttachmentTable::add($dataAttachment);
         }
     }
     return $result;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:30,代码来源:event.php

示例6: go

    public function go()
    {
        require_once $_SERVER["DOCUMENT_ROOT"] . "/classes/XML.php";
        $xml = file_get_contents("http://alfabank.by/a-blog.xml");
        $rss = new \XML($xml);
        foreach ($rss->rss->channel->item as $it) {
            $dom = \phpQuery::newDocumentHTML($it->childByName("content:encoded"));
            $date = date_create($it->pubDate->getData());
            $arResult = array(
                "IBLOCK_ID" => self::ABLOG_IBLOCK_ID,
                "NAME" => $it->title->getData(),
                "DATE_ACTIVE_FROM" => date_format($date, 'd.m.Y'),
                "PREVIEW_TEXT" => $it->description->getData(),
                "PREVIEW_PICTURE" => \CFile::MakeFileArray($dom->find('img')->attr('src')),
                "DETAIL_TEXT" => $it->childByName("content:encoded"),
                "CODE" => \Ns\Bitrix\Helper::Create('iblock')->useVariant('text')->translite($it->title->getData()),
                "PROPERTY_VALUES" => array("ORIGINAL_LINK" => $it->link->getData())
            );
            $this->objElement->Add($arResult);
            if ($this->objElement->LAST_ERROR) {
                prentExpection($this->objElement->LAST_ERROR);
            }
        }

        return true;
	}
开发者ID:ASDAFF,项目名称:bitrix_tehnomir,代码行数:26,代码来源:ABlog.php

示例7: getData

 function getData()
 {
     $data = array();
     $svg = new SimpleXMLElement(file_get_contents($this->xml));
     foreach ($svg->deals->deal as $var) {
         $id = $var->id;
         $url = preg_replace("#http://#i", "", $var->vendor_website_url);
         $url = preg_replace("#^([^/]+)/.*#i", "\\1", $url);
         $url = str_replace("www.", "", $url);
         $arSelect = array("ID", "NAME");
         if ($this->filterSite($url)) {
             $arFilter = array("IBLOCK_ID" => IB_CLUB_ID, "PROPERTY_SITE" => "%" . $url . "%");
             if ($res = CIBlockElement::GetList(array("SORT" => "DESC"), $arFilter, FALSE, FALSE, $arSelect)->Fetch()) {
                 if (!($resStock = CIBlockElement::GetList(array("SORT" => "DESC"), array("CODE" => $id, "TAGS" => $this->tags), FALSE, FALSE, $arSelect)->Fetch())) {
                     $PROP = array();
                     $PROP["URL"] = $var->deal_url;
                     // �������� � ����� 12 ����������� �������� "�����"
                     $PROP["CLUB_ID"] = $res["ID"];
                     // �������� � ����� 3 ����������� �������� 38
                     $PROP["PRICE"] = intval($var->value);
                     // �������� � ����� 3 ����������� �������� 38
                     $PROP["DISCOUNT"] = intval($var->discount_percent);
                     // �������� � ����� 3 ����������� �������� 38
                     $PROP["DISCOUNTPRICE"] = intval($var->discount_amount);
                     // �������� � ����� 3 ����������� �������� 38
                     $PROP["PRICECOUPON"] = intval($var->price);
                     // �������� � ����� 3 ����������� �������� 38
                     $arLoadProductArray = array("IBLOCK_ID" => IB_SUB_STOCK_ID, "PROPERTY_VALUES" => $PROP, "NAME" => $var->title, "ACTIVE_FROM" => date("d.m.Y H:m:s", intval($var->start_timestamp)), "ACTIVE_TO" => date("d.m.Y H:m:s", intval($var->end_timestamp)), "CODE" => $id, "TAGS" => $this->tags, "ACTIVE" => "Y", "PREVIEW_TEXT" => strip_tags($var->conditions), "DETAIL_PICTURE" => CFile::MakeFileArray($var->large_image_url));
                     $data[] = $arLoadProductArray;
                 }
             }
         }
     }
     return count($data) ? $data : false;
 }
开发者ID:nProfessor,项目名称:Mytb,代码行数:35,代码来源:MegaKupon.php

示例8: Authorize

    public function Authorize()
    {
        $GLOBALS["APPLICATION"]->RestartBuffer();
        $bSuccess = 1;
        if (isset($_REQUEST["code"]) && $_REQUEST["code"] != '') {
            if (CSocServAuthManager::CheckUniqueKey()) {
                if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME')) {
                    $redirect_uri = self::CONTROLLER_URL . "/redirect.php?redirect_to=" . urlencode(CSocServUtil::GetCurUrl('auth_service_id=' . self::ID, array("code")));
                } else {
                    $redirect_uri = CSocServUtil::GetCurUrl('auth_service_id=' . self::ID, array("code"));
                }
                $appID = trim(self::GetOption("facebook_appid"));
                $appSecret = trim(self::GetOption("facebook_appsecret"));
                $fb = new CFacebookInterface($appID, $appSecret, $_REQUEST["code"]);
                if ($fb->GetAccessToken($redirect_uri) !== false) {
                    $arFBUser = $fb->GetCurrentUser();
                    if (is_array($arFBUser) && isset($arFBUser["id"])) {
                        $email = $arFBUser["email"] != '' ? $arFBUser["email"] : '';
                        $arFields = array('EXTERNAL_AUTH_ID' => self::ID, 'XML_ID' => $arFBUser["id"], 'LOGIN' => "FB_" . $arFBUser["id"], 'EMAIL' => $email, 'NAME' => $arFBUser["first_name"], 'LAST_NAME' => $arFBUser["last_name"]);
                        if (isset($arFBUser['picture']['data']['url']) && self::CheckPhotoURI($arFBUser['picture']['data']['url'])) {
                            if ($arPic = CFile::MakeFileArray($arFBUser['picture']['data']['url'])) {
                                $arFields["PERSONAL_PHOTO"] = $arPic;
                            }
                        }
                        if (isset($arFBUser['birthday'])) {
                            if ($date = MakeTimeStamp($arFBUser['birthday'], "MM/DD/YYYY")) {
                                $arFields["PERSONAL_BIRTHDAY"] = ConvertTimeStamp($date);
                            }
                        }
                        if (isset($arFBUser['gender']) && $arFBUser['gender'] != '') {
                            if ($arFBUser['gender'] == 'male') {
                                $arFields["PERSONAL_GENDER"] = 'M';
                            } elseif ($arFBUser['gender'] == 'female') {
                                $arFields["PERSONAL_GENDER"] = 'F';
                            }
                        }
                        $arFields["PERSONAL_WWW"] = "http://www.facebook.com/" . $arFBUser["id"];
                        if (strlen(SITE_ID) > 0) {
                            $arFields["SITE_ID"] = SITE_ID;
                        }
                        $bSuccess = $this->AuthorizeUser($arFields);
                    }
                }
            }
        }
        $aRemove = array("logout", "auth_service_error", "auth_service_id", "code", "error_reason", "error", "error_description", "check_key", "current_fieldset");
        $url = $GLOBALS['APPLICATION']->GetCurPageParam($bSuccess === true ? '' : 'auth_service_id=' . self::ID . '&auth_service_error=' . $bSuccess, $aRemove);
        if (CModule::IncludeModule("socialnetwork") && strpos($url, "current_fieldset=") === false) {
            $url = preg_match("/\\?/", $url) ? $url . "&current_fieldset=SOCSERV" : $url . "?current_fieldset=SOCSERV";
        }
        echo '
<script type="text/javascript">
if(window.opener)
	window.opener.location = \'' . CUtil::JSEscape($url) . '\';
window.close();
</script>
';
        die;
    }
开发者ID:spas-viktor,项目名称:books,代码行数:59,代码来源:facebook.php

示例9: Authorize

    public function Authorize()
    {
        $GLOBALS["APPLICATION"]->RestartBuffer();
        $bSuccess = 1;
        $appID = trim(self::GetOption("twitter_key"));
        $appSecret = trim(self::GetOption("twitter_secret"));
        if (!isset($_REQUEST["oauth_token"]) || $_REQUEST["oauth_token"] == '') {
            $tw = new CTwitterInterface($appID, $appSecret);
            $callback = CSocServUtil::GetCurUrl('auth_service_id=' . self::ID);
            //$callback = 'http://algerman.sam:6448/script.php?auth_service_id='.self::ID;
            if ($tw->GetRequestToken($callback)) {
                $tw->RedirectAuthUrl();
            }
        } elseif (CSocServAuthManager::CheckUniqueKey()) {
            $tw = new CTwitterInterface($appID, $appSecret, $_REQUEST["oauth_token"], $_REQUEST["oauth_verifier"]);
            if (($arResult = $tw->GetAccessToken()) !== false && $arResult["user_id"] != '') {
                $twUser = $tw->GetUserInfo($arResult["user_id"]);
                $first_name = $last_name = "";
                if ($twUser["name"] != '') {
                    $aName = explode(" ", $twUser["name"]);
                    $first_name = $aName[0];
                    if (isset($aName[1])) {
                        $last_name = $aName[1];
                    }
                }
                $arFields = array('EXTERNAL_AUTH_ID' => self::ID, 'XML_ID' => $arResult["user_id"], 'LOGIN' => $arResult["screen_name"], 'NAME' => $first_name, 'LAST_NAME' => $last_name);
                if (isset($twUser["profile_image_url"]) && self::CheckPhotoURI($twUser["profile_image_url"])) {
                    if ($arPic = CFile::MakeFileArray($twUser["profile_image_url"])) {
                        $arFields["PERSONAL_PHOTO"] = $arPic;
                    }
                }
                $arFields["PERSONAL_WWW"] = "https://twitter.com/" . $arResult["screen_name"];
                if (strlen(SITE_ID) > 0) {
                    $arFields["SITE_ID"] = SITE_ID;
                }
                if (COption::GetOptionString('socialservices', 'last_twit_id', '1') == 1) {
                    if (isset($twUser["status"]["id_str"])) {
                        COption::SetOptionString('socialservices', 'last_twit_id', $twUser["status"]["id_str"]);
                    }
                }
                $bSuccess = $this->AuthorizeUser($arFields);
            }
        }
        $aRemove = array("logout", "auth_service_error", "auth_service_id", "oauth_token", "oauth_verifier", "check_key", "current_fieldset");
        $url = $GLOBALS['APPLICATION']->GetCurPageParam($bSuccess === true ? '' : 'auth_service_id=' . self::ID . '&auth_service_error=' . $bSuccess, $aRemove);
        if (CModule::IncludeModule("socialnetwork")) {
            $url = preg_match("/\\?/", $url) ? $url . "&current_fieldset=SOCSERV" : $url . "?current_fieldset=SOCSERV";
        }
        echo '
<script type="text/javascript">
if(window.opener)
	window.opener.location = \'' . CUtil::JSEscape($url) . '\';
window.close();
</script>
';
        die;
    }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:57,代码来源:twitter.php

示例10: createByTemporaryPath

 /**
  * @param $path
  * @return \WS\Tools\ORM\BitrixEntity\File|null
  * @throws \Exception
  */
 public function createByTemporaryPath($path)
 {
     $file = \CFile::MakeFileArray($path);
     $fileId = \CFile::SaveFile($file, '/upload/');
     if ($fileId) {
         $filter = $this->createFilter()->equal('id', $fileId)->toArray();
         return $this->findOne($filter);
     }
     return null;
 }
开发者ID:Under5,项目名称:bitrix-module-tools,代码行数:15,代码来源:file.php

示例11: OnAfterUserAuthorizeHandler

function OnAfterUserAuthorizeHandler(&$arFields)
{
    $f = fopen($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/md/log.txt', 'a+');
    global $USER;
    $rsUser = CUser::GetByID($USER->GetId());
    $arUser = $rsUser->Fetch();
    fwrite($f, "---start\n");
    if ($arUser['ID'] > 0 && $arUser['EXTERNAL_AUTH_ID'] == 'Facebook' && $arUser['UF_RULES'] != '1') {
        $facebook = new Facebook_Facebook(array('appId' => '447579571927341', 'secret' => '2f2cf9cd60f9e98d6cf3309e6b7bde5d'));
        $id = $arUser["XML_ID"];
        $user_info = $facebook->api('/' . $id . '?fields=id,name,first_name,middle_name,last_name,gender,birthday,email,picture');
        $props = array();
        if (!$arUser['PERSONAL_GENDER']) {
            if (isset($user_info['gender']) && $user_info['gender']) {
                $props['PERSONAL_GENDER'] = $user_info['gender'] == 'male' ? 'M' : 'F';
            }
        }
        if (!empty($props)) {
            $user = new CUser();
            $user->Update($arUser["ID"], $props);
        }
        CModule::IncludeModule("blog");
        $blogUser = CBlogUser::GetByID($USER->GetId(), BLOG_BY_USER_ID);
        $props = array();
        if (!$blogUser['AVATAR']) {
            if (isset($user_info['picture']) && $user_info['picture']) {
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, "http://graph.facebook.com/{$id}/picture?type=large");
                curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                curl_setopt($ch, CURLOPT_MAXREDIRS, 3);
                $output = curl_exec($ch);
                if ($output) {
                    $fileName = md5($user_info['picture']);
                    $fullPath = $_SERVER['DOCUMENT_ROOT'] . "/bitrix/cache/social_pictures/{$fileName}.jpg";
                    if (file_put_contents($fullPath, $output) !== false) {
                        $picture = CFile::MakeFileArray($fullPath);
                        $props['AVATAR'] = $picture;
                        $user = new CBlogUser();
                        $user->Update($blogUser["ID"], $props);
                        unlink($fullPath);
                    }
                }
            }
        }
    }
    fwrite($f, "---finish\n");
    fclose($f);
}
开发者ID:irotaev,项目名称:vector-vip.server,代码行数:50,代码来源:init.php

示例12: UploadAvatar

 function UploadAvatar($Url = "", $Folder = "", $FileName = 0, $type = 0)
 {
     $NewAvatar = array();
     if (strlen($Url) > 0) {
         if ($type == 0) {
             $Url = "http://" . parse_url($Url, PHP_URL_HOST) . parse_url($Url, PHP_URL_PATH);
         } elseif ($type == 1) {
             $Url = "https://graph.facebook.com/" . $Url . "/picture?type=large";
         }
         $Avatar = file_get_contents($Url);
         $AvatarPach = $_SERVER["DOCUMENT_ROOT"] . "/upload/" . $Folder . $FileName . ".jpg";
         file_put_contents($AvatarPach, $Avatar);
         if (file_exists($AvatarPach)) {
             $NewAvatar = CFile::MakeFileArray($AvatarPach);
         }
     }
     return $NewAvatar;
 }
开发者ID:dayAlone,项目名称:MyQube,代码行数:18,代码来源:facebook.php

示例13: handle_file_upload

 protected function handle_file_upload($uploaded_file, $name, $size, $type, $error, $index = null, $content_range = null)
 {
     $file = parent::handle_file_upload($uploaded_file, $name, $size, $type, $error, $index, $content_range);
     if (empty($file->error)) {
         global $USER;
         $uid = $USER->GetID();
         $rsUser = CUser::GetByID($uid);
         $arUser = $rsUser->Fetch();
         $arFile = CFile::MakeFileArray($_SERVER['DOCUMENT_ROOT'] . "/upload/avatar/thumbnail/" . $file->name);
         $arFile['del'] = "Y";
         $arFile['old_file'] = $arUser['PERSONAL_PHOTO'];
         $arFile["MODULE_ID"] = "main";
         $fields['PERSONAL_PHOTO'] = $arFile;
         $cuser = new CUser();
         $cuser->Update($uid, $fields);
     }
     return $file;
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:18,代码来源:upload.php

示例14: __MPF_ImageResizeHandler

 function __MPF_ImageResizeHandler(&$arCustomFile)
 {
     $arResizeParams = array("width" => 400, "height" => 400);
     if (!is_array($arCustomFile) || !isset($arCustomFile['fileID'])) {
         return false;
     }
     $fileID = $arCustomFile['fileID'];
     $arFile = CFile::MakeFileArray($fileID);
     if (CFile::CheckImageFile($arFile) === null) {
         $aImgThumb = CFile::ResizeImageGet($fileID, array("width" => 90, "height" => 90), BX_RESIZE_IMAGE_EXACT, true);
         $arCustomFile['img_thumb_src'] = $aImgThumb['src'];
         if (!empty($arResizeParams)) {
             $aImgSource = CFile::ResizeImageGet($fileID, array("width" => $arResizeParams["width"], "height" => $arResizeParams["height"]), BX_RESIZE_IMAGE_PROPORTIONAL, true);
             $arCustomFile['img_source_src'] = $aImgSource['src'];
             $arCustomFile['img_source_width'] = $aImgSource['width'];
             $arCustomFile['img_source_height'] = $aImgSource['height'];
         }
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:19,代码来源:result_modifier.php

示例15: getArImage

 private function getArImage($images, $xmlID)
 {
     $arImage = array();
     foreach ($images as $arImg) {
         $img = \CFile::MakeFileArray($arImg);
         //\Helper::pR($img);
         //die();
         if ($img['type'] != 'application/octet-stream') {
             $arImage[] = $img;
         }
         if (!file_exists($img['tmp_name'])) {
             $this->errors = \Helper::boldColorText("Не удалось добавить картинку {$arImg}, для элемента {$xmlID}", "red");
         }
     }
     /*if (!empty($arImage)) {
           \Helper::pR($arImage);
           die();
       }*/
     return $arImage;
 }
开发者ID:HannibalLecktor,项目名称:alfa74,代码行数:20,代码来源:parser.php


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