本文整理汇总了PHP中PhocaGalleryImage类的典型用法代码示例。如果您正苦于以下问题:PHP PhocaGalleryImage类的具体用法?PHP PhocaGalleryImage怎么用?PHP PhocaGalleryImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PhocaGalleryImage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _setFormatIcon
function _setFormatIcon()
{
if (empty($this->_formaticon)) {
phocagalleryimport('phocagallery.image.image');
$this->_formaticon = PhocaGalleryImage::getFormatIcon();
}
return true;
}
示例2: getFileSize
function getFileSize($filename, $readable = 1)
{
$path =& PhocaGalleryPath::getPath();
$fileNameAbs = JPath::clean($path->image_abs . $filename);
$formatIcon =& PhocaGalleryImage::getFormatIcon();
if (!JFile::exists($fileNameAbs)) {
$fileNameAbs = $path->image_abs_front . 'phoca_thumb_l_no_image.' . $formatIcon;
}
if ($readable == 1) {
return PhocaGalleryFile::getFileSizeReadable(filesize($fileNameAbs));
} else {
return filesize($fileNameAbs);
}
}
示例3: getImageSize
function getImageSize($filename, $returnString = 0, $extLink = 0)
{
phocagalleryimport('phocagallery.image.image');
phocagalleryimport('phocagallery.path.path');
if ($extLink == 1) {
$fileNameAbs = $filename;
} else {
$path =& PhocaGalleryPath::getPath();
$fileNameAbs = JPath::clean($path->image_abs . $filename);
$formatIcon =& PhocaGalleryImage::getFormatIcon();
if (!JFile::exists($fileNameAbs)) {
$fileNameAbs = $path->image_abs_front . 'phoca_thumb_l_no_image.' . $formatIcon;
}
}
if ($returnString == 1) {
$imageSize = @getimagesize($fileNameAbs);
return $imageSize[0] . ' x ' . $imageSize[1];
} else {
return @getimagesize($fileNameAbs);
}
}
示例4: foreach
}
echo '<div class="pg-multibox-username" style="padding-top: ' . $this->tmpl['useravatarmiddle'] . 'px;">' . $this->item->usernameno . '</div>';
echo '<div style="clear:both"></div>';
}
// Rating
if ($this->tmpl['mb_rating']) {
echo "\n";
echo $this->loadTemplate('rating');
echo "\n";
}
//Thumbnails
if ($this->tmpl['mb_thumbs']) {
if (!empty($this->tmpl['mb_thumbs_data'])) {
echo '<div class="pg-multibox-thumbs-box" style="width: ' . (int) $this->tmpl['multibox_thubms_box_width'] . 'px;">';
foreach ($this->tmpl['mb_thumbs_data'] as $k => $v) {
$extImage = PhocaGalleryImage::isExtImage($v->extid);
//$altValue = PhocaGalleryRenderFront::getAltValue($this->tmpl['altvalue'], $v->title, $v->description, $v->metadesc);
$altValue = '';
//Save resources - not necessary
if ($extImage) {
$img = JHtml::_('image', $v->exts, $altValue);
} else {
$linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($v->filename, 'small');
$img = JHtml::_('image', $linkthumbnailpath, $altValue);
}
if ($this->tmpl['detailwindow'] == 7) {
$tmplCom = '';
} else {
$tmplCom = '&tmpl=component';
}
echo '<div class="pg-multibox-thumbs-item"><a href="' . JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $v->catslug . '&id=' . $v->slug . $tmplCom . '&Itemid=' . $this->itemId) . '">';
示例5: display
//.........这里部分代码省略.........
// Seems we are in iframe
$this->tmpl['enable_multibox_iframe'] = 1;
}
// CSS
PhocaGalleryRenderFront::renderAllCSS();
if ($this->tmpl['gallerymetakey'] != '') {
$document->setMetaData('keywords', $this->tmpl['gallerymetakey']);
}
if ($this->tmpl['gallerymetadesc'] != '') {
$document->setMetaData('description', $this->tmpl['gallerymetadesc']);
}
// PARAMS - Open window parameters - modal popup box or standard popup window
$detail_window = $this->params->get('detail_window', 0);
// Plugin information
if (isset($get['comment']) && $get['comment'] != '') {
$detail_window = $get['comment'];
}
// Only registered (VOTES + COMMENTS)
$this->tmpl['not_registered'] = true;
$this->tmpl['name'] = '';
if ($access) {
$this->tmpl['not_registered'] = false;
$this->tmpl['name'] = $user->name;
}
$document->addScript(JURI::base(true) . '/media/com_phocagallery/js/comments.js');
$document->addCustomTag(PhocaGalleryRenderFront::renderCommentJS((int) $this->tmpl['maxcommentchar']));
$this->tmpl['already_commented'] = PhocaGalleryCommentImage::checkUserComment((int) $this->tmpl['id'], (int) $user->id);
$commentItem = PhocaGalleryCommentImage::displayComment((int) $this->tmpl['id']);
// PARAMS - Display Description in Detail window - set the font color
$this->tmpl['detailwindowbackgroundcolor'] = $this->params->get('detail_window_background_color', '#ffffff');
$this->tmpl['detailwindow'] = $this->params->get('detail_window', 0);
$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);
// NO SCROLLBAR IN DETAIL WINDOW
$document->addCustomTag("<style type=\"text/css\"> \n" . " html,body, .contentpane{background:" . $this->tmpl['detailwindowbackgroundcolor'] . ";text-align:left;} \n" . " center, table {background:" . $this->tmpl['detailwindowbackgroundcolor'] . ";} \n" . " #sbox-window {background-color:#fff;padding:5px} \n" . " </style> \n");
$model = $this->getModel();
$item = $model->getData();
$this->tmpl['imgtitle'] = $item->title;
// Back button
$this->tmpl['backbutton'] = '';
if ($this->tmpl['detailwindow'] == 7 || $this->tmpl['display_comment_nopup']) {
// Display Image
// Access check - don't display the image if you have no access to this image (if user add own url)
// USER RIGHT - ACCESS - - - - - - - - - -
$rightDisplay = 0;
if (!empty($item)) {
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $item->cataccessuserid, $item->cataccess, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0);
}
if ($rightDisplay == 0) {
$this->tmpl['pl'] = 'index.php?option=com_users&view=login&return=' . base64_encode($uri->toString());
$app->redirect(JRoute::_($this->tmpl['pl'], false), JText::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION'));
exit;
}
// - - - - - - - - - - - - - - - - - - - -
phocagalleryimport('phocagallery.image.image');
$this->tmpl['backbutton'] = '<div><a href="' . JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $this->tmpl['catid'] . '&Itemid=' . $this->itemId) . '"' . ' 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>';
// Get file thumbnail or No Image
$item->filenameno = $item->filename;
$item->filename = PhocaGalleryFile::getTitleFromFile($item->filename, 1);
$item->filesize = PhocaGalleryFile::getFileSize($item->filenameno);
$altValue = PhocaGalleryRenderFront::getAltValue($this->tmpl['altvalue'], $item->title, $item->description, $item->metadesc);
$item->altvalue = $altValue;
$realImageSize = '';
$extImage = PhocaGalleryImage::isExtImage($item->extid);
if ($extImage) {
$item->extl = $item->extl;
$item->exto = $item->exto;
$realImageSize = PhocaGalleryImage::getRealImageSize($item->extl, '', 1);
$item->imagesize = PhocaGalleryImage::getImageSize($item->exto, 1, 1);
if ($item->extw != '') {
$extw = explode(',', $item->extw);
$item->extw = $extw[0];
}
$correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($item->extw, $item->exth, $this->tmpl['picasa_correct_width_l'], $this->tmpl['picasa_correct_height_l']);
$item->linkimage = JHtml::_('image', $item->extl, $item->altvalue, array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height']));
$item->realimagewidth = $correctImageRes['width'];
$item->realimageheight = $correctImageRes['height'];
} else {
$item->linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($item->filenameno, 'large');
$item->linkimage = JHtml::_('image', $item->linkthumbnailpath, $item->altvalue);
$realImageSize = PhocaGalleryImage::getRealImageSize($item->filenameno);
$item->imagesize = PhocaGalleryImage::getImageSize($item->filenameno, 1);
if (isset($realImageSize['w']) && isset($realImageSize['h'])) {
$item->realimagewidth = $realImageSize['w'];
$item->realimageheight = $realImageSize['h'];
} else {
$item->realimagewidth = $this->tmpl['largewidth'];
$item->realimageheight = $this->tmpl['largeheight'];
}
}
$this->assignRef('item', $item);
}
// ACTION
$this->assignRef('item', $item);
$this->tmpl['action'] = $uri->toString();
$this->assignRef('commentitem', $commentItem);
$this->_prepareDocument($item);
parent::display($tpl);
}
示例6: display
function display($tpl = null)
{
$app = JFactory::getApplication();
$document =& JFactory::getDocument();
$uri =& JFactory::getURI();
$menus =& JSite::getMenu();
$menu = $menus->getActive();
$this->params =& $app->getParams();
$user =& JFactory::getUser();
$path = PhocaGalleryPath::getPath();
$neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels();
$access = PhocaGalleryAccess::isAccess($user->authorisedLevels(), $neededAccessLevels);
$this->tmpl['fi'] = PhocaGalleryImage::getFormatIcon();
$this->tmpl['pi'] = 'components/com_phocagallery/assets/images/';
$this->tmpl['pp'] = 'index.php?option=com_phocagallery&view=user&controller=user';
$this->tmpl['pl'] = 'index.php?option=com_users&view=login&return=' . base64_encode($this->tmpl['pp'] . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int'));
// LIBRARY
$library =& PhocaGalleryLibrary::getLibrary();
$libraries['pg-css-ie'] = $library->getLibrary('pg-css-ie');
// Only registered users
if (!$access) {
$app->redirect(JRoute::_($this->tmpl['pl'], false), JText::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION'));
exit;
}
$this->tmpl['gallerymetakey'] = $this->params->get('gallery_metakey', '');
$this->tmpl['gallerymetadesc'] = $this->params->get('gallery_metadesc', '');
if ($this->tmpl['gallerymetakey'] != '') {
$document->setMetaData('keywords', $this->tmpl['gallerymetakey']);
}
if ($this->tmpl['gallerymetadesc'] != '') {
$document->setMetaData('description', $this->tmpl['gallerymetadesc']);
}
$this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0);
$this->tmpl['customcss'] = $this->params->get('custom_css', '');
// CSS
JHtml::stylesheet('components/com_phocagallery/assets/phocagallery.css');
if ($this->tmpl['enablecustomcss'] == 1) {
JHtml::stylesheet('components/com_phocagallery/assets/phocagallerycustom.css');
PhocaGalleryRenderFront::displayCustomCSS($this->tmpl['customcss']);
} else {
if ($libraries['pg-css-ie']->value == 0) {
$document->addCustomTag("<!--[if lt IE 8]>\n<link rel=\"stylesheet\" href=\"" . JURI::base(true) . "/components/com_phocagallery/assets/phocagalleryieall.css\" type=\"text/css\" />\n<![endif]-->");
$library->setLibrary('pg-css-ie', 1);
}
}
// = = = = = = = = = = =
// PANE
// = = = = = = = = = = =
// - - - - - - - - - -
// ALL TABS
// - - - - - - - - - -
// UCP is disabled (security reasons)
if ((int) $this->params->get('enable_user_cp', 0) == 0) {
$app->redirect(JURI::base(true), JText::_('COM_PHOCAGALLERY_UCP_DISABLED'));
exit;
}
$this->tmpl['tab'] = JRequest::getVar('tab', 0, '', 'string');
$this->tmpl['maxuploadchar'] = $this->params->get('max_upload_char', 1000);
$this->tmpl['maxcreatecatchar'] = $this->params->get('max_create_cat_char', 1000);
$this->tmpl['dp'] = PhocaGalleryRenderInfo::getPhocaIc((int) $this->params->get('display_phoca_info', 1));
$this->tmpl['showpageheading'] = $this->params->get('show_page_heading', 1);
$this->tmpl['javaboxwidth'] = $this->params->get('java_box_width', 480);
$this->tmpl['javaboxheight'] = $this->params->get('java_box_height', 480);
$this->tmpl['enableuploadavatar'] = $this->params->get('enable_upload_avatar', 1);
$this->tmpl['uploadmaxsize'] = $this->params->get('upload_maxsize', 3145728);
$this->tmpl['uploadmaxsizeread'] = PhocaGalleryFile::getFileSizeReadable($this->tmpl['uploadmaxsize']);
$this->tmpl['uploadmaxreswidth'] = $this->params->get('upload_maxres_width', 3072);
$this->tmpl['uploadmaxresheight'] = $this->params->get('upload_maxres_height', 2304);
$this->tmpl['multipleuploadchunk'] = $this->params->get('multiple_upload_chunk', 0);
$this->tmpl['displaytitleupload'] = $this->params->get('display_title_upload', 0);
$this->tmpl['displaydescupload'] = $this->params->get('display_description_upload', 0);
$this->tmpl['enablejava'] = $this->params->get('enable_java', 0);
$this->tmpl['enablemultiple'] = $this->params->get('enable_multiple', 0);
$this->tmpl['ytbupload'] = $this->params->get('youtube_upload', 0);
$this->tmpl['multipleuploadmethod'] = $this->params->get('multiple_upload_method', 1);
$this->tmpl['multipleresizewidth'] = $this->params->get('multiple_resize_width', -1);
$this->tmpl['multipleresizeheight'] = $this->params->get('multiple_resize_height', -1);
$this->tmpl['usersubcatcount'] = $this->params->get('user_subcat_count', 5);
$this->tmpl['userimagesmaxspace'] = $this->params->get('user_images_max_size', 20971520);
$this->tmpl['iepx'] = '<div style="font-size:1px;height:1px;margin:0px;padding:0px;"> </div>';
//Subcateogry
$this->tmpl['parentid'] = JRequest::getVar('parentcategoryid', 0, 'post', 'int');
$document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/comments.js');
$document->addCustomTag(PhocaGalleryRenderFront::renderOnUploadJS());
$document->addCustomTag(PhocaGalleryRenderFront::renderDescriptionCreateCatJS((int) $this->tmpl['maxcreatecatchar']));
$document->addCustomTag(PhocaGalleryRenderFront::userTabOrdering());
// SubCategory + Image
$document->addCustomTag(PhocaGalleryRenderFront::renderDescriptionCreateSubCatJS((int) $this->tmpl['maxcreatecatchar']));
$document->addCustomTag(PhocaGalleryRenderFront::saveOrderUserJS());
$model = $this->getModel('user');
$ownerMainCategory = $model->getOwnerMainCategory($user->id);
$this->tmpl['usertab'] = 1;
$this->tmpl['createcategory'] = 1;
$this->tmpl['createsubcategory'] = 1;
$this->tmpl['images'] = 1;
$this->tmpl['displayupload'] = 1;
// Tabs
$displayTabs = 0;
if ((int) $this->tmpl['usertab'] == 0) {
$currentTab['user'] = -1;
//.........这里部分代码省略.........
示例7: display
function display($tpl = null)
{
$app = JFactory::getApplication();
$document =& JFactory::getDocument();
$this->params =& $app->getParams();
// PLUGIN WINDOW - we get information from plugin
$get = '';
$get['map'] = JRequest::getVar('map', '', 'get', 'string');
// Multibox
$get['mapwidth'] = JRequest::getVar('mapwidth', '', 'get', 'string');
$get['mapheight'] = JRequest::getVar('mapheight', '', 'get', 'string');
$this->tmpl['enable_multibox'] = $this->params->get('enable_multibox', 0);
$this->tmpl['enable_multibox_iframe'] = 0;
if ($get['mapwidth'] != '') {
// Seems we are in iframe
$this->tmpl['enable_multibox_iframe'] = 1;
}
$this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0);
$this->tmpl['customcss'] = $this->params->get('custom_css', '');
// CSS
JHtml::stylesheet('components/com_phocagallery/assets/phocagallery.css');
if ($this->tmpl['enablecustomcss'] == 1) {
JHtml::stylesheet('components/com_phocagallery/assets/phocagallerycustom.css');
PhocaGalleryRenderFront::displayCustomCSS($this->tmpl['customcss']);
}
// 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['map']) && $get['map'] != '') {
$this->tmpl['detailwindow'] = $get['map'];
}
// 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['detailwindow'] = $this->params->get('detail_window', 0);
$this->tmpl['detailwindowbackgroundcolor'] = $this->params->get('detail_window_background_color', '#ffffff');
$this->tmpl['pgl'] = PhocaGalleryRenderInfo::getPhocaIc((int) $this->params->get('display_phoca_info', 1));
$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', '');
if ($this->tmpl['gallerymetakey'] != '') {
$document->setMetaData('keywords', $this->tmpl['gallerymetakey']);
}
if ($this->tmpl['gallerymetadesc'] != '') {
$document->setMetaData('description', $this->tmpl['gallerymetadesc']);
}
// NO SCROLLBAR IN DETAIL WINDOW
if ($this->tmpl['detailwindow'] == 7) {
} else {
$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['largemapwidth'] = (int) $this->params->get('front_modal_box_width', 680) - 20;
$this->tmpl['largemapheight'] = (int) $this->params->get('front_modal_box_height', 560) - 20;
// Multibox
if (isset($get['mapwidth']) && $get['mapwidth'] != '') {
$this->tmpl['largemapwidth'] = $get['mapwidth'];
}
if (isset($get['mapheight']) && $get['mapheight'] != '') {
$this->tmpl['largemapheight'] = $get['mapheight'];
}
// $this->tmpl['googlemapsapikey'] = $this->params->get( 'google_maps_api_key', '' );
// MODEL
$model =& $this->getModel();
$map = $model->getData();
phocagalleryimport('phocagallery.image.imagefront');
if (!empty($map)) {
if (isset($map->filename) && $map->filename != '') {
$file_thumbnail = PhocaGalleryImageFront::displayCategoryImageOrNoImage($map->filename, 'small');
$map->thumbnail = $file_thumbnail;
} else {
$map->thumbnail = '';
}
if (isset($map->latitude) && $map->latitude != '' && $map->latitude != 0 && isset($map->longitude) && $map->longitude != '' && $map->longitude != 0) {
} else {
$map->longitude = '';
$map->latitude = '';
$map->zoom = 2;
$map->geotitle = '';
}
}
// Second try to get category data
if (empty($map) || $map->longitude == '' && $map->latitude == '' && $map->geotitle == '') {
$map = $model->getDataCategory();
if (!empty($map)) {
if (isset($map->latitude) && $map->latitude != '' && $map->latitude != 0 && isset($map->longitude) && $map->longitude != '' && $map->longitude != 0) {
$map->thumbnail = '';
if ($map->geotitle == '') {
$map->geotitle = $map->title;
}
} else {
$map->longitude = '';
$map->latitude = '';
$map->zoom = 2;
$map->geotitle = '';
}
//.........这里部分代码省略.........
示例8: onPrepareContent
//.........这里部分代码省略.........
$imageBg = $mediumCSS;
$imgCatSizeHelper = 5;
break;
case 'smallshadow':
$imageBg = $smallCSS;
$imgCatSizeHelper = 4;
break;
case 'mediumfolder':
$imageBg = '';
$imgCatSizeHelper = 3;
break;
case 'smallfolder':
default:
$imageBg = '';
$imgCatSizeHelper = 2;
break;
case 'medium':
$imageBg = '';
$imgCatSizeHelper = 1;
break;
case 'small':
default:
$imageBg = '';
$imgCatSizeHelper = 0;
break;
}
// Display Key Icon (in case we want to display unaccessable categories in list view)
$rightDisplayKey = 1;
// we simulate that we want not to display unaccessable categories
// so we get rightDisplayKey = 0 then the key will be displayed
if (isset($category)) {
$rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $category->accessuserid, $category->access, $user->get('aid', 0), $user->get('id', 0), 0);
}
$file_thumbnail = PhocaGalleryImageFront::displayCategoriesImageOrFolder($category->filename, $imgCatSizeHelper, $rightDisplayKey);
$category->linkthumbnailpath = $file_thumbnail->rel;
//Output
$output .= '<tr>' . '<td align="center" valign="middle" style="' . $imageBg . '"><a href="' . $category->link . '">' . '<img src="' . $category->linkthumbnailpath . '" alt="' . $category->title . '" style="border:0" />' . '</a></td>' . '<td><a href="' . $category->link . '" class="category' . $params->get('pageclass_sfx') . '">' . $category->title . '</a> ' . '<span class="small">(' . $category->numlinks . ')</span></td>' . '</tr>';
}
$output .= '</table>';
} else {
$output .= '<ul>';
foreach ($data_outcome_array as $category) {
// -------------------------------------------------------------- SEF PROBLEM
// Is there a Itemid for category
$items = $menu->getItems('link', 'index.php?option=com_phocagallery&view=category&id=' . $category->id);
$itemscat = $menu->getItems('link', 'index.php?option=com_phocagallery&view=categories');
if (isset($itemscat[0])) {
$itemid = $itemscat[0]->id;
$category->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $category->slug . '&Itemid=' . $itemid);
} else {
if (isset($items[0])) {
$itemid = $items[0]->id;
$category->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $category->slug . '&Itemid=' . $itemid);
} else {
$itemid = 0;
$category->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $category->slug);
}
}
// ---------------------------------------------------------------------------------
$output .= '<li>' . '<a href="' . $category->link . '" class="category' . $params->get('pageclass_sfx') . '">' . $category->title . '</a> <span class="small">(' . $category->numlinks . ')</span>' . '</li>';
}
$output .= '</ul>';
}
}
//-----------------------
// DISPLAYING OF IMAGES
示例9: rotateImage
public static function rotateImage($thumbName, $size, $angle = 90, &$errorMsg)
{
$params = JComponentHelper::getParams('com_phocagallery');
$jfile_thumbs = $params->get('jfile_thumbs', 1);
$jpeg_quality = $params->get('jpeg_quality', 85);
$jpeg_quality = PhocaGalleryImage::getJpegQuality($jpeg_quality);
// Try to change the size
$memory = 8;
$memoryLimitChanged = 0;
$memory = (int) ini_get('memory_limit');
if ($memory == 0) {
$memory = 8;
}
$fileIn = $thumbName->abs;
$fileOut = $thumbName->abs;
if ($fileIn !== '' && file_exists($fileIn)) {
//array of width, height, IMAGETYPE, "height=x width=x" (string)
list($w, $h, $type) = GetImageSize($fileIn);
// we got the info from GetImageSize
if ($w > 0 && $h > 0 && $type != '') {
// Change the $w against $h because of rotating
$src = array(0, 0, $w, $h);
$dst = array(0, 0, $h, $w);
} else {
$errorMsg = 'ErrorWorHorType';
return false;
}
// Try to increase memory
if ($memory < 50) {
ini_set('memory_limit', '50M');
$memoryLimitChanged = 1;
}
switch ($type) {
case IMAGETYPE_JPEG:
if (!function_exists('ImageCreateFromJPEG')) {
$errorMsg = 'ErrorNoJPGFunction';
return false;
}
//$image1 = ImageCreateFromJPEG($fileIn);
try {
$image1 = ImageCreateFromJPEG($fileIn);
} catch (\Exception $exception) {
$errorMsg = 'ErrorJPGFunction';
return false;
}
break;
case IMAGETYPE_PNG:
if (!function_exists('ImageCreateFromPNG')) {
$errorMsg = 'ErrorNoPNGFunction';
return false;
}
//$image1 = ImageCreateFromPNG($fileIn);
try {
$image1 = ImageCreateFromPNG($fileIn);
} catch (\Exception $exception) {
$errorMsg = 'ErrorPNGFunction';
return false;
}
break;
case IMAGETYPE_GIF:
if (!function_exists('ImageCreateFromGIF')) {
$errorMsg = 'ErrorNoGIFFunction';
return false;
}
//$image1 = ImageCreateFromGIF($fileIn);
try {
$image1 = ImageCreateFromGIF($fileIn);
} catch (\Exception $exception) {
$errorMsg = 'ErrorGIFFunction';
return false;
}
break;
case IMAGETYPE_WBMP:
if (!function_exists('ImageCreateFromWBMP')) {
$errorMsg = 'ErrorNoWBMPFunction';
return false;
}
//$image1 = ImageCreateFromWBMP($fileIn);
try {
$image1 = ImageCreateFromWBMP($fileIn);
} catch (\Exception $exception) {
$errorMsg = 'ErrorWBMPFunction';
return false;
}
break;
default:
$errorMsg = 'ErrorNotSupportedImage';
return false;
break;
}
if ($image1) {
// Building image for ROTATING
/* $image2 = @ImageCreateTruecolor($dst[2], $dst[3]);
if (!$image2) {
return 'ErrorNoImageCreateTruecolor';
}*/
/* if(!function_exists("imagerotate")) {
$errorMsg = 'ErrorNoImageRotate';
return false;
}*/
//.........这里部分代码省略.........
示例10: 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 != '') {
//.........这里部分代码省略.........
示例11: display
public function display($tpl = null)
{
$document =& JFactory::getDocument();
JHTML::stylesheet('administrator/components/com_phocagallery/assets/phocagallery.css');
JHTML::stylesheet('administrator/components/com_phocagallery/assets/jcp/picker.css');
$document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/jcp/picker.js');
$this->require_ftp = JClientHelper::setCredentialsFromRequest('ftp');
if ($this->themeName()) {
$this->theme_name = $this->themeName();
}
// Background Image
$params = JComponentHelper::getParams('com_phocagallery');
$this->tmpl['formaticon'] = PhocaGalleryImage::getFormatIcon();
// Small
$this->tmpl['siw'] = $params->get('small_image_width', 50);
$this->tmpl['sih'] = $params->get('small_image_height', 50);
//After creating an image (post with data);
$this->tmpl['ssbgc'] = JRequest::getVar('ssbgc', '', '', 'string');
$this->tmpl['sibgc'] = JRequest::getVar('sibgc', '', '', 'string');
$this->tmpl['sibrdc'] = JRequest::getVar('sibrdc', '', '', 'string');
$this->tmpl['sie'] = JRequest::getVar('sie', '', '', 'int');
$this->tmpl['siec'] = JRequest::getVar('siec', '', '', 'string');
$siw = JRequest::getVar('siw', '', '', 'int');
$sih = JRequest::getVar('sih', '', '', 'int');
$this->tmpl['ssbgc'] = PhocaGalleryUtils::filterInput($this->tmpl['ssbgc']);
$this->tmpl['sibgc'] = PhocaGalleryUtils::filterInput($this->tmpl['sibgc']);
$this->tmpl['sibrdc'] = PhocaGalleryUtils::filterInput($this->tmpl['sibrdc']);
$this->tmpl['siec'] = PhocaGalleryUtils::filterInput($this->tmpl['siec']);
if ($this->tmpl['ssbgc'] != '') {
$this->tmpl['ssbgc'] = '#' . $this->tmpl['ssbgc'];
}
if ($this->tmpl['sibgc'] != '') {
$this->tmpl['sibgc'] = '#' . $this->tmpl['sibgc'];
}
if ($this->tmpl['sibrdc'] != '') {
$this->tmpl['sibrdc'] = '#' . $this->tmpl['sibrdc'];
}
if ($this->tmpl['siec'] != '') {
$this->tmpl['siec'] = '#' . $this->tmpl['siec'];
}
if ((int) $siw > 0) {
$this->tmpl['siw'] = (int) $siw;
}
if ((int) $sih > 0) {
$this->tmpl['sih'] = (int) $sih;
}
// Medium
$this->tmpl['miw'] = $params->get('medium_image_width', 100);
$this->tmpl['mih'] = $params->get('medium_image_height', 100);
//After creating an image (post with data);
$this->tmpl['msbgc'] = JRequest::getVar('msbgc', '', '', 'string');
$this->tmpl['mibgc'] = JRequest::getVar('mibgc', '', '', 'string');
$this->tmpl['mibrdc'] = JRequest::getVar('mibrdc', '', '', 'string');
$this->tmpl['mie'] = JRequest::getVar('mie', '', '', 'int');
$this->tmpl['miec'] = JRequest::getVar('miec', '', '', 'string');
$miw = JRequest::getVar('miw', '', '', 'int');
$mih = JRequest::getVar('mih', '', '', 'int');
$this->tmpl['msbgc'] = PhocaGalleryUtils::filterInput($this->tmpl['msbgc']);
$this->tmpl['mibgc'] = PhocaGalleryUtils::filterInput($this->tmpl['mibgc']);
$this->tmpl['mibrdc'] = PhocaGalleryUtils::filterInput($this->tmpl['mibrdc']);
$this->tmpl['miec'] = PhocaGalleryUtils::filterInput($this->tmpl['miec']);
if ($this->tmpl['msbgc'] != '') {
$this->tmpl['msbgc'] = '#' . $this->tmpl['msbgc'];
}
if ($this->tmpl['mibgc'] != '') {
$this->tmpl['mibgc'] = '#' . $this->tmpl['mibgc'];
}
if ($this->tmpl['mibrdc'] != '') {
$this->tmpl['mibrdc'] = '#' . $this->tmpl['mibrdc'];
}
if ($this->tmpl['miec'] != '') {
$this->tmpl['miec'] = '#' . $this->tmpl['miec'];
}
if ((int) $miw > 0) {
$this->tmpl['miw'] = (int) $miw;
}
if ((int) $mih > 0) {
$this->tmpl['mih'] = (int) $mih;
}
$this->addToolbar();
parent::display($tpl);
}
示例12: preg_match
// Categories View in Category View
if ($this->tmpl['display_categories_cv']) {
echo $this->loadTemplate('categories');
}
echo $this->loadTemplate('images');
echo '<div class="ph-cb"></div><div> </div>';
echo $this->loadTemplate('pagination');
echo '</div>' . "\n";
} else {
// Standard category displaying
$this->checkRights = 0;
// Switch image
$noBaseImg = false;
$noBaseImg = preg_match("/phoca_thumb_l_no_image/i", $this->tmpl['basic_image']);
if ($this->tmpl['switch_image'] == 1 && $noBaseImg == false) {
$switchImage = PhocaGalleryImage::correctSwitchSize($this->tmpl['switch_height'], $this->tmpl['switch_width']);
echo '<div class="main-switch-image"><center>' . '<table border="0" cellspacing="5" cellpadding="5" class="main-switch-image-table">' . '<tr>' . '<td align="center" valign="middle" style="text-align:center;' . 'width: ' . $switchImage['width'] . 'px;' . 'height: ' . $switchImage['height'] . 'px;' . 'background: url(\'' . $this->tmpl['wait_image'] . '\') ' . $switchImage['centerw'] . 'px ' . $switchImage['centerh'] . 'px no-repeat;margin:0px;padding:0px;">' . $this->tmpl['basic_image'] . '</td>' . '</tr></table></center></div>' . "\n";
}
// Categories View in Category View
if ($this->tmpl['display_categories_cv']) {
echo $this->loadTemplate('categories');
}
// Rendering images
echo $this->loadTemplate('images');
echo '<div class="ph-cb"> </div>';
echo $this->loadTemplate('pagination');
if ($this->tmpl['displaytabs'] > 0) {
echo '<div id="phocagallery-pane">';
echo JHtml::_('tabs.start', 'config-tabs-com_phocagallery-category', array('useCookie' => 1, 'startOffset' => $this->tmpl['tab']));
if ((int) $this->tmpl['display_rating'] == 1) {
echo JHtml::_('tabs.panel', JHtml::_('image', 'media/com_phocagallery/images/icon-vote.png', '') . ' ' . JText::_('COM_PHOCAGALLERY_RATING'), 'pgvotes');
示例13: orderDownIcon
function orderDownIcon($i, $n, $condition = true, $task = '#', $alt = 'COM_PHOCAGALLERY_MOVE_DOWN', $enabled = true)
{
$formatIcon = PhocaGalleryImage::getFormatIcon();
$alt = JText::_($alt);
$html = ' ';
if (($i < $n - 1 || $i + $this->limitstart < $this->total - 1) && $condition) {
if ($enabled) {
$html = '<a href="' . $task . '" title="' . $alt . '">';
$html .= ' <img src="' . JURI::base(true) . '/components/com_phocagallery/assets/images/icon-downarrow.' . $formatIcon . '" width="16" height="16" border="0" alt="' . $alt . '" />';
$html .= '</a>';
} else {
$html = '<img src="' . JURI::base(true) . '/components/com_phocagallery/assets/images/icon-downarrow0.' . $formatIcon . '" width="16" height="16" border="0" alt="' . $alt . '" />';
}
}
return $html;
}
示例14: imageMagic
/**
* need GD library (first PHP line WIN: dl("php_gd.dll"); UNIX: dl("gd.so");
* www.boutell.com/gd/
* interval.cz/clanky/php-skript-pro-generovani-galerie-obrazku-2/
* cz.php.net/imagecopyresampled
* www.linuxsoft.cz/sw_detail.php?id_item=871
* www.webtip.cz/art/wt_tech_php/liquid_ir.html
* php.vrana.cz/zmensovani-obrazku.php
* diskuse.jakpsatweb.cz/
*
* @param string $fileIn Vstupni soubor (mel by existovat)
* @param string $fileOut Vystupni soubor, null ho jenom zobrazi (taky kdyz nema pravo se zapsat :)
* @param int $width Vysledna sirka (maximalni)
* @param int $height Vysledna vyska (maximalni)
* @param bool $crop Orez (true, obrazek bude presne tak velky), jinak jenom Resample (udane maximalni rozmery)
* @param int $typeOut IMAGETYPE_type vystupniho obrazku
* @return bool Chyba kdyz vrati false
*/
public static function imageMagic($fileIn, $fileOut = null, $width = null, $height = null, $crop = null, $typeOut = null, $watermarkParams = array(), $frontUpload = 0, &$errorMsg)
{
$params = JComponentHelper::getParams('com_phocagallery');
$jfile_thumbs = $params->get('jfile_thumbs', 1);
$jpeg_quality = $params->get('jpeg_quality', 85);
$jpeg_quality = PhocaGalleryImage::getJpegQuality($jpeg_quality);
$fileWatermark = '';
// While front upload we don't display the process page
if ($frontUpload == 0) {
$stopText = PhocaGalleryRenderProcess::displayStopThumbnailsCreating('processpage');
echo $stopText;
}
// Memory - - - - - - - -
$memory = 8;
$memoryLimitChanged = 0;
$memory = (int) ini_get('memory_limit');
if ($memory == 0) {
$memory = 8;
}
// - - - - - - - - - - -
if ($fileIn !== '' && JFile::exists($fileIn)) {
// array of width, height, IMAGETYPE, "height=x width=x" (string)
list($w, $h, $type) = GetImageSize($fileIn);
if ($w > 0 && $h > 0) {
// we got the info from GetImageSize
// size of the image
if ($width == null || $width == 0) {
// no width added
$width = $w;
} else {
if ($height == null || $height == 0) {
// no height, adding the same as width
$height = $width;
}
}
if ($height == null || $height == 0) {
// no height, no width
$height = $h;
}
// miniaturizing
if (!$crop) {
// new size - nw, nh (new width/height)
$scale = $width / $w < $height / $h ? $width / $w : $height / $h;
// smaller rate
$src = array(0, 0, $w, $h);
$dst = array(0, 0, floor($w * $scale), floor($h * $scale));
} else {
// will be cropped
$scale = $width / $w > $height / $h ? $width / $w : $height / $h;
// greater rate
$newW = $width / $scale;
// check the size of in file
$newH = $height / $scale;
// which side is larger (rounding error)
if ($w - $newW > $h - $newH) {
$src = array(floor(($w - $newW) / 2), 0, floor($newW), $h);
} else {
$src = array(0, floor(($h - $newH) / 2), $w, floor($newH));
}
$dst = array(0, 0, floor($width), floor($height));
}
// Watermark - - - - - - - - - - -
if (!empty($watermarkParams) && ($watermarkParams['create'] == 1 || $watermarkParams['create'] == 2)) {
$thumbnailSmall = false;
$thumbnailMedium = false;
$thumbnailLarge = false;
$thumbnailMedium = preg_match("/phoca_thumb_m_/i", $fileOut);
$thumbnailLarge = preg_match("/phoca_thumb_l_/i", $fileOut);
$path = PhocaGalleryPath::getPath();
$fileName = PhocaGalleryFile::getTitleFromFile($fileIn, 1);
// Which Watermark will be used
// If watermark is in current directory use it else use Default
$fileWatermarkMedium = str_replace($fileName, 'watermark-medium.png', $fileIn);
$fileWatermarkLarge = str_replace($fileName, 'watermark-large.png', $fileIn);
clearstatcache();
// Which Watermark will be used
if ($thumbnailMedium) {
if (JFile::exists($fileWatermarkMedium)) {
$fileWatermark = $fileWatermarkMedium;
} else {
if ($watermarkParams['create'] == 2) {
$fileWatermark = $path->image_abs . 'watermark-medium.png';
//.........这里部分代码省略.........
示例15: _singleFileUploadAvatar
function _singleFileUploadAvatar(&$errUploadMsg, $file, &$redirectUrl)
{
$app = JFactory::getApplication();
JRequest::checkToken('request') or jexit('Invalid Token');
jimport('joomla.client.helper');
$ftp =& JClientHelper::setCredentialsFromRequest('ftp');
$path = PhocaGalleryPath::getPath();
$format = JRequest::getVar('format', 'html', '', 'cmd');
$return = JRequest::getVar('return-url', null, 'post', 'base64');
$viewBack = JRequest::getVar('viewback', '', '', '');
$view = JRequest::getVar('view', '', 'get', '', JREQUEST_NOTRIM);
$paramsC = JComponentHelper::getParams('com_phocagallery');
$limitStartUrl = $this->getLimitStartUrl(0, 'subcat');
$return = JRoute::_($this->_url . $limitStartUrl->subcat . $limitStartUrl->image, false);
$enableUploadAvatar = (int) $paramsC->get('enable_upload_avatar', 1);
if ($enableUploadAvatar != 1) {
$errUploadMsg = JText::_('COM_PHOCAGALLERY_NOT_ABLE_UPLOAD_AVATAR');
$redirectUrl = $return;
return false;
}
if (isset($file['name'])) {
$fileAvatar = md5(uniqid(time())) . '.' . JFile::getExt($file['name']);
$filepath = JPath::clean($path->avatar_abs . DS . $fileAvatar);
if (!PhocaGalleryFileUpload::canUpload($file, $errUploadMsg)) {
if ($errUploadMsg == 'COM_PHOCAGALLERY_WARNING_FILE_TOOLARGE') {
$errUploadMsg = JText::_($errUploadMsg) . ' (' . PhocaGalleryFile::getFileSizeReadable($file['size']) . ')';
} else {
if ($errUploadMsg == 'COM_PHOCAGALLERY_WARNING_FILE_TOOLARGERESOLUTION') {
$imgSize = PhocaGalleryImage::getImageSize($file['tmp_name']);
$errUploadMsg = JText::_($errUploadMsg) . ' (' . (int) $imgSize[0] . ' x ' . (int) $imgSize[1] . ' px)';
} else {
$errUploadMsg = JText::_($errUploadMsg);
}
}
$redirectUrl = $return;
return false;
}
if (!JFile::upload($file['tmp_name'], $filepath)) {
$errUploadMsg = JText::_('COM_PHOCAGALLERY_FILE_UNABLE_UPLOAD');
$redirectUrl = $return;
return false;
} else {
$redirectUrl = $return;
//Create thumbnail small, medium, large (Delete previous before)
PhocaGalleryFileThumbnail::deleteFileThumbnail('avatars/' . $fileAvatar, 1, 1, 1);
$returnFrontMessage = PhocaGalleryFileThumbnail::getOrCreateThumbnail('avatars/' . $fileAvatar, $return, 1, 1, 1, 1);
if ($returnFrontMessage != 'Success') {
$errUploadMsg = JText::_('COM_PHOCAGALLERY_THUMBNAIL_AVATAR_NOT_CREATED');
return false;
}
// Saving file name into database with relative path
$succeeded = false;
PhocaGalleryControllerUser::saveUser($fileAvatar, $succeeded, $errUploadMsg);
$redirectUrl = $return;
return $succeeded;
}
} else {
$errUploadMsg = JText::_('COM_PHOCAGALLERY_WARNING_FILETYPE');
$redirectUrl = $return;
return false;
}
return false;
}