function display($tpl = null) { $app = JFactory::getApplication(); $document =& JFactory::getDocument(); $this->params = $app->getParams(); $user =& JFactory::getUser(); $var['slideshow'] = JRequest::getVar('phocaslideshow', 0, '', 'int'); $var['download'] = JRequest::getVar('phocadownload', 0, '', 'int'); $uri =& JFactory::getURI(); $this->tmpl['action'] = $uri->toString(); $path = PhocaGalleryPath::getPath(); $neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels(); $access = PhocaGalleryAccess::isAccess($user->authorisedLevels(), $neededAccessLevels); // Information from the plugin - window is displayed after plugin action $get = array(); $get['detail'] = JRequest::getVar('detail', '', 'get', 'string'); $get['buttons'] = JRequest::getVar('buttons', '', 'get', 'string'); $get['ratingimg'] = JRequest::getVar('ratingimg', '', 'get', 'string'); $this->tmpl['picasa_correct_width_l'] = (int) $this->params->get('large_image_width', 640); $this->tmpl['picasa_correct_height_l'] = (int) $this->params->get('large_image_height', 480); $this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0); $this->tmpl['customcss'] = $this->params->get('custom_css', ''); $this->tmpl['enable_multibox'] = $this->params->get('enable_multibox', 0); $this->tmpl['multibox_height'] = (int) $this->params->get('multibox_height', 560); $this->tmpl['multibox_width'] = (int) $this->params->get('multibox_width', 980); $this->tmpl['multibox_map_height'] = (int) $this->params->get('multibox_map_height', 300); $this->tmpl['multibox_map_width'] = (int) $this->params->get('multibox_map_width', 280); $this->tmpl['multibox_height_overflow'] = (int) $this->tmpl['multibox_height'] - 10; //padding $this->tmpl['multibox_left_bgcolor'] = $this->params->get('multibox_left_bgcolor', '#000000'); $this->tmpl['multibox_right_bgcolor'] = $this->params->get('multibox_right_bgcolor', '#ffffff'); $this->tmpl['multibox_comments_width'] = $this->params->get('multibox_comments_width', 300); $this->tmpl['multibox_comments_height'] = $this->params->get('multibox_comments_height', 600); $this->tmpl['multibox_thubms_box_width'] = $this->params->get('multibox_thubms_box_width', 300); $this->tmpl['multibox_thubms_count'] = $this->params->get('multibox_thubms_count', 4); $this->tmpl['large_image_width'] = $this->params->get('large_image_width', 640); $this->tmpl['large_image_height'] = $this->params->get('large_image_height', 640); $this->tmpl['multibox_fixed_cols'] = $this->params->get('multibox_fixed_cols', 1); $this->tmpl['display_multibox'] = $this->params->get('display_multibox', array(1, 2)); // 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']); } // Plugin information $this->tmpl['detailwindow'] = $this->params->get('detail_window', 0); if (isset($get['detail']) && $get['detail'] != '') { $this->tmpl['detailwindow'] = $get['detail']; } // Plugin information $this->tmpl['detailbuttons'] = $this->params->get('detail_buttons', 1); if (isset($get['buttons']) && $get['buttons'] != '') { $this->tmpl['detailbuttons'] = $get['buttons']; } // Close and Reload links (for different window types) $close = PhocaGalleryRenderFront::renderCloseReloadDetail($this->tmpl['detailwindow']); $this->tmpl['detailwindowclose'] = $close['detailwindowclose']; $this->tmpl['detailwindowreload'] = $close['detailwindowreload']; $this->tmpl['displaydescriptiondetail'] = $this->params->get('display_description_detail', 0); $this->tmpl['displaytitleindescription'] = $this->params->get('display_title_description', 0); $this->tmpl['descriptiondetailheight'] = $this->params->get('description_detail_height', 16); $this->tmpl['fontsizedesc'] = $this->params->get('font_size_desc', 11); $this->tmpl['fontcolordesc'] = $this->params->get('font_color_desc', '#333333'); $this->tmpl['detailwindowbackgroundcolor'] = $this->params->get('detail_window_background_color', '#ffffff'); $this->tmpl['descriptionlightboxfontcolor'] = $this->params->get('description_lightbox_font_color', '#ffffff'); $this->tmpl['descriptionlightboxbgcolor'] = $this->params->get('description_lightbox_bg_color', '#000000'); $this->tmpl['descriptionlightboxfontsize'] = $this->params->get('description_lightbox_font_size', 12); $this->tmpl['displayratingimg'] = $this->params->get('display_rating_img', 0); $this->tmpl['displayicondownload'] = $this->params->get('display_icon_download', 0); $this->tmpl['externalcommentsystem'] = $this->params->get('external_comment_system', 0); $this->tmpl['largewidth'] = $this->params->get('large_image_width', 640); $this->tmpl['largeheight'] = $this->params->get('large_image_height', 480); $this->tmpl['boxlargewidth'] = $this->params->get('front_modal_box_width', 680); $this->tmpl['boxlargeheight'] = $this->params->get('front_modal_box_height', 560); $this->tmpl['slideshow_delay'] = $this->params->get('slideshow_delay', 3000); $this->tmpl['slideshow_pause'] = $this->params->get('slideshow_pause', 2500); $this->tmpl['slideshowrandom'] = $this->params->get('slideshow_random', 0); $this->tmpl['slideshow_description'] = $this->params->get('slideshow_description', 'peekaboo'); $this->tmpl['gallerymetakey'] = $this->params->get('gallery_metakey', ''); $this->tmpl['gallerymetadesc'] = $this->params->get('gallery_metadesc', ''); $this->tmpl['altvalue'] = $this->params->get('alt_value', 1); $this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0); $this->tmpl['customcss'] = $this->params->get('custom_css', ''); $this->tmpl['display_tags_links'] = $this->params->get('display_tags_links', 0); $this->tmpl['ytb_display'] = $this->params->get('ytb_display', 0); $paramsFb = PhocaGalleryFbSystem::getCommentsParams($this->params->get('fb_comment_user_id', '')); // Facebook $this->tmpl['fb_comment_app_id'] = isset($paramsFb['fb_comment_app_id']) ? $paramsFb['fb_comment_app_id'] : ''; $this->tmpl['fb_comment_width'] = isset($paramsFb['fb_comment_width']) ? $paramsFb['fb_comment_width'] : 550; $this->tmpl['fb_comment_lang'] = isset($paramsFb['fb_comment_lang']) ? $paramsFb['fb_comment_lang'] : 'en_US'; $this->tmpl['fb_comment_count'] = isset($paramsFb['fb_comment_count']) ? $paramsFb['fb_comment_count'] : ''; $oH = ''; if ($this->tmpl['enable_multibox'] == 1) { $this->tmpl['fb_comment_width'] = $this->tmpl['multibox_comments_width']; $oH = 'overflow:hidden;'; } // CSS JHtml::stylesheet('components/com_phocagallery/assets/phocagallery.css'); if ($this->tmpl['enablecustomcss'] == 1) { JHtml::stylesheet('components/com_phocagallery/assets/phocagallerycustom.css'); if ($this->tmpl['customcss'] != '') { $document->addCustomTag("\n <style type=\"text/css\"> \n" . $this->escape(strip_tags($this->tmpl['customcss'])) . "\n </style> \n"); } } //Multibox displaying $this->tmpl['mb_title'] = PhocaGalleryUtils::isEnabledMultiboxFeature(1); $this->tmpl['mb_desc'] = PhocaGalleryUtils::isEnabledMultiboxFeature(2); $this->tmpl['mb_uploaded_by'] = PhocaGalleryUtils::isEnabledMultiboxFeature(3); $this->tmpl['mb_rating'] = PhocaGalleryUtils::isEnabledMultiboxFeature(4); $this->tmpl['mb_maps'] = PhocaGalleryUtils::isEnabledMultiboxFeature(5); $this->tmpl['mb_tags'] = PhocaGalleryUtils::isEnabledMultiboxFeature(6); $this->tmpl['mb_comments'] = PhocaGalleryUtils::isEnabledMultiboxFeature(7); $this->tmpl['mb_thumbs'] = PhocaGalleryUtils::isEnabledMultiboxFeature(8); // No bar in Detail View if ($this->tmpl['detailwindow'] == 7) { } else { $document->addCustomTag("<style type=\"text/css\"> \n" . " html, body, .contentpane, #all, #main {" . $oH . "background:" . $this->tmpl['detailwindowbackgroundcolor'] . ";padding:0px !important;margin:0px !important; width: 100% !important; max-width: 100% !important;} \n" . " center, table {background:" . $this->tmpl['detailwindowbackgroundcolor'] . ";} \n" . " #sbox-window {background-color:#fff;padding:5px} \n" . "body {min-width:100%} \n" . ".rt-container {width:100%} \n" . " </style> \n"); } // Download from the detail view which is not in the popupbox if ($var['download'] == 2) { $this->tmpl['displayicondownload'] = 2; } // Plugin Information if (isset($get['ratingimg']) && $get['ratingimg'] != '') { $this->tmpl['displayratingimg'] = $get['ratingimg']; } // Model $model =& $this->getModel(); $item = $model->getData(); //Multibox Thumbnails $this->tmpl['mb_thumbs_data'] = ''; if ($this->tmpl['mb_thumbs'] == 1) { // if we get item variable, we have rights to load the thumbnails, this is why we checking it if (isset($item->id) && isset($item->catid) && (int) $item->id > 0 && (int) $item->catid > 0) { $this->tmpl['mb_thumbs_data'] = $model->getThumbnails((int) $item->id, (int) $item->catid, (int) $item->ordering); } } // User Avatar $this->tmpl['useravatarimg'] = ''; $this->tmpl['useravatarmiddle'] = ''; $userAvatar = PhocaGalleryUser::getUserAvatar($item->userid); if ($userAvatar) { $pathAvatarAbs = $path->avatar_abs . 'thumbs' . DS . 'phoca_thumb_s_' . $userAvatar->avatar; $pathAvatarRel = $path->avatar_rel . 'thumbs/phoca_thumb_s_' . $userAvatar->avatar; if (JFile::exists($pathAvatarAbs)) { $sIH = $this->params->get('small_image_height', 50); $sIHR = @getImageSize($pathAvatarAbs); if (isset($sIHR[1])) { $sIH = $sIHR[1]; } if ((int) $sIH > 0) { $this->tmpl['useravatarmiddle'] = (int) $sIH / 2 - 10; } $this->tmpl['useravatarimg'] = '<img src="' . JURI::base(true) . '/' . $pathAvatarRel . '?imagesid=' . md5(uniqid(time())) . '" alt="" />'; } } // 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->authorisedLevels(), $user->get('id', 0), 0); } if ((int) $rightDisplay == 0) { echo $close['html']; //Some problem with cache - Joomla! return this message if there is no reason for do it. //$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'); phocagalleryimport('phocagallery.render.renderdetailbutton'); // Javascript Slideshow buttons $detailButton = new PhocaGalleryRenderDetailButton(); if ($this->tmpl['enable_multibox'] == 1) { $detailButton->setType('multibox'); } $item->reloadbutton = $detailButton->getReload($item->catslug, $item->slug); $item->closebutton = $detailButton->getClose($item->catslug, $item->slug); $item->closetext = $detailButton->getCloseText($item->catslug, $item->slug); $item->nextbutton = $detailButton->getNext((int) $item->catid, (int) $item->id, (int) $item->ordering); $item->nextbuttonhref = $detailButton->getNext((int) $item->catid, (int) $item->id, (int) $item->ordering, 1); $item->prevbutton = $detailButton->getPrevious((int) $item->catid, (int) $item->id, (int) $item->ordering); $slideshowData = $detailButton->getJsSlideshow((int) $item->catid, (int) $item->id, (int) $var['slideshow'], $item->catslug, $item->slug); $item->slideshowbutton = $slideshowData['icons']; $item->slideshowfiles = $slideshowData['files']; $item->slideshow = $var['slideshow']; $item->download = $var['download']; // ALT VALUE $altValue = PhocaGalleryRenderFront::getAltValue($this->tmpl['altvalue'], $item->title, $item->description, $item->metadesc); $item->altvalue = $altValue; // Get file thumbnail or No Image $item->filenameno = $item->filename; $item->filename = PhocaGalleryFile::getTitleFromFile($item->filename, 1); $item->filesize = PhocaGalleryFile::getFileSize($item->filenameno); $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'], 'class' => 'pg-detail-image')); $item->realimagewidth = $correctImageRes['width']; $item->realimageheight = $correctImageRes['height']; } else { $item->linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($item->filenameno, 'large'); $item->linkimage = JHtml::_('image', $item->linkthumbnailpath, $item->altvalue, array('class' => 'pg-detail-image')); $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']; } } // Add Statistics $model->hit(JRequest::getVar('id', '', '', 'int')); // R A T I N G // Only registered (VOTES + COMMENTS) $this->tmpl['notregisteredimg'] = true; $this->tmpl['usernameimg'] = ''; if ($access > 0) { $this->tmpl['notregisteredimg'] = false; $this->tmpl['usernameimg'] = $user->name; } // VOTES Statistics Img if ((int) $this->tmpl['displayratingimg'] == 1 || $this->tmpl['mb_rating']) { $this->tmpl['votescountimg'] = 0; $this->tmpl['votesaverageimg'] = 0; $this->tmpl['voteswidthimg'] = 0; $votesStatistics = PhocaGalleryRateImage::getVotesStatistics((int) $item->id); if (!empty($votesStatistics->count)) { $this->tmpl['votescountimg'] = $votesStatistics->count; } if (!empty($votesStatistics->average)) { $this->tmpl['votesaverageimg'] = $votesStatistics->average; if ($this->tmpl['votesaverageimg'] > 0) { $this->tmpl['votesaverageimg'] = round((double) $this->tmpl['votesaverageimg'] / 0.5) * 0.5; $this->tmpl['voteswidthimg'] = 22 * $this->tmpl['votesaverageimg']; } else { $this->tmpl['votesaverageimg'] = (int) 0; // not float displaying } } if ((int) $this->tmpl['votescountimg'] > 1) { $this->tmpl['votestextimg'] = 'COM_PHOCAGALLERY_VOTES'; } else { $this->tmpl['votestextimg'] = 'COM_PHOCAGALLERY_VOTE'; } // Already rated? $this->tmpl['alreadyratedimg'] = PhocaGalleryRateImage::checkUserVote((int) $item->id, (int) $user->id); } // Tags $this->tmpl['displaying_tags_output'] = ''; if ($this->tmpl['display_tags_links'] == 1 || $this->tmpl['display_tags_links'] == 3 || $this->tmpl['mb_tags']) { if ($this->tmpl['detailwindow'] == 7) { $this->tmpl['displaying_tags_output'] = PhocaGalleryTag::displayTags($item->id); } else { $this->tmpl['displaying_tags_output'] = PhocaGalleryTag::displayTags($item->id, 1); } } // Back button $this->tmpl['backbutton'] = ''; if ($this->tmpl['detailwindow'] == 7) { phocagalleryimport('phocagallery.image.image'); $formatIcon =& PhocaGalleryImage::getFormatIcon(); $this->tmpl['backbutton'] = '<div><a href="' . JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $item->catslug . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int')) . '"' . ' title="' . JText::_('COM_PHOCAGALLERY_BACK_TO_CATEGORY') . '">' . JHtml::_('image', 'components/com_phocagallery/assets/images/icon-up-images.' . $formatIcon, JText::_('COM_PHOCAGALLERY_BACK_TO_CATEGORY')) . '</a></div>'; } // ASIGN $this->assignRef('tmpl', $this->tmpl); $this->assignRef('item', $item); $this->_prepareDocument($item); if ($this->tmpl['enable_multibox'] == 1) { if ($item->download > 0) { if ($this->tmpl['displayicondownload'] == 2) { $backLink = 'index.php?option=com_phocagallery&view=category&id=' . $item->catslug . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int'); phocagalleryimport('phocagallery.file.filedownload'); if (isset($item->exto) && $item->exto != '') { PhocaGalleryFileDownload::download($item, $backLink, 1); } else { PhocaGalleryFileDownload::download($item, $backLink); } exit; } else { parent::display('multibox'); //parent::display('download'); } } else { if (isset($item->videocode) && $item->videocode != '' && $item->videocode != '0') { $item->videocode = PhocaGalleryYoutube::displayVideo($item->videocode); } parent::display('multibox'); } } else { if (isset($item->videocode) && $item->videocode != '' && $item->videocode != '0') { $item->videocode = PhocaGalleryYoutube::displayVideo($item->videocode); if ($this->tmpl['detailwindow'] != 7 && $this->tmpl['ytb_display'] == 1) { $document->addCustomTag("<style type=\"text/css\"> \n" . " html, body, .contentpane, div#all, div#main, div#system-message-container {padding: 0px !important;margin: 0px !important;} \n" . " div#sbox-window {background-color:#fff;padding: 0px;margin: 0px;} \n" . " </style> \n"); } parent::display('video'); } else { parent::display('slideshowjs'); if ($item->slideshow == 1) { parent::display('slideshow'); } else { if ($item->download > 0) { if ($this->tmpl['displayicondownload'] == 2) { $backLink = 'index.php?option=com_phocagallery&view=category&id=' . $item->catslug . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int'); phocagalleryimport('phocagallery.file.filedownload'); if (isset($item->exto) && $item->exto != '') { PhocaGalleryFileDownload::download($item, $backLink, 1); } else { PhocaGalleryFileDownload::download($item, $backLink); } exit; } else { parent::display('download'); } } else { parent::display($tpl); } } } } }
public function display($tpl = null) { $app = JFactory::getApplication(); $user = JFactory::getUser(); $uri = JFactory::getURI(); $path = PhocaGalleryPath::getPath(); $this->params = $app->getParams(); $this->tmplGeo = array(); $this->tmpl = array(); $this->itemId = $app->input->get('Itemid', 0, 'int'); $document = JFactory::getDocument(); $library = PhocaGalleryLibrary::getLibrary(); $this->tmpl['action'] = $uri->toString(); // CSS PhocaGalleryRenderFront::renderAllCSS(); // Params $this->tmpl['display_name'] = 1; //$this->params->get( 'display_name', 1); $this->tmpl['image_categories_size'] = $this->params->get('image_categories_size', 1); $display_categories_geotagging = $this->params->get('display_categories_geotagging', 0); $display_access_category = $this->params->get('display_access_category', 1); $display_empty_categories = $this->params->get('display_empty_categories', 0); $hideCatArray = explode(',', trim($this->params->get('hide_categories', ''))); $showCatArray = explode(',', trim($this->params->get('show_categories', ''))); $showParentCatArray = explode(',', trim($this->params->get('show_parent_categories', ''))); $this->tmpl['categoriesimageordering'] = $this->params->get('categories_image_ordering', 10); $this->tmpl['categoriesdisplayavatar'] = $this->params->get('categories_display_avatar'); $this->tmpl['categories_description'] = $this->params->get('categories_description', ''); $this->tmpl['phocagallery_width'] = $this->params->get('phocagallery_width', ''); $this->tmpl['phocagallery_center'] = $this->params->get('phocagallery_center', ''); $this->tmpl['display_rating'] = $this->params->get('display_rating', 0); $this->tmpl['categories_box_space'] = $this->params->get('categories_box_space', ''); $this->tmpl['display_cat_desc_box'] = $this->params->get('display_cat_desc_box', 0); $this->tmpl['char_cat_length_name'] = $this->params->get('char_cat_length_name', 9); $this->tmpl['categories_mosaic_images'] = $this->params->get('categories_mosaic_images', 0); $this->tmpl['diff_thumb_height'] = $this->params->get('diff_thumb_height', 0); // L E G A C Y === $this->tmpl['equalpercentagewidth'] = $this->params->get('equal_percentage_width', 1); $this->tmpl['categoriesboxwidth'] = $this->params->get('categories_box_width', '33%'); $this->tmpl['categoriescolumns'] = $this->params->get('categories_columns', 1); $this->tmpl['displayrating'] = $this->params->get('display_rating', 0); $this->tmpl['display_image_categories'] = $this->params->get('display_image_categories', 1); if ($this->tmpl['display_image_categories'] == 1) { } else { // If legacy no different height, no mosaic $this->tmpl['diff_thumb_height'] = 0; $this->tmpl['categories_mosaic_images'] = 0; } // END L E G A C Y === switch ($this->tmpl['image_categories_size']) { // medium case 1: $this->tmpl['picasa_correct_width'] = (int) $this->params->get('medium_image_width', 100); $this->tmpl['picasa_correct_height'] = (int) $this->params->get('medium_image_height', 100); $this->tmpl['imagewidth'] = (int) $this->params->get('medium_image_width', 100); $this->tmpl['imageheight'] = (int) $this->params->get('medium_image_height', 100); $this->tmpl['class_suffix'] = 'medium'; if ($this->tmpl['categories_mosaic_images'] == 1) { $this->tmpl['imagewidth'] = (int) $this->params->get('medium_image_width', 100) * 3; $this->tmpl['imageheight'] = (int) $this->params->get('medium_image_height', 100) * 2; } break; // small // small case 0: default: $this->tmpl['picasa_correct_width'] = (int) $this->params->get('small_image_width', 50); $this->tmpl['picasa_correct_height'] = (int) $this->params->get('small_image_height', 50); $this->tmpl['imagewidth'] = (int) $this->params->get('small_image_width', 50); $this->tmpl['imageheight'] = (int) $this->params->get('small_image_height', 50); $this->tmpl['class_suffix'] = 'small'; if ($this->tmpl['categories_mosaic_images'] == 1) { $this->tmpl['imagewidth'] = (int) $this->params->get('small_image_width', 50) * 3; $this->tmpl['imageheight'] = (int) $this->params->get('small_image_height', 50) * 2; } break; } $this->tmpl['boxsize'] = PhocaGalleryImage::setBoxSize($this->tmpl, 1); if ($this->tmpl['diff_thumb_height'] == 2) { $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/masonry/masonry.min.js'); $document->addCustomTag('<script type="text/javascript"> window.onload = function() { var wall = new Masonry( document.getElementById(\'pg-msnr-container\'), { isFitWidth: true }); }; </script>'); } $s = '#phocagallery {' . "\n"; if ($this->tmpl['phocagallery_center'] != '') { $s .= ' margin: 0 auto; text-align: center;' . "\n"; } if ($this->tmpl['phocagallery_width'] != '') { $s .= ' width: ' . $this->tmpl['phocagallery_width'] . 'px;' . "\n"; } $s .= '}' . "\n"; if ($this->tmpl['phocagallery_center'] != '') { $s = "\n" . '#pg-msnr-container {' . "\n"; $s .= ' margin: 0 auto;' . "\n"; $s .= '}' . "\n"; } $s .= '.pg-csv-box {' . "\n"; $s .= ' height: ' . $this->tmpl['boxsize']['height'] . 'px;' . "\n"; $s .= ' width: ' . $this->tmpl['boxsize']['width'] . 'px;' . "\n"; $s .= '}' . "\n"; $s .= '.pg-csv-box-img {' . "\n"; $s .= ' height: ' . $this->tmpl['imageheight'] . 'px;' . "\n"; $s .= ' width: ' . $this->tmpl['imagewidth'] . 'px;' . "\n"; $s .= '}' . "\n"; $document->addCustomTag('<style type="text/css">' . $s . '</style>'); // Image next to Category in Categories View is ordered by Random as default $categoriesImageOrdering = PhocaGalleryOrdering::getOrderingString($this->tmpl['categoriesimageordering']); // MODEL $model = $this->getModel(); $this->tmpl['ordering'] = $model->getOrdering(); $this->categories = $this->get('data'); // Add link and unset the categories which user cannot see (if it is enabled in params) // If it will be unset while access view, we must sort the keys from category array - ACCESS $unSet = 0; foreach ($this->categories as $key => $item) { // Unset empty categories if it is set if ($display_empty_categories == 0) { if ($this->categories[$key]->numlinks < 1) { unset($this->categories[$key]); $unSet = 1; continue; } } // Set only selected category ID if (!empty($showCatArray[0]) && is_array($showCatArray)) { $unSetHCA = 0; foreach ($showCatArray as $valueHCA) { if ((int) trim($valueHCA) == $this->categories[$key]->id) { $unSetHCA = 0; $unSet = 0; break; } else { $unSetHCA = 1; $unSet = 1; } } if ($unSetHCA == 1) { unset($this->categories[$key]); continue; } } // Unset hidden category if (!empty($hideCatArray) && is_array($hideCatArray)) { $unSetHCA = 0; foreach ($hideCatArray as $valueHCA) { if ((int) trim($valueHCA) == $this->categories[$key]->id) { unset($this->categories[$key]); $unSet = 1; $unSetHCA = 1; break; } } if ($unSetHCA == 1) { continue; } } // Unset not set parent categories - only categories which have specific parent id will be displayed if (!empty($showParentCatArray[0]) && is_array($showParentCatArray)) { $unSetPHCA = 0; foreach ($showParentCatArray as $valuePHCA) { if ((int) trim($valuePHCA) == $this->categories[$key]->parent_id) { $unSetPHCA = 0; //$unSet = 0; break; } else { $unSetPHCA = 1; $unSet = 1; } } if ($unSetPHCA == 1) { unset($this->categories[$key]); continue; } } // Link $this->categories[$key]->link = PhocaGalleryRoute::getCategoryRoute($item->id, $item->alias); // USER RIGHT - ACCESS - - - - - // First Check - check if we can display category $rightDisplay = 1; if (!empty($this->categories[$key])) { $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $this->categories[$key]->accessuserid, $this->categories[$key]->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), $display_access_category); } // Second Check - if we can display hidden category, set Key icon for them // if we don't have access right to see them // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; if ($display_access_category == 1) { // we simulate that we want not to display unaccessable categories // so if we get rightDisplayKey = 0 then the key will be displayed if (!empty($this->categories[$key])) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $this->categories[$key]->accessuserid, $this->categories[$key]->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0); // 0 - simulation } } // Is Ext Image Album? $extCategory = PhocaGalleryImage::isExtImage($this->categories[$key]->extid, $this->categories[$key]->extfbcatid); // DISPLAY AVATAR, IMAGE(ordered), IMAGE(not ordered, not recursive) OR FOLDER ICON $displayAvatar = 0; if ($this->tmpl['categoriesdisplayavatar'] == 1 && isset($this->categories[$key]->avatar) && $this->categories[$key]->avatar != '' && $this->categories[$key]->avatarapproved == 1 && $this->categories[$key]->avatarpublished == 1) { $sizeString = PhocaGalleryImageFront::getSizeString($this->tmpl['image_categories_size']); $pathAvatarAbs = $path->avatar_abs . 'thumbs' . DS . 'phoca_thumb_' . $sizeString . '_' . $this->categories[$key]->avatar; $pathAvatarRel = $path->avatar_rel . 'thumbs/phoca_thumb_' . $sizeString . '_' . $this->categories[$key]->avatar; if (JFile::exists($pathAvatarAbs)) { $this->categories[$key]->linkthumbnailpath = $pathAvatarRel; $displayAvatar = 1; } } if ($displayAvatar == 0) { if ($extCategory) { if ($this->tmpl['categories_mosaic_images'] == 1) { if ($this->tmpl['categoriesimageordering'] == 10) { // Special cannot be used in this case: $categoriesImageOrdering = 1; // set to default ordering } $this->categories[$key]->filenames = PhocaGalleryImageFront::getCategoryImages($this->categories[$key]->id, $categoriesImageOrdering); $this->categories[$key]->mosaic = PhocaGalleryImageFront::renderMosaic($this->categories[$key]->filenames, $this->tmpl['image_categories_size'], 1, $this->tmpl['picasa_correct_width'], $this->tmpl['picasa_correct_height']); } else { if ($this->tmpl['categoriesimageordering'] != 10) { $imagePic = PhocaGalleryImageFront::getRandomImageRecursive($this->categories[$key]->id, $categoriesImageOrdering, 1); if ($rightDisplayKey == 0) { $imagePic = new StdClass(); $imagePic->exts = ''; $imagePic->extm = ''; $imagePic->extw = ''; $imagePic->exth = ''; } $fileThumbnail = PhocaGalleryImageFront::displayCategoriesExtImgOrFolder($imagePic->exts, $imagePic->extm, $imagePic->extw, $imagePic->exth, $this->tmpl['image_categories_size'], $rightDisplayKey); $this->categories[$key]->linkthumbnailpath = $fileThumbnail->rel; $this->categories[$key]->extw = $fileThumbnail->extw; $this->categories[$key]->exth = $fileThumbnail->exth; $this->categories[$key]->extpic = $fileThumbnail->extpic; } else { $fileThumbnail = PhocaGalleryImageFront::displayCategoriesExtImgOrFolder($this->categories[$key]->exts, $this->categories[$key]->extm, $this->categories[$key]->extw, $this->categories[$key]->exth, $this->tmpl['image_categories_size'], $rightDisplayKey); $this->categories[$key]->linkthumbnailpath = $fileThumbnail->rel; $this->categories[$key]->extw = $fileThumbnail->extw; $this->categories[$key]->exth = $fileThumbnail->exth; $this->categories[$key]->extpic = $fileThumbnail->extpic; } } } else { if ($this->tmpl['categories_mosaic_images'] == 1) { if ($this->tmpl['categoriesimageordering'] == 10) { // Special cannot be used in this case: $categoriesImageOrdering = 1; // set to default ordering } $this->categories[$key]->filenames = PhocaGalleryImageFront::getCategoryImages($this->categories[$key]->id, $categoriesImageOrdering); $this->categories[$key]->mosaic = PhocaGalleryImageFront::renderMosaic($this->categories[$key]->filenames, $this->tmpl['image_categories_size']); } else { // Standard Internal Image if ($this->tmpl['categoriesimageordering'] != 10) { $this->categories[$key]->filename = PhocaGalleryImageFront::getRandomImageRecursive($this->categories[$key]->id, $categoriesImageOrdering); } $fileThumbnail = PhocaGalleryImageFront::displayCategoriesImageOrFolder($this->categories[$key]->filename, $this->tmpl['image_categories_size'], $rightDisplayKey); $this->categories[$key]->linkthumbnailpath = $fileThumbnail->rel; } } } if ($rightDisplay == 0) { unset($this->categories[$key]); $unSet = 1; } // - - - - - - - - - - - - - - - } // ACCESS - - - - - - // In case we unset some category from the list, we must sort the array new if ($unSet == 1) { $this->categories = array_values($this->categories); } // - - - - - - - - - - - - - - - - // Do Pagination - we can do it after reducing all unneeded $this->categories, not before $totalCount = count($this->categories); $model->setTotal($totalCount); $this->tmpl['pagination'] = $this->get('pagination'); $this->categories = array_slice($this->categories, (int) $this->tmpl['pagination']->limitstart, (int) $this->tmpl['pagination']->limit); // - - - - - - - - - - - - - - - - $this->tmpl['ems'] = ''; // L E G A C Y === $this->tmpl['countcategories'] = count($this->categories); $this->tmpl['begin'] = array(); $this->tmpl['end'] = array(); $this->tmpl['begin'][0] = 0; // first $this->tmpl['begin'][1] = ceil($this->tmpl['countcategories'] / (int) $this->tmpl['categoriescolumns']); $this->tmpl['end'][0] = $this->tmpl['begin'][1] - 1; for ($j = 2; $j < (int) $this->tmpl['categoriescolumns']; $j++) { $this->tmpl['begin'][$j] = ceil($this->tmpl['countcategories'] / (int) $this->tmpl['categoriescolumns'] * $j); $this->tmpl['end'][$j - 1] = $this->tmpl['begin'][$j] - 1; } $this->tmpl['end'][$j - 1] = $this->tmpl['countcategories'] - 1; // last $this->tmpl['endfloat'] = $this->tmpl['countcategories'] - 1; if ($this->tmpl['equalpercentagewidth'] == 1) { $fixedWidth = 100 / (int) (int) $this->tmpl['categoriescolumns']; $this->tmpl['fixedwidthstyle1'] = 'width:' . $fixedWidth . '%;'; $this->tmpl['fixedwidthstyle2'] = 'width:' . $fixedWidth . '%;'; } else { $this->tmpl['fixedwidthstyle1'] = ''; //'margin: 10px;'; $this->tmpl['fixedwidthstyle2'] = ''; //'margin: 0px;'; } // END L E G A C Y === $this->_prepareDocument(); if ($display_categories_geotagging == 1) { // Params $this->tmplGeo['categorieslng'] = $this->params->get('categories_lng', ''); $this->tmplGeo['categorieslat'] = $this->params->get('categories_lat', ''); $this->tmplGeo['categorieszoom'] = $this->params->get('categories_zoom', 2); $this->tmplGeo['googlemapsapikey'] = $this->params->get('google_maps_api_key', ''); $this->tmplGeo['categoriesmapwidth'] = $this->params->get('categories_map_width', ''); $this->tmplGeo['categoriesmapheight'] = $this->params->get('categorires_map_height', 500); // If no lng and lat will be added, Phoca Gallery will try to find it in categories if ($this->tmplGeo['categorieslat'] == '' || $this->tmplGeo['categorieslng'] == '') { phocagalleryimport('phocagallery.geo.geo'); $latLng = PhocaGalleryGeo::findLatLngFromCategory($this->categories); $this->tmplGeo['categorieslng'] = $latLng['lng']; $this->tmplGeo['categorieslat'] = $latLng['lat']; } $this->assignRef('tmplGeo', $this->tmplGeo); parent::display('map'); } else { parent::display($tpl); } }
function display($tpl = null) { $app = JFactory::getApplication(); $user = JFactory::getUser(); $userLevels = implode(',', $user->authorisedLevels()); $db =& JFactory::getDBO(); //$menu = &JSite::getMenu(); $menu = JFactory::getApplication()->getMenu(); $document =& JFactory::getDocument(); $params = $app->getParams(); // Specific category $id = JRequest::getVar('id', 0, '', 'int'); // Params $categories = $params->get('feed_cat_ids', ''); $ordering = $params->get('feed_img_ordering', 6); $imgCount = $params->get('feed_img_count', 5); $feedTitle = $params->get('feed_title', JText::_('COM_PHOCAGALLERY_GALLERY')); $tmpl['picasa_correct_width_m'] = (int) $params->get('medium_image_width', 100); $tmpl['picasa_correct_height_m'] = (int) $params->get('medium_image_height', 100); $document->setTitle($this->escape(html_entity_decode($feedTitle))); if ($id > 0) { $wheres[] = ' c.id =' . (int) $id; } else { if (count($categories) > 1) { JArrayHelper::toInteger($categories); $categoriesString = implode(',', $categories); $wheres[] = ' c.id IN ( ' . $categoriesString . ' ) '; } else { if ((int) $categories > 0) { $wheres[] = ' c.id IN ( ' . $categories . ' ) '; } } } $imageOrdering = PhocaGalleryOrdering::getOrderingString($ordering, 6); $wheres[] = ' a.published = 1'; $wheres[] = ' a.approved = 1'; $wheres[] = ' c.published = 1'; $wheres[] = ' c.approved = 1'; $wheres[] = ' c.access IN (' . $userLevels . ')'; $u = " (c.accessuserid LIKE '%0%' OR c.accessuserid LIKE '%-1%' OR c.accessuserid LIKE '%," . (int) $user->id . "' OR c.accessuserid LIKE '" . (int) $user->id . ",%' OR c.accessuserid LIKE '%," . (int) $user->id . ",%' OR c.accessuserid =" . (int) $user->id . ") "; $e = 'c.accessuserid IS NULL'; $wheres[] = ' CASE WHEN c.accessuserid IS NOT NULL THEN ' . $u . ' ELSE ' . $e . ' END'; $query = 'SELECT a.*, c.alias as catalias, c.title as categorytitle' . ' FROM #__phocagallery AS a' . ' LEFT JOIN #__phocagallery_categories AS c ON a.catid = c.id' . ' WHERE ' . implode(' AND ', $wheres) . $imageOrdering['output']; $db->setQuery($query, 0, $imgCount); $images = $db->loadObjectList(); foreach ($images as $keyI => $value) { $item = new JFeedItem(); $title = $this->escape($value->title); $title = html_entity_decode($title); $item->title = $title; $link = PhocaGalleryRoute::getCategoryRoute($value->catid, $value->catalias); $item->link = JRoute::_($link); // imgDate $imgDate = ''; $imgDate = JHtml::Date($value->date, "Y-m-d h:m:s"); if ($imgDate != '') { $item->date = $imgDate; } $item->description = ''; if ($value->description != '') { $item->description .= '<div>' . $value->description . '</div>'; } $extImage = false; if (isset($value->extid)) { $extImage = PhocaGalleryImage::isExtImage($value->extid); } // Trying to fix but in Joomla! method $this->_relToAbs - it cannot work with JRoute links :-( $itemL = str_replace(JURI::base(true), '', $item->link); if (substr($itemL, 0, 1) == '/') { $itemL = substr_replace($itemL, '', 0, 1); } $itemL = JURI::base() . $itemL; // Should really not happen $itemLTmp = str_replace('http://', '', $itemL); $pos = stripos($itemLTmp, '//'); if ($pos !== false) { $itemLTmp = str_replace('//', '/', $itemLTmp); $itemL = 'http://' . $itemLTmp; } // - - - - - - - - - - - if ($extImage) { $correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($value->extw, $value->exth, $tmpl['picasa_correct_width_m'], $tmpl['picasa_correct_height_m']); $imgLink = $value->extm; //$i = '<div><a href="'.JRoute::_($link).'"><img src="'.$imgLink .'" border="0" width="'.$correctImageRes['width'].'" height="'.$correctImageRes['height'].'" /></a></div>'; $i = '<div><a href="' . $itemL . '"><img src="' . $imgLink . '" border="0" /></a></div>'; } else { $imgLink = PhocaGalleryImageFront::displayCategoryImageOrNoImage($value->filename, 'medium'); $i = '<div><a href="' . $itemL . '"><img src="' . $imgLink . '" border="0" /></a></div>'; } $item->description .= $i; $item->category = $value->categorytitle; /*if ($value->author != '') { $item->author = $value->author; }*/ $document->addItem($item); } }
} 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) . '">';
function getStatisticsImages($catId, $order, $order2 = 'ASC', $limit = 3) { $query = 'SELECT i.*' . ' FROM #__phocagallery AS i' . ' WHERE i.catid = ' . (int) $catId . ' AND i.published = 1' . ' AND i.approved = 1' . ' ORDER BY ' . $order . ' ' . $order2; $this->_db->setQuery($query, 0, $limit); $statistics = $this->_db->loadObjectList(); $item = array(); $count = 0; $total = count($statistics); for ($i = 0; $i < $total; $i++) { $statisticsData[$count] = $statistics[$i]; $item[$i] =& $statisticsData[$count]; $item[$i]->slug = $item[$i]->id . ':' . $item[$i]->alias; $item[$i]->item_type = "image"; $extImg = PhocaGalleryImage::isExtImage($item[$i]->extid); if ($extImg) { $item[$i]->linkthumbnailpath = $item[$i]->extm; } else { $item[$i]->linkthumbnailpath = PhocaGalleryImageFront::displayCategoryImageOrNoImage($item[$i]->filename, 'medium'); } $count++; } return $item; }
echo $map->setZoomOpt($this->tmplGeo['categorieszoom']) . ',' . "\n"; echo $map->setCenterOpt() . ',' . "\n"; echo $map->setTypeControlOpt() . ',' . "\n"; echo $map->setNavigationControlOpt() . ',' . "\n"; echo $map->setScaleControlOpt(1) . ',' . "\n"; echo $map->setScrollWheelOpt(1) . ',' . "\n"; echo $map->setDisableDoubleClickZoomOpt(0) . ',' . "\n"; echo $map->setMapTypeOpt() . "\n"; echo $map->endOptions(); echo $map->setMap(); foreach ($this->categories as $category) { if (isset($category->longitude) && $category->longitude != '' && $category->longitude != 0 && (isset($category->latitude) && $category->latitude != '' && $category->latitude != 0)) { if ($category->geotitle == '') { $category->geotitle = $category->title; } $extCategory = PhocaGalleryImage::isExtImage($category->extid); if ($extCategory) { $correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($category->extw, $category->exth, $this->tmpl['picasa_correct_width'], $this->tmpl['picasa_correct_height']); $imgLink = JHtml::_('image', $category->linkthumbnailpath, str_replace('»', '-', $category->title), array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height'])); } else { $imgLink = JHtml::_('image', $category->linkthumbnailpath, PhocaGalleryText::strTrimAll(addslashes($category->geotitle))); } $text = '<div style="text-align:left">' . '<table border="0" cellspacing="5" cellpadding="5">' . '<tr>' . '<td align="left" colspan="2"><b><a href="' . $category->link . '">' . PhocaGalleryText::strTrimAll(addslashes($category->geotitle)) . '</a></b></td>' . '</tr>' . '<tr>' . '<td valign="top" align="left"><a href="' . $category->link . '">' . $imgLink . '</a></td>' . '<td valign="top" align="left">' . PhocaGalleryText::strTrimAll(addslashes($category->description)) . '</td>' . '</tr></table></div>'; // Markers $iconOutput = $map->setMarkerIcon(0); echo $iconOutput['js']; echo $map->setMarker($category->id, $category->geotitle, $category->description, $category->latitude, $category->longitude, $iconOutput['icon'], $text); echo $map->setListener(); } } echo $map->endMapF();
function display($tpl = null) { $app = JFactory::getApplication(); $document = JFactory::getDocument(); $this->params = $app->getParams(); $user = JFactory::getUser(); $uri = JFactory::getURI(); $this->itemId = $app->input->get('Itemid', 0, 'int'); $neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels(); $access = PhocaGalleryAccess::isAccess($user->getAuthorisedViewLevels(), $neededAccessLevels); // PLUGIN WINDOW - we get information from plugin $get = ''; $get['comment'] = $app->input->get('comment', '', 'string'); $this->tmpl['id'] = $app->input->get('id', 0, 'int'); $this->tmpl['catid'] = $app->input->get('catid', '', 'string'); $this->tmpl['maxcommentchar'] = $this->params->get('max_comment_char', 1000); $this->tmpl['displaycommentimg'] = $this->params->get('display_comment_img', 0); $this->tmpl['detailwindowbackgroundcolor'] = $this->params->get('detail_window_background_color', '#ffffff'); $this->tmpl['commentwidth'] = $this->params->get('comment_width', 500); $this->tmpl['enable_multibox'] = $this->params->get('enable_multibox', 0); $this->tmpl['multibox_comments_width'] = $this->params->get('multibox_comments_width', 300); $this->tmpl['externalcommentsystem'] = $this->params->get('external_comment_system', 0); $this->tmpl['gallerymetakey'] = $this->params->get('gallery_metakey', ''); $this->tmpl['gallerymetadesc'] = $this->params->get('gallery_metadesc', ''); $this->tmpl['altvalue'] = $this->params->get('alt_value', 1); $this->tmpl['largewidth'] = $this->params->get('large_image_width', 640); $this->tmpl['largeheight'] = $this->params->get('large_image_height', 480); $this->tmpl['picasa_correct_width_l'] = (int) $this->params->get('large_image_width', 640); $this->tmpl['picasa_correct_height_l'] = (int) $this->params->get('large_image_height', 480); $paramsFb = PhocaGalleryFbSystem::getCommentsParams($this->params->get('fb_comment_user_id', '')); // Facebook $this->tmpl['fb_comment_app_id'] = isset($paramsFb['fb_comment_app_id']) ? $paramsFb['fb_comment_app_id'] : ''; $this->tmpl['fb_comment_width'] = isset($paramsFb['fb_comment_width']) ? $paramsFb['fb_comment_width'] : 550; $this->tmpl['fb_comment_lang'] = isset($paramsFb['fb_comment_lang']) ? $paramsFb['fb_comment_lang'] : 'en_US'; $this->tmpl['fb_comment_count'] = isset($paramsFb['fb_comment_count']) ? $paramsFb['fb_comment_count'] : ''; $this->tmpl['display_comment_nopup'] = $this->params->get('display_comment_nopup', 0); $this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0); $this->tmpl['customcss'] = $this->params->get('custom_css', ''); // Multibox if ($this->tmpl['enable_multibox'] == 1) { $this->tmpl['commentwidth'] = (int) $this->tmpl['multibox_comments_width'] - 70; //padding - margin } $get['commentsi'] = $app->input->get('commentsi', '', 'int'); $this->tmpl['enable_multibox_iframe'] = 0; if ($get['commentsi'] == 1) { // 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); }
<?php defined('_JEXEC') or die('Restricted access'); $title = $this->item->filename; $imgLink = JHtml::_('image', 'images/phocagallery/' . $this->item->filenameno, ''); $extImage = PhocaGalleryImage::isExtImage($this->item->extid); if ($extImage) { $title = $this->item->title; $imgLink = JHtml::_('image', $this->item->exto, ''); } if ($this->tmpl['backbutton'] != '') { echo $this->tmpl['backbutton']; echo '<div id="download-box"><div style="overflow:scroll;width:' . $this->tmpl['boxlargewidth'] . 'px;height:' . $this->tmpl['boxlargeheight'] . 'px;margin:0px;padding:0px;">' . $imgLink . '</div>'; echo '<div id="download-msg-nopopup"><div>' . '<table width="360">' . '<tr><td align="left">' . JText::_('COM_PHOCAGALLERY_IMAGE_NAME') . ': </td><td>' . $title . '</td></tr>' . '<tr><td align="left">' . JText::_('COM_PHOCAGALLERY_IMAGE_FORMAT') . ': </td><td>' . $this->item->imagesize . '</td></tr>' . '<tr><td align="left">' . JText::_('COM_PHOCAGALLERY_IMAGE_SIZE') . ': </td><td>' . $this->item->filesize . '</td></tr>'; echo '<tr><td align="left"><a title="' . JText::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD') . '" href="' . JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $this->item->catslug . '&id=' . $this->item->slug . '&phocadownload=2' . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int')) . '">' . JText::_('COM_PHOCAGALLERY_IMAGE_DOWNLOAD') . '</a></td><td> </td>'; echo '</table>'; echo '</div></div>'; } else { echo '<div id="download-box"><div style="overflow:scroll;width:' . $this->tmpl['boxlargewidth'] . 'px;height:' . $this->tmpl['boxlargeheight'] . 'px;margin:0px;padding:0px;">' . $imgLink . '</div>'; echo '<div id="download-msg"><div>' . '<table width="360">' . '<tr><td align="left">' . JText::_('COM_PHOCAGALLERY_IMAGE_NAME') . ': </td><td>' . $title . '</td></tr>' . '<tr><td align="left">' . JText::_('COM_PHOCAGALLERY_IMAGE_FORMAT') . ': </td><td>' . $this->item->imagesize . '</td></tr>' . '<tr><td align="left">' . JText::_('COM_PHOCAGALLERY_IMAGE_SIZE') . ': </td><td>' . $this->item->filesize . '</td></tr>' . '<tr><td colspan="2" align="left"><small>' . JText::_('COM_PHOCAGALLERY_DOWNLOAD_IMAGE') . '</small></td></tr>'; if ($this->tmpl['detailwindow'] == 4 || $this->tmpl['detailwindow'] == 5 || $this->tmpl['detailwindow'] == 7 || $this->tmpl['detailwindow'] == 9 || $this->tmpl['detailwindow'] == 10) { } else { echo '<tr><td> </td><td align="right">' . str_replace("%onclickclose%", $this->tmpl['detailwindowclose'], $this->item->closetext) . '</td></tr>'; } echo '</table>'; echo '</div></div>'; } echo '<div id="phocaGallerySlideshowC" style="display:none"></div>'; //because of loaded slideshow js if ($this->tmpl['detailwindow'] == 7) { PhocaGalleryUtils::footer();
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 != '') { $vsValues = explode(".", $vs, 2); if (isset($vsValues[0])) { $section = $vsValues[0]; } else { $section = ''; } if (isset($vsValues[1])) { $name = $vsValues[1]; } else { $name = ''; } if ($section != '' && $name != '') { if (isset($exif[$section][$name])) { switch ($name) { case 'FileDateTime': jimport('joomla.utilities.date'); $date = new JDate($exif[$section][$name]); $exifValue = $date->format('d/m/Y, H:m'); break; case 'FileSize': $exifValue = PhocaGalleryFile::getFileSizeReadable($exif[$section][$name]); break; case 'Height': case 'Width': case 'ExifImageWidth': case 'ExifImageLength': $exifValue = $exif[$section][$name] . ' px'; break; case 'IsColor': switch ((int) $exif[$section][$name]) { case 0: $exifValue = JText::_('COM_PHOCAGALLERY_NO'); break; default: $exifValue = JText::_('COM_PHOCAGALLERY_YES'); break; } break; case 'ResolutionUnit': switch ((int) $exif[$section][$name]) { case 2: $exifValue = JText::_('COM_PHOCAGALLERY_INCH'); break; case 3: $exifValue = JText::_('COM_PHOCAGALLERY_CM'); break; case 4: $exifValue = JText::_('COM_PHOCAGALLERY_MM'); break; case 5: $exifValue = JText::_('COM_PHOCAGALLERY_MICRO'); break; case 0: case 1: default: $exifValue = '?'; break; } break; case 'ExposureProgram': switch ((int) $exif[$section][$name]) { case 1: $exifValue = JText::_('COM_PHOCAGALLERY_MANUAL'); break; case 2: $exifValue = JText::_('COM_PHOCAGALLERY_NORMAL_PROGRAM'); break; case 3: $exifValue = JText::_('COM_PHOCAGALLERY_APERTURE_PRIORITY'); break; case 4: $exifValue = JText::_('COM_PHOCAGALLERY_SHUTTER_PRIORITY'); break; case 5: $exifValue = JText::_('COM_PHOCAGALLERY_CREATIVE_PROGRAM'); break; case 6: $exifValue = JText::_('COM_PHOCAGALLERY_ACTION_PROGRAM'); break; case 7: $exifValue = JText::_('COM_PHOCAGALLERY_PORTRAIT_MODE'); break; case 8: $exifValue = JText::_('COM_PHOCAGALLERY_LANDSCAPE_MODE'); break; case 0: default: $exifValue = JText::_('COM_PHOCAGALLERY_NOT_DEFINED'); break; } break; case 'MeteringMode': switch ((int) $exif[$section][$name]) { case 0: $exifValue = JText::_('COM_PHOCAGALLERY_UNKNOWN'); break; case 1: $exifValue = JText::_('COM_PHOCAGALLERY_AVERAGE'); break; case 2: $exifValue = JText::_('COM_PHOCAGALLERY_CENTERWEIGHTEDAVERAGE'); break; case 3: $exifValue = JText::_('COM_PHOCAGALLERY_SPOT'); break; case 4: $exifValue = JText::_('COM_PHOCAGALLERY_MULTISPOT'); break; case 5: $exifValue = JText::_('COM_PHOCAGALLERY_PATTERN'); break; case 6: $exifValue = JText::_('COM_PHOCAGALLERY_PARTIAL'); break; case 255: default: $exifValue = JText::_('COM_PHOCAGALLERY_OTHER'); break; } break; case 'LightSource': switch ((int) $exif[$section][$name]) { case 0: $exifValue = JText::_('COM_PHOCAGALLERY_UNKNOWN'); break; case 1: $exifValue = JText::_('COM_PHOCAGALLERY_DAYLIGHT'); break; case 2: $exifValue = JText::_('COM_PHOCAGALLERY_FLUORESCENT'); break; case 3: $exifValue = JText::_('COM_PHOCAGALLERY_TUNGSTEN'); break; case 4: $exifValue = JText::_('COM_PHOCAGALLERY_FLASH'); break; case 9: $exifValue = JText::_('COM_PHOCAGALLERY_FINEWEATHER'); break; case 10: $exifValue = JText::_('COM_PHOCAGALLERY_CLOUDYWEATHER'); break; case 11: $exifValue = JText::_('COM_PHOCAGALLERY_SHADE'); break; case 12: $exifValue = JText::_('COM_PHOCAGALLERY_DAYLIGHTFLUORESCENT'); break; case 13: $exifValue = JText::_('COM_PHOCAGALLERY_DAYWHITEFLUORESCENT'); break; case 14: $exifValue = JText::_('COM_PHOCAGALLERY_COOLWHITEFLUORESCENT'); break; case 15: $exifValue = JText::_('COM_PHOCAGALLERY_WHITEFLUORESCENT'); break; case 17: $exifValue = JText::_('COM_PHOCAGALLERY_STANDARDLIGHTA'); break; case 18: $exifValue = JText::_('COM_PHOCAGALLERY_STANDARDLIGHTB'); break; case 19: $exifValue = JText::_('COM_PHOCAGALLERY_STANDARDLIGHTC'); break; case 20: $exifValue = JText::_('COM_PHOCAGALLERY_D55'); break; case 21: $exifValue = JText::_('COM_PHOCAGALLERY_D65'); break; case 22: $exifValue = JText::_('COM_PHOCAGALLERY_D75'); break; case 23: $exifValue = JText::_('COM_PHOCAGALLERY_D50'); break; case 24: $exifValue = JText::_('COM_PHOCAGALLERY_ISOSTUDIOTUNGSTEN'); break; case 255: default: $exifValue = JText::_('COM_PHOCAGALLERY_OTHERLIGHTSOURCE'); break; } break; case 'SensingMethod': switch ((int) $exif[$section][$name]) { case 2: $exifValue = JText::_('COM_PHOCAGALLERY_ONE-CHIP_COLOR_AREA_SENSOR'); break; case 3: $exifValue = JText::_('COM_PHOCAGALLERY_TWO-CHIP_COLOR_AREA_SENSOR'); break; case 4: $exifValue = JText::_('COM_PHOCAGALLERY_THREE-CHIP_COLOR_AREA_SENSOR'); break; case 5: $exifValue = JText::_('COM_PHOCAGALLERY_COLOR_SEQUENTIAL_AREA_SENSOR'); break; case 7: $exifValue = JText::_('COM_PHOCAGALLERY_TRILINEAR_SENSOR'); break; case 8: $exifValue = JText::_('COM_PHOCAGALLERY_COLOR_SEQUENTIAL_LINEAR_SENSOR'); break; case 1: default: $exifValue = JText::_('COM_PHOCAGALLERY_NOT_DEFINED'); break; } break; case 'CustomRendered': switch ((int) $exif[$section][$name]) { case 1: $exifValue = JText::_('COM_PHOCAGALLERY_CUSTOM_PROCESS'); break; case 0: default: $exifValue = JText::_('COM_PHOCAGALLERY_NORMAL_PROCESS'); break; } break; case 'ExposureMode': switch ((int) $exif[$section][$name]) { case 1: $exifValue = JText::_('COM_PHOCAGALLERY_MANUAL_EXPOSURE'); break; case 2: $exifValue = JText::_('COM_PHOCAGALLERY_AUTO_BRACKET'); break; case 0: default: $exifValue = JText::_('COM_PHOCAGALLERY_AUTO_EXPOSURE'); break; } break; case 'WhiteBalance': switch ((int) $exif[$section][$name]) { case 1: $exifValue = JText::_('COM_PHOCAGALLERY_MANUAL_WHITE_BALANCE'); break; case 0: default: $exifValue = JText::_('COM_PHOCAGALLERY_AUTO_WHITE_BALANCE'); break; } break; case 'SceneCaptureType': switch ((int) $exif[$section][$name]) { case 1: $exifValue = JText::_('COM_PHOCAGALLERY_LANDSCAPE'); break; case 2: $exifValue = JText::_('COM_PHOCAGALLERY_PORTRAIT'); break; case 3: $exifValue = JText::_('COM_PHOCAGALLERY_NIGHT_SCENE'); break; case 0: default: $exifValue = JText::_('COM_PHOCAGALLERY_STANDARD'); break; } break; case 'GainControl': switch ((int) $exif[$section][$name]) { case 1: $exifValue = JText::_('COM_PHOCAGALLERY_LOW_GAIN_UP'); break; case 2: $exifValue = JText::_('COM_PHOCAGALLERY_HIGH_GAIN_UP'); break; case 3: $exifValue = JText::_('COM_PHOCAGALLERY_LOW_GAIN_UP'); break; case 4: $exifValue = JText::_('COM_PHOCAGALLERY_HIGH_GAIN_UP'); break; case 0: default: $exifValue = JText::_('COM_PHOCAGALLERY_NONE'); break; } break; case 'ColorSpace': switch ((int) $exif[$section][$name]) { case 1: $exifValue = JText::_('COM_PHOCAGALLERY_SRGB'); break; case 'FFFF.H': $exifValue = JText::_('COM_PHOCAGALLERY_UNCALIBRATED'); break; case 0: default: $exifValue = '-'; break; } break; case 'Contrast': case 'Sharpness': switch ((int) $exif[$section][$name]) { case 1: $exifValue = JText::_('COM_PHOCAGALLERY_SOFT'); break; case 2: $exifValue = JText::_('COM_PHOCAGALLERY_HARD'); break; case 0: default: $exifValue = JText::_('COM_PHOCAGALLERY_NORMAL'); break; } break; case 'Saturation': switch ((int) $exif[$section][$name]) { case 1: $exifValue = JText::_('COM_PHOCAGALLERY_LOW_SATURATION'); break; case 2: $exifValue = JText::_('COM_PHOCAGALLERY_HIGH_SATURATION'); break; case 0: default: $exifValue = JText::_('COM_PHOCAGALLERY_NORMAL'); break; } break; case 'SubjectDistanceRange': switch ((int) $exif[$section][$name]) { case 1: $exifValue = JText::_('COM_PHOCAGALLERY_MACRO'); break; case 2: $exifValue = JText::_('COM_PHOCAGALLERY_CLOSE_VIEW'); break; case 3: $exifValue = JText::_('COM_PHOCAGALLERY_DISTANT_VIEW'); break; case 0: default: $exifValue = JText::_('COM_PHOCAGALLERY_UNKNOWN'); break; } break; case 'GPSLatitude': case 'GPSLongitude': $exifValue = ''; if (isset($exif[$section][$name][0])) { list($l, $r) = explode("/", $exif[$section][$name][0]); $d = $l / $r; $exifValue .= $d . '° '; } if (isset($exif[$section][$name][1])) { list($l, $r) = explode("/", $exif[$section][$name][1]); $m = $l / $r; if ($l % $r > 0) { $sNoInt = $l / $r; $sInt = $l / $r; $s = ($sNoInt - (int) $sInt) * 60; $exifValue .= (int) $m . '\' ' . $s . '" '; } else { $exifValue .= $m . '\' '; if (isset($exif[$section][$name][2])) { list($l, $r) = explode("/", $exif[$section][$name][2]); $s = $l / $r; $exifValue .= $s . '" '; } } } break; case 'GPSTimeStamp': $exifValue = ''; if (isset($exif[$section][$name][0])) { list($l, $r) = explode("/", $exif[$section][$name][0]); $h = $l / $r; $exifValue .= $h . ' h '; } if (isset($exif[$section][$name][1])) { list($l, $r) = explode("/", $exif[$section][$name][1]); $m = $l / $r; $exifValue .= $m . ' m '; } if (isset($exif[$section][$name][2])) { list($l, $r) = explode("/", $exif[$section][$name][2]); $s = $l / $r; $exifValue .= $s . ' s '; } break; case 'ExifVersion': if (is_numeric($exif[$section][$name])) { $exifValue = (int) $exif[$section][$name] / 100; } else { $exifValue = $exif[$section][$name]; } break; case 'FocalLength': if (isset($exif[$section][$name]) && $exif[$section][$name] != '') { $focalLength = explode('/', $exif[$section][$name]); if (isset($focalLength[0]) && (int) $focalLength[0] > 0 && isset($focalLength[1]) && (int) $focalLength[1] > 0) { $exifValue = (int) $focalLength[0] / (int) $focalLength[1]; $exifValue = $exifValue . ' mm'; } } break; case 'ExposureTime': if (isset($exif[$section][$name]) && $exif[$section][$name] != '') { $exposureTime = explode('/', $exif[$section][$name]); if (isset($exposureTime[0]) && (int) $exposureTime[0] > 0 && isset($exposureTime[1]) && (int) $exposureTime[1] > 1) { if ((int) $exposureTime[1] > (int) $exposureTime[0]) { $exifValue = (int) $exposureTime[1] / (int) $exposureTime[0]; $exifValue = '1/' . $exifValue . ' sec'; } } } break; /*case 'ShutterSpeedValue': if (isset($exif[$section][$name]) && $exif[$section][$name] != '') { $shutterSpeedValue = explode ('/', $exif[$section][$name]); if (isset($shutterSpeedValue[0]) && (int)$shutterSpeedValue[0] > 0 && isset($shutterSpeedValue[1]) && (int)$shutterSpeedValue[1] > 1 ) { if ((int)$shutterSpeedValue[1] > (int)$shutterSpeedValue[0]) { $exifValue = (int)$shutterSpeedValue[1] / (int)$shutterSpeedValue[0]; $exifValue = '1/'. $exifValue . ' sec'; } } } break;*/ /*case 'ShutterSpeedValue': if (isset($exif[$section][$name]) && $exif[$section][$name] != '') { $shutterSpeedValue = explode ('/', $exif[$section][$name]); if (isset($shutterSpeedValue[0]) && (int)$shutterSpeedValue[0] > 0 && isset($shutterSpeedValue[1]) && (int)$shutterSpeedValue[1] > 1 ) { if ((int)$shutterSpeedValue[1] > (int)$shutterSpeedValue[0]) { $exifValue = (int)$shutterSpeedValue[1] / (int)$shutterSpeedValue[0]; $exifValue = '1/'. $exifValue . ' sec'; } } } break;*/ default: $exifValue = $exif[$section][$name]; break; } $vs = str_replace('.', '_', $vs); $infoOutput .= '<tr ' . $class . '>' . '<td>' . JText::_('COM_PHOCAGALLERY_' . strtoupper($vs)) . '</td>' . '<td>' . $exifValue . '</td>' . '</tr>'; } } } $i++; } } // ASIGN $this->assignRef('tmpl', $this->tmpl); $this->assignRef('infooutput', $infoOutput); // $this->assignRef( 'infooutput', $infoOutput ); $this->_prepareDocument($info); parent::display($tpl); }
public function display($tpl = null) { $app = JFactory::getApplication(); $user =& JFactory::getUser(); $uri =& JFactory::getURI(); $path =& PhocaGalleryPath::getPath(); $this->params = $app->getParams(); $this->tmplGeo = array(); $this->tmpl['categories_description'] = $this->params->get('categories_description', ''); $image_categories_size = $this->params->get('image_categories_size', 4); $medium_image_width = (int) $this->params->get('medium_image_width', 100) + 18; $medium_image_height = (int) $this->params->get('medium_image_height', 100) + 18; $small_image_width = (int) $this->params->get('small_image_width', 50) + 18; $small_image_height = (int) $this->params->get('small_image_height', 50) + 18; $this->tmpl['phocagallerywidth'] = $this->params->get('phocagallery_width', ''); $this->tmpl['categoriescolumns'] = $this->params->get('categories_columns', 1); $this->tmpl['displayrating'] = $this->params->get('display_rating', 0); $this->tmpl['phocagallerycenter'] = $this->params->get('phocagallery_center', ''); $this->tmpl['categoriesimageordering'] = $this->params->get('categories_image_ordering', 9); $this->tmpl['displayimagecategories'] = $this->params->get('display_image_categories', 1); $display_categories_geotagging = $this->params->get('display_categories_geotagging', 0); $display_access_category = $this->params->get('display_access_category', 1); $display_empty_categories = $this->params->get('display_empty_categories', 0); $hideCatArray = explode(',', trim($this->params->get('hide_categories', ''))); $showCatArray = explode(',', trim($this->params->get('show_categories', ''))); $this->tmpl['equalpercentagewidth'] = $this->params->get('equal_percentage_width'); $this->tmpl['categoriesdisplayavatar'] = $this->params->get('categories_display_avatar'); $this->tmpl['categoriesboxwidth'] = $this->params->get('categories_box_width'); $this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0); $this->tmpl['customcss'] = $this->params->get('custom_css', ''); // = = = = = = = = = = // CSS // = = = = = = = = = = $document =& JFactory::getDocument(); $library =& PhocaGalleryLibrary::getLibrary(); 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 { $libraries['pg-css-ie'] = $library->getLibrary('pg-css-ie'); // CSS for IE 8 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); } } // = = = = = = = = = = // Correct Picasa Images - get Info switch ($image_categories_size) { // medium case 1: case 5: $this->tmpl['picasa_correct_width'] = (int) $this->params->get('medium_image_width', 100); $this->tmpl['picasa_correct_height'] = (int) $this->params->get('medium_image_height', 100); $this->tmpl['class_suffix'] = 'medium'; break; case 0: case 4: default: $this->tmpl['picasa_correct_width'] = (int) $this->params->get('small_image_width', 50); $this->tmpl['picasa_correct_height'] = (int) $this->params->get('small_image_height', 50); $this->tmpl['class_suffix'] = 'small'; break; } // - - - - - - - - - - - - - - - // Get background for the image $catImg = PhocaGalleryImageFront::getCategoriesImageBackground($image_categories_size, $small_image_width, $small_image_height, $medium_image_height, $medium_image_width); $this->tmpl['imagebg'] = $catImg->image; $this->tmpl['imagewidth'] = $catImg->width; //$total = $this->get('total'); //$this->tmpl['pagination'] = &$this->get('pagination'); // Image next to Category in Categories View is ordered by Random as default $categoriesImageOrdering = PhocaGalleryOrdering::getOrderingString($this->tmpl['categoriesimageordering']); // MODEL $model =& $this->getModel(); $this->tmpl['ordering'] =& $model->getOrdering(); $this->categories = $this->get('data'); // Add link and unset the categories which user cannot see (if it is enabled in params) // If it will be unset while access view, we must sort the keys from category array - ACCESS $unSet = 0; foreach ($this->categories as $key => $item) { // Unset empty categories if it is set if ($display_empty_categories == 0) { if ($this->categories[$key]->numlinks < 1) { unset($this->categories[$key]); $unSet = 1; continue; } } // Set only selected category ID if (!empty($showCatArray[0]) && is_array($showCatArray)) { $unSetHCA = 0; foreach ($showCatArray as $valueHCA) { if ((int) trim($valueHCA) == $this->categories[$key]->id) { $unSetHCA = 0; $unSet = 0; break; } else { $unSetHCA = 1; $unSet = 1; } } if ($unSetHCA == 1) { unset($this->categories[$key]); continue; } } // Unset hidden category if (!empty($hideCatArray) && is_array($hideCatArray)) { $unSetHCA = 0; foreach ($hideCatArray as $valueHCA) { if ((int) trim($valueHCA) == $this->categories[$key]->id) { unset($this->categories[$key]); $unSet = 1; $unSetHCA = 1; break; } } if ($unSetHCA == 1) { continue; } } // Link //$this->categories[$key]->link = JRoute::_('index.php?option=com_phocagallery&view=category&id='. $item->slug.'&Itemid='. JRequest::getVar('Itemid', 0, '', 'int') ); $this->categories[$key]->link = PhocaGalleryRoute::getCategoryRoute($item->id, $item->alias); // USER RIGHT - ACCESS - - - - - // First Check - check if we can display category $rightDisplay = 1; if (!empty($this->categories[$key])) { $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $this->categories[$key]->accessuserid, $this->categories[$key]->access, $user->authorisedLevels(), $user->get('id', 0), $display_access_category); } // Second Check - if we can display hidden category, set Key icon for them // if we don't have access right to see them // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; if ($display_access_category == 1) { // we simulate that we want not to display unaccessable categories // so if we get rightDisplayKey = 0 then the key will be displayed if (!empty($this->categories[$key])) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $this->categories[$key]->accessuserid, $this->categories[$key]->access, $user->authorisedLevels(), $user->get('id', 0), 0); // 0 - simulation } } // Is Ext Image Album? $extCategory = PhocaGalleryImage::isExtImage($this->categories[$key]->extid, $this->categories[$key]->extfbcatid); // DISPLAY AVATAR, IMAGE(ordered), IMAGE(not ordered, not recursive) OR FOLDER ICON $displayAvatar = 0; if ($this->tmpl['categoriesdisplayavatar'] == 1 && isset($this->categories[$key]->avatar) && $this->categories[$key]->avatar != '' && $this->categories[$key]->avatarapproved == 1 && $this->categories[$key]->avatarpublished == 1) { $sizeString = PhocaGalleryImageFront::getSizeString($image_categories_size); $pathAvatarAbs = $path->avatar_abs . 'thumbs' . DS . 'phoca_thumb_' . $sizeString . '_' . $this->categories[$key]->avatar; $pathAvatarRel = $path->avatar_rel . 'thumbs/phoca_thumb_' . $sizeString . '_' . $this->categories[$key]->avatar; if (JFile::exists($pathAvatarAbs)) { $this->categories[$key]->linkthumbnailpath = $pathAvatarRel; $displayAvatar = 1; } } if ($displayAvatar == 0) { if ($extCategory) { if ($this->tmpl['categoriesimageordering'] != 10) { $imagePic = PhocaGalleryImageFront::getRandomImageRecursive($this->categories[$key]->id, $categoriesImageOrdering, 1); $fileThumbnail = PhocaGalleryImageFront::displayCategoriesExtImgOrFolder($imagePic->exts, $imagePic->extm, $imagePic->extw, $imagePic->exth, $image_categories_size, $rightDisplayKey); } else { $fileThumbnail = PhocaGalleryImageFront::displayCategoriesExtImgOrFolder($this->categories[$key]->exts, $this->categories[$key]->extm, $this->categories[$key]->extw, $this->categories[$key]->exth, $image_categories_size, $rightDisplayKey); } $this->categories[$key]->linkthumbnailpath = $fileThumbnail->rel; $this->categories[$key]->extw = $fileThumbnail->extw; $this->categories[$key]->exth = $fileThumbnail->exth; $this->categories[$key]->extpic = $fileThumbnail->extpic; } else { if ($this->tmpl['categoriesimageordering'] != 10) { $this->categories[$key]->filename = PhocaGalleryImageFront::getRandomImageRecursive($this->categories[$key]->id, $categoriesImageOrdering); } $fileThumbnail = PhocaGalleryImageFront::displayCategoriesImageOrFolder($this->categories[$key]->filename, $image_categories_size, $rightDisplayKey); $this->categories[$key]->linkthumbnailpath = $fileThumbnail->rel; } } if ($rightDisplay == 0) { unset($this->categories[$key]); $unSet = 1; } // - - - - - - - - - - - - - - - } $this->tmpl['mtb'] = PhocaGalleryRenderInfo::getPhocaIc((int) $this->params->get('display_phoca_info', 1)); // ACCESS - - - - - - // In case we unset some category from the list, we must sort the array new if ($unSet == 1) { $this->categories = array_values($this->categories); } // - - - - - - - - - - - - - - - - // Do Pagination - we can do it after reducing all unneeded $this->categories, not before $totalCount = count($this->categories); $model->setTotal($totalCount); $this->tmpl['pagination'] =& $this->get('pagination'); $this->categories = array_slice($this->categories, (int) $this->tmpl['pagination']->limitstart, (int) $this->tmpl['pagination']->limit); // - - - - - - - - - - - - - - - - // Display Image of Categories Description /* if ($this->params->get('image') != -1) { $attribs['align'] = $this->params->get('image_align'); $attribs['hspace'] = 6; // Use the static HTML library to build the image tag $this->tmpl['image'] = JHtml::_('image', 'images/stories/'.$this->params->get('image'), '', $attribs); }*/ // ACTION $this->tmpl['action'] = $uri->toString(); //Design $this->tmpl['countcategories'] = count($this->categories); $this->tmpl['begin'] = array(); $this->tmpl['end'] = array(); $this->tmpl['begin'][0] = 0; // first $this->tmpl['begin'][1] = ceil($this->tmpl['countcategories'] / (int) $this->tmpl['categoriescolumns']); $this->tmpl['end'][0] = $this->tmpl['begin'][1] - 1; for ($j = 2; $j < (int) $this->tmpl['categoriescolumns']; $j++) { $this->tmpl['begin'][$j] = ceil($this->tmpl['countcategories'] / (int) $this->tmpl['categoriescolumns'] * $j); $this->tmpl['end'][$j - 1] = $this->tmpl['begin'][$j] - 1; } $this->tmpl['end'][$j - 1] = $this->tmpl['countcategories'] - 1; // last $this->tmpl['endfloat'] = $this->tmpl['countcategories'] - 1; if ($this->tmpl['equalpercentagewidth'] == 1) { $fixedWidth = 100 / (int) (int) $this->tmpl['categoriescolumns']; $this->tmpl['fixedwidthstyle1'] = 'width:' . $fixedWidth . '%;'; $this->tmpl['fixedwidthstyle2'] = 'width:' . $fixedWidth . '%;'; } else { $this->tmpl['fixedwidthstyle1'] = ''; //'margin: 10px;'; $this->tmpl['fixedwidthstyle2'] = ''; //'margin: 0px;'; } // ASSIGN //$this->assignRef('tmpl', $this->tmpl); $this->assignRef('params', $this->params); $this->_prepareDocument(); if ($display_categories_geotagging == 1) { // PARAMS - - - - - - - - - - $this->tmplGeo['categorieslng'] = $this->params->get('categories_lng', ''); $this->tmplGeo['categorieslat'] = $this->params->get('categories_lat', ''); $this->tmplGeo['categorieszoom'] = $this->params->get('categories_zoom', 2); $this->tmplGeo['googlemapsapikey'] = $this->params->get('google_maps_api_key', ''); $this->tmplGeo['categoriesmapwidth'] = $this->params->get('categories_map_width', ''); $this->tmplGeo['categoriesmapheight'] = $this->params->get('categorires_map_height', 500); // - - - - - - - - - - - - - - - // if no lng and lat will be added, Phoca Gallery will try to find it in categories if ($this->tmplGeo['categorieslat'] == '' || $this->tmplGeo['categorieslng'] == '') { phocagalleryimport('phocagallery.geo.geo'); $latLng = PhocaGalleryGeo::findLatLngFromCategory($this->categories); $this->tmplGeo['categorieslng'] = $latLng['lng']; $this->tmplGeo['categorieslat'] = $latLng['lat']; } $this->assignRef('tmplGeo', $this->tmplGeo); parent::display('map'); } else { parent::display($tpl); } }
function display($tpl = null) { $app = JFactory::getApplication(); // Don't load all the framework if nonsense $id = $app->input->get('id', 0, 'int'); $this->tagId = $app->input->get('tagid', 0, 'int'); if ($id < 1 && $this->tagId < 1) { JError::raiseError(404, JText::_("COM_PHOCAGALLERY_CATEGORY_IS_UNPUBLISHED")); exit; } $document = JFactory::getDocument(); $uri = JFactory::getURI(); $menus = $app->getMenu(); $menu = $menus->getActive(); $this->params = $app->getParams(); $this->tmpl['user'] = JFactory::getUser(); $this->tmpl['action'] = $uri->toString(); $this->tmpl['path'] = PhocaGalleryPath::getPath(); $limitStart = $app->input->get('limitstart', 0, 'int'); $this->tmpl['tab'] = $app->input->get('tab', 0, 'int'); $this->tmpl['pl'] = 'index.php?option=com_users&view=login&return=' . base64_encode($uri->toString()); $this->tmpl['icon_path'] = 'media/com_phocagallery/images/'; $this->tmpl['plcat'] = 'index.php?option=com_phocagallery&view=category'; $this->itemId = $app->input->get('Itemid', 0, 'int'); $neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels(); $access = PhocaGalleryAccess::isAccess($this->tmpl['user']->getAuthorisedViewLevels(), $neededAccessLevels); // CSS PhocaGalleryRenderFront::renderAllCSS(); // LIBRARY $library = PhocaGalleryLibrary::getLibrary(); $libraries['pg-group-shadowbox'] = $library->getLibrary('pg-group-shadowbox'); $libraries['pg-group-highslide'] = $library->getLibrary('pg-group-highslide'); $libraries['pg-group-jak'] = $library->getLibrary('pg-group-jak'); // PARAMS $this->tmpl['image_categories_size_cv'] = $this->params->get('image_categories_size_cv', 1); $this->tmpl['display_cat_name_title'] = $this->params->get('display_cat_name_title', 1); $this->tmpl['display_categories_cv'] = $this->params->get('display_categories_cv', 0); $this->tmpl['switch_image'] = $this->params->get('switch_image', 0); $this->tmpl['switch_height'] = $this->params->get('switch_height', 480); $this->tmpl['switch_width'] = $this->params->get('switch_width', 640); $this->tmpl['switch_fixed_size'] = $this->params->get('switch_fixed_size', 0); $this->tmpl['show_page_heading'] = $this->params->get('show_page_heading', 1); $this->tmpl['phocagallery_width'] = $this->params->get('phocagallery_width', ''); $this->tmpl['phocagallery_center'] = $this->params->get('phocagallery_center', ''); $this->tmpl['imagewidth'] = $this->params->get('medium_image_width', 100); $this->tmpl['imageheight'] = $this->params->get('medium_image_height', 100); $this->tmpl['picasa_correct_width_m'] = (int) $this->params->get('medium_image_width', 100); $this->tmpl['picasa_correct_height_m'] = (int) $this->params->get('medium_image_height', 100); $this->tmpl['picasa_correct_width_s'] = (int) $this->params->get('small_image_width', 50); $this->tmpl['picasa_correct_height_s'] = (int) $this->params->get('small_image_height', 50); $this->tmpl['picasa_correct_width_l'] = (int) $this->params->get('large_image_width', 640); $this->tmpl['picasa_correct_height_l'] = (int) $this->params->get('large_image_height', 480); $this->tmpl['category_box_space'] = $this->params->get('category_box_space', 0); $this->tmpl['detail_window'] = $this->params->get('detail_window', 0); $this->tmpl['display_name'] = $this->params->get('display_name', 1); $this->tmpl['display_rating'] = $this->params->get('display_rating', 0); $this->tmpl['display_rating_img'] = $this->params->get('display_rating_img', 0); $this->tmpl['display_comment'] = $this->params->get('display_comment', 0); $this->tmpl['display_comment_img'] = $this->params->get('display_comment_img', 0); $this->tmpl['display_subcategory'] = $this->params->get('display_subcategory', 1); $this->tmpl['display_icon_detail'] = $this->params->get('display_icon_detail', 1); $this->tmpl['display_icon_download'] = $this->params->get('display_icon_download', 2); $this->tmpl['display_icon_vm'] = $this->params->get('display_icon_vm', 0); $this->tmpl['display_img_desc_box'] = $this->params->get('display_img_desc_box', 0); $this->tmpl['diff_thumb_height'] = $this->params->get('diff_thumb_height', 0); $this->tmpl['overlib_attributes'] = $this->params->get('overlib_attributes', "BELOW, RIGHT, CSSCLASS, TEXTFONTCLASS, 'fontPhocaClass', FGCLASS, 'fgPhocaClass', BGCLASS, 'bgPhocaClass', CAPTIONFONTCLASS,'capfontPhocaClass', CLOSEFONTCLASS, 'capfontclosePhocaClass'"); // Switch image JS $this->tmpl['basic_image'] = ''; if ($this->tmpl['switch_image'] == 1) { $this->tmpl['wait_image'] = $this->tmpl['path']->image_rel_front_full . 'icon-switch.gif'; $this->tmpl['basic_image'] = $this->tmpl['path']->image_rel_front_full . 'phoca_thumb_l_no_image.png'; $document->addCustomTag(PhocaGalleryRenderFront::switchImage($this->tmpl['wait_image'])); $basic_imageSelected = 0; // we have not selected the basic image yet } $display_cat_name_breadcrumbs = $this->params->get('display_cat_name_breadcrumbs', 1); $popup_width = $this->params->get('front_modal_box_width', 680); $popup_height = $this->params->get('front_modal_box_height', 560); $this->tmpl['maxuploadchar'] = $this->params->get('max_upload_char', 1000); $this->tmpl['maxcommentchar'] = $this->params->get('max_comment_char', 1000); $this->tmpl['maxcreatecatchar'] = $this->params->get('max_create_cat_char', 1000); $this->tmpl['commentwidth'] = $this->params->get('comment_width', 500); $this->tmpl['displaycategorygeotagging'] = $this->params->get('display_category_geotagging', 0); $this->tmpl['displaycategorystatistics'] = $this->params->get('display_category_statistics', 0); // Used for Highslide JS (only image) $this->tmpl['displaydescriptiondetail'] = $this->params->get('display_description_detail', 0); $this->tmpl['display_title_description'] = $this->params->get('display_title_description', 0); $this->tmpl['charlengthname'] = $this->params->get('char_length_name', 15); $this->tmpl['char_cat_length_name'] = $this->params->get('char_cat_length_name', 9); $this->tmpl['display_icon_geo'] = $this->params->get('display_icon_geotagging', 0); // Check the category $this->tmpl['display_icon_geoimage'] = $this->params->get('display_icon_geotagging', 0); // Check the image $this->tmpl['display_camera_info'] = $this->params->get('display_camera_info', 0); // PARAMS - Upload $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', -1); $this->tmpl['enablemultiple'] = $this->params->get('enable_multiple', 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['javaboxwidth'] = $this->params->get('java_box_width', 480); $this->tmpl['javaboxheight'] = $this->params->get('java_box_height', 480); $this->tmpl['large_image_width'] = $this->params->get('large_image_width', 640); $this->tmpl['large_image_height'] = $this->params->get('large_image_height', 640); $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); $display_description_detail = $this->params->get('display_description_detail', 0); $description_detail_height = $this->params->get('description_detail_height', 16); $detail_buttons = $this->params->get('detail_buttons', 1); //$modal_box_overlay_color = $this->params->get( 'modal_box_overlay_color', '#000000' ); $modal_box_overlay_opacity = $this->params->get('modal_box_overlay_opacity', 0.3); //$modal_box_border_color = $this->params->get( 'modal_box_border_color', '#6b6b6b' ); //$modal_box_border_width = $this->params->get( 'modal_box_border_width', '2' ); $this->tmpl['enablecooliris'] = $this->params->get('enable_cooliris', 0); $highslide_class = $this->params->get('highslide_class', 'rounded-white'); $highslide_opacity = $this->params->get('highslide_opacity', 0); $highslide_outline_type = $this->params->get('highslide_outline_type', 'rounded-white'); $highslide_fullimg = $this->params->get('highslide_fullimg', 0); $highslide_slideshow = $this->params->get('highslide_slideshow', 1); $highslide_close_button = $this->params->get('highslide_close_button', 0); $this->tmpl['jakslideshowdelay'] = $this->params->get('jak_slideshow_delay', 5); $this->tmpl['jakorientation'] = $this->params->get('jak_orientation', 'none'); $this->tmpl['jakdescription'] = $this->params->get('jak_description', 1); $this->tmpl['jakdescriptionheight'] = $this->params->get('jak_description_height', 0); $this->tmpl['categoryimageordering'] = $this->params->get('category_image_ordering', 10); $this->tmpl['externalcommentsystem'] = $this->params->get('external_comment_system', 0); $display_subcat_page_cv = $this->params->get('display_subcat_page_cv', 0); $this->tmpl['display_back_button_cv'] = $this->params->get('display_back_button_cv', 1); $this->tmpl['display_categories_back_button_cv'] = $this->params->get('display_categories_back_button_cv', 1); $medium_image_width_cv = (int) $this->params->get('medium_image_width', 100) + 18; $medium_image_height_cv = (int) $this->params->get('medium_image_height', 100) + 18; $small_image_width_cv = (int) $this->params->get('small_image_width', 50) + 18; $small_image_height_cv = (int) $this->params->get('small_image_height', 50) + 18; $this->tmpl['imagetypecv'] = $this->tmpl['image_categories_size_cv']; $this->tmpl['overlibimagerate'] = (int) $this->params->get('overlib_image_rate', ''); $this->tmpl['gallerymetakey'] = $this->params->get('gallery_metakey', ''); $this->tmpl['gallerymetadesc'] = $this->params->get('gallery_metadesc', ''); $this->tmpl['altvalue'] = $this->params->get('alt_value', 1); $paramsFb = PhocaGalleryFbSystem::getCommentsParams($this->params->get('fb_comment_user_id', '')); // Facebook $this->tmpl['fb_comment_app_id'] = isset($paramsFb['fb_comment_app_id']) ? $paramsFb['fb_comment_app_id'] : ''; $this->tmpl['fb_comment_width'] = isset($paramsFb['fb_comment_width']) ? $paramsFb['fb_comment_width'] : 550; $this->tmpl['fb_comment_lang'] = isset($paramsFb['fb_comment_lang']) ? $paramsFb['fb_comment_lang'] : 'en_US'; $this->tmpl['fb_comment_count'] = isset($paramsFb['fb_comment_count']) ? $paramsFb['fb_comment_count'] : ''; $this->tmpl['enable_direct_subcat'] = $this->params->get('enable_direct_subcat', 0); $this->tmpl['display_comment_nopup'] = $this->params->get('display_comment_nopup', 0); $this->tmpl['boxplus_theme'] = $this->params->get('boxplus_theme', 'lightsquare'); $this->tmpl['boxplus_bautocenter'] = (int) $this->params->get('boxplus_bautocenter', 1); $this->tmpl['boxplus_autofit'] = (int) $this->params->get('boxplus_autofit', 1); $this->tmpl['boxplus_slideshow'] = (int) $this->params->get('boxplus_slideshow', 0); $this->tmpl['boxplus_loop'] = (int) $this->params->get('boxplus_loop', 0); $this->tmpl['boxplus_captions'] = $this->params->get('boxplus_captions', 'bottom'); $this->tmpl['boxplus_thumbs'] = $this->params->get('boxplus_thumbs', 'inside'); $this->tmpl['boxplus_duration'] = (int) $this->params->get('boxplus_duration', 250); $this->tmpl['boxplus_transition'] = $this->params->get('boxplus_transition', 'linear'); $this->tmpl['boxplus_contextmenu'] = (int) $this->params->get('boxplus_contextmenu', 1); $this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0); $this->tmpl['customcss'] = $this->params->get('custom_css', ''); $this->tmpl['display_tags_links'] = $this->params->get('display_tags_links', 0); $this->tmpl['displaying_tags_true'] = 0; //No tag found, if yes, the box will be resized $this->tmpl['ytbupload'] = $this->params->get('youtube_upload', 0); $this->tmpl['ytb_display'] = $this->params->get('ytb_display', 0); $this->tmpl['enable_multibox'] = $this->params->get('enable_multibox', 0); $this->tmpl['multibox_height'] = (int) $this->params->get('multibox_height', 560); $this->tmpl['multibox_width'] = (int) $this->params->get('multibox_width', 980); // CSS /*switch($this->tmpl['image_categories_size']) { // medium case 1: $this->tmpl['picasa_correct_width'] = (int)$this->params->get( 'medium_image_width', 100 ); $this->tmpl['picasa_correct_height'] = (int)$this->params->get( 'medium_image_height', 100 ); $this->tmpl['imagewidth'] = (int)$this->params->get( 'medium_image_width', 100 ); $this->tmpl['imageheight'] = (int)$this->params->get( 'medium_image_height', 100 ); $this->tmpl['class_suffix'] = 'medium'; break; // small case 0: default: $this->tmpl['picasa_correct_width'] = (int)$this->params->get( 'small_image_width', 50 ); $this->tmpl['picasa_correct_height'] = (int)$this->params->get( 'small_image_height', 50 ); $this->tmpl['imagewidth'] = (int)$this->params->get( 'small_image_width', 50 ); $this->tmpl['imageheight'] = (int)$this->params->get( 'small_image_height', 50 ); $this->tmpl['class_suffix'] = 'small'; break; }*/ // CSS Specific /*$s = '.pg-cv {'."\n"; if ($this->tmpl['phocagallerywidth'] != '') { $s .= ' margin: auto;'."\n"; $s .= ' width: '.$this->tmpl['phocagallerywidth'].'px;'."\n"; } $s .= '}'."\n"; $s .= '.pg-cv-box {'."\n"; $s .= ' height: '.$this->tmpl['boxsize']['height'].'px;'."\n"; $s .= ' width: '.$this->tmpl['boxsize']['width'].'px;"'."\n"; $s .= '}'."\n"; $s .= '.pg-cv-box-img {'."\n"; $s .= ' height: '.$this->tmpl['imageheight'].'px;'."\n"; $s .= ' width: '.$this->tmpl['imagewidth'].'px;"'."\n"; $s .= '}'."\n"; $document->addCustomTag('<style type="text/css">'.$s.'</style>');*/ // Correct Height // Description detail height if ($display_description_detail == 1) { $popup_height = $popup_height + $description_detail_height; } // Detail buttons in detail view if ($detail_buttons != 1) { $popup_height = $popup_height - 45; } if ($this->tmpl['display_rating_img'] == 1) { $popup_height = $popup_height + 35; } // Youtube video without padding, margin if ($this->tmpl['detail_window'] != 7 && $this->tmpl['ytb_display'] == 1) { $document->addCustomTag("<style type=\"text/css\"> \n" . " #boxplus .boxplus-dialog .boxplus-controlsclose {\n\t\t\t\ttop: -15px !important;\n\t\t\t\tright: -15px !important;\n\t\t\t\tmargin:0px 0 0 0 !important;\n\t\t\t} \n" . " </style> \n"); $popup_width = PhocaGallerySettings::getAdvancedSettings('youtubewidth'); $popup_height = PhocaGallerySettings::getAdvancedSettings('youtubeheight'); } // Multibox if ($this->tmpl['enable_multibox'] == 1) { $popup_width = $this->tmpl['multibox_width']; $popup_height = $this->tmpl['multibox_height']; } if ($this->tmpl['detail_window'] == 4) { $popup_height = $popup_height + 12; } // Comment Image JS if ((int) $this->tmpl['display_comment_img'] == 2 || (int) $this->tmpl['display_comment_img'] == 3) { PhocaGalleryCommentImage::renderCommentImageJS(); } // Rate Image JS if ((int) $this->tmpl['display_rating_img'] == 2) { PhocaGalleryRateImage::renderRateImgJS(); } // ======================================================= // DIFFERENT METHODS OF DISPLAYING THE DETAIL VIEW // ======================================================= // MODAL - will be displayed in case e.g. highslide or shadowbox too, because in there are more links JHtml::_('behavior.modal', 'a.pg-modal-button'); $btn = new PhocaGalleryRenderDetailWindow(); $btn->popupWidth = $popup_width; $btn->popupHeight = $popup_height; $btn->mbOverlayOpacity = $modal_box_overlay_opacity; $btn->sbSlideshowDelay = $this->params->get('sb_slideshow_delay', 5); $btn->sbSettings = $this->params->get('sb_settings', "overlayColor: '#000',overlayOpacity:0.5,resizeDuration:0.35,displayCounter:true,displayNav:true"); $btn->hsSlideshow = $highslide_slideshow; $btn->hsClass = $highslide_class; $btn->hsOutlineType = $highslide_outline_type; $btn->hsOpacity = $highslide_opacity; $btn->hsCloseButton = $highslide_close_button; $btn->hsFullImg = $highslide_fullimg; $btn->jakDescHeight = $this->tmpl['jakdescriptionheight']; $btn->jakDescWidth = ''; $btn->jakOrientation = $this->tmpl['jakorientation']; $btn->jakSlideshowDelay = $this->tmpl['jakslideshowdelay']; $btn->bpTheme = $this->tmpl['boxplus_theme']; $btn->bpBautocenter = (int) $this->tmpl['boxplus_bautocenter']; $btn->bpAutofit = (int) $this->tmpl['boxplus_autofit']; $btn->bpSlideshow = (int) $this->tmpl['boxplus_slideshow']; $btn->bpLoop = (int) $this->tmpl['boxplus_loop']; $btn->bpCaptions = $this->tmpl['boxplus_captions']; $btn->bpThumbs = $this->tmpl['boxplus_thumbs']; $btn->bpDuration = (int) $this->tmpl['boxplus_duration']; $btn->bpTransition = $this->tmpl['boxplus_transition']; $btn->bpContextmenu = (int) $this->tmpl['boxplus_contextmenu']; $btn->setButtons($this->tmpl['detail_window'], $libraries, $library); $this->button = $btn->getB1(); $this->button2 = $btn->getB2(); $this->buttonother = $btn->getB3(); $this->tmpl['highslideonclick'] = ''; // for using with highslide if (isset($this->button->highslideonclick)) { $this->tmpl['highslideonclick'] = $this->button->highslideonclick; // TODO } $this->tmpl['highslideonclick2'] = ''; if (isset($this->button->highslideonclick2)) { $this->tmpl['highslideonclick2'] = $this->button->highslideonclick2; // TODO } $folderButton = new JObject(); $folderButton->set('name', 'image'); $folderButton->set('options', ""); // End open window parameters // ================================================================== // Information about current category $this->category = $this->get('category'); // Cooliris (Piclens) $this->tmpl['start_cooliris'] = 0; if ($this->tmpl['enablecooliris'] == 1) { $this->tmpl['start_cooliris'] = $this->params->get('start_cooliris', 0); // CSS - PicLens START $document->addCustomTag(PhocaGalleryRenderFront::renderPicLens($this->category->id)); } // PARAMS - Pagination and subcategories on other sites // Subcategories will be displayed only on first page if pagination will be used $display_subcat_page = $this->params->get('display_subcat_page', 0); // On the first site subcategories will be displayed always $get['start'] = $app->input->get('limitstart', '', 'string'); if ($display_subcat_page == 2) { $display_subcat_page = 0; // Nowhere } else { if ($display_subcat_page == 0 && $get['start'] > 0) { $display_subcat_page = 0; //in case: second page and param=0 } else { $display_subcat_page = 1; //in case:first page or param==1 } } // Categories View in Category View if ($display_subcat_page_cv == 2) { $display_subcat_page_cv = 0; // Nowhere } else { if ($display_subcat_page_cv == 0 && $get['start'] > 0) { $display_subcat_page_cv = 0; //in case: second page and param=0 } else { $display_subcat_page_cv = 1; //in case:first page or param==1 } } // PARAMS - Display Back Buttons $display_back_button = $this->params->get('display_back_button', 1); $display_categories_back_button = $this->params->get('display_categories_back_button', 1); // PARAMS - Access Category - display category (subcategory folder or backbutton to not accessible cat $display_access_category = $this->params->get('display_access_category', 1); // Set page title per category if ($this->tmpl['display_cat_name_title'] == 1 && isset($this->category->title)) { $document->setTitle($this->params->get('page_title') . ' - ' . $this->category->title); } else { $document->setTitle($this->params->get('page_title')); } // Breadcrumb display: // 0 - only menu link // 1 - menu link - category name // 2 - only category name $this->_addBreadCrumbs(isset($menu->query['id']) ? $menu->query['id'] : 0, $display_cat_name_breadcrumbs); // Define image tag attributes /* if (!empty ($this->category->image)) { $attribs['align'] = '"'.$this->category->image_position.'"'; $attribs['hspace'] = '"6"'; $this->tmpl['image'] = JHtml::_('image', 'images/stories/'.$this->category->image,'', $attribs); }*/ // Overlib $enable_overlib = $this->params->get('enable_overlib', 0); if ((int) $enable_overlib > 0) { $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/overlib/overlib_mini.js'); } // MODEL $model = $this->getModel(); // Trash $this->tmpl['trash'] = 0; $this->tmpl['publish_unpublish'] = 0; $this->tmpl['approved_not_approved'] = 0; // only to see the info // USER RIGHT - DELETE - - - - - - - - - - - // 2, 2 means that user access will be ignored in function getUserRight for display Delete button $rightDisplayDelete = 0; // default is to null (all users cannot upload) if (!empty($this->category)) { $rightDisplayDelete = PhocaGalleryAccess::getUserRight('deleteuserid', $this->category->deleteuserid, 2, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), 0); } if ($rightDisplayDelete == 1) { $this->tmpl['trash'] = 1; $this->tmpl['publish_unpublish'] = 1; $this->tmpl['approved_not_approved'] = 1; // only to see the info } // - - - - - - - - - - - - - - - - - - - - - // Upload $this->tmpl['displayupload'] = 0; // USER RIGHT - UPLOAD - - - - - - - - - - - // 2, 2 means that user access will be ignored in function getUserRight for display Delete button $rightDisplayUpload = 0; // default is to null (all users cannot upload) if (!empty($this->category)) { $rightDisplayUpload = PhocaGalleryAccess::getUserRight('uploaduserid', $this->category->uploaduserid, 2, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), 0); } if ($rightDisplayUpload == 1) { $this->tmpl['displayupload'] = 1; $document->addCustomTag(PhocaGalleryRenderFront::renderOnUploadCategoryJS()); $document->addCustomTag(PhocaGalleryRenderFront::renderDescriptionUploadJS((int) $this->tmpl['maxuploadchar'])); } $this->tmpl['displaycreatecat'] = 0; if ($rightDisplayUpload == 1 && $this->tmpl['enable_direct_subcat'] == 1) { $this->tmpl['displaycreatecat'] = 1; $document->addCustomTag(PhocaGalleryRenderFront::renderOnUploadCategoryJS()); $document->addCustomTag(PhocaGalleryRenderFront::renderDescriptionCreateSubCatJS((int) $this->tmpl['maxcreatecatchar'])); } // - - - - - - - - - - - - - - - - - - - - - // USER RIGHT - ACCESS - - - - - - - - - - - $rightDisplay = 1; //default is set to 1 (all users can see the category) if (!empty($this->category)) { $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $this->category->accessuserid, 0, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), $display_access_category); } if ($rightDisplay == 0) { $app->redirect(JRoute::_($this->tmpl['pl'], false), JText::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION')); exit; } // - - - - - - - - - - - - - - - - - - - - - // 1. GEOTAGGING CATEGORY $this->map['longitude'] = ''; // will be used for 1. default_geotagging to not display pane and 2. to remove pane (line cca 1554) $this->map['latitude'] = ''; if (isset($this->category->latitude) && $this->category->latitude != '' && $this->category->latitude != 0 && isset($this->category->longitude) && $this->category->longitude != '' && $this->category->longitude != 0) { $this->map['longitude'] = $this->category->longitude; $this->map['latitude'] = $this->category->latitude; $this->map['zoom'] = $this->category->zoom; $this->map['geotitle'] = $this->category->geotitle; $this->map['description'] = $this->category->description; if ($this->map['geotitle'] == '') { $this->map['geotitle'] = $this->category->title; } } else { $this->tmpl['display_icon_geo'] = 0; } $this->tmpl['categoryimageordering'] = $this->params->get('category_image_ordering', 10); //$this->tmpl['categoryimageorderingcv'] = 10;//$this->params->get( 'category_image_ordering_cv', 10 ); // Image next to Category in Categories View in Category View is ordered by Random as default phocagalleryimport('phocagallery.ordering.ordering'); $this->categoryImageOrdering = PhocaGalleryOrdering::getOrderingString($this->tmpl['categoryimageordering']); //$this->categoryImageOrderingCV = PhocaGalleryOrdering::getOrderingString($this->tmpl['categoryimageorderingcv']); // = = = = = = = = = = = = = = = = = = = = // BOXES // = = = = = = = = = = = = = = = = = = = = // Information because of height of box (if they are used not by all images) $this->tmpl['display_icon_extlink1_box'] = 0; $this->tmpl['display_icon_extlink2_box'] = 0; $this->tmpl['display_icon_vmbox'] = 0; $this->tmpl['display_icon_geo_box'] = 0; $iS = 0; $iCV = 0; $this->items = array(); // Category View $this->itemscv = array(); // Category List (Categories View) in Category View // ---------------------------------------- // PARENT FOLDERS(I) or Back Button STANDARD // ---------------------------------------- /* // Set Back Button to CATEGORIES VIEW $this->itemsLink = $menu->getItems('link', 'index.php?option=com_phocagallery&view=categories'); $itemId = 0; if(isset($this->itemsLink[0])) { $itemId = $this->itemsLink[0]->id; } $backLink = 'index.php?option=com_phocagallery&view=categories&Itemid='.$itemId;*/ $posItemid = $posItemidNull = $backLinkItemId = false; $backLink = PhocaGalleryRoute::getCategoriesRoute(); $posItemidNull = strpos($backLink, "Itemid=0"); $posItemid = strpos($backLink, "Itemid="); if ($posItemidNull === false && $posItemid) { $backLinkItemId = 1; } $parentCategory = $this->get('parentcategory'); if ($display_back_button == 1) { if (!empty($parentCategory)) { $this->items[$iS] = $parentCategory; // USER RIGHT - ACCESS - - - - - - - - - - - // Should be the link to parentcategory displayed $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $this->items[$iS]->accessuserid, $this->items[$iS]->access, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), $display_access_category); // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; if ($display_access_category == 1) { // we simulate that we want not to display unaccessable categories // so we get rightDisplayKey = 0 then the key will be displayed if (!empty($parentCategory)) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $this->items[$iS]->accessuserid, $this->items[$iS]->access, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), 0); } } // - - - - - - - - - - - - - - - - - - - - - if ($rightDisplay > 0) { $this->items[$iS]->cls = 'pg-box-parentfolder'; $this->items[$iS]->slug = $this->items[$iS]->id . ':' . $this->items[$iS]->alias; $this->items[$iS]->item_type = "parentfolder"; $this->items[$iS]->linkthumbnailpath = PhocaGalleryImageFront::displayBackFolder('medium', $rightDisplayKey); $this->items[$iS]->extm = $this->items[$iS]->linkthumbnailpath; $this->items[$iS]->exts = $this->items[$iS]->linkthumbnailpath; $this->items[$iS]->numlinks = 0; // We are in category view $this->items[$iS]->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $this->items[$iS]->slug . '&Itemid=' . $this->itemId); $this->items[$iS]->button =& $folderButton; $this->items[$iS]->button->methodname = ''; $this->items[$iS]->display_icon_detail = 0; $this->items[$iS]->display_icon_download = 0; $this->items[$iS]->display_name = 0; $this->items[$iS]->display_icon_vm = ''; $this->items[$iS]->start_cooliris = 0; $this->items[$iS]->trash = 0; $this->items[$iS]->publish_unpublish = 0; $this->items[$iS]->approved_not_approved = 0; $this->items[$iS]->enable_cooliris = 0; $this->items[$iS]->overlib = 0; $this->items[$iS]->display_icon_geo = 0; $this->items[$iS]->display_icon_commentimg = 0; $this->items[$iS]->type = 0; $this->items[$iS]->camera_info = 0; $this->items[$iS]->display_icon_extlink1 = 0; $this->items[$iS]->display_icon_extlink2 = 0; $this->items[$iS]->description = ''; $this->items[$iS]->altvalue = ''; $iS++; } else { // There is no right to see the data but the object exists (because it was loaded from database // Destroy it unset($this->items[$iS]); } } else { // Back button to categories list if it exists if ($backLinkItemId != 0 && $display_categories_back_button == 1) { $this->items[$iS] = new JObject(); $this->items[$iS]->cls = 'pg-box-backbtn'; $this->items[$iS]->link = JRoute::_($backLink); $this->items[$iS]->title = JTEXT::_('COM_PHOCAGALLERY_CATEGORY_LIST'); $this->items[$iS]->item_type = "categorieslist"; $this->items[$iS]->linkthumbnailpath = PhocaGalleryImageFront::displayBackFolder('medium', 1); $this->items[$iS]->extm = $this->items[$iS]->linkthumbnailpath; $this->items[$iS]->exts = $this->items[$iS]->linkthumbnailpath; $this->items[$iS]->numlinks = 0; // We are in category view $this->items[$iS]->button =& $folderButton; $this->items[$iS]->button->methodname = ''; $this->items[$iS]->display_icon_detail = 0; $this->items[$iS]->display_icon_download = 0; $this->items[$iS]->display_name = 0; $this->items[$iS]->display_icon_vm = ''; $this->items[$iS]->start_cooliris = 0; $this->items[$iS]->trash = 0; $this->items[$iS]->publish_unpublish = 0; $this->items[$iS]->approved_not_approved = 0; $this->items[$iS]->enable_cooliris = 0; $this->items[$iS]->overlib = 0; $this->items[$iS]->display_icon_geo = 0; $this->items[$iS]->display_icon_commentimg = 0; $this->items[$iS]->type = 0; $this->items[$iS]->camera_info = 0; $this->items[$iS]->display_icon_extlink1 = 0; $this->items[$iS]->display_icon_extlink2 = 0; $this->items[$iS]->description = ''; $this->items[$iS]->altvalue = ''; $iS++; } } } // ---------------------------------------- // PARENT FOLDERS(II) or Back Button CATEGORIES VIEW IN CATEGORY VIEW // ---------------------------------------- if ($this->tmpl['display_back_button_cv'] == 1 && $this->tmpl['display_categories_cv'] == 1) { if (!empty($parentCategory)) { $this->itemscv[$iCV] = clone $parentCategory; // USER RIGHT - ACCESS - - - - - - - - - - - // Should be the link to parentcategory displayed $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $this->itemscv[$iCV]->accessuserid, $this->itemscv[$iCV]->access, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), $display_access_category); // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; if ($display_access_category == 1) { // we simulate that we want not to display unaccessable categories // so we get rightDisplayKey = 0 then the key will be displayed if (!empty($parentCategory)) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $this->itemscv[$iCV]->accessuserid, $this->itemscv[$iCV]->access, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), 0); } } // - - - - - - - - - - - - - - - - - - - - - if ($rightDisplay > 0) { $this->itemscv[$iCV]->cls = 'pg-box-parentfolder-cv'; $this->itemscv[$iCV]->slug = $this->itemscv[$iCV]->id . ':' . $this->itemscv[$iCV]->alias; $this->itemscv[$iCV]->item_type = "parentfoldercv"; $this->itemscv[$iCV]->linkthumbnailpath = PhocaGalleryImageFront::displayBackFolder('medium', $rightDisplayKey); $this->itemscv[$iCV]->extm = $this->itemscv[$iCV]->linkthumbnailpath; $this->itemscv[$iCV]->exts = $this->itemscv[$iCV]->linkthumbnailpath; $this->itemscv[$iCV]->numlinks = 0; // We are in category view $this->itemscv[$iCV]->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $this->itemscv[$iCV]->slug . '&Itemid=' . $this->itemId); $this->itemscv[$iCV]->type = 3; $this->itemscv[$iCV]->altvalue = ''; $iCV++; } else { // There is no right to see the data but the object exists (because it was loaded from database // Destroy it unset($this->itemscv[$iCV]); } } else { // Back button to categories list if it exists if ($backLinkItemId != 0 && $this->tmpl['display_categories_back_button_cv'] == 1) { $this->itemscv[$iCV] = new JObject(); $this->itemscv[$iCV]->cls = 'pg-cvcsv-back'; $this->itemscv[$iCV]->link = $backLink; $this->itemscv[$iCV]->title = JTEXT::_('COM_PHOCAGALLERY_CATEGORY_LIST'); $this->itemscv[$iCV]->item_type = "categorieslistcv"; $this->itemscv[$iCV]->linkthumbnailpath = PhocaGalleryImageFront::displayBackFolder('medium', 1); $this->itemscv[$iCV]->extm = $this->itemscv[$iCV]->linkthumbnailpath; $this->itemscv[$iCV]->exts = $this->itemscv[$iCV]->linkthumbnailpath; $this->itemscv[$iCV]->numlinks = 0; // We are in category view $this->itemscv[$iCV]->link = JRoute::_($this->itemscv[$iCV]->link); $this->itemscv[$iCV]->type = 3; $this->itemscv[$iCV]->altvalue = ''; $iCV++; } } } // ---------------------------------------- // SUB FOLDERS(1) STANDARD // ---------------------------------------- // Display subcategories on every page if ($display_subcat_page == 1) { $subCategory = $this->get('subcategory'); $totalSubCat = count($subCategory); if ((int) $this->tagId > 0) { $subCategory = array(); } // No subcategories for tag searching if (!empty($subCategory)) { $this->items[$iS] =& $subCategory; for ($iSub = 0; $iSub < $totalSubCat; $iSub++) { $this->items[$iS] =& $subCategory[$iSub]; // USER RIGHT - ACCESS - - - - - - - - - - $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $this->items[$iS]->accessuserid, $this->items[$iS]->access, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), $display_access_category); // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; if ($display_access_category == 1) { // we simulate that we want not to display unaccessable categories // so we get rightDisplayKey = 0 then the key will be displayed if (!empty($this->items[$iS])) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $this->items[$iS]->accessuserid, $this->items[$iS]->access, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), 0); } } // - - - - - - - - - - - - - - - - - - - - if ($rightDisplay > 0) { $this->items[$iS]->cls = 'pg-box-subfolder'; $this->items[$iS]->slug = $this->items[$iS]->id . ':' . $this->items[$iS]->alias; $this->items[$iS]->item_type = "subfolder"; $numlinks = $model->getCountItem($this->items[$iS]->id); //Should be get from main subcategories query if (isset($numlinks[0]) && $numlinks[0] > 0) { $this->items[$iS]->numlinks = (int) $numlinks[0]; } else { $this->items[$iS]->numlinks = 0; } $extImage = PhocaGalleryImage::isExtImage($this->items[$iS]->extid); if ($extImage) { $imagePic = new stdClass(); if ($this->tmpl['categoryimageordering'] != 10) { $imagePic = PhocaGalleryImageFront::getRandomImageRecursive($this->items[$iS]->id, $this->categoryImageOrdering, 1); $fileThumbnail = PhocaGalleryImageFront::displayCategoryExtImgOrFolder($imagePic->exts, $imagePic->extm, 'medium', $rightDisplayKey, 'display_category_icon_image'); } else { $fileThumbnail = PhocaGalleryImageFront::displayCategoryExtImgOrFolder($this->items[$iS]->exts, $this->items[$iS]->extm, 'medium', $rightDisplayKey, 'display_category_icon_image'); $imagePic->extw = $this->items[$iS]->extw; $imagePic->exth = $this->items[$iS]->exth; } // in case category is locked or no extm exists $this->items[$iS]->linkthumbnailpath = $fileThumbnail->linkthumbnailpath; $this->items[$iS]->extm = $fileThumbnail->extm; $this->items[$iS]->exts = $fileThumbnail->exts; $this->items[$iS]->exthswitch = $this->items[$iS]->extwswitch = 0; if ($imagePic->extw != '') { $extw = explode(',', $imagePic->extw); $this->items[$iS]->extw = $extw[1]; $this->items[$iS]->extwswitch = $extw[0]; } if ($imagePic->exth != '') { $exth = explode(',', $imagePic->exth); $this->items[$iS]->exth = $exth[1]; $this->items[$iS]->exthswitch = $exth[0]; } $this->items[$iS]->extpic = $fileThumbnail->extpic; } else { if ($this->tmpl['categoryimageordering'] != 10) { $randomImage = PhocaGalleryImageFront::getRandomImageRecursive($this->items[$iS]->id, $this->categoryImageOrdering); $fileThumbnail = PhocaGalleryImageFront::displayCategoryImageOrFolder($randomImage, 'medium', $rightDisplayKey, 'display_category_icon_image'); } else { $fileThumbnail = PhocaGalleryImageFront::displayCategoryImageOrFolder($this->items[$iS]->filename, 'medium', $rightDisplayKey, 'display_category_icon_image'); } $this->items[$iS]->linkthumbnailpath = $fileThumbnail->rel; } $this->items[$iS]->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $this->items[$iS]->slug . '&Itemid=' . $this->itemId); $this->items[$iS]->button =& $folderButton; $this->items[$iS]->button->methodname = ''; $this->items[$iS]->display_icon_detail = 0; $this->items[$iS]->display_icon_download = 0; $this->items[$iS]->display_name = $this->tmpl['display_name']; $this->items[$iS]->display_icon_vm = ''; $this->items[$iS]->start_cooliris = 0; $this->items[$iS]->trash = 0; $this->items[$iS]->publish_unpublish = 0; $this->items[$iS]->approved_not_approved = 0; $this->items[$iS]->enable_cooliris = 0; $this->items[$iS]->overlib = 0; $this->items[$iS]->display_icon_geo = 0; $this->items[$iS]->type = 1; $this->items[$iS]->camera_info = 0; $this->items[$iS]->display_icon_extlink1 = 0; $this->items[$iS]->display_icon_extlink2 = 0; $this->items[$iS]->description = ''; $this->items[$iS]->display_icon_commentimg = 0; $this->items[$iS]->altvalue = ''; $iS++; } else { // There is no right to see the data but the object exists (because it was loaded from database // Destroy it unset($this->items[$iS]); } } } } // ---------------------------------------- // SUB FOLDERS(II) or Back Button CATEGORIES VIEW IN CATEGORY VIEW // ---------------------------------------- //display subcategories on every page if ($display_subcat_page_cv == 1 && $this->tmpl['display_categories_cv'] == 1) { $subCategory = $this->get('subcategory'); $totalSubCat = count($subCategory); if ((int) $this->tagId > 0) { $subCategory = array(); } // No subcategories for tag searching if (!empty($subCategory)) { $this->itemscv[$iCV] =& $subCategory; for ($iSub = 0; $iSub < $totalSubCat; $iSub++) { $this->itemscv[$iCV] =& $subCategory[$iSub]; // USER RIGHT - ACCESS - - - - - - - - - - $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $this->itemscv[$iCV]->accessuserid, $this->itemscv[$iCV]->access, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), $display_access_category); // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; if ($display_access_category == 1) { // we simulate that we want not to display unaccessable categories // so we get rightDisplayKey = 0 then the key will be displayed if (!empty($this->itemscv[$iCV])) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $this->itemscv[$iCV]->accessuserid, $this->itemscv[$iCV]->access, $this->tmpl['user']->getAuthorisedViewLevels(), $this->tmpl['user']->get('id', 0), 0); } } // - - - - - - - - - - - - - - - - - - - - if ($rightDisplay > 0) { $this->itemscv[$iCV]->cls = 'pg-cvcsv-name'; $this->itemscv[$iCV]->slug = $this->itemscv[$iCV]->id . ':' . $this->itemscv[$iCV]->alias; $this->itemscv[$iCV]->item_type = "subfoldercv"; $this->itemscv[$iCV]->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $this->itemscv[$iCV]->slug . '&Itemid=' . $this->itemId); $this->itemscv[$iCV]->type = 4; $numlinks = $model->getCountItem($this->itemscv[$iCV]->id); //Should be get from main subcategories query if (isset($numlinks[0]) && $numlinks[0] > 0) { $this->itemscv[$iCV]->numlinks = (int) $numlinks[0]; } else { $this->itemscv[$iCV]->numlinks = 0; } $extImage = PhocaGalleryImage::isExtImage($this->itemscv[$iCV]->extid); if ($extImage) { /*$imagePic = new stdClass(); if ($this->tmpl['categoryimageordering'] != 10) { $imagePic= PhocaGalleryImageFront::getRandomImageRecursive($this->itemscv[$iCV]->id, $this->categoryImageOrderingCV, 1); $fileThumbnail = PhocaGalleryImageFront::displayCategoryExtImgOrFolder($imagePic->exts, $imagePic->extm, 'medium', $rightDisplayKey, 'display_category_icon_image'); } else { $fileThumbnail = PhocaGalleryImageFront::displayCategoryExtImgOrFolder($this->itemscv[$iCV]->exts,$this->itemscv[$iCV]->extm, 'medium', $rightDisplayKey, 'display_category_icon_image'); $imagePic->extw = $this->itemscv[$iCV]->extw; $imagePic->exth = $this->itemscv[$iCV]->exth; } // in case category is locked or no extm exists $this->itemscv[$iCV]->linkthumbnailpath = $fileThumbnail->linkthumbnailpath; $this->itemscv[$iCV]->extm = $fileThumbnail->extm; $this->itemscv[$iCV]->exts = $fileThumbnail->exts; $this->itemscv[$iCV]->exthswitch = $this->items[$iCV]->extwswitch = 0; if ($imagePic->extw != '') { $extw = explode(',',$imagePic->extw); $this->itemscv[$iCV]->extw = $extw[1]; $this->itemscv[$iCV]->extwswitch = $extw[0]; } if ($imagePic->exth != '') { $exth = explode(',',$imagePic->exth); $this->itemscv[$iCV]->exth = $exth[1]; $this->itemscv[$iCV]->exthswitch = $exth[0]; }*/ $this->itemscv[$iCV]->extpic = ''; } else { /*if ($this->tmpl['categoryimageordering'] != 10) { $randomImage = PhocaGalleryImageFront::getRandomImageRecursive($this->itemscv[$iCV]->id, $this->categoryImageOrderingCV); $fileThumbnail = PhocaGalleryImageFront::displayCategoryImageOrFolder($randomImage, 'medium', $rightDisplayKey, 'display_category_icon_image_cv'); } else { $fileThumbnail = PhocaGalleryImageFront::displayCategoryImageOrFolder($this->itemscv[$iCV]->filename, 'medium', $rightDisplayKey, 'display_category_icon_image_cv'); }*/ $this->itemscv[$iCV]->linkthumbnailpath = ''; $this->itemscv[$iCV]->altvalue = ''; } $iCV++; } else { // There is no right to see the data but the object exists (because it was loaded from database // Destroy it unset($this->itemscv[$iCV]); } } } } // ---------------------------------------- // IMAGES // ---------------------------------------- // If user has rights to delete or publish or unpublish, unbublished items should be displayed if ($rightDisplayDelete == 1) { $images = $model->getData(1, $this->tagId); $this->tmpl['pagination'] = $model->getPagination(1, $this->tagId); } else { $images = $model->getData(0, $this->tagId); $this->tmpl['pagination'] = $model->getPagination(0, $this->tagId); } $this->tmpl['ordering'] = $model->getOrdering(); $totalImg = count($images); if ($limitStart > 0) { $this->tmpl['limitstarturl'] = '&limitstart=' . $limitStart; } else { $this->tmpl['limitstarturl'] = ''; } $this->tmpl['jakdatajs'] = array(); $this->tmpl['display_icon_commentimg_box'] = 0; for ($iM = 0; $iM < $totalImg; $iM++) { $this->items[$iS] = $images[$iM]; $this->items[$iS]->cls = 'pg-box-image'; $this->items[$iS]->slug = $this->items[$iS]->id . ':' . $this->items[$iS]->alias; $this->items[$iS]->item_type = "image"; $this->items[$iS]->linknr = ''; //Def $extImage = PhocaGalleryImage::isExtImage($this->items[$iS]->extid); // Get file thumbnail or No Image $this->items[$iS]->exthswitch = $this->items[$iS]->extwswitch = 0; if ($this->items[$iS]->extm != '') { if ($this->items[$iS]->extw != '') { $extw = explode(',', $this->items[$iS]->extw); $this->items[$iS]->extw = $extw[1]; $this->items[$iS]->extwswitch = $extw[0]; } if ($this->items[$iS]->exth != '') { $exth = explode(',', $this->items[$iS]->exth); $this->items[$iS]->exth = $exth[1]; $this->items[$iS]->exthswitch = $exth[0]; } $this->items[$iS]->extpic = 1; $this->items[$iS]->linkthumbnailpath = ''; } else { // Mansory $iFormat = 'medium'; if ($this->tmpl['diff_thumb_height'] > 0) { if ($this->items[$iS]->format == 2) { $iFormat = 'medium1'; // 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; $this->items[$iS]->linkother = $siteLink; $this->items[$iS]->linkorig = $imgLinkOrig; // jak data js switch ($this->tmpl['jakdescription']) { case 0: $descriptionJakJs = ''; break; case 2: $descriptionJakJs = PhocaGalleryText::strTrimAll(addslashes($this->items[$iS]->description)); break; case 3: $descriptionJakJs = PhocaGalleryText::strTrimAll(addslashes($this->items[$iS]->title)); if ($this->items[$iS]->description != '') { $descriptionJakJs .= '<br />' . PhocaGalleryText::strTrimAll(addslashes($this->items[$iS]->description)); } break; case 1: default: $descriptionJakJs = PhocaGalleryText::strTrimAll(addslashes($this->items[$iS]->title)); break; } $this->items[$iS]->linknr = $iM; $this->tmpl['jakdatajs'][$iS] = "{alt: '" . PhocaGalleryText::strTrimAll(addslashes($this->items[$iS]->title)) . "',"; if ($descriptionJakJs != '') { $this->tmpl['jakdatajs'][$iS] .= "description: '" . $descriptionJakJs . "',"; } else { $this->tmpl['jakdatajs'][$iS] .= "description: ' ',"; } if ($extImage) { $this->tmpl['jakdatajs'][$iS] .= "small: {url: '" . $this->items[$iS]->extm . "'}," . "big: {url: '" . $this->items[$iS]->extl . "'} }"; } else { $this->tmpl['jakdatajs'][$iS] .= "small: {url: '" . htmlentities(JURI::base(true) . '/' . PhocaGalleryText::strTrimAll(addslashes($thumbLinkM->rel))) . "'}," . "big: {url: '" . htmlentities(JURI::base(true) . '/' . PhocaGalleryText::strTrimAll(addslashes($imgLink))) . "'} }"; } } else { if ($this->tmpl['detail_window'] == 8) { $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'] == 9) { $this->items[$iS]->link = $siteLink; $this->items[$iS]->link2 = $siteLink; $this->items[$iS]->linkother = $siteLink; $this->items[$iS]->linkorig = $imgLinkOrig; } else { if ($this->tmpl['detail_window'] == 10) { $this->items[$iS]->link = $imgLink; $this->items[$iS]->link2 = $imgLink; $this->items[$iS]->linkother = $siteLink; $this->items[$iS]->linkorig = $imgLinkOrig; } else { $this->items[$iS]->link = $siteLink; $this->items[$iS]->link2 = $siteLink; $this->items[$iS]->linkother = $siteLink; $this->items[$iS]->linkorig = $imgLinkOrig; } } } } } } } // Buttons, e.g. shadowbox: // button - click on image // button2 - click on zoom icon (cannot be the same as click on image because of duplicity of images) // buttonOther - other detail window like download, geotagging $this->items[$iS]->button =& $this->button; $this->items[$iS]->button2 =& $this->button2; $this->items[$iS]->buttonother =& $this->buttonother; $this->items[$iS]->display_icon_detail = $this->tmpl['display_icon_detail']; $this->items[$iS]->display_icon_download = $this->tmpl['display_icon_download']; $this->items[$iS]->display_name = $this->tmpl['display_name']; $this->items[$iS]->display_icon_vm = ''; $this->items[$iS]->start_cooliris = $this->tmpl['start_cooliris']; $this->items[$iS]->type = 2; // Trash icon if ($this->tmpl['trash'] == 1) { $this->items[$iS]->trash = 1; } else { $this->items[$iS]->trash = 0; } // Publish Unpublish icon if ($this->tmpl['publish_unpublish'] == 1) { $this->items[$iS]->publish_unpublish = 1; } else { $this->items[$iS]->publish_unpublish = 0; } // Publish Unpublish icon if ($this->tmpl['approved_not_approved'] == 1) { $this->items[$iS]->approved_not_approved = 1; } else { $this->items[$iS]->approved_not_approved = 0; } // PICLENS if ($this->tmpl['enablecooliris']) { $this->items[$iS]->enable_cooliris = 1; } else { $this->items[$iS]->enable_cooliris = 0; } // 2. GEOTAGGING IMAGE // We have checked the category so if geotagging is enabled // and there is no geotagging data for category, then $this->tmpl['display_icon_geo'] = 0; // so we need to check it for the image too, we need to set the $this->tmpl['display_icon_geoimage'] for image only // we are in loop now $this->tmpl['display_icon_geoimagetmp'] = 0; if ($this->tmpl['display_icon_geoimage'] == 1) { $this->tmpl['display_icon_geoimagetmp'] = 1; if (isset($this->items[$iS]->latitude) && $this->items[$iS]->latitude != '' && $this->items[$iS]->latitude != 0 && isset($this->items[$iS]->longitude) && $this->items[$iS]->longitude != '' && $this->items[$iS]->longitude != 0) { } else { $this->tmpl['display_icon_geoimagetmp'] = 0; } } // GEOTAGGING if ($this->tmpl['display_icon_geo'] == 1 || $this->tmpl['display_icon_geoimagetmp'] == 1) { $this->items[$iS]->display_icon_geo = 1; $this->tmpl['display_icon_geo_box'] = 1; // because of height of box } else { $this->items[$iS]->display_icon_geo = 0; } // Set it back because of loop $this->tmpl['display_icon_geoimagetmp'] = 0; // CAMERA INFO if ($this->tmpl['display_camera_info'] == 1) { $this->items[$iS]->camera_info = 1; } else { $this->items[$iS]->camera_info = 0; } // EXT LINK $this->items[$iS]->display_icon_extlink1 = 0; if (isset($this->items[$iS]->extlink1)) { $this->items[$iS]->extlink1 = explode("|", $this->items[$iS]->extlink1, 4); if (isset($this->items[$iS]->extlink1[0]) && $this->items[$iS]->extlink1[0] != '' && isset($this->items[$iS]->extlink1[1])) { $this->items[$iS]->display_icon_extlink1 = 1; $this->tmpl['display_icon_extlink1_box'] = 1; // because of height of box if (!isset($this->items[$iS]->extlink1[2])) { $this->items[$iS]->extlink1[2] = '_self'; } if (!isset($this->items[$iS]->extlink1[3]) || $this->items[$iS]->extlink1[3] == 1) { $this->items[$iS]->extlink1[4] = JHtml::_('image', 'media/com_phocagallery/images/icon-extlink1.png', JText::_($this->items[$iS]->extlink1[1])); $this->items[$iS]->extlink1[5] = ''; } else { $this->items[$iS]->extlink1[4] = $this->items[$iS]->extlink1[1]; $this->items[$iS]->extlink1[5] = 'style="text-decoration:underline"'; } } else { $this->items[$iS]->display_icon_extlink1 = 0; } } $this->items[$iS]->display_icon_extlink2 = 0; if (isset($this->items[$iS]->extlink2)) { $this->items[$iS]->extlink2 = explode("|", $this->items[$iS]->extlink2, 4); if (isset($this->items[$iS]->extlink2[0]) && $this->items[$iS]->extlink2[0] != '' && isset($this->items[$iS]->extlink2[1])) { $this->items[$iS]->display_icon_extlink2 = 1; $this->tmpl['display_icon_extlink2_box'] = 1; // because of height of box if (!isset($this->items[$iS]->extlink2[2])) { $this->items[$iS]->extlink2[2] = '_self'; } if (!isset($this->items[$iS]->extlink2[3]) || $this->items[$iS]->extlink2[3] == 1) { $this->items[$iS]->extlink2[4] = JHtml::_('image', 'media/com_phocagallery/images/icon-extlink2.png', JText::_($this->items[$iS]->extlink2[1])); $this->items[$iS]->extlink2[5] = ''; } else { $this->items[$iS]->extlink2[4] = $this->items[$iS]->extlink2[1]; $this->items[$iS]->extlink2[5] = 'style="text-decoration:underline"'; } } else { $this->items[$iS]->display_icon_extlink2 = 0; } } // OVERLIB if (!empty($this->items[$iS]->description)) { $divPadding = 'ph-ovrl1'; } else { $divPadding = 'ph-ovrl2'; } // Resize image in overlib by rate $wHOutput = array(); if (isset($this->items[$iS]->extpic) && $this->items[$iS]->extpic != '') { if ((int) $this->tmpl['overlibimagerate'] > 0) { $imgSize = @getimagesize($this->items[$iS]->extl); $wHOutput = PhocaGalleryImage::getTransformImageArray($imgSize, $this->tmpl['overlibimagerate']); } $oImg = JHtml::_('image', $this->items[$iS]->extl, '', $wHOutput); } else { $thumbL = str_replace('phoca_thumb_m1_', 'phoca_thumb_m_', $this->items[$iS]->linkthumbnailpath); $thumbL = str_replace('phoca_thumb_m2_', 'phoca_thumb_m_', $thumbL); $thumbL = str_replace('phoca_thumb_m3_', 'phoca_thumb_m_', $thumbL); $thumbL = str_replace('phoca_thumb_m_', 'phoca_thumb_l_', $thumbL); if ((int) $this->tmpl['overlibimagerate'] > 0) { $imgSize = @getimagesize($thumbL); $wHOutput = PhocaGalleryImage::getTransformImageArray($imgSize, $this->tmpl['overlibimagerate']); } $thumbLI = str_replace('phoca_thumb_m1_', 'phoca_thumb_m_', $this->items[$iS]->linkthumbnailpath); $thumbLI = str_replace('phoca_thumb_m2_', 'phoca_thumb_m_', $thumbLI); $thumbLI = str_replace('phoca_thumb_m3_', 'phoca_thumb_m_', $thumbLI); $oImg = JHtml::_('image', $thumbL, '', $wHOutput); } switch ($enable_overlib) { case 1: case 4: $uBy = ''; //Uploaded by ... if ($enable_overlib == 4 && isset($this->items[$iS]->usernameno) && $this->items[$iS]->usernameno != '') { $uBy = '<div>' . JText::_('COM_PHOCAGALLERY_UPLOADED_BY') . ' <strong>' . $this->items[$iS]->usernameno . '</strong></div>'; } $this->items[$iS]->overlib = 1; $this->items[$iS]->overlib_value = "\n\n" . "onmouseover=\"return overlib('" . htmlspecialchars(addslashes('<div class="pg-overlib"><center>' . $oImg . "</center></div>" . $uBy)) . "', CAPTION, '" . htmlspecialchars(addslashes($this->items[$iS]->title)) . "' ," . htmlspecialchars($this->tmpl['overlib_attributes']) . ");\"" . " onmouseout=\"return nd();\"" . "\n"; break; case 2: case 5: $uBy = ''; //Uploaded by ... if ($enable_overlib == 5 && isset($this->items[$iS]->usernameno) && $this->items[$iS]->usernameno != '') { $uBy = '<div>' . JText::_('COM_PHOCAGALLERY_UPLOADED_BY') . ' <strong>' . $this->items[$iS]->usernameno . '</strong></div>'; } $this->items[$iS]->overlib = 2; $this->items[$iS]->description = str_replace('"', '\'', $this->items[$iS]->description); $this->items[$iS]->description = str_replace("\n", '<br />', $this->items[$iS]->description); $sA = array(utf8_encode(chr(11)), utf8_encode(chr(160))); $eA = array("\t", "\n", "\r", ""); $this->items[$iS]->description = str_replace($sA, ' ', $this->items[$iS]->description); $this->items[$iS]->description = str_replace($eA, '', $this->items[$iS]->description); $this->items[$iS]->overlib_value = " onmouseover=\"return overlib('" . htmlspecialchars(addslashes('<div class="pg-overlib"><div class="' . $divPadding . '">' . $this->items[$iS]->description . '</div></div>' . $uBy)) . "', CAPTION, '" . htmlspecialchars(addslashes($this->items[$iS]->title)) . "', " . htmlspecialchars($this->tmpl['overlib_attributes']) . ");\"" . " onmouseout=\"return nd();\" "; break; case 3: case 6: $uBy = ''; //Uploaded by ... if ($enable_overlib == 6 && isset($this->items[$iS]->usernameno) && $this->items[$iS]->usernameno != '') { $uBy = '<div>' . JText::_('COM_PHOCAGALLERY_UPLOADED_BY') . ' <strong>' . $this->items[$iS]->usernameno . '</strong></div>'; } $this->items[$iS]->overlib = 3; $this->items[$iS]->description = str_replace('"', '\'', $this->items[$iS]->description); $this->items[$iS]->description = str_replace("\n", '<br />', $this->items[$iS]->description); $sA = array(utf8_encode(chr(11)), utf8_encode(chr(160))); $eA = array("\t", "\n", "\r", ""); $this->items[$iS]->description = str_replace($sA, ' ', $this->items[$iS]->description); $this->items[$iS]->description = str_replace($eA, '', $this->items[$iS]->description); $this->items[$iS]->overlib_value = " onmouseover=\"return overlib('" . PhocaGalleryText::strTrimAll(htmlspecialchars(addslashes('<div class="pg-overlib"><div style="text-align:center"><center>' . $oImg . '</center></div><div class="' . $divPadding . '">' . $this->items[$iS]->description . '</div></div>' . $uBy))) . "', CAPTION, '" . htmlspecialchars(addslashes($this->items[$iS]->title)) . "', " . htmlspecialchars($this->tmpl['overlib_attributes']) . ");\"" . " onmouseout=\"return nd();\" "; break; default: $this->items[$iS]->overlib = 0; $this->items[$iS]->overlib_value = ''; break; } // VirtueMart link if ($this->tmpl['display_icon_vm'] == 1) { phocagalleryimport('phocagallery.virtuemart.virtuemart'); $vmLink = PhocaGalleryVirtueMart::getVmLink($this->items[$iS]->vmproductid, $errorMsg); if (!$vmLink) { $this->items[$iS]->display_icon_vm = ''; } else { $this->items[$iS]->display_icon_vm = 1; $this->items[$iS]->vmlink = $vmLink; $this->tmpl['display_icon_vmbox'] = 1; // because of height of box } } else { $this->items[$iS]->display_icon_vm = ''; } // End VM Link // V O T E S - IMAGES if ((int) $this->tmpl['display_rating_img'] == 1) { $this->items[$iS]->votescountimg = 0; $this->items[$iS]->votesaverageimg = 0; $this->items[$iS]->voteswidthimg = 0; $votesStatistics = PhocaGalleryRateImage::getVotesStatistics((int) $this->items[$iS]->id); if (!empty($votesStatistics->count)) { $this->items[$iS]->votescountimg = $votesStatistics->count; } if (!empty($votesStatistics->average)) { $this->items[$iS]->votesaverageimg = $votesStatistics->average; if ($this->items[$iS]->votesaverageimg > 0) { $this->items[$iS]->votesaverageimg = round((double) $this->items[$iS]->votesaverageimg / 0.5) * 0.5; $this->items[$iS]->voteswidthimg = 16 * $this->items[$iS]->votesaverageimg; } else { $this->items[$iS]->votesaverageimg = (int) 0; // not float displaying } } } $this->items[$iS]->display_icon_commentimg = 0; // C O M M E N T S - IMAGES if ((int) $this->tmpl['display_comment_img'] == 1 || (int) $this->tmpl['display_comment_img'] == 3) { $this->items[$iS]->display_icon_commentimg = 1; $this->tmpl['display_icon_commentimg_box'] = 1; // because of height of box } // COMMENTS IMAGES, masonry if ((int) $this->tmpl['display_comment_img'] == 2 || (int) $this->tmpl['display_comment_img'] == 3) { //PhocaGalleryCommentImage::renderCommentImageJS(); $this->items[$iS]->allready_commented = 0; $this->items[$iS]->allready_commented = PhocaGalleryCommentImage::checkUserComment((int) $this->items[$iS]->id, (int) $this->tmpl['user']->id); $this->items[$iS]->comment_items = PhocaGalleryCommentImage::displayComment($this->items[$iS]->id); } // ALT VALUE $altValue = PhocaGalleryRenderFront::getAltValue($this->tmpl['altvalue'], $this->items[$iS]->title, $this->items[$iS]->description, $this->items[$iS]->metadesc); $this->items[$iS]->altvalue = $altValue; // TITLE TAG - Description Output in Title Tag $imgAlt = $imgTitle = ''; // Some methods cannot use Alt because of conflicting with Title and popup methods if ($this->tmpl['detail_window'] == 3 || $this->tmpl['detail_window'] == 9 || $this->tmpl['detail_window'] == 10) { $imgAlt = $this->items[$iS]->altvalue; $imgTitle = $this->items[$iS]->title; if ($imgAlt == $imgTitle) { $imgAlt = ''; } $this->items[$iS]->oimgalt = $imgAlt; } else { $this->items[$iS]->oimgalt = $altValue; } // TITLE TAG - Detail if ($this->tmpl['detail_window'] == 9 || $this->tmpl['detail_window'] == 10) { $detailAlt = $this->items[$iS]->altvalue; $detailTitle = $this->items[$iS]->title; if ($detailAlt == $detailTitle) { $detailAlt = ''; } } else { $detailAlt = JText::_('COM_PHOCAGALLERY_IMAGE_DETAIL'); $detailTitle = JText::_('COM_PHOCAGALLERY_IMAGE_DETAIL'); } $this->items[$iS]->oimgaltdetail = $detailAlt; $this->items[$iS]->oimgtitledetail = $detailTitle; $titleDesc = ''; if ($this->tmpl['display_title_description'] == 1) { $titleDesc .= $this->items[$iS]->title; if ($this->items[$iS]->description != '' && $titleDesc != '') { $titleDesc .= ' - '; } } if ($this->tmpl['detail_window'] == 8 && $this->tmpl['displaydescriptiondetail'] == 1) { $this->items[$iS]->odesctitletag = strip_tags($titleDesc) . strip_tags($this->items[$iS]->description); } else { $this->items[$iS]->odesctitletag = strip_tags($imgTitle); } // Overlib class if ($this->items[$iS]->overlib == 0) { $this->items[$iS]->ooverlibclass = array('class' => 'pg-image'); } else { $this->items[$iS]->ooverlibclass = array('class' => 'pimo pg-image'); } // Tags $this->items[$iS]->otags = ''; if ($this->tmpl['display_tags_links'] == 1 || $this->tmpl['display_tags_links'] == 3) { $this->items[$iS]->otags = PhocaGalleryTag::displayTags($this->items[$iS]->id); if ($this->items[$iS]->otags != '') { $this->tmpl['displaying_tags_true'] = 1; } } $iS++; } // END IMAGES // Upload Form - - - - - - - - - - - - - // Set FTP form $ftp = !JClientHelper::hasCredentials('ftp'); // PARAMS - Upload size $this->tmpl['uploadmaxsize'] = $this->params->get('upload_maxsize', 3000000); $sess = JFactory::getSession(); $this->assignRef('session', $sess); //$this->assignRef('uploadmaxsize', $upload_maxsize); // END Upload Form - - - - - - - - - - - - // V O T E S - CATEGORY // Only registered (VOTES + COMMENTS) $this->tmpl['not_registered'] = true; $this->tmpl['name'] = ''; if ($access > 0) { $this->tmpl['not_registered'] = false; $this->tmpl['name'] = $this->tmpl['user']->name; } // VOTES Statistics if ((int) $this->tmpl['display_rating'] == 1 && (int) $id > 0) { $this->tmpl['votescount'] = 0; $this->tmpl['votesaverage'] = 0; $this->tmpl['voteswidth'] = 0; $votesStatistics = PhocaGalleryRateCategory::getVotesStatistics((int) $id); if (!empty($votesStatistics->count)) { $this->tmpl['votescount'] = $votesStatistics->count; } if (!empty($votesStatistics->average)) { $this->tmpl['votesaverage'] = $votesStatistics->average; if ($this->tmpl['votesaverage'] > 0) { $this->tmpl['votesaverage'] = round((double) $this->tmpl['votesaverage'] / 0.5) * 0.5; $this->tmpl['voteswidth'] = 22 * $this->tmpl['votesaverage']; } else { $this->tmpl['votesaverage'] = (int) 0; // not float displaying } } if ((int) $this->tmpl['votescount'] > 1) { $this->tmpl['votestext'] = 'COM_PHOCAGALLERY_VOTES'; } else { $this->tmpl['votestext'] = 'COM_PHOCAGALLERY_VOTE'; } // Already rated? $this->tmpl['alreay_rated'] = PhocaGalleryRateCategory::checkUserVote((int) $id, (int) $this->tmpl['user']->id); } // COMMENTS if ((int) $this->tmpl['display_comment'] == 1 && (int) $id > 0) { $document->addScript(JURI::base(true) . '/media/com_phocagallery/js/comments.js'); $document->addCustomTag(PhocaGalleryRenderFront::renderCommentJS((int) $this->tmpl['maxcommentchar'])); $this->tmpl['already_commented'] = PhocaGalleryCommentCategory::checkUserComment((int) $id, (int) $this->tmpl['user']->id); $commentItem = PhocaGalleryCommentCategory::displaycomment((int) $id); $this->assignRef('commentitem', $commentItem); } // - - - - - - - - - - - - - - - - // TABS // - - - - - - - - - - - - - - - - $this->tmpl['displaytabs'] = 0; $this->tmpl['currenttab'] = 0; if ((int) $id > 0) { $displayTabs = 0; // R A T I N G if ((int) $this->tmpl['display_rating'] == 0) { $currentTab['rating'] = -1; } else { $currentTab['rating'] = $displayTabs; $displayTabs++; } // C O M M E N T S if ((int) $this->tmpl['display_comment'] == 0) { $currentTab['comment'] = -1; } else { $currentTab['comment'] = $displayTabs; $displayTabs++; } // S T A T I S T I C S if ((int) $this->tmpl['displaycategorystatistics'] == 0) { $currentTab['statistics'] = -1; } else { $currentTab['statistics'] = $displayTabs; $displayTabs++; $this->tmpl['displaymaincatstat'] = $this->params->get('display_main_cat_stat', 1); $this->tmpl['displaylastaddedcatstat'] = $this->params->get('display_lastadded_cat_stat', 1); $this->tmpl['displaymostviewedcatstat'] = $this->params->get('display_mostviewed_cat_stat', 1); $this->tmpl['countlastaddedcatstat'] = $this->params->get('count_lastadded_cat_stat', 3); $this->tmpl['countmostviewedcatstat'] = $this->params->get('count_mostviewed_cat_stat', 3); if ($this->tmpl['displaymaincatstat'] == 1) { $numberImgP = $model->getCountImages($id, 1); $this->tmpl['numberimgpub'] = $numberImgP->countimg; $numberImgU = $model->getCountImages($id, 0); $this->tmpl['numberimgunpub'] = $numberImgU->countimg; $this->categoryViewed = $model->getHits($id); $this->tmpl['categoryviewed'] = $this->categoryViewed->catviewed; } // M O S T V I E W E D I M A G E S //$this->tmpl['mostviewedimg'] = array(); if ($this->tmpl['displaymostviewedcatstat'] == 1) { $mostViewedImages = $model->getStatisticsImages($id, 'hits', 'DESC', $this->tmpl['countmostviewedcatstat']); for ($i = 0; $i < count($mostViewedImages); $i++) { $itemMVI =& $mostViewedImages[$i]; $itemMVI->button =& $this->button; $itemMVI->button2 =& $this->button2; $itemMVI->buttonother =& $this->buttonother; $itemMVI->display_icon_detail = $this->tmpl['display_icon_detail']; $itemMVI->display_name = $this->tmpl['display_name']; $itemMVI->type = 2; $altValue = PhocaGalleryRenderFront::getAltValue($this->tmpl['altvalue'], $itemMVI->title, $itemMVI->description, $itemMVI->metadesc); $itemMVI->altvalue = $altValue; $thumbLink = PhocaGalleryFileThumbnail::getThumbnailName($itemMVI->filename, 'large'); $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $this->category->slug . '&id=' . $itemMVI->slug . '&tmpl=component' . '&Itemid=' . $this->itemId); $imgLink = JURI::base(true) . '/' . $thumbLink->rel; switch ($this->tmpl['detail_window']) { case 2: case 3: case 8: $itemMVI->link = $imgLink; break; default: $itemMVI->link = $siteLink; break; } //$this->tmpl['mostviewedimg'][] = $itemMVI; if ($itemMVI->extw != '') { $extw = explode(',', $itemMVI->extw); $itemMVI->extw = $extw[1]; } if ($itemMVI->exth != '') { $exth = explode(',', $itemMVI->exth); $itemMVI->exth = $exth[1]; } } $this->tmpl['mostviewedimg'] = $mostViewedImages; } // L A S T A D D E D I M A G E S //$this->tmpl['lastaddedimg'] = array(); if ($this->tmpl['displaylastaddedcatstat'] == 1) { $lastAddedImages = $model->getStatisticsImages($id, 'date', 'DESC', $this->tmpl['countlastaddedcatstat']); for ($i = 0; $i < count($lastAddedImages); $i++) { $itemLAI =& $lastAddedImages[$i]; $itemLAI->link = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $this->category->slug . '&id=' . $itemLAI->slug . '&tmpl=component' . '&Itemid=' . $this->itemId); $itemLAI->button =& $this->button; $itemLAI->button2 =& $this->button2; $itemLAI->buttonother =& $this->buttonother; $itemLAI->display_icon_detail = $this->tmpl['display_icon_detail']; $itemLAI->display_name = $this->tmpl['display_name']; $itemLAI->type = 2; $altValue = PhocaGalleryRenderFront::getAltValue($this->tmpl['altvalue'], $itemLAI->title, $itemLAI->description, $itemLAI->metadesc); $itemLAI->altvalue = $altValue; $thumbLink = PhocaGalleryFileThumbnail::getThumbnailName($itemLAI->filename, 'large'); $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $this->category->slug . '&id=' . $itemLAI->slug . '&tmpl=component' . '&Itemid=' . $this->itemId); $imgLink = JURI::base(true) . '/' . $thumbLink->rel; switch ($this->tmpl['detail_window']) { case 2: case 3: case 8: $itemLAI->link = $imgLink; break; default: $itemLAI->link = $siteLink; break; } //$this->tmpl['lastaddedimg'][] = $itemLAI; if ($itemLAI->extw != '') { $extw = explode(',', $itemLAI->extw); $itemLAI->extw = $extw[1]; } if ($itemLAI->exth != '') { $exth = explode(',', $itemLAI->exth); $itemLAI->exth = $exth[1]; } } $this->tmpl['lastaddedimg'] = $lastAddedImages; } } // G E O T A G G I N G if ((int) $this->tmpl['displaycategorygeotagging'] == 0) { $currentTab['geotagging'] = -1; } else { if ($this->map['longitude'] == '') { $currentTab['geotagging'] = -1; } else { if ($this->map['latitude'] == '') { $currentTab['geotagging'] = -1; } else { $currentTab['geotagging'] = $displayTabs; $displayTabs++; $this->tmpl['googlemapsapikey'] = $this->params->get('google_maps_api_key', ''); $this->tmpl['categorymapwidth'] = $this->params->get('category_map_width', ''); $this->tmpl['categorymapheight'] = $this->params->get('category_map_height', 400); } } } if ((int) $this->tmpl['displaycreatecat'] == 0) { $currentTab['createsubcategory'] = -1; } else { $currentTab['createsubcategory'] = $displayTabs; $displayTabs++; } // = = = = = = = = = = // U P L O A D // = = = = = = = = = = $this->tmpl['ftp'] = !JClientHelper::hasCredentials('ftp'); // SEF problem $isThereQM = false; $isThereQM = preg_match("/\\?/i", $this->tmpl['action']); if ($isThereQM) { $amp = '&'; // will be protected by htmlspecialchars } else { $amp = '?'; } $isThereTab = false; $isThereTab = preg_match("/tab=/i", $this->tmpl['action']); if ((int) $this->tmpl['displayupload'] == 0) { $currentTab['upload'] = -1; } else { $currentTab['upload'] = $displayTabs; $displayTabs++; } if ((int) $this->tmpl['ytbupload'] == 0 || (int) $this->tmpl['displayupload'] == 0) { $currentTab['ytbupload'] = -1; } else { $currentTab['ytbupload'] = $displayTabs; $displayTabs++; } if ((int) $this->tmpl['enablemultiple'] < 1 || (int) $this->tmpl['displayupload'] == 0) { $currentTab['multipleupload'] = -1; } else { $currentTab['multipleupload'] = $displayTabs; $displayTabs++; } if ((int) $this->tmpl['enablejava'] < 1 || (int) $this->tmpl['displayupload'] == 0) { $currentTab['javaupload'] = -1; } else { $currentTab['javaupload'] = $displayTabs; $displayTabs++; } $this->tmpl['displaytabs'] = $displayTabs; $this->tmpl['currenttab'] = $currentTab; // - - - - - - - - - - - // Upload // - - - - - - - - - - - if ((int) $this->tmpl['displayupload'] == 1) { $sU = new PhocaGalleryFileUploadSingle(); $sU->returnUrl = htmlspecialchars($this->tmpl['action'] . $amp . 'task=upload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['upload']); $sU->tab = $this->tmpl['currenttab']['upload']; $this->tmpl['su_output'] = $sU->getSingleUploadHTML(1); $this->tmpl['su_url'] = htmlspecialchars($this->tmpl['action'] . $amp . 'task=upload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['upload']); } // - - - - - - - - - - - // Youtube Upload (single upload form can be used) // - - - - - - - - - - - if ((int) $this->tmpl['ytbupload'] == 1 && $this->tmpl['displayupload'] == 1) { $sYU = new PhocaGalleryFileUploadSingle(); $sYU->returnUrl = htmlspecialchars($this->tmpl['action'] . $amp . 'task=ytbupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['ytbupload']); $sYU->tab = $this->tmpl['currenttab']['ytbupload']; $this->tmpl['syu_output'] = $sYU->getSingleUploadHTML(1); $this->tmpl['syu_url'] = htmlspecialchars($this->tmpl['action'] . $amp . 'task=ytbupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['ytbupload']); } // - - - - - - - - - - - // Multiple Upload // - - - - - - - - - - - // Get infos from multiple upload $muFailed = $app->input->get('mufailed', '0', 'int'); $muUploaded = $app->input->get('muuploaded', '0', 'int'); $this->tmpl['mu_response_msg'] = $muUploadedMsg = ''; if ($muUploaded > 0) { $muUploadedMsg = JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded; } if ($muFailed > 0) { $muFailedMsg = JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed; } if ($muFailed > 0 && $muUploaded > 0) { $this->tmpl['mu_response_msg'] = '<div class="alert alert-info">' . JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded . '<br />' . JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed . '</div>'; } else { if ($muFailed > 0 && $muUploaded == 0) { $this->tmpl['mu_response_msg'] = '<div class="alert alert-error">' . JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed . '</div>'; } else { if ($muFailed == 0 && $muUploaded > 0) { $this->tmpl['mu_response_msg'] = '<div class="alert alert-success">' . JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded . '</div>'; } else { $this->tmpl['mu_response_msg'] = ''; } } } if ((int) $this->tmpl['enablemultiple'] == 1 && (int) $this->tmpl['displayupload'] == 1) { PhocaGalleryFileUploadMultiple::renderMultipleUploadLibraries(); $mU = new PhocaGalleryFileUploadMultiple(); $mU->frontEnd = 1; $mU->method = $this->tmpl['multipleuploadmethod']; $mU->url = htmlspecialchars($this->tmpl['action'] . $amp . 'controller=category&task=multipleupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&tab=' . $this->tmpl['currenttab']['multipleupload']); $mU->reload = htmlspecialchars($this->tmpl['action'] . $amp . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&tab=' . $this->tmpl['currenttab']['multipleupload']); $mU->maxFileSize = PhocaGalleryFileUploadMultiple::getMultipleUploadSizeFormat($this->tmpl['uploadmaxsize']); $mU->chunkSize = '1mb'; $mU->imageHeight = $this->tmpl['multipleresizeheight']; $mU->imageWidth = $this->tmpl['multipleresizewidth']; $mU->imageQuality = 100; $mU->renderMultipleUploadJS(0, $this->tmpl['multipleuploadchunk']); $this->tmpl['mu_output'] = $mU->getMultipleUploadHTML(); } // - - - - - - - - - - - // Java Upload // - - - - - - - - - - - if ((int) $this->tmpl['enablejava'] == 1 && (int) $this->tmpl['displayupload'] == 1) { $jU = new PhocaGalleryFileUploadJava(); $jU->width = $this->tmpl['javaboxwidth']; $jU->height = $this->tmpl['javaboxheight']; $jU->resizewidth = $this->tmpl['multipleresizewidth']; $jU->resizeheight = $this->tmpl['multipleresizeheight']; $jU->uploadmaxsize = $this->tmpl['uploadmaxsize']; $jU->returnUrl = $this->tmpl['action'] . $amp . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&tab=' . $this->tmpl['currenttab']['javaupload']; $jU->url = $this->tmpl['action'] . $amp . 'controller=category&task=javaupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&tab=' . $this->tmpl['currenttab']['javaupload']; $jU->source = JURI::root(true) . '/components/com_phocagallery/assets/jupload/wjhk.jupload.jar'; $this->tmpl['ju_output'] = $jU->getJavaUploadHTML(); } } $this->tmpl['dem'] = '<div style="text-align:right;color:#ccc;display:block">Powered by <a href="http://www.phoca.cz/phocagallery">Phoca Gallery</a></div>'; // ADD STATISTICS if ((int) $id > 0) { $model->hit($id); } // ADD JAK DATA CSS style if ($this->tmpl['detail_window'] == 6) { $document->addCustomTag('<script type="text/javascript">' . 'var dataJakJs = [' . implode($this->tmpl['jakdatajs'], ',') . ']' . '</script>'); } // Detail Window - will be popup or not if ($this->tmpl['detail_window'] == 7) { $this->tmpl['tmplcom'] = ''; $this->tmpl['tmplcomcomments'] = ''; } else { $this->tmpl['tmplcom'] = '&tmpl=component'; $this->tmpl['tmplcomcomments'] = '&tmpl=component'; } if ($this->tmpl['display_comment_nopup'] == 1) { $this->tmpl['tmplcomcomments'] = ''; } $this->tmpl['boxsize'] = PhocaGalleryImage::setBoxSize($this->tmpl, 2); $this->tmpl['boxsizestat'] = PhocaGalleryImage::setBoxSize($this->tmpl, 3); $masBoxWidth = $this->tmpl['boxsize']['width'] + 20; // Masonry effect if ($this->tmpl['diff_thumb_height'] == 2) { $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/masonry/masonry.min.js'); $document->addCustomTag('<script type="text/javascript"> window.onload = function() { var wall = new Masonry( document.getElementById(\'pg-msnr-container\'), { isFitWidth: true }); }; </script>'); } // CSS Specific $s = "\n" . '#phocagallery {' . "\n"; if ($this->tmpl['phocagallery_center'] != '') { $s .= ' margin: 0 auto; text-align: center;' . "\n"; } if ($this->tmpl['phocagallery_width'] != '') { $s .= ' width: ' . $this->tmpl['phocagallery_width'] . 'px;' . "\n"; } $s .= '}' . "\n"; if ($this->tmpl['phocagallery_center'] != '') { $s = "\n" . '#pg-msnr-container {' . "\n"; $s .= ' margin: 0 auto;' . "\n"; $s .= '}' . "\n"; } $s .= '.pg-cv-box {' . "\n"; if ($this->tmpl['diff_thumb_height'] > 0) { } else { $s .= ' height: ' . $this->tmpl['boxsize']['height'] . 'px;' . "\n"; } $s .= ' width: ' . $this->tmpl['boxsize']['width'] . 'px;"' . "\n"; $s .= '}' . "\n"; $s .= '.pg-cv-box-stat {' . "\n"; $s .= ' height: ' . $this->tmpl['boxsizestat']['height'] . 'px;' . "\n"; $s .= ' width: ' . $this->tmpl['boxsizestat']['width'] . 'px;"' . "\n"; $s .= '}' . "\n"; $s .= '.pg-cv-box-img {' . "\n"; $s .= ' height: ' . $this->tmpl['imageheight'] . 'px;' . "\n"; $s .= ' width: ' . $this->tmpl['imagewidth'] . 'px;"' . "\n"; $s .= '}' . "\n"; $document->addCustomTag('<style type="text/css">' . $s . '</style>'); $this->_prepareDocument(); parent::display($tpl); }
function display($tpl = null) { $app = JFactory::getApplication(); $document = JFactory::getDocument(); $uri = JFactory::getURI(); //$menus = JSite::getMenu(); $menus = JFactory::getApplication()->getMenu(); $menu = $menus->getActive(); $this->params = $app->getParams(); $this->tmpl['user'] = JFactory::getUser(); $this->tmpl['action'] = $uri->toString(); $path = PhocaGalleryPath::getPath(); $limitStart = JRequest::getVar('limitstart', 0, '', 'int'); $id = JRequest::getVar('id', 0, '', 'int'); $this->tagId = JRequest::getVar('tagid', 0, '', 'int'); $this->tmpl['tab'] = JRequest::getVar('tab', 0, '', 'int'); $this->tmpl['formaticon'] = PhocaGalleryImage::getFormatIcon(); $this->tmpl['pl'] = 'index.php?option=com_users&view=login&return=' . base64_encode($uri->toString()); $neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels(); $access = PhocaGalleryAccess::isAccess($this->tmpl['user']->authorisedLevels(), $neededAccessLevels); // LIBRARY $library =& PhocaGalleryLibrary::getLibrary(); $libraries['pg-group-shadowbox'] = $library->getLibrary('pg-group-shadowbox'); $libraries['pg-group-highslide'] = $library->getLibrary('pg-group-highslide'); $libraries['pg-group-jak'] = $library->getLibrary('pg-group-jak'); // PARAMS $this->tmpl['displaycatnametitle'] = $this->params->get('display_cat_name_title', 1); $display_cat_name_breadcrumbs = $this->params->get('display_cat_name_breadcrumbs', 1); $image_background_color = $this->params->get('image_background_color', '#f5f5f5'); $this->tmpl['displayimageshadow'] = $this->params->get('image_background_shadow', 'shadow1'); $this->tmpl['imagewidth'] = $this->params->get('medium_image_width', 100); $this->tmpl['imageheight'] = $this->params->get('medium_image_height', 100); $popup_width = $this->params->get('front_modal_box_width', 680); $popup_height = $this->params->get('front_modal_box_height', 560); $this->tmpl['olbgcolor'] = $this->params->get('ol_bg_color', '#666666'); $this->tmpl['olfgcolor'] = $this->params->get('ol_fg_color', '#f6f6f6'); $this->tmpl['oltfcolor'] = $this->params->get('ol_tf_color', '#000000'); $this->tmpl['olcfcolor'] = $this->params->get('ol_cf_color', '#ffffff'); $this->tmpl['maxuploadchar'] = $this->params->get('max_upload_char', 1000); $this->tmpl['maxcommentchar'] = $this->params->get('max_comment_char', 1000); $this->tmpl['maxcreatecatchar'] = $this->params->get('max_create_cat_char', 1000); $this->tmpl['commentwidth'] = $this->params->get('comment_width', 500); $this->tmpl['displayrating'] = $this->params->get('display_rating', 0); $this->tmpl['displayratingimg'] = $this->params->get('display_rating_img', 0); $this->tmpl['displaycomment'] = $this->params->get('display_comment', 0); $this->tmpl['displaycommentimg'] = $this->params->get('display_comment_img', 0); $this->tmpl['displaysubcategory'] = $this->params->get('display_subcategory', 1); $this->tmpl['displaycategorygeotagging'] = $this->params->get('display_category_geotagging', 0); $this->tmpl['displaycategorystatistics'] = $this->params->get('display_category_statistics', 0); // Used for Highslide JS (only image) $this->tmpl['displaydescriptiondetail'] = $this->params->get('display_description_detail', 0); $this->tmpl['displaytitleindescription'] = $this->params->get('display_title_description', 0); $this->tmpl['displayname'] = $this->params->get('display_name', 1); $this->tmpl['displayicondetail'] = $this->params->get('display_icon_detail', 1); $this->tmpl['displayicondownload'] = $this->params->get('display_icon_download', 2); $this->tmpl['displayiconfolder'] = $this->params->get('display_icon_folder', 0); $this->tmpl['displayiconvm'] = $this->params->get('display_icon_vm', 0); $this->tmpl['fontsizename'] = $this->params->get('font_size_name', 12); $this->tmpl['fontsizeimgdesc'] = $this->params->get('font_size_img_desc', 10); $this->tmpl['imgdescboxheight'] = $this->params->get('img_desc_box_height', 30); $this->tmpl['displayimgdescbox'] = $this->params->get('display_img_desc_box', 0); $this->tmpl['charlengthimgdesc'] = $this->params->get('char_length_img_desc', 300); $this->tmpl['charlengthname'] = $this->params->get('char_length_name', 15); $this->tmpl['displayicongeo'] = $this->params->get('display_icon_geotagging', 0); // Check the category $this->tmpl['displayicongeoimage'] = $this->params->get('display_icon_geotagging', 0); // Check the image $this->tmpl['displaycamerainfo'] = $this->params->get('display_camera_info', 0); $this->tmpl['displaypage'] = PhocaGalleryRenderInfo::getPhocaIc((int) $this->params->get('display_phoca_info', 1)); $this->tmpl['switchimage'] = $this->params->get('switch_image', 0); $this->tmpl['switchheight'] = $this->params->get('switch_height', 480); $this->tmpl['switchwidth'] = $this->params->get('switch_width', 640); $this->tmpl['switchfixedsize'] = $this->params->get('switch_fixed_size', 0); // PARAMS - Upload $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['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['javaboxwidth'] = $this->params->get('java_box_width', 480); $this->tmpl['javaboxheight'] = $this->params->get('java_box_height', 480); $this->tmpl['large_image_width'] = $this->params->get('large_image_width', 640); $this->tmpl['large_image_height'] = $this->params->get('large_image_height', 640); $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['phocagallerywidth'] = $this->params->get('phocagallery_width', ''); $this->tmpl['phocagallerycenter'] = $this->params->get('phocagallery_center', ''); $display_description_detail = $this->params->get('display_description_detail', 0); $description_detail_height = $this->params->get('description_detail_height', 16); $this->tmpl['categoryboxspace'] = $this->params->get('category_box_space', 0); $this->tmpl['detailwindow'] = $this->params->get('detail_window', 0); $detail_buttons = $this->params->get('detail_buttons', 1); $modal_box_overlay_color = $this->params->get('modal_box_overlay_color', '#000000'); $modal_box_overlay_opacity = $this->params->get('modal_box_overlay_opacity', 0.3); $modal_box_border_color = $this->params->get('modal_box_border_color', '#6b6b6b'); $modal_box_border_width = $this->params->get('modal_box_border_width', '2'); $this->tmpl['enablecooliris'] = $this->params->get('enable_cooliris', 0); $highslide_class = $this->params->get('highslide_class', 'rounded-white'); $highslide_opacity = $this->params->get('highslide_opacity', 0); $highslide_outline_type = $this->params->get('highslide_outline_type', 'rounded-white'); $highslide_fullimg = $this->params->get('highslide_fullimg', 0); $highslide_slideshow = $this->params->get('highslide_slideshow', 1); $highslide_close_button = $this->params->get('highslide_close_button', 0); $this->tmpl['jakslideshowdelay'] = $this->params->get('jak_slideshow_delay', 5); $this->tmpl['jakorientation'] = $this->params->get('jak_orientation', 'none'); $this->tmpl['jakdescription'] = $this->params->get('jak_description', 1); $this->tmpl['jakdescriptionheight'] = $this->params->get('jak_description_height', 0); $this->tmpl['categoryimageordering'] = $this->params->get('category_image_ordering', 10); $this->tmpl['externalcommentsystem'] = $this->params->get('external_comment_system', 0); // Possible Categories View in Category View $this->tmpl['categoryimageorderingcv'] = $this->params->get('category_image_ordering_cv', 10); $this->tmpl['displaycategoriescv'] = $this->params->get('display_categories_cv', 0); $display_subcat_page_cv = $this->params->get('display_subcat_page_cv', 0); $display_back_button_cv = $this->params->get('display_back_button_cv', 1); $display_categories_back_button_cv = $this->params->get('display_categories_back_button_cv', 1); $this->tmpl['displayimagecategoriescv'] = $this->params->get('display_image_categories_cv', 1); $this->tmpl['categoriescolumnscv'] = $this->params->get('categories_columns_cv', 1); $image_categories_size_cv = $this->params->get('image_categories_size_cv', 4); $medium_image_width_cv = (int) $this->params->get('medium_image_width', 100) + 18; $medium_image_height_cv = (int) $this->params->get('medium_image_height', 100) + 18; $small_image_width_cv = (int) $this->params->get('small_image_width', 50) + 18; $small_image_height_cv = (int) $this->params->get('small_image_height', 50) + 18; $this->tmpl['imagetypecv'] = $image_categories_size_cv; $this->tmpl['overlibimagerate'] = (int) $this->params->get('overlib_image_rate', ''); $this->tmpl['picasa_correct_width_m'] = (int) $this->params->get('medium_image_width', 100); $this->tmpl['picasa_correct_height_m'] = (int) $this->params->get('medium_image_height', 100); $this->tmpl['picasa_correct_width_s'] = (int) $this->params->get('small_image_width', 50); $this->tmpl['picasa_correct_height_s'] = (int) $this->params->get('small_image_height', 50); $this->tmpl['picasa_correct_width_l'] = (int) $this->params->get('large_image_width', 640); $this->tmpl['picasa_correct_height_l'] = (int) $this->params->get('large_image_height', 480); $this->tmpl['gallerymetakey'] = $this->params->get('gallery_metakey', ''); $this->tmpl['gallerymetadesc'] = $this->params->get('gallery_metadesc', ''); $this->tmpl['altvalue'] = $this->params->get('alt_value', 1); $paramsFb = PhocaGalleryFbSystem::getCommentsParams($this->params->get('fb_comment_user_id', '')); // Facebook $this->tmpl['fb_comment_app_id'] = isset($paramsFb['fb_comment_app_id']) ? $paramsFb['fb_comment_app_id'] : ''; $this->tmpl['fb_comment_width'] = isset($paramsFb['fb_comment_width']) ? $paramsFb['fb_comment_width'] : 550; $this->tmpl['fb_comment_lang'] = isset($paramsFb['fb_comment_lang']) ? $paramsFb['fb_comment_lang'] : 'en_US'; $this->tmpl['fb_comment_count'] = isset($paramsFb['fb_comment_count']) ? $paramsFb['fb_comment_count'] : ''; $this->tmpl['enable_direct_subcat'] = $this->params->get('enable_direct_subcat', 0); $this->tmpl['display_comment_nopup'] = $this->params->get('display_comment_nopup', 0); $this->tmpl['boxplus_theme'] = $this->params->get('boxplus_theme', 'lightsquare'); $this->tmpl['boxplus_bautocenter'] = (int) $this->params->get('boxplus_bautocenter', 1); $this->tmpl['boxplus_autofit'] = (int) $this->params->get('boxplus_autofit', 1); $this->tmpl['boxplus_slideshow'] = (int) $this->params->get('boxplus_slideshow', 0); $this->tmpl['boxplus_loop'] = (int) $this->params->get('boxplus_loop', 0); $this->tmpl['boxplus_captions'] = $this->params->get('boxplus_captions', 'bottom'); $this->tmpl['boxplus_thumbs'] = $this->params->get('boxplus_thumbs', 'inside'); $this->tmpl['boxplus_duration'] = (int) $this->params->get('boxplus_duration', 250); $this->tmpl['boxplus_transition'] = $this->params->get('boxplus_transition', 'linear'); $this->tmpl['boxplus_contextmenu'] = (int) $this->params->get('boxplus_contextmenu', 1); $this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0); $this->tmpl['customcss'] = $this->params->get('custom_css', ''); $this->tmpl['display_tags_links'] = $this->params->get('display_tags_links', 0); $this->tmpl['displaying_tags_true'] = 0; //No tag found, if yes, the box will be resized $this->tmpl['ytbupload'] = $this->params->get('youtube_upload', 0); $this->tmpl['ytb_display'] = $this->params->get('ytb_display', 0); $this->tmpl['enable_multibox'] = $this->params->get('enable_multibox', 0); $this->tmpl['multibox_height'] = (int) $this->params->get('multibox_height', 560); $this->tmpl['multibox_width'] = (int) $this->params->get('multibox_width', 980); // = = = = = = = = = = // 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 { $libraries['pg-css-ie'] = $library->getLibrary('pg-css-ie'); $libraries['pg-css-ie-hover'] = $library->getLibrary('pg-css-ie-hover'); // PARAMS - Background shadow if ($this->tmpl['displayimageshadow'] != 'none') { // IE hack $shadowPath = $path->image_abs_front . $this->tmpl['displayimageshadow'] . '.' . $this->tmpl['formaticon']; $shadowSize = getimagesize($shadowPath); if (isset($shadowSize[0]) && isset($shadowSize[0])) { $w = (int) $this->tmpl['imagewidth'] + 18 - (int) $shadowSize[0]; $h = (int) $this->tmpl['imageheight'] + 18 - (int) $shadowSize[1]; if ($w != 0) { $w = $w / 2; } // plus or minus should be divided, not null if ($h != 0) { $h = $h / 2; } } else { $w = $h = 0; } $imageBgCSS = 'background: url(\'' . JURI::base(true) . '/components/com_phocagallery/assets/images/' . $this->tmpl['displayimageshadow'] . '.' . $this->tmpl['formaticon'] . '\') 50% 50% no-repeat;'; $imageBgCSSIE = 'background: url(\'' . JURI::base(true) . '/components/com_phocagallery/assets/images/' . $this->tmpl['displayimageshadow'] . '.' . $this->tmpl['formaticon'] . '\') ' . $w . 'px ' . $h . 'px no-repeat;'; } else { $imageBgCSS = 'background: ' . $image_background_color . ';'; $imageBgCSSIE = 'background: ' . $image_background_color . ';'; } 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); } $document->addCustomTag(PhocaGalleryRenderFront::renderCategoryCSS($this->params->get('font_color', '#b36b00'), $this->params->get('background_color', '#fcfcfc'), $this->params->get('border_color', '#e8e8e8'), $imageBgCSS, $imageBgCSSIE, $this->params->get('border_color_hover', '#b36b00'), $this->params->get('background_color_hover', '#f5f5f5'), $this->tmpl['olfgcolor'], $this->tmpl['olbgcolor'], $this->tmpl['oltfcolor'], $this->tmpl['olcfcolor'], $this->params->get('margin_box', 5), $this->params->get('padding_box', 5), $this->params->get('overlib_overlay_opacity', 0.7))); if ($libraries['pg-css-ie-hover']->value == 0) { $document->addCustomTag(PhocaGalleryRenderFront::renderIeHover()); $library->setLibrary('pg-css-ie-hover', 1); } } // = = = = = = = = = = // Default_Categories $catImg = PhocaGalleryImageFront::getCategoriesImageBackground($image_categories_size_cv, $small_image_width_cv, $small_image_height_cv, $medium_image_height_cv, $medium_image_width_cv); $this->tmpl['imagebgcv'] = $catImg->image; $this->tmpl['imagewidthcv'] = $catImg->width; switch ($image_categories_size_cv) { // medium case 1: case 5: $this->tmpl['class_suffix'] = 'medium'; break; case 0: case 4: default: $this->tmpl['class_suffix'] = 'small'; break; } // Correct Height // Description detail height if ($display_description_detail == 1) { $popup_height = $popup_height + $description_detail_height; } // Detail buttons in detail view if ($detail_buttons != 1) { $popup_height = $popup_height - 45; } if ($this->tmpl['displayratingimg'] == 1) { $popup_height = $popup_height + 35; } // Correct height of description in image box (set null if this will be hidden) if ($this->tmpl['displayimgdescbox'] == 0) { $this->tmpl['imgdescboxheight'] = 0; } // Youtube video without padding, margin if ($this->tmpl['detailwindow'] != 7 && $this->tmpl['ytb_display'] == 1) { $document->addCustomTag("<style type=\"text/css\"> \n" . " #boxplus .boxplus-dialog .boxplus-controlsclose {\r\n\t\t\t\ttop: -15px !important;\r\n\t\t\t\tright: -15px !important;\r\n\t\t\t\tmargin:0px 0 0 0 !important;\r\n\t\t\t} \n" . " </style> \n"); $popup_width = PhocaGallerySettings::getAdvancedSettings('youtubewidth'); $popup_height = PhocaGallerySettings::getAdvancedSettings('youtubeheight'); } // Multibox if ($this->tmpl['enable_multibox'] == 1) { $popup_width = $this->tmpl['multibox_width']; $popup_height = $this->tmpl['multibox_height']; } $this->tmpl['bna'] = '<div style="text-align: center; color: rgb(211, 211, 211);">Powe' . 'red by <a href="http://www.phoca.cz/phocaga' . 'llery" style="text-decoration: none;" target="_blank" title="Phoca Gal' . 'lery">Pho' . 'ca Gall' . 'ery</a></div>'; // ======================================================= // DIFFERENT METHODS OF DISPLAYING THE DETAIL VIEW // ======================================================= // MODAL - will be displayed in case e.g. highslide or shadowbox too, because in there are more links JHtml::_('behavior.modal', 'a.pg-modal-button'); // CSS Specific $document->addCustomTag("<style type=\"text/css\"> \n" . " #sbox-window {background-color:" . $modal_box_border_color . ";padding:" . $modal_box_border_width . "px} \n" . " #sbox-overlay {background-color:" . $modal_box_overlay_color . ";} \n" . " </style> \n"); // BUTTON (IMAGE - standard, modal, shadowbox) $button = new JObject(); $button->set('name', 'image'); $button->set('options', ''); //initialize // BUTTON (ICON - standard, modal, shadowbox) $button2 = new JObject(); $button2->set('name', 'icon'); $button2->set('options', ''); //initialize // BUTTON OTHER (geotagging, downloadlink, ...) $buttonOther = new JObject(); $buttonOther->set('name', 'other'); $buttonOther->set('options', ''); //initialize $buttonOther->set('optionsrating', ''); //initialize $this->tmpl['highslideonclick'] = ''; // for using with highslide $this->tmpl['highslideonclick2'] = ''; // ------------------------------------------------------- // STANDARD POPUP // ------------------------------------------------------- if ($this->tmpl['detailwindow'] == 1) { $button->set('methodname', 'js-button'); $button->set('options', "window.open(this.href,'win2','width=" . $popup_width . ",height=" . $popup_height . ",scrollbars=yes,menubar=no,resizable=yes'); return false;"); $button->set('optionsrating', "window.open(this.href,'win2','width=" . $popup_width . ",height=" . $popup_height . ",scrollbars=yes,menubar=no,resizable=yes'); return false;"); $button2->methodname =& $button->methodname; $button2->options =& $button->options; $buttonOther->methodname =& $button->methodname; $buttonOther->options =& $button->options; $buttonOther->optionsrating =& $button->optionsrating; } else { if ($this->tmpl['detailwindow'] == 0 || $this->tmpl['detailwindow'] == 2) { // Button $button->set('modal', true); $button->set('methodname', 'pg-modal-button'); $button2->modal =& $button->modal; $button2->methodname =& $button->methodname; $buttonOther->modal =& $button->modal; $buttonOther->methodname =& $button->methodname; // Modal - Image only if ($this->tmpl['detailwindow'] == 2) { $button->set('options', "{handler: 'image', size: {x: 200, y: 150}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); $button2->options =& $button->options; $buttonOther->set('options', "{handler: 'iframe', size: {x: " . $popup_width . ", y: " . $popup_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); $buttonOther->set('optionsrating', "{handler: 'iframe', size: {x: " . $popup_width . ", y: " . $popup_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); // Modal - Iframe } else { $button->set('options', "{handler: 'iframe', size: {x: " . $popup_width . ", y: " . $popup_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); $buttonOther->set('optionsrating', "{handler: 'iframe', size: {x: " . $popup_width . ", y: " . $popup_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); $button2->options =& $button->options; $buttonOther->options =& $button->options; } } else { if ($this->tmpl['detailwindow'] == 3) { $sb_slideshow_delay = $this->params->get('sb_slideshow_delay', 5); $sb_lang = $this->params->get('sb_lang', 'en'); $button->set('methodname', 'shadowbox-button'); $button->set('options', "shadowbox[PhocaGallery];options={slideshowDelay:" . $sb_slideshow_delay . "}"); $button2->methodname =& $button->methodname; $button2->set('options', "shadowbox[PhocaGallery2];options={slideshowDelay:" . $sb_slideshow_delay . "}"); $buttonOther->set('modal', true); $buttonOther->set('methodname', 'pg-modal-button'); $buttonOther->set('options', "{handler: 'iframe', size: {x: " . $popup_width . ", y: " . $popup_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); $buttonOther->set('optionsrating', "{handler: 'iframe', size: {x: " . $popup_width . ", y: " . $popup_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); // $document->addScript(JURI::base(true).'/components/com_phocagallery/assets/js/shadowbox/adapter/shadowbox-mootools.js'); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/shadowbox/shadowbox.js'); //$document->addScript(JURI::base(true).'/components/com_phocagallery/assets/js/shadowbox/src/lang/shadowbox-cs.js'); //$document->addStyleSheet(JURI::base(true).'/components/com_phocagallery/assets/js/shadowbox/shadowbox.css'); if ($libraries['pg-group-shadowbox']->value == 0) { $document->addCustomTag('<script type="text/javascript"> Shadowbox.loadSkin("classic", "' . JURI::base(true) . '/components/com_phocagallery/assets/js/shadowbox/src/skin"); Shadowbox.loadLanguage("' . $sb_lang . '", "' . JURI::base(true) . '/components/com_phocagallery/assets/js/shadowbox/src/lang"); Shadowbox.loadPlayer(["img"], "' . JURI::base(true) . '/components/com_phocagallery/assets/js/shadowbox/src/player"); window.addEvent(\'domready\', function(){ Shadowbox.init() }); </script>'); /*$document->addCustomTag('<script type="text/javascript"> Shadowbox.init({ handleOversize: "drag", modal: true, overlayOpacity: 0.8, language: "cs" }); </script>');*/ // window.onload = function(){ // Shadowbox.init(); $library->setLibrary('pg-group-shadowbox', 1); } } else { if ($this->tmpl['detailwindow'] == 4) { $button->set('methodname', 'highslide'); $button2->methodname =& $button->methodname; $buttonOther->methodname =& $button->methodname; $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide-full.js'); $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide.css'); if ($libraries['pg-group-highslide']->value == 0) { $document->addCustomTag(PhocaGalleryRenderFront::renderHighslideJSAll()); $document->addCustomTag('<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="' . JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide-ie6.css" /><![endif]-->'); $library->setLibrary('pg-group-highslide', 1); } //$document->addCustomTag( PhocaGalleryRenderFront::renderHighslideJS ('',$popup_width, $popup_height, $highslide_outline_type, $highslide_opacity)); $document->addCustomTag(PhocaGalleryRenderFront::renderHighslideJS('', $popup_width, $popup_height, $highslide_slideshow, $highslide_class, $highslide_outline_type, $highslide_opacity, $highslide_close_button)); $this->tmpl['highslideonclick'] = 'return hs.htmlExpand(this, phocaZoom )'; } else { if ($this->tmpl['detailwindow'] == 5) { $button->set('methodname', 'highslide'); $button2->methodname =& $button->methodname; $buttonOther->methodname =& $button->methodname; $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide-full.js'); $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide.css'); if ($libraries['pg-group-highslide']->value == 0) { $document->addCustomTag(PhocaGalleryRenderFront::renderHighslideJSAll()); $document->addCustomTag('<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="' . JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide-ie6.css" /><![endif]-->'); $library->setLibrary('pg-group-highslide', 1); } $document->addCustomTag(PhocaGalleryRenderFront::renderHighslideJS('', $popup_width, $popup_height, $highslide_slideshow, $highslide_class, $highslide_outline_type, $highslide_opacity, $highslide_close_button)); $this->tmpl['highslideonclick2'] = 'return hs.htmlExpand(this, phocaZoom )'; $this->tmpl['highslideonclick'] = PhocaGalleryRenderFront::renderHighslideJSImage('', $highslide_class, $highslide_outline_type, $highslide_opacity, $highslide_fullimg); } else { if ($this->tmpl['detailwindow'] == 6) { $button->set('methodname', 'jaklightbox'); $button2->methodname =& $button->methodname; $buttonOther->set('modal', true); $buttonOther->set('methodname', 'pg-modal-button'); $buttonOther->set('options', "{handler: 'iframe', size: {x: " . $popup_width . ", y: " . $popup_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); $buttonOther->set('optionsrating', "{handler: 'iframe', size: {x: " . $popup_width . ", y: " . $popup_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/jak/jak_compressed.js'); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/jak/lightbox_compressed.js'); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/jak/jak_slideshow.js'); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/jak/window_compressed.js'); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/jak/interpolator_compressed.js'); $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/jak/lightbox-slideshow.css'); $lHeight = 472 + (int) $this->tmpl['jakdescriptionheight']; $lcHeight = 10 + (int) $this->tmpl['jakdescriptionheight']; $customJakTag = ''; if ($this->tmpl['jakorientation'] == 'horizontal') { $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/jak/lightbox-horizontal.css'); } else { if ($this->tmpl['jakorientation'] == 'vertical') { $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/jak/lightbox-vertical.css'); $customJakTag .= '.lightBox {height: ' . $lHeight . 'px;}' . '.lightBox .image-browser-caption { height: ' . $lcHeight . 'px;}'; } else { $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/jak/lightbox-vertical.css'); $customJakTag .= '.lightBox {height: ' . $lHeight . 'px;width:800px;}' . '.lightBox .image-browser-caption { height: ' . $lcHeight . 'px;}' . '.lightBox .image-browser-thumbs { display:none;}' . '.lightBox .image-browser-thumbs div.image-browser-thumb-box { display:none;}'; } } if ($customJakTag != '') { $document->addCustomTag("<style type=\"text/css\">\n" . $customJakTag . "\n" . "</style>"); } if ($libraries['pg-group-jak']->value == 0) { $document->addCustomTag(PhocaGalleryRenderFront::renderJakJs($this->tmpl['jakslideshowdelay'], $this->tmpl['jakorientation'])); $library->setLibrary('pg-group-jak', 1); } } else { if ($this->tmpl['detailwindow'] == 7) { $button->set('methodname', 'no-popup'); $button2->methodname =& $button->methodname; $buttonOther->set('modal', true); $buttonOther->set('methodname', 'no-popup'); $buttonOther->set('options', ""); $buttonOther->set('optionsrating', ""); } else { if ($this->tmpl['detailwindow'] == 8) { $button->set('methodname', 'slimbox'); $button2->methodname =& $button->methodname; $button2->methodname =& $button->methodname; $button2->set('options', "lightbox-images"); $buttonOther->set('modal', true); $buttonOther->set('methodname', 'pg-modal-button'); $buttonOther->set('options', "{handler: 'iframe', size: {x: " . $popup_width . ", y: " . $popup_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); $buttonOther->set('optionsrating', "{handler: 'iframe', size: {x: " . $popup_width . ", y: " . $popup_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . "}"); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/slimbox/slimbox.js'); $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/slimbox/css/slimbox.css'); } else { if ($this->tmpl['detailwindow'] == 9 || $this->tmpl['detailwindow'] == 10) { $language = JFactory::getLanguage(); $button->set('options', 'phocagallerycboxplus'); $button->set('methodname', 'phocagallerycboxplus'); $button2->set('options', "phocagallerycboxplusi"); $button2->set('methodname', 'phocagallerycboxplusi'); $buttonOther->set('methodname', 'phocagallerycboxpluso'); $buttonOther->set('options', "phocagallerycboxpluso"); $buttonOther->set('optionsrating', "phocagallerycboxpluso"); //if ($crossdomain) { // $document->addScript(JURI::base(true).'/components/com_phocagallery/assets/js/boxplus/jsonp.mootools.js'); //} $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/boxplus/boxplus.js'); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/boxplus/boxplus.lang.js?lang=' . $language->getTag()); $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/boxplus/css/boxplus.css'); if ($language->isRTL()) { $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/boxplus/css/boxplus.rtl.css'); } $document->addCustomTag('<!--[if lt IE 9]><link rel="stylesheet" href="' . JURI::base(true) . '/components/com_phocagallery/assets/js/boxplus/css/boxplus.ie8.css" type="text/css" /><![endif]-->'); $document->addCustomTag('<!--[if lt IE 8]><link rel="stylesheet" href="' . JURI::base(true) . '/components/com_phocagallery/assets/js/boxplus/css/boxplus.ie7.css" type="text/css" /><![endif]-->'); $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/boxplus/css/boxplus.' . $this->tmpl['boxplus_theme'] . '.css', 'text/css', null, array('title' => 'boxplus-' . $this->tmpl['boxplus_theme'])); if (file_exists(JPATH_BASE . DS . 'components' . DS . 'com_phocagallery' . DS . 'assets' . DS . 'js' . DS . 'boxplus' . DS . 'css' . DS . 'boxplus.' . $this->tmpl['boxplus_theme'])) { // use IE-specific stylesheet only if it exists $this->addCustomTag('<!--[if lt IE 9]><link rel="stylesheet" href="' . JURI::base(true) . '/components/com_phocagallery/assets/js/boxplus/css/boxplus.' . $this->tmpl['boxplus_theme'] . '.ie8.css" type="text/css" title="boxplus-' . $this->tmpl['boxplus_theme'] . '" /><![endif]-->'); } $document->addScriptDeclaration('window.addEvent("domready", function () {'); if ($this->tmpl['detailwindow'] == 10) { // Image $document->addScriptDeclaration('new boxplus($$("a.phocagallerycboxplus"),{"theme":"' . $this->tmpl['boxplus_theme'] . '","autocenter":' . (int) $this->tmpl['boxplus_bautocenter'] . ',"autofit":' . (int) $this->tmpl['boxplus_autofit'] . ',"slideshow":' . (int) $this->tmpl['boxplus_slideshow'] . ',"loop":' . (int) $this->tmpl['boxplus_loop'] . ',"captions":"' . $this->tmpl['boxplus_captions'] . '","thumbs":"' . $this->tmpl['boxplus_thumbs'] . '","width":' . (int) $popup_width . ',"height":' . (int) $popup_height . ',"duration":' . (int) $this->tmpl['boxplus_duration'] . ',"transition":"' . $this->tmpl['boxplus_transition'] . '","contextmenu":' . (int) $this->tmpl['boxplus_contextmenu'] . ', phocamethod:1});'); // Icon $document->addScriptDeclaration('new boxplus($$("a.phocagallerycboxplusi"),{"theme":"' . $this->tmpl['boxplus_theme'] . '","autocenter":' . (int) $this->tmpl['boxplus_bautocenter'] . ',"autofit":' . (int) $this->tmpl['boxplus_autofit'] . ',"slideshow":' . (int) $this->tmpl['boxplus_slideshow'] . ',"loop":' . (int) $this->tmpl['boxplus_loop'] . ',"captions":"' . $this->tmpl['boxplus_captions'] . '","thumbs":"hide","width":' . (int) $popup_width . ',"height":' . (int) $popup_height . ',"duration":' . (int) $this->tmpl['boxplus_duration'] . ',"transition":"' . $this->tmpl['boxplus_transition'] . '","contextmenu":' . (int) $this->tmpl['boxplus_contextmenu'] . ', phocamethod:1});'); } else { // Image $document->addScriptDeclaration('new boxplus($$("a.phocagallerycboxplus"),{"theme":"' . $this->tmpl['boxplus_theme'] . '","autocenter":' . (int) $this->tmpl['boxplus_bautocenter'] . ',"autofit": false,"slideshow": false,"loop":false,"captions":"none","thumbs":"hide","width":' . (int) $popup_width . ',"height":' . (int) $popup_height . ',"duration":0,"transition":"linear","contextmenu":false, phocamethod:2});'); // Icon $document->addScriptDeclaration('new boxplus($$("a.phocagallerycboxplusi"),{"theme":"' . $this->tmpl['boxplus_theme'] . '","autocenter":' . (int) $this->tmpl['boxplus_bautocenter'] . ',"autofit": false,"slideshow": false,"loop":false,"captions":"none","thumbs":"hide","width":' . (int) $popup_width . ',"height":' . (int) $popup_height . ',"duration":0,"transition":"linear","contextmenu":false, phocamethod:2});'); } // Other (Map, Info, Download) $document->addScriptDeclaration('new boxplus($$("a.phocagallerycboxpluso"),{"theme":"' . $this->tmpl['boxplus_theme'] . '","autocenter":' . (int) $this->tmpl['boxplus_bautocenter'] . ',"autofit": false,"slideshow": false,"loop":false,"captions":"none","thumbs":"hide","width":' . (int) $popup_width . ',"height":' . (int) $popup_height . ',"duration":0,"transition":"linear","contextmenu":false, phocamethod:2});'); $document->addScriptDeclaration('});'); } } } } } } } } } $folderButton = new JObject(); $folderButton->set('name', 'image'); $folderButton->set('options', ""); // End open window parameters // ================================================================== // Information about current category $category = $this->get('category'); //$total = $this->get('total'); // Cooliris (Piclens) $this->tmpl['startpiclens'] = 0; if ($this->tmpl['enablecooliris'] == 1) { $this->tmpl['startpiclens'] = $this->params->get('start_cooliris', 0); // CSS - PicLens START $document->addCustomTag(PhocaGalleryRenderFront::renderPicLens($category->id)); } // PARAMS - Pagination and subcategories on other sites // Subcategories will be displayed only on first page if pagination will be used $display_subcat_page = $this->params->get('display_subcat_page', 0); // On the first site subcategories will be displayed always $get['start'] = JRequest::getVar('limitstart', '', 'get', 'string'); if ($display_subcat_page == 2) { $display_subcat_page = 0; // Nowhere } else { if ($display_subcat_page == 0 && $get['start'] > 0) { $display_subcat_page = 0; //in case: second page and param=0 } else { $display_subcat_page = 1; //in case:first page or param==1 } } // Categories View in Category View if ($display_subcat_page_cv == 2) { $display_subcat_page_cv = 0; // Nowhere } else { if ($display_subcat_page_cv == 0 && $get['start'] > 0) { $display_subcat_page_cv = 0; //in case: second page and param=0 } else { $display_subcat_page_cv = 1; //in case:first page or param==1 } } // PARAMS - Display Back Buttons $display_back_button = $this->params->get('display_back_button', 1); $display_categories_back_button = $this->params->get('display_categories_back_button', 1); // PARAMS - Access Category - display category (subcategory folder or backbutton to not accessible cat $display_access_category = $this->params->get('display_access_category', 1); // Set page title per category if ($this->tmpl['displaycatnametitle'] == 1 && isset($category->title)) { $document->setTitle($this->params->get('page_title') . ' - ' . $category->title); } else { $document->setTitle($this->params->get('page_title')); } // Breadcrumb display: // 0 - only menu link // 1 - menu link - category name // 2 - only category name $this->_addBreadCrumbs($category, isset($menu->query['id']) ? $menu->query['id'] : 0, $display_cat_name_breadcrumbs); // PARAMS - the whole page title with category or without category $this->tmpl['showpageheading'] = $this->params->get('show_page_heading', 1); // Define image tag attributes /* if (!empty ($category->image)) { $attribs['align'] = '"'.$category->image_position.'"'; $attribs['hspace'] = '"6"'; $this->tmpl['image'] = JHtml::_('image', 'images/stories/'.$category->image,'', $attribs); }*/ // Switch image JS $this->tmpl['basicimage'] = ''; if ($this->tmpl['switchimage'] == 1) { $imagePathFront = PhocaGalleryPath::getPath(); $this->tmpl['waitimage'] = $imagePathFront->image_rel_front_full . 'icon-switch.gif'; $this->tmpl['basicimage'] = $imagePathFront->image_rel_front_full . 'phoca_thumb_l_no_image.' . $this->tmpl['formaticon']; $document->addCustomTag(PhocaGalleryRenderFront::switchImage($this->tmpl['waitimage'])); $basicImageSelected = 0; // we have not selected the basic image yet } // Overlib $enable_overlib = $this->params->get('enable_overlib', 0); if ((int) $enable_overlib > 0) { $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/overlib/overlib_mini.js'); } // MODEL $model =& $this->getModel(); // Trash $this->tmpl['trash'] = 0; $this->tmpl['publishunpublish'] = 0; $this->tmpl['approvednotapproved'] = 0; // only to see the info // USER RIGHT - DELETE - - - - - - - - - - - // 2, 2 means that user access will be ignored in function getUserRight for display Delete button $rightDisplayDelete = 0; // default is to null (all users cannot upload) if (!empty($category)) { $rightDisplayDelete = PhocaGalleryAccess::getUserRight('deleteuserid', $category->deleteuserid, 2, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), 0); } if ($rightDisplayDelete == 1) { $this->tmpl['trash'] = 1; $this->tmpl['publishunpublish'] = 1; $this->tmpl['approvednotapproved'] = 1; // only to see the info } // - - - - - - - - - - - - - - - - - - - - - // Upload $this->tmpl['displayupload'] = 0; // USER RIGHT - UPLOAD - - - - - - - - - - - // 2, 2 means that user access will be ignored in function getUserRight for display Delete button $rightDisplayUpload = 0; // default is to null (all users cannot upload) if (!empty($category)) { $rightDisplayUpload = PhocaGalleryAccess::getUserRight('uploaduserid', $category->uploaduserid, 2, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), 0); } if ($rightDisplayUpload == 1) { $this->tmpl['displayupload'] = 1; $document->addCustomTag(PhocaGalleryRenderFront::renderOnUploadCategoryJS()); $document->addCustomTag(PhocaGalleryRenderFront::renderDescriptionUploadJS((int) $this->tmpl['maxuploadchar'])); } $this->tmpl['displaycreatecat'] = 0; if ($rightDisplayUpload == 1 && $this->tmpl['enable_direct_subcat'] == 1) { $this->tmpl['displaycreatecat'] = 1; $document->addCustomTag(PhocaGalleryRenderFront::renderOnUploadCategoryJS()); $document->addCustomTag(PhocaGalleryRenderFront::renderDescriptionCreateSubCatJS((int) $this->tmpl['maxcreatecatchar'])); } // - - - - - - - - - - - - - - - - - - - - - // USER RIGHT - ACCESS - - - - - - - - - - - $rightDisplay = 1; //default is set to 1 (all users can see the category) if (!empty($category)) { $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $category->accessuserid, 0, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), $display_access_category); } if ($rightDisplay == 0) { $app->redirect(JRoute::_($this->tmpl['pl'], false), JText::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION')); exit; } // - - - - - - - - - - - - - - - - - - - - - // 1. GEOTAGGING CATEGORY $map['longitude'] = ''; // will be used for 1. default_geotagging to not display pane and 2. to remove pane (line cca 1554) $map['latitude'] = ''; if (isset($category->latitude) && $category->latitude != '' && $category->latitude != 0 && isset($category->longitude) && $category->longitude != '' && $category->longitude != 0) { $map['longitude'] = $category->longitude; $map['latitude'] = $category->latitude; $map['zoom'] = $category->zoom; $map['geotitle'] = $category->geotitle; $map['description'] = $category->description; if ($map['geotitle'] == '') { $map['geotitle'] = $category->title; } } else { $this->tmpl['displayicongeo'] = 0; } // Image next to Category in Categories View in Category View is ordered by Random as default phocagalleryimport('phocagallery.ordering.ordering'); $categoryImageOrdering = PhocaGalleryOrdering::getOrderingString($this->tmpl['categoryimageordering']); $categoryImageOrderingCV = PhocaGalleryOrdering::getOrderingString($this->tmpl['categoryimageorderingcv']); // = = = = = = = = = = = = = = = = = = = = // BOXES // = = = = = = = = = = = = = = = = = = = = // Information because of height of box (if they are used not by all images) $this->tmpl['displayiconextlink1box'] = 0; $this->tmpl['displayiconextlink2box'] = 0; $this->tmpl['displayiconvmbox'] = 0; $this->tmpl['displayicongeobox'] = 0; $iS = 0; $iCV = 0; $items = array(); // Category View $itemsCV = array(); // Category List (Categories View) in Category View // ---------------------------------------- // PARENT FOLDERS(I) or Back Button STANDARD // ---------------------------------------- /*$menu = &JSite::getMenu(); // Set Back Button to CATEGORIES VIEW $itemsLink = $menu->getItems('link', 'index.php?option=com_phocagallery&view=categories'); $itemId = 0; if(isset($itemsLink[0])) { $itemId = $itemsLink[0]->id; } $backLink = 'index.php?option=com_phocagallery&view=categories&Itemid='.$itemId;*/ $posItemid = $posItemidNull = $backLinkItemId = false; $backLink = PhocaGalleryRoute::getCategoriesRoute(); $posItemidNull = strpos($backLink, "Itemid=0"); $posItemid = strpos($backLink, "Itemid="); if ($posItemidNull === false && $posItemid) { $backLinkItemId = 1; } $parentCategory = $this->get('parentcategory'); if ($display_back_button == 1) { if (!empty($parentCategory)) { $items[$iS] = $parentCategory; // USER RIGHT - ACCESS - - - - - - - - - - - // Should be the link to parentcategory displayed $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $items[$iS]->accessuserid, $items[$iS]->access, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), $display_access_category); // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; if ($display_access_category == 1) { // we simulate that we want not to display unaccessable categories // so we get rightDisplayKey = 0 then the key will be displayed if (!empty($parentCategory)) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $items[$iS]->accessuserid, $items[$iS]->access, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), 0); } } // - - - - - - - - - - - - - - - - - - - - - if ($rightDisplay > 0) { $items[$iS]->cls = 'pg-box-parentfolder'; $items[$iS]->slug = $items[$iS]->id . ':' . $items[$iS]->alias; $items[$iS]->item_type = "parentfolder"; $items[$iS]->linkthumbnailpath = PhocaGalleryImageFront::displayBackFolder('medium', $rightDisplayKey); $items[$iS]->extm = $items[$iS]->linkthumbnailpath; $items[$iS]->exts = $items[$iS]->linkthumbnailpath; $items[$iS]->numlinks = 0; // We are in category view $items[$iS]->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $items[$iS]->slug . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int')); $items[$iS]->button =& $folderButton; $items[$iS]->button->methodname = ''; $items[$iS]->displayicondetail = 0; $items[$iS]->displayicondownload = 0; $items[$iS]->displayiconfolder = 0; $items[$iS]->displayname = 0; $items[$iS]->displayiconvm = ''; $items[$iS]->startpiclens = 0; $items[$iS]->trash = 0; $items[$iS]->publishunpublish = 0; $items[$iS]->approvednotapproved = 0; $items[$iS]->enable_cooliris = 0; $items[$iS]->overlib = 0; $items[$iS]->displayicongeo = 0; $items[$iS]->type = 0; $items[$iS]->camerainfo = 0; $items[$iS]->displayiconextlink1 = 0; $items[$iS]->displayiconextlink2 = 0; $items[$iS]->description = ''; $items[$iS]->altvalue = ''; $iS++; } else { // There is no right to see the data but the object exists (because it was loaded from database // Destroy it unset($items[$iS]); } } else { // Back button to categories list if it exists if ($backLinkItemId != 0 && $display_categories_back_button == 1) { $items[$iS] = new JObject(); $items[$iS]->cls = 'pg-box-backbtn'; $items[$iS]->link = JRoute::_($backLink); $items[$iS]->title = JTEXT::_('COM_PHOCAGALLERY_CATEGORY_LIST'); $items[$iS]->item_type = "categorieslist"; $items[$iS]->linkthumbnailpath = PhocaGalleryImageFront::displayBackFolder('medium', 1); $items[$iS]->extm = $items[$iS]->linkthumbnailpath; $items[$iS]->exts = $items[$iS]->linkthumbnailpath; $items[$iS]->numlinks = 0; // We are in category view $items[$iS]->button =& $folderButton; $items[$iS]->button->methodname = ''; $items[$iS]->displayicondetail = 0; $items[$iS]->displayicondownload = 0; $items[$iS]->displayiconfolder = 0; $items[$iS]->displayname = 0; $items[$iS]->displayiconvm = ''; $items[$iS]->startpiclens = 0; $items[$iS]->trash = 0; $items[$iS]->publishunpublish = 0; $items[$iS]->approvednotapproved = 0; $items[$iS]->enable_cooliris = 0; $items[$iS]->overlib = 0; $items[$iS]->displayicongeo = 0; $items[$iS]->type = 0; $items[$iS]->camerainfo = 0; $items[$iS]->displayiconextlink1 = 0; $items[$iS]->displayiconextlink2 = 0; $items[$iS]->description = ''; $items[$iS]->altvalue = ''; $iS++; } } } // ---------------------------------------- // PARENT FOLDERS(II) or Back Button CATEGORIES VIEW IN CATEGORY VIEW // ---------------------------------------- if ($display_back_button_cv == 1 && $this->tmpl['displaycategoriescv'] == 1) { if (!empty($parentCategory)) { $itemsCV[$iCV] = clone $parentCategory; // USER RIGHT - ACCESS - - - - - - - - - - - // Should be the link to parentcategory displayed $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $itemsCV[$iCV]->accessuserid, $itemsCV[$iCV]->access, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), $display_access_category); // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; if ($display_access_category == 1) { // we simulate that we want not to display unaccessable categories // so we get rightDisplayKey = 0 then the key will be displayed if (!empty($parentCategory)) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $itemsCV[$iCV]->accessuserid, $itemsCV[$iCV]->access, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), 0); } } // - - - - - - - - - - - - - - - - - - - - - if ($rightDisplay > 0) { $itemsCV[$iCV]->cls = 'pg-box-parentfolder-cv'; $itemsCV[$iCV]->slug = $itemsCV[$iCV]->id . ':' . $itemsCV[$iCV]->alias; $itemsCV[$iCV]->item_type = "parentfoldercv"; $itemsCV[$iCV]->linkthumbnailpath = PhocaGalleryImageFront::displayBackFolder('medium', $rightDisplayKey); $itemsCV[$iCV]->extm = $itemsCV[$iCV]->linkthumbnailpath; $itemsCV[$iCV]->exts = $itemsCV[$iCV]->linkthumbnailpath; $itemsCV[$iCV]->numlinks = 0; // We are in category view $itemsCV[$iCV]->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $itemsCV[$iCV]->slug . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int')); $itemsCV[$iCV]->type = 3; $itemsCV[$iCV]->altvalue = ''; $iCV++; } else { // There is no right to see the data but the object exists (because it was loaded from database // Destroy it unset($itemsCV[$iCV]); } } else { // Back button to categories list if it exists if ($backLinkItemId != 0 && $display_categories_back_button_cv == 1) { $itemsCV[$iCV] = new JObject(); $itemsCV[$iCV]->cls = 'pg-box-backbtn-cv'; $itemsCV[$iCV]->link = $backLink; $itemsCV[$iCV]->title = JTEXT::_('COM_PHOCAGALLERY_CATEGORY_LIST'); $itemsCV[$iCV]->item_type = "categorieslistcv"; $itemsCV[$iCV]->linkthumbnailpath = PhocaGalleryImageFront::displayBackFolder('medium', 1); $itemsCV[$iCV]->extm = $itemsCV[$iCV]->linkthumbnailpath; $itemsCV[$iCV]->exts = $itemsCV[$iCV]->linkthumbnailpath; $itemsCV[$iCV]->numlinks = 0; // We are in category view $itemsCV[$iCV]->link = JRoute::_($itemsCV[$iCV]->link); $itemsCV[$iCV]->type = 3; $itemsCV[$iCV]->altvalue = ''; $iCV++; } } } // ---------------------------------------- // SUB FOLDERS(1) STANDARD // ---------------------------------------- // Display subcategories on every page if ($display_subcat_page == 1) { $subCategory = $this->get('subcategory'); $totalSubCat = count($subCategory); if ((int) $this->tagId > 0) { $subCategory = array(); } // No subcategories for tag searching if (!empty($subCategory)) { $items[$iS] =& $subCategory; for ($iSub = 0; $iSub < $totalSubCat; $iSub++) { $items[$iS] =& $subCategory[$iSub]; // USER RIGHT - ACCESS - - - - - - - - - - $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $items[$iS]->accessuserid, $items[$iS]->access, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), $display_access_category); // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; if ($display_access_category == 1) { // we simulate that we want not to display unaccessable categories // so we get rightDisplayKey = 0 then the key will be displayed if (!empty($items[$iS])) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $items[$iS]->accessuserid, $items[$iS]->access, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), 0); } } // - - - - - - - - - - - - - - - - - - - - if ($rightDisplay > 0) { $items[$iS]->cls = 'pg-box-subfolder'; $items[$iS]->slug = $items[$iS]->id . ':' . $items[$iS]->alias; $items[$iS]->item_type = "subfolder"; $numlinks = $model->getCountItem($items[$iS]->id); //Should be get from main subcategories query if (isset($numlinks[0]) && $numlinks[0] > 0) { $items[$iS]->numlinks = (int) $numlinks[0]; } else { $items[$iS]->numlinks = 0; } $extImage = PhocaGalleryImage::isExtImage($items[$iS]->extid); if ($extImage) { if ($this->tmpl['categoryimageordering'] != 10) { $imagePic = PhocaGalleryImageFront::getRandomImageRecursive($items[$iS]->id, $categoryImageOrdering, 1); $fileThumbnail = PhocaGalleryImageFront::displayCategoryExtImgOrFolder($imagePic->exts, $imagePic->extm, 'medium', $rightDisplayKey, 'display_category_icon_image'); } else { $fileThumbnail = PhocaGalleryImageFront::displayCategoryExtImgOrFolder($items[$iS]->exts, $items[$iS]->extm, 'medium', $rightDisplayKey, 'display_category_icon_image'); $imagePic = new stdClass(); $imagePic->extw = $items[$iS]->extw; $imagePic->exth = $items[$iS]->exth; } // in case category is locked or no extm exists $items[$iS]->linkthumbnailpath = $fileThumbnail->linkthumbnailpath; $items[$iS]->extm = $fileThumbnail->extm; $items[$iS]->exts = $fileThumbnail->exts; $items[$iS]->exthswitch = $items[$iS]->extwswitch = 0; if ($imagePic->extw != '') { $extw = explode(',', $imagePic->extw); $items[$iS]->extw = $extw[1]; $items[$iS]->extwswitch = $extw[0]; } if ($imagePic->exth != '') { $exth = explode(',', $imagePic->exth); $items[$iS]->exth = $exth[1]; $items[$iS]->exthswitch = $exth[0]; } $items[$iS]->extpic = $fileThumbnail->extpic; } else { if ($this->tmpl['categoryimageordering'] != 10) { $randomImage = PhocaGalleryImageFront::getRandomImageRecursive($items[$iS]->id, $categoryImageOrdering); $fileThumbnail = PhocaGalleryImageFront::displayCategoryImageOrFolder($randomImage, 'medium', $rightDisplayKey, 'display_category_icon_image'); } else { $fileThumbnail = PhocaGalleryImageFront::displayCategoryImageOrFolder($items[$iS]->filename, 'medium', $rightDisplayKey, 'display_category_icon_image'); } $items[$iS]->linkthumbnailpath = $fileThumbnail->rel; } $items[$iS]->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $items[$iS]->slug . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int')); $items[$iS]->button =& $folderButton; $items[$iS]->button->methodname = ''; $items[$iS]->displayicondetail = 0; $items[$iS]->displayicondownload = 0; $items[$iS]->displayiconfolder = $this->tmpl['displayiconfolder']; $items[$iS]->displayname = $this->tmpl['displayname']; $items[$iS]->displayiconvm = ''; $items[$iS]->startpiclens = 0; $items[$iS]->trash = 0; $items[$iS]->publishunpublish = 0; $items[$iS]->approvednotapproved = 0; $items[$iS]->enable_cooliris = 0; $items[$iS]->overlib = 0; $items[$iS]->displayicongeo = 0; $items[$iS]->type = 1; $items[$iS]->camerainfo = 0; $items[$iS]->displayiconextlink1 = 0; $items[$iS]->displayiconextlink2 = 0; $items[$iS]->description = ''; $items[$iS]->displayiconcommentimg = ''; $items[$iS]->altvalue = ''; $iS++; } else { // There is no right to see the data but the object exists (because it was loaded from database // Destroy it unset($items[$iS]); } } } } // ---------------------------------------- // SUB FOLDERS(II) or Back Button CATEGORIES VIEW IN CATEGORY VIEW // ---------------------------------------- //display subcategories on every page if ($display_subcat_page_cv == 1 && $this->tmpl['displaycategoriescv'] == 1) { $subCategory = $this->get('subcategory'); $totalSubCat = count($subCategory); if ((int) $this->tagId > 0) { $subCategory = array(); } // No subcategories for tag searching if (!empty($subCategory)) { $itemsCV[$iCV] =& $subCategory; for ($iSub = 0; $iSub < $totalSubCat; $iSub++) { $itemsCV[$iCV] =& $subCategory[$iSub]; // USER RIGHT - ACCESS - - - - - - - - - - $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $itemsCV[$iCV]->accessuserid, $itemsCV[$iCV]->access, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), $display_access_category); // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; if ($display_access_category == 1) { // we simulate that we want not to display unaccessable categories // so we get rightDisplayKey = 0 then the key will be displayed if (!empty($itemsCV[$iCV])) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $itemsCV[$iCV]->accessuserid, $itemsCV[$iCV]->access, $this->tmpl['user']->authorisedLevels(), $this->tmpl['user']->get('id', 0), 0); } } // - - - - - - - - - - - - - - - - - - - - if ($rightDisplay > 0) { $itemsCV[$iCV]->cls = 'pg-box-subfolder-cv'; $itemsCV[$iCV]->slug = $itemsCV[$iCV]->id . ':' . $itemsCV[$iCV]->alias; $itemsCV[$iCV]->item_type = "subfoldercv"; $itemsCV[$iCV]->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $itemsCV[$iCV]->slug . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int')); $itemsCV[$iCV]->type = 4; $numlinks = $model->getCountItem($itemsCV[$iCV]->id); //Should be get from main subcategories query if (isset($numlinks[0]) && $numlinks[0] > 0) { $itemsCV[$iCV]->numlinks = (int) $numlinks[0]; } else { $itemsCV[$iCV]->numlinks = 0; } $extImage = PhocaGalleryImage::isExtImage($itemsCV[$iCV]->extid); if ($extImage) { if ($this->tmpl['categoryimageordering'] != 10) { $imagePic = PhocaGalleryImageFront::getRandomImageRecursive($itemsCV[$iCV]->id, $categoryImageOrderingCV, 1); $fileThumbnail = PhocaGalleryImageFront::displayCategoryExtImgOrFolder($imagePic->exts, $imagePic->extm, 'medium', $rightDisplayKey, 'display_category_icon_image'); } else { $fileThumbnail = PhocaGalleryImageFront::displayCategoryExtImgOrFolder($itemsCV[$iCV]->exts, $itemsCV[$iCV]->extm, 'medium', $rightDisplayKey, 'display_category_icon_image'); $imagePic = new stdClass(); $imagePic->extw = $itemsCV[$iCV]->extw; $imagePic->exth = $itemsCV[$iCV]->exth; } // in case category is locked or no extm exists $itemsCV[$iCV]->linkthumbnailpath = $fileThumbnail->linkthumbnailpath; $itemsCV[$iCV]->extm = $fileThumbnail->extm; $itemsCV[$iCV]->exts = $fileThumbnail->exts; $itemsCV[$iCV]->exthswitch = $itemsCV[$iCV]->extwswitch = 0; if ($imagePic->extw != '') { $extw = explode(',', $imagePic->extw); $itemsCV[$iCV]->extw = $extw[1]; $itemsCV[$iCV]->extwswitch = $extw[0]; } if ($imagePic->exth != '') { $exth = explode(',', $imagePic->exth); $itemsCV[$iCV]->exth = $exth[1]; $itemsCV[$iCV]->exthswitch = $exth[0]; } $itemsCV[$iCV]->extpic = $fileThumbnail->extpic; } else { if ($this->tmpl['categoryimageordering'] != 10) { $randomImage = PhocaGalleryImageFront::getRandomImageRecursive($itemsCV[$iCV]->id, $categoryImageOrderingCV); $fileThumbnail = PhocaGalleryImageFront::displayCategoryImageOrFolder($randomImage, 'medium', $rightDisplayKey, 'display_category_icon_image_cv'); } else { $fileThumbnail = PhocaGalleryImageFront::displayCategoryImageOrFolder($itemsCV[$iCV]->filename, 'medium', $rightDisplayKey, 'display_category_icon_image_cv'); } $itemsCV[$iCV]->linkthumbnailpath = $fileThumbnail->rel; $itemsCV[$iCV]->altvalue = ''; } $iCV++; } else { // There is no right to see the data but the object exists (because it was loaded from database // Destroy it unset($itemsCV[$iCV]); } } } } // ---------------------------------------- // IMAGES // ---------------------------------------- // If user has rights to delete or publish or unpublish, unbublished items should be displayed if ($rightDisplayDelete == 1) { $images = $model->getData(1, $this->tagId); $this->tmpl['pagination'] =& $model->getPagination(1, $this->tagId); } else { $images = $model->getData(0, $this->tagId); $this->tmpl['pagination'] =& $model->getPagination(0, $this->tagId); } $this->tmpl['ordering'] =& $model->getOrdering(); $totalImg = count($images); if ($limitStart > 0) { $this->tmpl['limitstarturl'] = '&limitstart=' . $limitStart; } else { $this->tmpl['limitstarturl'] = ''; } $this->tmpl['jakdatajs'] = array(); $this->tmpl['displayiconcommentimgbox'] = 0; for ($iM = 0; $iM < $totalImg; $iM++) { $items[$iS] = $images[$iM]; $items[$iS]->cls = 'pg-box-image'; $items[$iS]->slug = $items[$iS]->id . ':' . $items[$iS]->alias; $items[$iS]->item_type = "image"; $items[$iS]->linknr = ''; //Def $extImage = PhocaGalleryImage::isExtImage($items[$iS]->extid); // Get file thumbnail or No Image $items[$iS]->exthswitch = $items[$iS]->extwswitch = 0; if ($items[$iS]->extm != '') { if ($items[$iS]->extw != '') { $extw = explode(',', $items[$iS]->extw); $items[$iS]->extw = $extw[1]; $items[$iS]->extwswitch = $extw[0]; } 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; $items[$iS]->linkother = $siteLink; $items[$iS]->linkorig = $imgLinkOrig; // jak data js switch ($this->tmpl['jakdescription']) { case 0: $descriptionJakJs = ''; break; case 2: $descriptionJakJs = PhocaGalleryText::strTrimAll(addslashes($items[$iS]->description)); break; case 3: $descriptionJakJs = PhocaGalleryText::strTrimAll(addslashes($items[$iS]->title)); if ($items[$iS]->description != '') { $descriptionJakJs .= '<br />' . PhocaGalleryText::strTrimAll(addslashes($items[$iS]->description)); } break; case 1: default: $descriptionJakJs = PhocaGalleryText::strTrimAll(addslashes($items[$iS]->title)); break; } $items[$iS]->linknr = $iM; $this->tmpl['jakdatajs'][$iS] = "{alt: '" . PhocaGalleryText::strTrimAll(addslashes($items[$iS]->title)) . "',"; if ($descriptionJakJs != '') { $this->tmpl['jakdatajs'][$iS] .= "description: '" . $descriptionJakJs . "',"; } else { $this->tmpl['jakdatajs'][$iS] .= "description: ' ',"; } if ($extImage) { $this->tmpl['jakdatajs'][$iS] .= "small: {url: '" . $items[$iS]->extm . "'}," . "big: {url: '" . $items[$iS]->extl . "'} }"; } else { $this->tmpl['jakdatajs'][$iS] .= "small: {url: '" . htmlentities(JURI::base(true) . '/' . PhocaGalleryText::strTrimAll(addslashes($thumbLinkM->rel))) . "'}," . "big: {url: '" . htmlentities(JURI::base(true) . '/' . PhocaGalleryText::strTrimAll(addslashes($imgLink))) . "'} }"; } } else { if ($this->tmpl['detailwindow'] == 8) { $items[$iS]->link = $imgLink; $items[$iS]->link2 = $imgLink; $items[$iS]->linkother = $imgLink; $items[$iS]->linkorig = $imgLinkOrig; } else { if ($this->tmpl['detailwindow'] == 9) { $items[$iS]->link = $siteLink; $items[$iS]->link2 = $siteLink; $items[$iS]->linkother = $siteLink; $items[$iS]->linkorig = $imgLinkOrig; } else { if ($this->tmpl['detailwindow'] == 10) { $items[$iS]->link = $imgLink; $items[$iS]->link2 = $imgLink; $items[$iS]->linkother = $siteLink; $items[$iS]->linkorig = $imgLinkOrig; } else { $items[$iS]->link = $siteLink; $items[$iS]->link2 = $siteLink; $items[$iS]->linkother = $siteLink; $items[$iS]->linkorig = $imgLinkOrig; } } } } } } } // Buttons, e.g. shadowbox: // button - click on image // button2 - click on zoom icon (cannot be the same as click on image because of duplicity of images) // buttonOther - other detail window like download, geotagging $items[$iS]->button =& $button; $items[$iS]->button2 =& $button2; $items[$iS]->buttonother =& $buttonOther; $items[$iS]->displayicondetail = $this->tmpl['displayicondetail']; $items[$iS]->displayicondownload = $this->tmpl['displayicondownload']; $items[$iS]->displayiconfolder = 0; $items[$iS]->displayname = $this->tmpl['displayname']; $items[$iS]->displayiconvm = ''; $items[$iS]->startpiclens = $this->tmpl['startpiclens']; $items[$iS]->type = 2; // Trash icon if ($this->tmpl['trash'] == 1) { $items[$iS]->trash = 1; } else { $items[$iS]->trash = 0; } // Publish Unpublish icon if ($this->tmpl['publishunpublish'] == 1) { $items[$iS]->publishunpublish = 1; } else { $items[$iS]->publishunpublish = 0; } // Publish Unpublish icon if ($this->tmpl['approvednotapproved'] == 1) { $items[$iS]->approvednotapproved = 1; } else { $items[$iS]->approvednotapproved = 0; } // PICLENS if ($this->tmpl['enablecooliris']) { $items[$iS]->enable_cooliris = 1; } else { $items[$iS]->enable_cooliris = 0; } // 2. GEOTAGGING IMAGE // We have checked the category so if geotagging is enabled // and there is no geotagging data for category, then $this->tmpl['displayicongeo'] = 0; // so we need to check it for the image too, we need to set the $this->tmpl['displayicongeoimage'] for image only // we are in loop now $this->tmpl['displayicongeoimagetmp'] = 0; if ($this->tmpl['displayicongeoimage'] == 1) { $this->tmpl['displayicongeoimagetmp'] = 1; if (isset($items[$iS]->latitude) && $items[$iS]->latitude != '' && $items[$iS]->latitude != 0 && isset($items[$iS]->longitude) && $items[$iS]->longitude != '' && $items[$iS]->longitude != 0) { } else { $this->tmpl['displayicongeoimagetmp'] = 0; } } // GEOTAGGING if ($this->tmpl['displayicongeo'] == 1 || $this->tmpl['displayicongeoimagetmp'] == 1) { $items[$iS]->displayicongeo = 1; $this->tmpl['displayicongeobox'] = 1; // because of height of box } else { $items[$iS]->displayicongeo = 0; } // Set it back because of loop $this->tmpl['displayicongeoimagetmp'] = 0; // CAMERA INFO if ($this->tmpl['displaycamerainfo'] == 1) { $items[$iS]->camerainfo = 1; } else { $items[$iS]->camerainfo = 0; } // EXT LINK $items[$iS]->displayiconextlink1 = 0; if (isset($items[$iS]->extlink1)) { $items[$iS]->extlink1 = explode("|", $items[$iS]->extlink1, 4); if (isset($items[$iS]->extlink1[0]) && $items[$iS]->extlink1[0] != '' && isset($items[$iS]->extlink1[1])) { $items[$iS]->displayiconextlink1 = 1; $this->tmpl['displayiconextlink1box'] = 1; // because of height of box if (!isset($items[$iS]->extlink1[2])) { $items[$iS]->extlink1[2] = '_self'; } if (!isset($items[$iS]->extlink1[3]) || $items[$iS]->extlink1[3] == 1) { $items[$iS]->extlink1[4] = JHtml::_('image', 'components/com_phocagallery/assets/images/icon-extlink1.' . $this->tmpl['formaticon'], JText::_($items[$iS]->extlink1[1])); $items[$iS]->extlink1[5] = ''; } else { $items[$iS]->extlink1[4] = $items[$iS]->extlink1[1]; $items[$iS]->extlink1[5] = 'style="text-decoration:underline"'; } } else { $items[$iS]->displayiconextlink1 = 0; } } $items[$iS]->displayiconextlink2 = 0; if (isset($items[$iS]->extlink2)) { $items[$iS]->extlink2 = explode("|", $items[$iS]->extlink2, 4); if (isset($items[$iS]->extlink2[0]) && $items[$iS]->extlink2[0] != '' && isset($items[$iS]->extlink2[1])) { $items[$iS]->displayiconextlink2 = 1; $this->tmpl['displayiconextlink2box'] = 1; // because of height of box if (!isset($items[$iS]->extlink2[2])) { $items[$iS]->extlink2[2] = '_self'; } if (!isset($items[$iS]->extlink2[3]) || $items[$iS]->extlink2[3] == 1) { $items[$iS]->extlink2[4] = JHtml::_('image', 'components/com_phocagallery/assets/images/icon-extlink2.' . $this->tmpl['formaticon'], JText::_($items[$iS]->extlink2[1])); $items[$iS]->extlink2[5] = ''; } else { $items[$iS]->extlink2[4] = $items[$iS]->extlink2[1]; $items[$iS]->extlink2[5] = 'style="text-decoration:underline"'; } } else { $items[$iS]->displayiconextlink2 = 0; } } // OVERLIB if (!empty($items[$iS]->description)) { $divPadding = 'padding:5px;'; } else { $divPadding = 'padding:0px;margin:0px;'; } // Resize image in overlib by rate $wHOutput = array(); if (isset($items[$iS]->extpic) && $items[$iS]->extpic != '') { if ((int) $this->tmpl['overlibimagerate'] > 0) { $imgSize = @getimagesize($items[$iS]->extl); $wHOutput = PhocaGalleryImage::getTransformImageArray($imgSize, $this->tmpl['overlibimagerate']); } $oImg = JHtml::_('image', $items[$iS]->extl, '', $wHOutput); } else { if ((int) $this->tmpl['overlibimagerate'] > 0) { $thumbL = str_replace('phoca_thumb_m_', 'phoca_thumb_l_', $items[$iS]->linkthumbnailpath); $imgSize = @getimagesize($thumbL); $wHOutput = PhocaGalleryImage::getTransformImageArray($imgSize, $this->tmpl['overlibimagerate']); } $oImg = JHtml::_('image', str_replace('phoca_thumb_m_', 'phoca_thumb_l_', $items[$iS]->linkthumbnailpath), '', $wHOutput); } switch ($enable_overlib) { case 1: case 4: $uBy = ''; //Uploaded by ... if ($enable_overlib == 4 && isset($items[$iS]->usernameno) && $items[$iS]->usernameno != '') { $uBy = '<div>' . JText::_('COM_PHOCAGALLERY_UPLOADED_BY') . ' <strong>' . $items[$iS]->usernameno . '</strong></div>'; } $items[$iS]->overlib = 1; $items[$iS]->overlib_value = " onmouseover=\"return overlib('" . htmlspecialchars(addslashes('<div class="pg-overlib"><center>' . $oImg . "</center></div>" . $uBy)) . "', CAPTION, '" . htmlspecialchars(addslashes($items[$iS]->title)) . "', BELOW, RIGHT, BGCLASS,'bgPhocaClass', FGCOLOR, '" . $this->tmpl['olfgcolor'] . "', BGCOLOR, '" . $this->tmpl['olbgcolor'] . "', TEXTCOLOR, '" . $this->tmpl['oltfcolor'] . "', CAPCOLOR, '" . $this->tmpl['olcfcolor'] . "');\"" . " onmouseout=\"return nd();\" "; break; case 2: case 5: $uBy = ''; //Uploaded by ... if ($enable_overlib == 5 && isset($items[$iS]->usernameno) && $items[$iS]->usernameno != '') { $uBy = '<div>' . JText::_('COM_PHOCAGALLERY_UPLOADED_BY') . ' <strong>' . $items[$iS]->usernameno . '</strong></div>'; } $items[$iS]->overlib = 2; $items[$iS]->description = str_replace("\n", '<br />', $items[$iS]->description); $items[$iS]->description = str_replace("\r", ' ', $items[$iS]->description); $items[$iS]->overlib_value = " onmouseover=\"return overlib('" . htmlspecialchars(addslashes('<div class="pg-overlib"><div style="' . $divPadding . '">' . $items[$iS]->description . '</div></div>' . $uBy)) . "', CAPTION, '" . htmlspecialchars(addslashes($items[$iS]->title)) . "', BELOW, RIGHT, CSSCLASS, TEXTFONTCLASS, 'fontPhocaClass', FGCLASS, 'fgPhocaClass', BGCLASS, 'bgPhocaClass', CAPTIONFONTCLASS,'capfontPhocaClass', CLOSEFONTCLASS, 'capfontclosePhocaClass');\"" . " onmouseout=\"return nd();\" "; break; case 3: case 6: $uBy = ''; //Uploaded by ... if ($enable_overlib == 6 && isset($items[$iS]->usernameno) && $items[$iS]->usernameno != '') { $uBy = '<div>' . JText::_('COM_PHOCAGALLERY_UPLOADED_BY') . ' <strong>' . $items[$iS]->usernameno . '</strong></div>'; } $items[$iS]->overlib = 3; $items[$iS]->description = str_replace("\n", '<br />', $items[$iS]->description); $items[$iS]->description = str_replace("\r", ' ', $items[$iS]->description); $items[$iS]->overlib_value = " onmouseover=\"return overlib('" . PhocaGalleryText::strTrimAll(htmlspecialchars(addslashes('<div class="pg-overlib"><div style="text-align:center"><center>' . $oImg . '</center></div><div style="' . $divPadding . '">' . $items[$iS]->description . '</div></div>' . $uBy))) . "', CAPTION, '" . htmlspecialchars(addslashes($items[$iS]->title)) . "', BELOW, RIGHT, BGCLASS,'bgPhocaClass', FGCLASS,'fgPhocaClass', FGCOLOR, '" . $this->tmpl['olfgcolor'] . "', BGCOLOR, '" . $this->tmpl['olbgcolor'] . "', TEXTCOLOR, '" . $this->tmpl['oltfcolor'] . "', CAPCOLOR, '" . $this->tmpl['olcfcolor'] . "');\"" . " onmouseout=\"return nd();\" "; break; default: $items[$iS]->overlib = 0; $items[$iS]->overlib_value = ''; break; } // VirtueMart link if ($this->tmpl['displayiconvm'] == 1) { phocagalleryimport('phocagallery.virtuemart.virtuemart'); $vmLink = PhocaGalleryVirtueMart::getVmLink($items[$iS]->vmproductid, $errorMsg); if (!$vmLink) { $items[$iS]->displayiconvm = ''; } else { $items[$iS]->displayiconvm = 1; $items[$iS]->vmlink = $vmLink; $this->tmpl['displayiconvmbox'] = 1; // because of height of box } } else { $items[$iS]->displayiconvm = ''; } // End VM Link // V O T E S - IMAGES if ((int) $this->tmpl['displayratingimg'] == 1) { $items[$iS]->votescountimg = 0; $items[$iS]->votesaverageimg = 0; $items[$iS]->voteswidthimg = 0; $votesStatistics = PhocaGalleryRateImage::getVotesStatistics((int) $items[$iS]->id); if (!empty($votesStatistics->count)) { $items[$iS]->votescountimg = $votesStatistics->count; } if (!empty($votesStatistics->average)) { $items[$iS]->votesaverageimg = $votesStatistics->average; if ($items[$iS]->votesaverageimg > 0) { $items[$iS]->votesaverageimg = round((double) $items[$iS]->votesaverageimg / 0.5) * 0.5; $items[$iS]->voteswidthimg = 16 * $items[$iS]->votesaverageimg; } else { $items[$iS]->votesaverageimg = (int) 0; // not float displaying } } } $items[$iS]->displayiconcommentimg = 0; // C O M M E N T S - IMAGES if ((int) $this->tmpl['displaycommentimg'] == 1) { $items[$iS]->displayiconcommentimg = 1; $this->tmpl['displayiconcommentimgbox'] = 1; // because of height of box } // ALT VALUE $altValue = PhocaGalleryRenderFront::getAltValue($this->tmpl['altvalue'], $items[$iS]->title, $items[$iS]->description, $items[$iS]->metadesc); $items[$iS]->altvalue = $altValue; // TITLE TAG - Description Output in Title Tag $imgAlt = $imgTitle = ''; // Some methods cannot use Alt because of conflicting with Title and popup methods if ($this->tmpl['detailwindow'] == 3 || $this->tmpl['detailwindow'] == 9 || $this->tmpl['detailwindow'] == 10) { $imgAlt = $items[$iS]->altvalue; $imgTitle = $items[$iS]->title; if ($imgAlt == $imgTitle) { $imgAlt = ''; } $items[$iS]->oimgalt = $imgAlt; } else { $items[$iS]->oimgalt = $altValue; } // TITLE TAG - Detail if ($this->tmpl['detailwindow'] == 9 || $this->tmpl['detailwindow'] == 10) { $detailAlt = $items[$iS]->altvalue; $detailTitle = $items[$iS]->title; if ($detailAlt == $detailTitle) { $detailAlt = ''; } } else { $detailAlt = JText::_('COM_PHOCAGALLERY_IMAGE_DETAIL'); $detailTitle = JText::_('COM_PHOCAGALLERY_IMAGE_DETAIL'); } $items[$iS]->oimgaltdetail = $detailAlt; $items[$iS]->oimgtitledetail = $detailTitle; $titleDesc = ''; if ($this->tmpl['displaytitleindescription'] == 1) { $titleDesc .= $items[$iS]->title; if ($items[$iS]->description != '' && $titleDesc != '') { $titleDesc .= ' - '; } } if ($this->tmpl['detailwindow'] == 8 && $this->tmpl['displaydescriptiondetail'] == 1) { $items[$iS]->odesctitletag = strip_tags($titleDesc) . strip_tags($items[$iS]->description); } else { $items[$iS]->odesctitletag = strip_tags($imgTitle); } // Overlib class if ($items[$iS]->overlib == 0) { $items[$iS]->ooverlibclass = array('class' => 'pg-image'); } else { $items[$iS]->ooverlibclass = array('class' => 'pimo pg-image'); } // Tags $items[$iS]->otags = ''; if ($this->tmpl['display_tags_links'] == 1 || $this->tmpl['display_tags_links'] == 3) { $items[$iS]->otags = PhocaGalleryTag::displayTags($items[$iS]->id); if ($items[$iS]->otags != '') { $this->tmpl['displaying_tags_true'] = 1; } } $iS++; } // END IMAGES // Upload Form - - - - - - - - - - - - - // Set FTP form $ftp = !JClientHelper::hasCredentials('ftp'); // PARAMS - Upload size $this->tmpl['uploadmaxsize'] = $this->params->get('upload_maxsize', 3000000); $this->assignRef('session', JFactory::getSession()); //$this->assignRef('uploadmaxsize', $upload_maxsize); // END Upload Form - - - - - - - - - - - - // V O T E S - CATEGORY // Only registered (VOTES + COMMENTS) $this->tmpl['notregistered'] = true; $this->tmpl['name'] = ''; if ($access > 0) { $this->tmpl['notregistered'] = false; $this->tmpl['name'] = $this->tmpl['user']->name; } // VOTES Statistics if ((int) $this->tmpl['displayrating'] == 1 && (int) $id > 0) { $this->tmpl['votescount'] = 0; $this->tmpl['votesaverage'] = 0; $this->tmpl['voteswidth'] = 0; $votesStatistics = PhocaGalleryRateCategory::getVotesStatistics((int) $id); if (!empty($votesStatistics->count)) { $this->tmpl['votescount'] = $votesStatistics->count; } if (!empty($votesStatistics->average)) { $this->tmpl['votesaverage'] = $votesStatistics->average; if ($this->tmpl['votesaverage'] > 0) { $this->tmpl['votesaverage'] = round((double) $this->tmpl['votesaverage'] / 0.5) * 0.5; $this->tmpl['voteswidth'] = 22 * $this->tmpl['votesaverage']; } else { $this->tmpl['votesaverage'] = (int) 0; // not float displaying } } if ((int) $this->tmpl['votescount'] > 1) { $this->tmpl['votestext'] = 'COM_PHOCAGALLERY_VOTES'; } else { $this->tmpl['votestext'] = 'COM_PHOCAGALLERY_VOTE'; } // Already rated? $this->tmpl['alreadyrated'] = PhocaGalleryRateCategory::checkUserVote((int) $id, (int) $this->tmpl['user']->id); } // COMMENTS if ((int) $this->tmpl['displaycomment'] == 1 && (int) $id > 0) { $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/comments.js'); $document->addCustomTag(PhocaGalleryRenderFront::renderCommentJS((int) $this->tmpl['maxcommentchar'])); $this->tmpl['alreadycommented'] = PhocaGalleryCommentCategory::checkUserComment((int) $id, (int) $this->tmpl['user']->id); $commentItem = PhocaGalleryCommentCategory::displayComment((int) $id); $this->assignRef('commentitem', $commentItem); } // - - - - - - - - - - - - - - - - // TABS // - - - - - - - - - - - - - - - - $this->tmpl['displaytabs'] = 0; $this->tmpl['currenttab'] = 0; if ((int) $id > 0) { $displayTabs = 0; // R A T I N G if ((int) $this->tmpl['displayrating'] == 0) { $currentTab['rating'] = -1; } else { $currentTab['rating'] = $displayTabs; $displayTabs++; } // C O M M E N T S if ((int) $this->tmpl['displaycomment'] == 0) { $currentTab['comment'] = -1; } else { $currentTab['comment'] = $displayTabs; $displayTabs++; } // S T A T I S T I C S if ((int) $this->tmpl['displaycategorystatistics'] == 0) { $currentTab['statistics'] = -1; } else { $currentTab['statistics'] = $displayTabs; $displayTabs++; $this->tmpl['displaymaincatstat'] = $this->params->get('display_main_cat_stat', 1); $this->tmpl['displaylastaddedcatstat'] = $this->params->get('display_lastadded_cat_stat', 1); $this->tmpl['displaymostviewedcatstat'] = $this->params->get('display_mostviewed_cat_stat', 1); $this->tmpl['countlastaddedcatstat'] = $this->params->get('count_lastadded_cat_stat', 3); $this->tmpl['countmostviewedcatstat'] = $this->params->get('count_mostviewed_cat_stat', 3); if ($this->tmpl['displaymaincatstat'] == 1) { $numberImgP = $model->getCountImages($id, 1); $this->tmpl['numberimgpub'] = $numberImgP->countimg; $numberImgU = $model->getCountImages($id, 0); $this->tmpl['numberimgunpub'] = $numberImgU->countimg; $categoryViewed = $model->getHits($id); $this->tmpl['categoryviewed'] = $categoryViewed->catviewed; } // M O S T V I E W E D I M A G E S //$this->tmpl['mostviewedimg'] = array(); if ($this->tmpl['displaymostviewedcatstat'] == 1) { $mostViewedImages = $model->getStatisticsImages($id, 'hits', 'DESC', $this->tmpl['countmostviewedcatstat']); for ($i = 0; $i < count($mostViewedImages); $i++) { $itemMVI =& $mostViewedImages[$i]; $itemMVI->button =& $button; $itemMVI->button2 =& $button2; $itemMVI->buttonother =& $buttonOther; $itemMVI->displayicondetail = $this->tmpl['displayicondetail']; $itemMVI->displayname = $this->tmpl['displayname']; $itemMVI->type = 2; $altValue = PhocaGalleryRenderFront::getAltValue($this->tmpl['altvalue'], $itemMVI->title, $itemMVI->description, $itemMVI->metadesc); $itemMVI->altvalue = $altValue; $thumbLink = PhocaGalleryFileThumbnail::getThumbnailName($itemMVI->filename, 'large'); $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $category->slug . '&id=' . $itemMVI->slug . '&tmpl=component' . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int')); $imgLink = JURI::base(true) . '/' . $thumbLink->rel; if ($this->tmpl['detailwindow'] == 2 || $this->tmpl['detailwindow'] == 8) { $itemMVI->link = $imgLink; } else { $itemMVI->link = $siteLink; } //$this->tmpl['mostviewedimg'][] = $itemMVI; if ($itemMVI->extw != '') { $extw = explode(',', $itemMVI->extw); $itemMVI->extw = $extw[1]; } if ($itemMVI->exth != '') { $exth = explode(',', $itemMVI->exth); $itemMVI->exth = $exth[1]; } } $this->tmpl['mostviewedimg'] = $mostViewedImages; } // L A S T A D D E D I M A G E S //$this->tmpl['lastaddedimg'] = array(); if ($this->tmpl['displaylastaddedcatstat'] == 1) { $lastAddedImages = $model->getStatisticsImages($id, 'date', 'DESC', $this->tmpl['countlastaddedcatstat']); for ($i = 0; $i < count($lastAddedImages); $i++) { $itemLAI =& $lastAddedImages[$i]; $itemLAI->link = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $category->slug . '&id=' . $itemLAI->slug . '&tmpl=component' . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int')); $itemLAI->button =& $button; $itemLAI->button2 =& $button2; $itemLAI->buttonother =& $buttonOther; $itemLAI->displayicondetail = $this->tmpl['displayicondetail']; $itemLAI->displayname = $this->tmpl['displayname']; $itemLAI->type = 2; $altValue = PhocaGalleryRenderFront::getAltValue($this->tmpl['altvalue'], $itemLAI->title, $itemLAI->description, $itemLAI->metadesc); $itemLAI->altvalue = $altValue; $thumbLink = PhocaGalleryFileThumbnail::getThumbnailName($itemLAI->filename, 'large'); $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $category->slug . '&id=' . $itemLAI->slug . '&tmpl=component' . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int')); $imgLink = JURI::base(true) . '/' . $thumbLink->rel; if ($this->tmpl['detailwindow'] == 2 || $this->tmpl['detailwindow'] == 8) { $itemLAI->link = $imgLink; } else { $itemLAI->link = $siteLink; } //$this->tmpl['lastaddedimg'][] = $itemLAI; if ($itemLAI->extw != '') { $extw = explode(',', $itemLAI->extw); $itemLAI->extw = $extw[1]; } if ($itemLAI->exth != '') { $exth = explode(',', $itemLAI->exth); $itemLAI->exth = $exth[1]; } } $this->tmpl['lastaddedimg'] = $lastAddedImages; } } // G E O T A G G I N G if ((int) $this->tmpl['displaycategorygeotagging'] == 0) { $currentTab['geotagging'] = -1; } else { if ($map['longitude'] == '') { $currentTab['geotagging'] = -1; } else { if ($map['latitude'] == '') { $currentTab['geotagging'] = -1; } else { $currentTab['geotagging'] = $displayTabs; $displayTabs++; $this->tmpl['googlemapsapikey'] = $this->params->get('google_maps_api_key', ''); $this->tmpl['categorymapwidth'] = $this->params->get('category_map_width', ''); $this->tmpl['categorymapheight'] = $this->params->get('category_map_height', 400); } } } if ((int) $this->tmpl['displaycreatecat'] == 0) { $currentTab['createsubcategory'] = -1; } else { $currentTab['createsubcategory'] = $displayTabs; $displayTabs++; } // = = = = = = = = = = // U P L O A D // = = = = = = = = = = $this->tmpl['ftp'] = !JClientHelper::hasCredentials('ftp'); // SEF problem $isThereQM = false; $isThereQM = preg_match("/\\?/i", $this->tmpl['action']); if ($isThereQM) { $amp = '&'; } else { $amp = '?'; } $isThereTab = false; $isThereTab = preg_match("/tab=/i", $this->tmpl['action']); if ((int) $this->tmpl['displayupload'] == 0) { $currentTab['upload'] = -1; } else { $currentTab['upload'] = $displayTabs; $displayTabs++; } if ((int) $this->tmpl['ytbupload'] == 0 || (int) $this->tmpl['displayupload'] == 0) { $currentTab['ytbupload'] = -1; } else { $currentTab['ytbupload'] = $displayTabs; $displayTabs++; } if ((int) $this->tmpl['enablemultiple'] < 1 || (int) $this->tmpl['displayupload'] == 0) { $currentTab['multipleupload'] = -1; } else { $currentTab['multipleupload'] = $displayTabs; $displayTabs++; } if ((int) $this->tmpl['enablejava'] < 1 || (int) $this->tmpl['displayupload'] == 0) { $currentTab['javaupload'] = -1; } else { $currentTab['javaupload'] = $displayTabs; $displayTabs++; } $this->tmpl['displaytabs'] = $displayTabs; $this->tmpl['currenttab'] = $currentTab; $this->tmpl['action'] = htmlspecialchars($this->tmpl['action']); // - - - - - - - - - - - // Upload // - - - - - - - - - - - if ((int) $this->tmpl['displayupload'] == 1) { $sU = new PhocaGalleryFileUploadSingle(); $sU->returnUrl = $this->tmpl['action'] . $amp . 'task=upload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['upload']; $sU->tab = $this->tmpl['currenttab']['upload']; $this->tmpl['su_output'] = $sU->getSingleUploadHTML(1); $this->tmpl['su_url'] = $this->tmpl['action'] . $amp . 'task=upload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['upload']; } // - - - - - - - - - - - // Youtube Upload (single upload form can be used) // - - - - - - - - - - - if ((int) $this->tmpl['ytbupload'] == 1 && $this->tmpl['displayupload'] == 1) { $sYU = new PhocaGalleryFileUploadSingle(); $sYU->returnUrl = $this->tmpl['action'] . $amp . 'task=ytbupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['ytbupload']; $sYU->tab = $this->tmpl['currenttab']['ytbupload']; $this->tmpl['syu_output'] = $sYU->getSingleUploadHTML(1); $this->tmpl['syu_url'] = $this->tmpl['action'] . $amp . 'task=ytbupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['ytbupload']; } // - - - - - - - - - - - // Multiple Upload // - - - - - - - - - - - // Get infos from multiple upload $muFailed = JRequest::getVar('mufailed', '0', '', 'int'); $muUploaded = JRequest::getVar('muuploaded', '0', '', 'int'); $this->tmpl['mu_response_msg'] = $muUploadedMsg = ''; if ($muUploaded > 0) { $muUploadedMsg = JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded; } if ($muFailed > 0) { $muFailedMsg = JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed; } if ($muFailed > 0 && $muUploaded > 0) { $this->tmpl['mu_response_msg'] = '<div class="pgunsetmsg">' . JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded . '<br />' . JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed . '</div>'; } else { if ($muFailed > 0 && $muUploaded == 0) { $this->tmpl['mu_response_msg'] = '<div class="pgerrormsg">' . JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed . '</div>'; } else { if ($muFailed == 0 && $muUploaded > 0) { $this->tmpl['mu_response_msg'] = '<div class="pgsuccessmsg">' . JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded . '</div>'; } else { $this->tmpl['mu_response_msg'] = ''; } } } if ((int) $this->tmpl['enablemultiple'] == 1 && (int) $this->tmpl['displayupload'] == 1) { PhocaGalleryFileUploadMultiple::renderMultipleUploadLibraries(); $mU = new PhocaGalleryFileUploadMultiple(); $mU->frontEnd = 1; $mU->method = $this->tmpl['multipleuploadmethod']; $mU->url = $this->tmpl['action'] . $amp . 'controller=category&task=multipleupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&tab=' . $this->tmpl['currenttab']['multipleupload']; $mU->reload = $this->tmpl['action'] . $amp . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&tab=' . $this->tmpl['currenttab']['multipleupload']; $mU->maxFileSize = PhocaGalleryFileUploadMultiple::getMultipleUploadSizeFormat($this->tmpl['uploadmaxsize']); $mU->chunkSize = '1mb'; $mU->imageHeight = $this->tmpl['multipleresizeheight']; $mU->imageWidth = $this->tmpl['multipleresizewidth']; $mU->imageQuality = 100; $mU->renderMultipleUploadJS(0, $this->tmpl['multipleuploadchunk']); $this->tmpl['mu_output'] = $mU->getMultipleUploadHTML(); } // - - - - - - - - - - - // Java Upload // - - - - - - - - - - - if ((int) $this->tmpl['enablejava'] == 1 && (int) $this->tmpl['displayupload'] == 1) { $jU = new PhocaGalleryFileUploadJava(); $jU->width = $this->tmpl['javaboxwidth']; $jU->height = $this->tmpl['javaboxheight']; $jU->resizewidth = $this->tmpl['multipleresizewidth']; $jU->resizeheight = $this->tmpl['multipleresizeheight']; $jU->uploadmaxsize = $this->tmpl['uploadmaxsize']; $jU->returnUrl = $this->tmpl['action'] . $amp . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&tab=' . $this->tmpl['currenttab']['javaupload']; $jU->url = $this->tmpl['action'] . $amp . 'controller=category&task=javaupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&tab=' . $this->tmpl['currenttab']['javaupload']; $jU->source = JURI::root(true) . '/components/com_phocagallery/assets/java/jupload/wjhk.jupload.jar'; $this->tmpl['ju_output'] = $jU->getJavaUploadHTML(); } } // ADD STATISTICS if ((int) $id > 0) { $model->hit($id); } // ADD JAK DATA CSS style if ($this->tmpl['detailwindow'] == 6) { $document->addCustomTag('<script type="text/javascript">' . 'var dataJakJs = [' . implode($this->tmpl['jakdatajs'], ',') . ']' . '</script>'); } // Detail Window - will be popup or not if ($this->tmpl['detailwindow'] == 7) { $this->tmpl['tmplcom'] = ''; $this->tmpl['tmplcomcomments'] = ''; } else { $this->tmpl['tmplcom'] = '&tmpl=component'; $this->tmpl['tmplcomcomments'] = '&tmpl=component'; } if ($this->tmpl['display_comment_nopup'] == 1) { $this->tmpl['tmplcomcomments'] = ''; } // Height of all boxes $this->tmpl['imageheight'] = PhocaGalleryImage::correctSize($this->tmpl['imageheight'], 100, 100, 0); $this->tmpl['imagewidth'] = PhocaGalleryImage::correctSize($this->tmpl['imagewidth'], 100, 120, 20); $this->tmpl['imageheight']['boxsize'] = PhocaGalleryImage::setBoxSize($this->tmpl['imageheight'], $this->tmpl['imagewidth'], $this->tmpl['displayname'], $this->tmpl['displayicondetail'], $this->tmpl['displayicondownload'], $this->tmpl['displayiconvmbox'], $this->tmpl['startpiclens'], $this->tmpl['trash'], $this->tmpl['publishunpublish'], $this->tmpl['displayicongeobox'], $this->tmpl['displaycamerainfo'], $this->tmpl['displayiconextlink1box'], $this->tmpl['displayiconextlink2box'], $this->tmpl['categoryboxspace'], $this->tmpl['displayimageshadow'], $this->tmpl['displayratingimg'], $this->tmpl['displayiconfolder'], $this->tmpl['imgdescboxheight'], $this->tmpl['approvednotapproved'], $this->tmpl['displayiconcommentimgbox'], $this->tmpl['displaying_tags_true']); if ($this->tmpl['displayimageshadow'] != 'none') { $this->tmpl['imageheight']['size'] = $this->tmpl['imageheight']['size'] + 18; $this->tmpl['imagewidth']['size'] = $this->tmpl['imagewidth']['size'] + 18; } //$this->assignRef( 'params' , $this->params); $this->assignRef('map', $map); $this->assignRef('items', $items); // Category View $this->assignRef('itemscv', $itemsCV); // Categories View in Category View $this->assignRef('category', $category); $this->assignRef('button', $button); $this->assignRef('button2', $button2); $this->assignRef('buttonother', $buttonOther); $this->_prepareDocument($category); parent::display($tpl); }