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


PHP PhocaGalleryFile::getFileOriginal方法代码示例

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


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

示例1: download

 function download($item, $backLink, $extLink = 0)
 {
     $app = JFactory::getApplication();
     if (empty($item)) {
         $msg = JText::_('COM_PHOCAGALLERY_ERROR_DOWNLOADING_FILE');
         $app->redirect($backLink, $msg);
         return false;
     } else {
         if ($extLink == 0) {
             phocagalleryimport('phocagallery.file.file');
             $fileOriginal = PhocaGalleryFile::getFileOriginal($item->filenameno);
             if (!JFile::exists($fileOriginal)) {
                 $msg = JText::_('COM_PHOCAGALLERY_ERROR_DOWNLOADING_FILE');
                 $app->redirect($backLink, $msg);
                 return false;
             }
             $fileToDownload = $item->filenameno;
             $fileNameToDownload = $item->filename;
         } else {
             $fileToDownload = $item->exto;
             $fileNameToDownload = $item->title;
             $fileOriginal = $item->exto;
         }
         // Clears file status cache
         clearstatcache();
         $fileOriginal = $fileOriginal;
         $fileSize = @filesize($fileOriginal);
         $mimeType = PhocaGalleryFile::getMimeType($fileToDownload);
         $fileName = $fileNameToDownload;
         // Clean the output buffer
         ob_end_clean();
         header("Cache-Control: public, must-revalidate");
         header('Cache-Control: pre-check=0, post-check=0, max-age=0');
         header("Pragma: no-cache");
         header("Expires: 0");
         header("Content-Description: File Transfer");
         header("Expires: Sat, 30 Dec 1990 07:07:07 GMT");
         header("Content-Type: " . (string) $mimeType);
         // Problem with IE
         if ($extLink == 0) {
             header("Content-Length: " . (string) $fileSize);
         }
         header('Content-Disposition: attachment; filename="' . $fileName . '"');
         header("Content-Transfer-Encoding: binary\n");
         @readfile($fileOriginal);
         exit;
     }
     return false;
 }
开发者ID:optimosolution,项目名称:marhk,代码行数:49,代码来源:filedownload.php

示例2: getGeoCoords

 function getGeoCoords($filename)
 {
     $lat = $long = '';
     $fileOriginal = PhocaGalleryFile::getFileOriginal($filename);
     if (!function_exists('exif_read_data')) {
         return array('latitude' => 0, 'longitude' => 0);
     } else {
         if (JFile::getExt($fileOriginal) != 'jpg') {
             return array('latitude' => 0, 'longitude' => 0);
         }
         // Not happy but @ must be added because of different warnings returned by exif functions - can break multiple upload
         $exif = @exif_read_data($fileOriginal, 0, true);
         if (empty($exif)) {
             return array('latitude' => 0, 'longitude' => 0);
         }
         if (isset($exif['GPS']['GPSLatitude'][0])) {
             $GPSLatDeg = explode('/', $exif['GPS']['GPSLatitude'][0]);
         }
         if (isset($exif['GPS']['GPSLatitude'][1])) {
             $GPSLatMin = explode('/', $exif['GPS']['GPSLatitude'][1]);
         }
         if (isset($exif['GPS']['GPSLatitude'][2])) {
             $GPSLatSec = explode('/', $exif['GPS']['GPSLatitude'][2]);
         }
         if (isset($exif['GPS']['GPSLongitude'][0])) {
             $GPSLongDeg = explode('/', $exif['GPS']['GPSLongitude'][0]);
         }
         if (isset($exif['GPS']['GPSLongitude'][1])) {
             $GPSLongMin = explode('/', $exif['GPS']['GPSLongitude'][1]);
         }
         if (isset($exif['GPS']['GPSLongitude'][2])) {
             $GPSLongSec = explode('/', $exif['GPS']['GPSLongitude'][2]);
         }
         if (isset($GPSLatDeg[0]) && isset($GPSLatDeg[1]) && (int) $GPSLatDeg[1] > 0 && isset($GPSLatMin[0]) && isset($GPSLatMin[1]) && (int) $GPSLatMin[1] > 0 && isset($GPSLatSec[0]) && isset($GPSLatSec[1]) && (int) $GPSLatSec[1] > 0) {
             $lat = $GPSLatDeg[0] / $GPSLatDeg[1] + $GPSLatMin[0] / $GPSLatMin[1] / 60 + $GPSLatSec[0] / $GPSLatSec[1] / 3600;
             if (isset($exif['GPS']['GPSLatitudeRef']) && $exif['GPS']['GPSLatitudeRef'] == 'S') {
                 $lat = $lat * -1;
             }
         }
         if (isset($GPSLongDeg[0]) && isset($GPSLongDeg[1]) && (int) $GPSLongDeg[1] > 0 && isset($GPSLongMin[0]) && isset($GPSLongMin[1]) && (int) $GPSLongMin[1] > 0 && isset($GPSLongSec[0]) && isset($GPSLongSec[1]) && (int) $GPSLongSec[1] > 0) {
             $long = $GPSLongDeg[0] / $GPSLongDeg[1] + $GPSLongMin[0] / $GPSLongMin[1] / 60 + $GPSLongSec[0] / $GPSLongSec[1] / 3600;
             if (isset($exif['GPS']['GPSLongitudeRef']) && $exif['GPS']['GPSLongitudeRef'] == 'W') {
                 $long = $long * -1;
             }
         }
         return array('latitude' => $lat, 'longitude' => $long);
     }
 }
开发者ID:VierlingMt,项目名称:joomla-3.x,代码行数:48,代码来源:geo.php

示例3: getData

 function getData()
 {
     if (empty($this->_data)) {
         $query = $this->_buildQuery();
         $this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));
     }
     if (!empty($this->_data)) {
         foreach ($this->_data as $key => $value) {
             $fileOriginal = PhocaGalleryFile::getFileOriginal($value->filename);
             //Let the user know that the file doesn't exists
             if (!JFile::exists($fileOriginal)) {
                 $this->_data[$key]->filename = JText::_('COM_PHOCAGALLERY_IMG_FILE_NOT_EXISTS');
                 $this->_data[$key]->fileoriginalexist = 0;
             } else {
                 //Create thumbnails small, medium, large
                 $refresh_url = 'index.php?option=com_phocagallery&view=phocagalleryimgs';
                 $fileThumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail($value->filename, $refresh_url, 1, 1, 1);
                 $this->_data[$key]->linkthumbnailpath = $fileThumb['thumb_name_s_no_rel'];
                 $this->_data[$key]->fileoriginalexist = 1;
             }
         }
     }
     return $this->_data;
 }
开发者ID:VierlingMt,项目名称:joomla-3.x,代码行数:24,代码来源:phocagallerylinkimg.php

示例4: getImageFromCat

 public static function getImageFromCat($idCat, $idImg = 0)
 {
     $db = JFactory::getDBO();
     $nextImg = '';
     if ($idImg > 0) {
         $nextImg = ' AND a.id > ' . (int) $idImg;
     }
     $query = 'SELECT a.*' . ' FROM #__phocagallery AS a' . ' WHERE a.catid = ' . (int) $idCat . ' AND a.published = 1' . ' AND a.approved = 1' . $nextImg . ' ORDER BY a.id ASC LIMIT 1';
     $db->setQuery($query);
     $item = $db->loadObject();
     if (!isset($item->id) || isset($item->id) && $item->id < 1) {
         $img['end'] = 1;
         return $img;
     }
     if (isset($item->description) && $item->description != '') {
         $img['caption'] = $item->title . ' - ' . $item->description;
     } else {
         $img['caption'] = $item->title;
     }
     //TODO TEST EXT IMAGE
     if (isset($item->extid) && $item->extid != '') {
         $img['extid'] = $item->extid;
     }
     $img['id'] = $item->id;
     $img['title'] = $item->title;
     $img['filename'] = PhocaGalleryFile::getTitleFromFile($item->filename, 1);
     $img['fileorigabs'] = PhocaGalleryFile::getFileOriginal($item->filename);
     return $img;
 }
开发者ID:01J,项目名称:skazkipronebo,代码行数:29,代码来源:fbsystem.php

示例5: getOrCreateThumbnail

 function getOrCreateThumbnail($fileNo, $refreshUrl, $small = 0, $medium = 0, $large = 0, $frontUpload = 0)
 {
     if ($frontUpload) {
         $returnFrontMessage = '';
     }
     $onlyThumbnailInfo = 0;
     if ($small == 0 && $medium == 0 && $large == 0) {
         $onlyThumbnailInfo = 1;
     }
     $paramsC = JComponentHelper::getParams('com_phocagallery');
     $additional_thumbnails = $paramsC->get('additional_thumbnails', 0);
     $path = PhocaGalleryPath::getPath();
     $origPathServer = str_replace(DS, '/', $path->image_abs);
     $file['name'] = PhocaGalleryFile::getTitleFromFile($fileNo, 1);
     $file['name_no'] = ltrim($fileNo, '/');
     $file['name_original_abs'] = PhocaGalleryFile::getFileOriginal($fileNo);
     $file['name_original_rel'] = PhocaGalleryFile::getFileOriginal($fileNo, 1);
     $file['path_without_file_name_original'] = str_replace($file['name'], '', $file['name_original_abs']);
     $file['path_without_file_name_thumb'] = str_replace($file['name'], '', $file['name_original_abs'] . 'thumbs' . DS);
     //$file['path_without_name']				= str_replace(DS, '/', JPath::clean($origPathServer));
     //$file['path_with_name_relative_no']		= str_replace($origPathServer, '', $file['name_original']);
     /*
     		$file['path_with_name_relative']		= $path['orig_rel_ds'] . str_replace($origPathServer, '', $file['name_original']);
     		$file['path_with_name_relative_no']		= str_replace($origPathServer, '', $file['name_original']);
     		
     		$file['path_without_name']				= str_replace(DS, '/', JPath::clean($origPath.DS));
     		$file['path_without_name_relative']		= $path['orig_rel_ds'] . str_replace($origPathServer, '', $file['path_without_name']);
     		$file['path_without_name_relative_no']	= str_replace($origPathServer, '', $file['path_without_name']);
     		$file['path_without_name_thumbs'] 		= $file['path_without_name'] .'thumbs';
     		$file['path_without_file_name_original'] 			= str_replace($file['name'], '', $file['name_original']);
     		$file['path_without_name_thumbs_no'] 	= str_replace($file['name'], '', $file['name_original'] .'thumbs');*/
     $ext = strtolower(JFile::getExt($file['name']));
     switch ($ext) {
         case 'jpg':
         case 'png':
         case 'gif':
         case 'jpeg':
             //Get File thumbnails name
             $thumbNameS = PhocaGalleryFileThumbnail::getThumbnailName($fileNo, 'small');
             $file['thumb_name_s_no_abs'] = $thumbNameS->abs;
             $file['thumb_name_s_no_rel'] = $thumbNameS->rel;
             $thumbNameM = PhocaGalleryFileThumbnail::getThumbnailName($fileNo, 'medium');
             $file['thumb_name_m_no_abs'] = $thumbNameM->abs;
             $file['thumb_name_m_no_rel'] = $thumbNameM->rel;
             $thumbNameL = PhocaGalleryFileThumbnail::getThumbnailName($fileNo, 'large');
             $file['thumb_name_l_no_abs'] = $thumbNameL->abs;
             $file['thumb_name_l_no_rel'] = $thumbNameL->rel;
             // Don't create thumbnails from watermarks...
             $dontCreateThumb = PhocaGalleryFileThumbnail::dontCreateThumb($file['name']);
             if ($dontCreateThumb == 1) {
                 $onlyThumbnailInfo = 1;
                 // WE USE $onlyThumbnailInfo FOR NOT CREATE A THUMBNAIL CLAUSE
             }
             // We want only information from the pictures OR
             if ($onlyThumbnailInfo == 0) {
                 $thumbInfo = $fileNo;
                 //Create thumbnail folder if not exists
                 $errorMsg = 'ErrorCreatingFolder';
                 $creatingFolder = PhocaGalleryFileThumbnail::createThumbnailFolder($file['path_without_file_name_original'], $file['path_without_file_name_thumb'], $errorMsg);
                 switch ($errorMsg) {
                     case 'Success':
                         //case 'ThumbnailExists':
                     //case 'ThumbnailExists':
                     case 'DisabledThumbCreation':
                         //case 'OnlyInformation':
                         break;
                     default:
                         // BACKEND OR FRONTEND
                         if ($frontUpload != 1) {
                             PhocaGalleryRenderProcess::getProcessPage($file['name'], $thumbInfo, $refreshUrl, $errorMsg, $frontUpload);
                             exit;
                         } else {
                             $returnFrontMessage = $errorMsg;
                         }
                         break;
                 }
                 // Folder must exist
                 if (JFolder::exists($file['path_without_file_name_thumb'])) {
                     $errorMsgS = $errorMsgM = $errorMsgL = '';
                     //Small thumbnail
                     if ($small == 1) {
                         PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], $thumbNameS->abs, 'small', $frontUpload, $errorMsgS);
                         if ($additional_thumbnails == 2 || $additional_thumbnails == 3) {
                             PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_s_', 'phoca_thumb_s1_', $thumbNameS->abs), 'small1', $frontUpload, $errorMsgS);
                             PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_s_', 'phoca_thumb_s2_', $thumbNameS->abs), 'small2', $frontUpload, $errorMsgS);
                             PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_s_', 'phoca_thumb_s3_', $thumbNameS->abs), 'small3', $frontUpload, $errorMsgS);
                         }
                     } else {
                         $errorMsgS = 'ThumbnailExists';
                         // in case we only need medium or large, because of if clause bellow
                     }
                     //Medium thumbnail
                     if ($medium == 1) {
                         PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], $thumbNameM->abs, 'medium', $frontUpload, $errorMsgM);
                         if ($additional_thumbnails == 1 || $additional_thumbnails == 3) {
                             PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_m_', 'phoca_thumb_m1_', $thumbNameM->abs), 'medium1', $frontUpload, $errorMsgM);
                             PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_m_', 'phoca_thumb_m2_', $thumbNameM->abs), 'medium2', $frontUpload, $errorMsgM);
                             PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_m_', 'phoca_thumb_m3_', $thumbNameM->abs), 'medium3', $frontUpload, $errorMsgM);
                         }
                     } else {
//.........这里部分代码省略.........
开发者ID:VierlingMt,项目名称:joomla-3.x,代码行数:101,代码来源:filethumbnail.php

示例6: array

echo '<h3>' . JText::_('COM_PHOCAGALLERY_EXTERNAL_LINKS2') . '</h3>' . "\n";
$formArray = array('extlink2link', 'extlink2title', 'extlink2target', 'extlink2icon');
echo $r->group($this->form, $formArray);
echo '</div>' . "\n";
echo '<div class="tab-pane" id="metadata">' . "\n";
echo $this->loadTemplate('metadata');
echo '</div>' . "\n";
echo '</div>';
//end tab content
echo '</div>';
//end span10
// Second Column
echo '<div class="span2">';
// - - - - - - - - - -
// Image
$fileOriginal = PhocaGalleryFile::getFileOriginal($this->item->filename);
if (!JFile::exists($fileOriginal)) {
    $this->item->fileoriginalexist = 0;
} else {
    $fileThumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail($this->item->filename, '', 0, 0, 0);
    $this->item->linkthumbnailpath = $fileThumb['thumb_name_m_no_rel'];
    $this->item->fileoriginalexist = 1;
}
echo '<div style="float:right;margin:5px;">';
// PICASA
if (isset($this->item->extid) && $this->item->extid != '') {
    $resW = explode(',', $this->item->extw);
    $resH = explode(',', $this->item->exth);
    $correctImageRes = PhocaGalleryImage::correctSizeWithRate($resW[2], $resH[2], 100, 100);
    $imgLink = $this->item->extl;
    echo '<img class="img-polaroid" src="' . $this->item->exts . '" width="' . $correctImageRes['width'] . '" height="' . $correctImageRes['height'] . '" alt="" />';
开发者ID:naka211,项目名称:malerfirmaet,代码行数:31,代码来源:edit.php

示例7: deleteFile

 function deleteFile($filename)
 {
     $fileOriginal = PhocaGalleryFile::getFileOriginal($filename);
     if (JFile::exists($fileOriginal)) {
         JFile::delete($fileOriginal);
         return true;
     }
     return false;
 }
开发者ID:VierlingMt,项目名称:joomla-3.x,代码行数:9,代码来源:file.php

示例8: processImages

 protected function processImages()
 {
     if (!empty($this->items)) {
         $params = JComponentHelper::getParams('com_phocagallery');
         $pagination_thumbnail_creation = $params->get('pagination_thumbnail_creation', 0);
         $clean_thumbnails = $params->get('clean_thumbnails', 0);
         //Server doesn't have CPU power
         //we do thumbnail for all images - there is no pagination...
         //or we do thumbanil for only listed images
         if (empty($this->items_thumbnail)) {
             if ($pagination_thumbnail_creation == 1) {
                 $this->items_thumbnail = $this->items;
             } else {
                 $this->items_thumbnail = $this->get('ItemsThumbnail');
             }
         }
         // - - - - - - - - - - - - - - - - - - - -
         // Check if the file stored in database is on the server. If not please refer to user
         // Get filename from every object there is stored in database
         // file - abc.img, file_no - folder/abc.img
         // Get folder variables from Helper
         $path = PhocaGalleryPath::getPath();
         $origPath = $path->image_abs;
         $origPathServer = str_replace(DS, '/', $path->image_abs);
         //-----------------------------------------
         //Do all thumbnails no limit no pagination
         if (!empty($this->items_thumbnail)) {
             foreach ($this->items_thumbnail as $key => $value) {
                 $fileOriginalThumb = PhocaGalleryFile::getFileOriginal($value->filename);
                 //Let the user know that the file doesn't exists and delete all thumbnails
                 if (JFile::exists($fileOriginalThumb)) {
                     $refreshUrlThumb = 'index.php?option=com_phocagallery&view=phocagalleryimgs';
                     $fileThumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail($value->filename, $refreshUrlThumb, 1, 1, 1);
                 }
             }
         }
         $this->items_thumbnail = null;
         // delete data to reduce memory
         //Only the the site with limitation or pagination...
         if (!empty($this->items)) {
             foreach ($this->items as $key => $value) {
                 $fileOriginal = PhocaGalleryFile::getFileOriginal($value->filename);
                 //Let the user know that the file doesn't exists and delete all thumbnails
                 if (!JFile::exists($fileOriginal)) {
                     $this->items[$key]->filename = JText::_('COM_PHOCAGALLERY_IMG_FILE_NOT_EXISTS');
                     $this->items[$key]->fileoriginalexist = 0;
                 } else {
                     //Create thumbnails small, medium, large
                     $refresh_url = 'index.php?option=com_phocagallery&view=phocagalleryimgs';
                     $fileThumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail($value->filename, $refresh_url, 1, 1, 1);
                     $this->items[$key]->linkthumbnailpath = $fileThumb['thumb_name_s_no_rel'];
                     $this->items[$key]->fileoriginalexist = 1;
                 }
             }
         }
         //Clean Thumbs Folder if there are thumbnail files but not original file
         if ($clean_thumbnails == 1) {
             PhocaGalleryFileFolder::cleanThumbsFolder();
         }
     }
 }
开发者ID:01J,项目名称:skazkipronebo,代码行数:61,代码来源:view.html.php

示例9: display

 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     // PLUGIN WINDOW - we get information from plugin
     $get = '';
     $get['info'] = $app->input->get('info', '', 'string');
     $this->itemId = $app->input->get('Itemid', 0, 'int');
     $document = JFactory::getDocument();
     $this->params = $app->getParams();
     $this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0);
     $this->tmpl['customcss'] = $this->params->get('custom_css', '');
     // CSS
     PhocaGalleryRenderFront::renderAllCSS();
     // PARAMS - Open window parameters - modal popup box or standard popup window
     $this->tmpl['detailwindow'] = $this->params->get('detail_window', 0);
     // Plugin information
     if (isset($get['info']) && $get['info'] != '') {
         $this->tmpl['detailwindow'] = $get['info'];
     }
     // Close and Reload links (for different window types)
     $close = PhocaGalleryRenderFront::renderCloseReloadDetail($this->tmpl['detailwindow']);
     $detail_window_close = $close['detailwindowclose'];
     $detail_window_reload = $close['detailwindowreload'];
     // PARAMS - Display Description in Detail window - set the font color
     $this->tmpl['detailwindowbackgroundcolor'] = $this->params->get('detail_window_background_color', '#ffffff');
     $description_lightbox_font_color = $this->params->get('description_lightbox_font_color', '#ffffff');
     $description_lightbox_bg_color = $this->params->get('description_lightbox_bg_color', '#000000');
     $description_lightbox_font_size = $this->params->get('description_lightbox_font_size', 12);
     $this->tmpl['gallerymetakey'] = $this->params->get('gallery_metakey', '');
     $this->tmpl['gallerymetadesc'] = $this->params->get('gallery_metadesc', '');
     // NO SCROLLBAR IN DETAIL WINDOW
     /*		$document->addCustomTag( "<style type=\"text/css\"> \n" 
     			." html,body, .contentpane{overflow:hidden;background:".$this->tmpl['detailwindowbackgroundcolor'].";} \n" 
     			." center, table {background:".$this->tmpl['detailwindowbackgroundcolor'].";} \n" 
     			." #sbox-window {background-color:#fff;padding:5px} \n" 
     			." </style> \n");
     */
     // PARAMS - Get image height and width
     $this->tmpl['boxlargewidth'] = $this->params->get('front_modal_box_width', 680);
     $this->tmpl['boxlargeheight'] = $this->params->get('front_modal_box_height', 560);
     $front_popup_window_width = $this->tmpl['boxlargewidth'];
     //since version 2.2
     $front_popup_window_height = $this->tmpl['boxlargeheight'];
     //since version 2.2
     if ($this->tmpl['detailwindow'] == 1) {
         $this->tmpl['windowwidth'] = $front_popup_window_width;
         $this->tmpl['windowheight'] = $front_popup_window_height;
     } else {
         //modal popup window
         $this->tmpl['windowwidth'] = $this->tmpl['boxlargewidth'];
         $this->tmpl['windowheight'] = $this->tmpl['boxlargeheight'];
     }
     $this->tmpl['largemapwidth'] = (int) $this->tmpl['windowwidth'] - 20;
     $this->tmpl['largemapheight'] = (int) $this->tmpl['windowheight'] - 20;
     $this->tmpl['googlemapsapikey'] = $this->params->get('google_maps_api_key', '');
     $this->tmpl['exifinformation'] = $this->params->get('exif_information', 'FILE.FileName,FILE.FileDateTime,FILE.FileSize,FILE.MimeType,COMPUTED.Height,COMPUTED.Width,COMPUTED.IsColor,COMPUTED.ApertureFNumber,IFD0.Make,IFD0.Model,IFD0.Orientation,IFD0.XResolution,IFD0.YResolution,IFD0.ResolutionUnit,IFD0.Software,IFD0.DateTime,IFD0.Exif_IFD_Pointer,IFD0.GPS_IFD_Pointer,EXIF.ExposureTime,EXIF.FNumber,EXIF.ExposureProgram,EXIF.ISOSpeedRatings,EXIF.ExifVersion,EXIF.DateTimeOriginal,EXIF.DateTimeDigitized,EXIF.ShutterSpeedValue,EXIF.ApertureValue,EXIF.ExposureBiasValue,EXIF.MaxApertureValue,EXIF.MeteringMode,EXIF.LightSource,EXIF.Flash,EXIF.FocalLength,EXIF.SubSecTimeOriginal,EXIF.SubSecTimeDigitized,EXIF.ColorSpace,EXIF.ExifImageWidth,EXIF.ExifImageLength,EXIF.SensingMethod,EXIF.CustomRendered,EXIF.ExposureMode,EXIF.WhiteBalance,EXIF.DigitalZoomRatio,EXIF.FocalLengthIn35mmFilm,EXIF.SceneCaptureType,EXIF.GainControl,EXIF.Contrast,EXIF.Saturation,EXIF.Sharpness,EXIF.SubjectDistanceRange,GPS.GPSLatitudeRef,GPS.GPSLatitude,GPS.GPSLongitudeRef,GPS.GPSLongitude,GPS.GPSAltitudeRef,GPS.GPSAltitude,GPS.GPSTimeStamp,GPS.GPSStatus,GPS.GPSMapDatum,GPS.GPSDateStamp');
     // MODEL
     $model = $this->getModel();
     $info = $model->getData();
     // Back button
     $this->tmpl['backbutton'] = '';
     if ($this->tmpl['detailwindow'] == 7) {
         phocagalleryimport('phocagallery.image.image');
         $this->tmpl['backbutton'] = '<div><a href="' . JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $info->catslug . '&Itemid=' . $app->input->get('Itemid', 0, 'int')) . '"' . ' title="' . JText::_('COM_PHOCAGALLERY_BACK_TO_CATEGORY') . '">' . JHtml::_('image', 'media/com_phocagallery/images/icon-up-images.png', JText::_('COM_PHOCAGALLERY_BACK_TO_CATEGORY')) . '</a></div>';
     }
     // EXIF DATA
     $outputExif = '';
     $originalFile = '';
     $extImage = PhocaGalleryImage::isExtImage($info->extid);
     if ($extImage && isset($info->exto) && $info->exto != '') {
         $originalFile = $info->exto;
     } else {
         if (isset($info->filename)) {
             $originalFile = PhocaGalleryFile::getFileOriginal($info->filename);
         }
     }
     if ($originalFile != '' && function_exists('exif_read_data')) {
         $exif = @exif_read_data($originalFile, 'IFD0');
         if ($exif === false) {
             $outputExif .= JText::_('COM_PHOCAGALLERY_NO_HEADER_DATA_FOUND');
         }
         $setExif = $this->tmpl['exifinformation'];
         $setExifArray = explode(",", $setExif, 200);
         $exif = @exif_read_data($originalFile, 0, true);
         /*	$infoOutput = '';
         			foreach ($exif as $key => $section) {
         				foreach ($section as $name => $val) {
         					$infoOutput .= strtoupper($key.'.'.$name).'='.$name.'<br />';
         					$infoOutput .= $key.'.'.$name.';';
         				}
         			}*/
         $infoOutput = '';
         $i = 0;
         foreach ($setExifArray as $ks => $vs) {
             if ($i % 2 == 0) {
                 $class = 'class="first"';
             } else {
                 $class = 'class="second"';
             }
             if ($vs != '') {
//.........这里部分代码省略.........
开发者ID:naka211,项目名称:malerfirmaet,代码行数:101,代码来源:view.html.php

示例10: display


//.........这里部分代码省略.........
                        // by portraits in everycase (medium1 = medium * x2(height))
                    } else {
                        $m2 = mt_rand(0, 1);
                        if ($m2 == 1) {
                            $iFormat = 'medium1';
                        }
                    }
                }
                $this->items[$iS]->linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($this->items[$iS]->filename, $iFormat);
            }
            if (isset($parentCategory->params)) {
                $this->items[$iS]->parentcategoryparams = $parentCategory->params;
            }
            // SWITCH IMAGE - Add the first Image as basic image
            if ($this->tmpl['switch_image'] == 1) {
                if ($basic_imageSelected == 0) {
                    if ((int) $this->tmpl['switch_width'] > 0 && (int) $this->tmpl['switch_height'] > 0 && $this->tmpl['switch_fixed_size'] == 1) {
                        $wHArray = array('id' => 'PhocaGalleryobjectPicture', 'border' => '0', 'width' => $this->tmpl['switch_width'], 'height' => $this->tmpl['switch_height']);
                        $wHString = ' id="PhocaGalleryobjectPicture"  border="0" width="' . $this->tmpl['switch_width'] . '" height="' . $this->tmpl['switch_height'] . '"';
                    } else {
                        $wHArray = array('id' => 'PhocaGalleryobjectPicture', 'border' => '0');
                        $wHString = ' id="PhocaGalleryobjectPicture"  border="0"';
                    }
                    if (isset($this->items[$iS]->extpic) && $this->items[$iS]->extpic != '') {
                        $this->tmpl['basic_image'] = JHtml::_('image', $this->items[$iS]->extl, '', $wHArray);
                    } else {
                        $this->tmpl['basic_image'] = JHtml::_('image', str_replace('phoca_thumb_m_', 'phoca_thumb_l_', $this->items[$iS]->linkthumbnailpath), '', $wHString);
                    }
                    $basic_imageSelected = 1;
                }
            }
            $thumbLink = PhocaGalleryFileThumbnail::getThumbnailName($this->items[$iS]->filename, 'large');
            $thumbLinkM = PhocaGalleryFileThumbnail::getThumbnailName($this->items[$iS]->filename, 'medium');
            $imgLinkOrig = JURI::base(true) . '/' . PhocaGalleryFile::getFileOriginal($this->items[$iS]->filename, 1);
            if ($this->tmpl['detail_window'] == 7) {
                $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $this->items[$iS]->catslug . '&id=' . $this->items[$iS]->slug . '&Itemid=' . $this->itemId);
            } else {
                $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $this->items[$iS]->catslug . '&id=' . $this->items[$iS]->slug . '&tmpl=component' . '&Itemid=' . $this->itemId);
            }
            $imgLink = $thumbLink->rel;
            if ($extImage) {
                $imgLink = $this->items[$iS]->extl;
                $imgLinkOrig = $this->items[$iS]->exto;
            }
            // Detail Window
            if ($this->tmpl['detail_window'] == 2) {
                $this->items[$iS]->link = $imgLink;
                $this->items[$iS]->link2 = $imgLink;
                $this->items[$iS]->linkother = $imgLink;
                $this->items[$iS]->linkorig = $imgLinkOrig;
            } else {
                if ($this->tmpl['detail_window'] == 3) {
                    $this->items[$iS]->link = $imgLink;
                    $this->items[$iS]->link2 = $imgLink;
                    $this->items[$iS]->linkother = $siteLink;
                    $this->items[$iS]->linkorig = $imgLinkOrig;
                } else {
                    if ($this->tmpl['detail_window'] == 5) {
                        $this->items[$iS]->link = $imgLink;
                        $this->items[$iS]->link2 = $siteLink;
                        $this->items[$iS]->linkother = $siteLink;
                        $this->items[$iS]->linkorig = $imgLinkOrig;
                    } else {
                        if ($this->tmpl['detail_window'] == 6) {
                            $this->items[$iS]->link = $imgLink;
                            $this->items[$iS]->link2 = $imgLink;
开发者ID:scarsroga,项目名称:blog-soa,代码行数:67,代码来源:view.html.php

示例11: onPrepareContent


//.........这里部分代码省略.........
                            // PicLens CSS - will be loaded only one time per site
                            $libraries[$libName] = $library->getLibrary('pg-pl-piclens');
                            if ($libraries['pg-pl-piclens']->value == 0) {
                                $document->addScript('http://lite.piclens.com/current/piclens.js');
                                $document->addCustomTag("<style type=\"text/css\">\n" . " .mbf-item { display: none; }\n" . " #phocagallery .mbf-item { display: none; }\n" . " </style>\n");
                                $library->setLibrary('pg-pl-piclens', 1);
                            }
                        }
                        // END PICLENS -----------------------------------------------------------------------------
                        $image->slug = $image->id . '-' . $image->alias;
                        // Get file thumbnail or No Image
                        $image->linkthumbnailpath = PhocaGalleryImageFront::displayImageOrNoImage($image->filename, 'medium');
                        $file_thumbnail = PhocaGalleryFileThumbnail::getThumbnailName($image->filename, 'medium');
                        $image->linkthumbnailpathabs = $file_thumbnail->abs;
                        // -------------------------------------------------------------- SEF PROBLEM
                        // Is there a Itemid for category
                        $items = $menu->getItems('link', 'index.php?option=com_phocagallery&view=category&id=' . $category_info->id);
                        $itemscat = $menu->getItems('link', 'index.php?option=com_phocagallery&view=categories');
                        if (isset($itemscat[0])) {
                            $itemid = $itemscat[0]->id;
                            $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $category_info->slug . '&id=' . $image->slug . '&Itemid=' . $itemid . '&tmpl=component&detail=' . $detail_window . '&buttons=' . $detail_buttons);
                        } else {
                            if (isset($items[0])) {
                                $itemid = $items[0]->id;
                                $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $category_info->slug . '&id=' . $image->slug . '&Itemid=' . $itemid . '&tmpl=component&detail=' . $detail_window . '&buttons=' . $detail_buttons);
                            } else {
                                $itemid = 0;
                                $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $category_info->slug . '&id=' . $image->slug . '&tmpl=component&detail=' . $detail_window . '&buttons=' . $detail_buttons);
                            }
                        }
                        // ---------------------------------------------------------------------------------
                        // Different links for different actions: image, zoom icon, download icon
                        $thumbLink = PhocaGalleryFileThumbnail::getThumbnailName($image->filename, 'large');
                        $imgLinkOrig = JURI::base(true) . '/' . PhocaGalleryFile::getFileOriginal($image->filename, 1);
                        $imgLink = $thumbLink->rel;
                        if ($detail_window == 2) {
                            $image->link = $imgLink;
                            $image->link2 = $imgLink;
                            $image->linkother = $siteLink;
                            $image->linkorig = $imgLinkOrig;
                        } else {
                            if ($detail_window == 3) {
                                $image->link = $imgLink;
                                $image->link2 = $imgLink;
                                $image->linkother = $siteLink;
                                $image->linkorig = $imgLinkOrig;
                            } else {
                                if ($detail_window == 5) {
                                    $image->link = $imgLink;
                                    $image->link2 = $siteLink;
                                    $image->linkother = $siteLink;
                                    $image->linkorig = $imgLinkOrig;
                                } else {
                                    $image->link = $siteLink;
                                    $image->link2 = $siteLink;
                                    $image->linkother = $siteLink;
                                    $image->linkorig = $imgLinkOrig;
                                }
                            }
                        }
                        // Float
                        $float_code = '';
                        if ($float != '') {
                            $float_code = 'position:relative;float:' . $float . ';';
                        }
                        // Maximum size of module image is 100 x 100
开发者ID:planetangel,项目名称:Planet-Angel-Website,代码行数:67,代码来源:phocagallery.php

示例12: display


//.........这里部分代码省略.........
                if ($items[$iS]->exth != '') {
                    $exth = explode(',', $items[$iS]->exth);
                    $items[$iS]->exth = $exth[1];
                    $items[$iS]->exthswitch = $exth[0];
                }
                $items[$iS]->extpic = 1;
                $items[$iS]->linkthumbnailpath = '';
            } else {
                $items[$iS]->linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($items[$iS]->filename, 'medium');
            }
            if (isset($parentCategory->params)) {
                $items[$iS]->parentcategoryparams = $parentCategory->params;
            }
            // Add the first Image as basic image
            if ($this->tmpl['switchimage'] == 1) {
                if ($basicImageSelected == 0) {
                    if ((int) $this->tmpl['switchwidth'] > 0 && (int) $this->tmpl['switchheight'] > 0 && $this->tmpl['switchfixedsize'] == 1) {
                        $wHArray = array('id' => 'PhocaGalleryobjectPicture', 'border' => '0', 'width' => $this->tmpl['switchwidth'], 'height' => $this->tmpl['switchheight']);
                        $wHString = ' id="PhocaGalleryobjectPicture"  border="0" width="' . $this->tmpl['switchwidth'] . '" height="' . $this->tmpl['switchheight'] . '"';
                    } else {
                        $wHArray = array('id' => 'PhocaGalleryobjectPicture', 'border' => '0');
                        $wHString = ' id="PhocaGalleryobjectPicture"  border="0"';
                    }
                    if (isset($items[$iS]->extpic) && $items[$iS]->extpic != '') {
                        $this->tmpl['basicimage'] = JHtml::_('image', $items[$iS]->extl, '', $wHArray);
                    } else {
                        $this->tmpl['basicimage'] = JHtml::_('image', str_replace('phoca_thumb_m_', 'phoca_thumb_l_', $items[$iS]->linkthumbnailpath), '', $wHString);
                    }
                    $basicImageSelected = 1;
                }
            }
            $thumbLink = PhocaGalleryFileThumbnail::getThumbnailName($items[$iS]->filename, 'large');
            $thumbLinkM = PhocaGalleryFileThumbnail::getThumbnailName($items[$iS]->filename, 'medium');
            $imgLinkOrig = JURI::base(true) . '/' . PhocaGalleryFile::getFileOriginal($items[$iS]->filename, 1);
            if ($this->tmpl['detailwindow'] == 7) {
                $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $items[$iS]->catslug . '&id=' . $items[$iS]->slug . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int'));
            } else {
                $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $items[$iS]->catslug . '&id=' . $items[$iS]->slug . '&tmpl=component' . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int'));
            }
            $imgLink = $thumbLink->rel;
            if ($extImage) {
                $imgLink = $items[$iS]->extl;
                $imgLinkOrig = $items[$iS]->exto;
            }
            // Detail Window
            if ($this->tmpl['detailwindow'] == 2) {
                $items[$iS]->link = $imgLink;
                $items[$iS]->link2 = $imgLink;
                $items[$iS]->linkother = $imgLink;
                $items[$iS]->linkorig = $imgLinkOrig;
            } else {
                if ($this->tmpl['detailwindow'] == 3) {
                    $items[$iS]->link = $imgLink;
                    $items[$iS]->link2 = $imgLink;
                    $items[$iS]->linkother = $siteLink;
                    $items[$iS]->linkorig = $imgLinkOrig;
                } else {
                    if ($this->tmpl['detailwindow'] == 5) {
                        $items[$iS]->link = $imgLink;
                        $items[$iS]->link2 = $siteLink;
                        $items[$iS]->linkother = $siteLink;
                        $items[$iS]->linkorig = $imgLinkOrig;
                    } else {
                        if ($this->tmpl['detailwindow'] == 6) {
                            $items[$iS]->link = $imgLink;
                            $items[$iS]->link2 = $imgLink;
开发者ID:sansandeep143,项目名称:av,代码行数:67,代码来源:view.html.php

示例13: onContentPrepare


//.........这里部分代码省略.........
                         if ($plugin_type == 1) {
                             $image->exth = $exth[2];
                             //small
                         } else {
                             if ($plugin_type == 2) {
                                 $image->exth = $exth[0];
                                 //large
                             } else {
                                 $image->exth = $exth[1];
                                 //medium
                             }
                         }
                         $image->exthswitch = $exth[0];
                         //used for correcting switch
                     }
                     // - - - - - - - - -
                     $image->slug = $image->id . '-' . $image->alias;
                     // Get file thumbnail or No Image
                     $image->linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($image->filename, $imgSize);
                     $file_thumbnail = PhocaGalleryFileThumbnail::getThumbnailName($image->filename, $imgSize);
                     $image->linkthumbnailpathabs = $file_thumbnail->abs;
                     // ROUTE
                     //$siteLink = JRoute::_(PhocaGalleryRoute::getImageRoute($image->id, $image->catid, $image->alias, $image->catalias, 'detail', 'tmpl=component&detail='.$tmpl['detail_window'].'&buttons='.$detail_buttons );
                     // Different links for different actions: image, zoom icon, download icon
                     $thumbLink = PhocaGalleryFileThumbnail::getThumbnailName($image->filename, 'large');
                     $thumbLinkM = PhocaGalleryFileThumbnail::getThumbnailName($image->filename, 'medium');
                     // ROUTE
                     if ($tmpl['detail_window'] == 7) {
                         $suffix = 'detail=' . $tmpl['detail_window'] . '&buttons=' . $detail_buttons;
                     } else {
                         $suffix = 'tmpl=component&detail=' . $tmpl['detail_window'] . '&buttons=' . $detail_buttons;
                     }
                     $siteLink = JRoute::_(PhocaGalleryRoute::getImageRoute($image->id, $image->catid, $image->alias, $image->catalias, 'detail', $suffix));
                     $imgLinkOrig = JURI::base(true) . '/' . PhocaGalleryFile::getFileOriginal($image->filename, 1);
                     $imgLink = $thumbLink->rel;
                     if (isset($image->extid) && $image->extid != '') {
                         $imgLink = $image->extl;
                         $imgLinkOrig = $image->exto;
                     }
                     // Different Link - to all categories
                     if ((int) $tmpl['pluginlink'] == 2) {
                         $siteLink = $imgLinkOrig = $imgLink = PhocaGalleryRoute::getCategoriesRoute();
                     } else {
                         if ((int) $tmpl['pluginlink'] == 1) {
                             $siteLink = $imgLinkOrig = $imgLink = PhocaGalleryRoute::getCategoryRoute($image->catid, $image->catalias);
                         }
                     }
                     if ($tmpl['detail_window'] == 2) {
                         $image->link = $imgLink;
                         $image->link2 = $imgLink;
                         $image->linkother = $siteLink;
                         $image->linkorig = $imgLinkOrig;
                     } else {
                         if ($tmpl['detail_window'] == 3) {
                             $image->link = $imgLink;
                             $image->link2 = $imgLink;
                             $image->linkother = $siteLink;
                             $image->linkorig = $imgLinkOrig;
                         } else {
                             if ($tmpl['detail_window'] == 5) {
                                 $image->link = $imgLink;
                                 $image->link2 = $siteLink;
                                 $image->linkother = $siteLink;
                                 $image->linkorig = $imgLinkOrig;
                             } else {
                                 if ($tmpl['detail_window'] == 6) {
开发者ID:01J,项目名称:skazkipronebo,代码行数:67,代码来源:phocagallery.php

示例14: onContentPrepare


//.........这里部分代码省略.........
             $query = ' SELECT a.filename, cc.id as catid, cc.alias as catalias, a.extid, a.exts, a.extm, a.extl, a.exto, a.description,' . ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as catslug' . ' FROM #__phocagallery_categories AS cc' . ' LEFT JOIN #__phocagallery AS a ON a.catid = cc.id' . ' WHERE cc.published = 1' . ' AND a.published = 1' . ' AND cc.approved = 1' . ' AND a.approved = 1' . ' AND a.catid = ' . (int) $id . $imageOrdering;
             $db->setQuery($query);
             $images = $db->loadObjectList();
             // START OUTPUT
             $jsSlideshowData['files'] = '';
             $countImg = 0;
             $endComma = ',';
             $output = '';
             if (!empty($images)) {
                 $countFilename = count($images);
                 foreach ($images as $key => $value) {
                     $countImg++;
                     if ($countImg == $countFilename) {
                         $endComma = '';
                     }
                     if ($desc != 'none') {
                         $description = PhocaGalleryText::strTrimAll(addslashes($value->description));
                     } else {
                         $description = "";
                     }
                     switch ($image) {
                         case 'S':
                             $imageName = PhocaGalleryFileThumbnail::getThumbnailName($value->filename, 'small');
                             $imageName->ext = $value->exts;
                             $sizeString = 's';
                             break;
                         case 'M':
                             $imageName = PhocaGalleryFileThumbnail::getThumbnailName($value->filename, 'medium');
                             $imageName->ext = $value->extm;
                             $sizeString = 'm';
                             break;
                         case 'O':
                             $imageName = new stdClass();
                             $imageName->rel = PhocaGalleryFile::getFileOriginal($value->filename, 1);
                             $imageName->abs = PhocaGalleryFile::getFileOriginal($value->filename, 0);
                             $imageName->ext = $value->exto;
                             $sizeString = 'l';
                             break;
                         case 'L':
                         default:
                             $imageName = PhocaGalleryFileThumbnail::getThumbnailName($value->filename, 'large');
                             $imageName->ext = $value->extl;
                             $sizeString = 'l';
                             break;
                     }
                     if (isset($value->extl) && $value->extl != '') {
                         $jsSlideshowData['files'] .= '["' . $imageName->ext . '", "", "", "' . $description . '"]' . $endComma . "\n";
                     } else {
                         $imgLink = JURI::base(true) . '/' . $imageName->rel;
                         if (JFile::exists($imageName->abs)) {
                             $jsSlideshowData['files'] .= '["' . $imgLink . '", "", "", "' . $description . '"]' . $endComma . "\n";
                         } else {
                             $fileThumbnail = JURI::base(true) . '/' . "components/com_phocagallery/assets/images/phoca_thumb_" . $sizeString . "_no_image.png";
                             $jsSlideshowData['files'] .= '["' . $fileThumbnail . '", "", "", ""]' . $endComma . "\n";
                         }
                     }
                 }
                 //$script  = '<script type="text/javascript">' . "\n";
                 $script = '/***********************************************' . "\n";
                 $script .= '* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)' . "\n";
                 $script .= '* This notice MUST stay intact for legal use' . "\n";
                 $script .= '* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more' . "\n";
                 $script .= '***********************************************/' . "\n";
                 $script .= 'var phocagalleryplugin' . $c . ' = new fadeSlideShow({' . "\n";
                 $script .= ' wrapperid: "phocaGallerySlideshowP' . $c . '",' . "\n";
                 $script .= ' dimensions: [' . $width . ', ' . $height . '],' . "\n";
开发者ID:01J,项目名称:bealtine,代码行数:67,代码来源:phocagalleryslideshow.php

示例15: download

 public static function download($item, $backLink, $extLink = 0)
 {
     $app = JFactory::getApplication();
     if (empty($item)) {
         $msg = JText::_('COM_PHOCAGALLERY_ERROR_DOWNLOADING_FILE');
         $app->redirect($backLink, $msg);
         return false;
     } else {
         if ($extLink == 0) {
             phocagalleryimport('phocagallery.file.file');
             $fileOriginal = PhocaGalleryFile::getFileOriginal($item->filenameno);
             if (!JFile::exists($fileOriginal)) {
                 $msg = JText::_('COM_PHOCAGALLERY_ERROR_DOWNLOADING_FILE');
                 $app->redirect($backLink, $msg);
                 return false;
             }
             $fileToDownload = $item->filenameno;
             $fileNameToDownload = $item->filename;
         } else {
             $fileToDownload = $item->exto;
             $fileNameToDownload = $item->title;
             $fileOriginal = $item->exto;
         }
         // Clears file status cache
         clearstatcache();
         $fileOriginal = $fileOriginal;
         $fileSize = @filesize($fileOriginal);
         $mimeType = PhocaGalleryFile::getMimeType($fileToDownload);
         $fileName = $fileNameToDownload;
         if ($extLink > 0) {
             $content = '';
             if (function_exists('curl_init')) {
                 $ch = curl_init();
                 curl_setopt($ch, CURLOPT_URL, $fileOriginal);
                 curl_setopt($ch, CURLOPT_HEADER, 0);
                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                 $downloadedFile = fopen($fileName, 'w+');
                 curl_setopt($ch, CURLOPT_FILE, $downloadedFile);
                 $content = curl_exec($ch);
                 $fileSize = strlen($content);
                 curl_close($ch);
                 fclose($downloadedFile);
             }
             if ($content != '') {
                 // Clean the output buffer
                 ob_end_clean();
                 header("Cache-Control: public, must-revalidate");
                 header('Cache-Control: pre-check=0, post-check=0, max-age=0');
                 header("Pragma: no-cache");
                 header("Expires: 0");
                 header("Content-Description: File Transfer");
                 header("Expires: Sat, 30 Dec 1990 07:07:07 GMT");
                 header("Content-Type: " . (string) $mimeType);
                 header("Content-Length: " . (string) $fileSize);
                 header('Content-Disposition: attachment; filename="' . $fileName . '"');
                 header("Content-Transfer-Encoding: binary\n");
                 echo $content;
                 exit;
             }
         } else {
             // Clean the output buffer
             ob_end_clean();
             header("Cache-Control: public, must-revalidate");
             header('Cache-Control: pre-check=0, post-check=0, max-age=0');
             header("Pragma: no-cache");
             header("Expires: 0");
             header("Content-Description: File Transfer");
             header("Expires: Sat, 30 Dec 1990 07:07:07 GMT");
             header("Content-Type: " . (string) $mimeType);
             // Problem with IE
             if ($extLink == 0) {
                 header("Content-Length: " . (string) $fileSize);
             }
             header('Content-Disposition: attachment; filename="' . $fileName . '"');
             header("Content-Transfer-Encoding: binary\n");
             @readfile($fileOriginal);
             exit;
         }
     }
     return false;
 }
开发者ID:naka211,项目名称:malerfirmaet,代码行数:81,代码来源:filedownload.php


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