本文整理汇总了PHP中PhocaGalleryPath类的典型用法代码示例。如果您正苦于以下问题:PHP PhocaGalleryPath类的具体用法?PHP PhocaGalleryPath怎么用?PHP PhocaGalleryPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PhocaGalleryPath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$path = PhocaGalleryPath::getPath();
$this->tmpl['avatarpathabs'] = $path->avatar_abs . DS . 'thumbs' . DS . 'phoca_thumb_s_';
$this->tmpl['avatarpathrel'] = $path->avatar_rel . 'thumbs/phoca_thumb_s_';
$this->tmpl['avtrpathrel'] = $path->avatar_rel;
JHTML::stylesheet('administrator/components/com_phocagallery/assets/phocagallery.css');
$document =& JFactory::getDocument();
$document->addCustomTag(PhocaGalleryRenderAdmin::renderIeCssLink(1));
// Button
JHTML::_('behavior.modal', 'a.modal_phocagalleryusers');
$this->button = new JObject();
$this->button->set('modal', true);
$this->button->set('methodname', 'modal-button');
//$this->button->set('link', $link);
$this->button->set('text', JText::_('COM_PHOCAGALLERY_DISPLAY_IMAGE_DETAIL'));
//$this->button->set('name', 'image');
$this->button->set('modalname', 'modal_phocagalleryusers');
$this->button->set('options', "{handler: 'image', size: {x: 200, y: 150}}");
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
parent::display($tpl);
}
示例2: display
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['path'] =& PhocaGalleryPath::getPath();
$model =& $this->getModel();
// PARAMS
$this->tmpl['displaycatnametitle'] = $this->params->get('display_cat_name_title', 1);
$display_cat_name_breadcrumbs = $this->params->get('display_cat_name_breadcrumbs', 1);
$this->tmpl['showpageheading'] = $this->params->get('show_page_heading', 1);
$this->tmpl['cooliris3d_wall_width'] = $this->params->get('cooliris3d_wall_width', 600);
$this->tmpl['cooliris3d_wall_height'] = $this->params->get('cooliris3d_wall_height', 370);
$this->tmpl['pmt'] = PhocaGalleryRenderInfo::getPhocaIc((int) $this->params->get('display_phoca_info', 1));
$this->tmpl['gallerymetakey'] = $this->params->get('gallery_metakey', '');
$this->tmpl['gallerymetadesc'] = $this->params->get('gallery_metadesc', '');
$this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0);
$this->tmpl['customcss'] = $this->params->get('custom_css', '');
$idCategory = JRequest::getVar('id', 0, 'get', 'int');
// 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']);
}
if ((int) $idCategory > 0) {
$category = $model->getCategory($idCategory);
$this->_prepareDocument($category);
// 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);
}*/
$this->_addBreadCrumbs($category, isset($menu->query['id']) ? $menu->query['id'] : 0, $display_cat_name_breadcrumbs);
// ASIGN
$this->tmpl['display_category'] = 1;
$this->assignRef('tmpl', $this->tmpl);
$this->assignRef('category', $category);
$this->assignRef('params', $this->params);
} else {
$this->tmpl['display_category'] = 0;
$this->assignRef('tmpl', $this->tmpl);
}
parent::display($tpl);
}
示例3: display
public function display($tpl = null)
{
$params = JComponentHelper::getParams('com_phocagallery');
JResponse::allowCache(false);
JHTML::stylesheet('media/com_phocagallery/css/administrator/phocagallery.css');
$document = JFactory::getDocument();
//$document->addCustomTag(PhocaGalleryRenderAdmin::renderIeCssLink(1));
$path = PhocaGalleryPath::getPath();
$this->field = JRequest::getVar('field');
$this->fce = 'phocaSelectFolder_' . $this->field;
$this->assignRef('session', JFactory::getSession());
$this->assign('path_orig_rel', $path->image_rel);
$this->assignRef('folders', $this->get('folders'));
$this->assignRef('state', $this->get('state'));
parent::display($tpl);
}
示例4: getImageSize
function getImageSize($filename, $returnString = 0, $extLink = 0)
{
phocagalleryimport('phocagallery.image.image');
phocagalleryimport('phocagallery.path.path');
if ($extLink == 1) {
$fileNameAbs = $filename;
} else {
$path =& PhocaGalleryPath::getPath();
$fileNameAbs = JPath::clean($path->image_abs . $filename);
if (!JFile::exists($fileNameAbs)) {
$fileNameAbs = $path->image_abs_front . 'phoca_thumb_l_no_image.png';
}
}
if ($returnString == 1) {
$imageSize = @getimagesize($fileNameAbs);
return $imageSize[0] . ' x ' . $imageSize[1];
} else {
return @getimagesize($fileNameAbs);
}
}
示例5: getList
function getList()
{
static $list;
// Only process the list once per request
if (is_array($list)) {
return $list;
}
// Get current path from request
$current = $this->getState('folder');
// If undefined, set to empty
if ($current == 'undefined') {
$current = '';
}
//Get folder variables from Helper
$path = PhocaGalleryPath::getPath();
// Initialize variables
if (strlen($current) > 0) {
$orig_path = JPath::clean($path->image_abs . $current);
} else {
$orig_path = $path->image_abs;
}
$orig_path_server = str_replace(DS, '/', $path->image_abs);
$folders = array();
// Get the list of files and folders from the given folder
$folder_list = JFolder::folders($orig_path, '', false, false, array(0 => 'thumbs'));
// Iterate over the folders if they exist
if ($folder_list !== false) {
foreach ($folder_list as $folder) {
$tmp = new JObject();
$tmp->name = basename($folder);
$tmp->path_with_name = str_replace(DS, '/', JPath::clean($orig_path . DS . $folder));
$tmp->path_without_name_relative = $path->image_rel . str_replace($orig_path_server, '', $tmp->path_with_name);
$tmp->path_with_name_relative_no = str_replace($orig_path_server, '', $tmp->path_with_name);
$folders[] = $tmp;
}
}
$list = array('folders' => $folders);
return $list;
}
示例6: getOrCreateThumbnail
function getOrCreateThumbnail($fileNo, $refreshUrl, $small = 0, $medium = 0, $large = 0, $frontUpload = 0)
{
if ($frontUpload) {
$returnFrontMessage = '';
}
$onlyThumbnailInfo = 0;
if ($small == 0 && $medium == 0 && $large == 0) {
$onlyThumbnailInfo = 1;
}
$paramsC = JComponentHelper::getParams('com_phocagallery');
$additional_thumbnails = $paramsC->get('additional_thumbnails', 0);
$path = PhocaGalleryPath::getPath();
$origPathServer = str_replace(DS, '/', $path->image_abs);
$file['name'] = PhocaGalleryFile::getTitleFromFile($fileNo, 1);
$file['name_no'] = ltrim($fileNo, '/');
$file['name_original_abs'] = PhocaGalleryFile::getFileOriginal($fileNo);
$file['name_original_rel'] = PhocaGalleryFile::getFileOriginal($fileNo, 1);
$file['path_without_file_name_original'] = str_replace($file['name'], '', $file['name_original_abs']);
$file['path_without_file_name_thumb'] = str_replace($file['name'], '', $file['name_original_abs'] . 'thumbs' . DS);
//$file['path_without_name'] = str_replace(DS, '/', JPath::clean($origPathServer));
//$file['path_with_name_relative_no'] = str_replace($origPathServer, '', $file['name_original']);
/*
$file['path_with_name_relative'] = $path['orig_rel_ds'] . str_replace($origPathServer, '', $file['name_original']);
$file['path_with_name_relative_no'] = str_replace($origPathServer, '', $file['name_original']);
$file['path_without_name'] = str_replace(DS, '/', JPath::clean($origPath.DS));
$file['path_without_name_relative'] = $path['orig_rel_ds'] . str_replace($origPathServer, '', $file['path_without_name']);
$file['path_without_name_relative_no'] = str_replace($origPathServer, '', $file['path_without_name']);
$file['path_without_name_thumbs'] = $file['path_without_name'] .'thumbs';
$file['path_without_file_name_original'] = str_replace($file['name'], '', $file['name_original']);
$file['path_without_name_thumbs_no'] = str_replace($file['name'], '', $file['name_original'] .'thumbs');*/
$ext = strtolower(JFile::getExt($file['name']));
switch ($ext) {
case 'jpg':
case 'png':
case 'gif':
case 'jpeg':
//Get File thumbnails name
$thumbNameS = PhocaGalleryFileThumbnail::getThumbnailName($fileNo, 'small');
$file['thumb_name_s_no_abs'] = $thumbNameS->abs;
$file['thumb_name_s_no_rel'] = $thumbNameS->rel;
$thumbNameM = PhocaGalleryFileThumbnail::getThumbnailName($fileNo, 'medium');
$file['thumb_name_m_no_abs'] = $thumbNameM->abs;
$file['thumb_name_m_no_rel'] = $thumbNameM->rel;
$thumbNameL = PhocaGalleryFileThumbnail::getThumbnailName($fileNo, 'large');
$file['thumb_name_l_no_abs'] = $thumbNameL->abs;
$file['thumb_name_l_no_rel'] = $thumbNameL->rel;
// Don't create thumbnails from watermarks...
$dontCreateThumb = PhocaGalleryFileThumbnail::dontCreateThumb($file['name']);
if ($dontCreateThumb == 1) {
$onlyThumbnailInfo = 1;
// WE USE $onlyThumbnailInfo FOR NOT CREATE A THUMBNAIL CLAUSE
}
// We want only information from the pictures OR
if ($onlyThumbnailInfo == 0) {
$thumbInfo = $fileNo;
//Create thumbnail folder if not exists
$errorMsg = 'ErrorCreatingFolder';
$creatingFolder = PhocaGalleryFileThumbnail::createThumbnailFolder($file['path_without_file_name_original'], $file['path_without_file_name_thumb'], $errorMsg);
switch ($errorMsg) {
case 'Success':
//case 'ThumbnailExists':
//case 'ThumbnailExists':
case 'DisabledThumbCreation':
//case 'OnlyInformation':
break;
default:
// BACKEND OR FRONTEND
if ($frontUpload != 1) {
PhocaGalleryRenderProcess::getProcessPage($file['name'], $thumbInfo, $refreshUrl, $errorMsg, $frontUpload);
exit;
} else {
$returnFrontMessage = $errorMsg;
}
break;
}
// Folder must exist
if (JFolder::exists($file['path_without_file_name_thumb'])) {
$errorMsgS = $errorMsgM = $errorMsgL = '';
//Small thumbnail
if ($small == 1) {
PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], $thumbNameS->abs, 'small', $frontUpload, $errorMsgS);
if ($additional_thumbnails == 2 || $additional_thumbnails == 3) {
PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_s_', 'phoca_thumb_s1_', $thumbNameS->abs), 'small1', $frontUpload, $errorMsgS);
PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_s_', 'phoca_thumb_s2_', $thumbNameS->abs), 'small2', $frontUpload, $errorMsgS);
PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_s_', 'phoca_thumb_s3_', $thumbNameS->abs), 'small3', $frontUpload, $errorMsgS);
}
} else {
$errorMsgS = 'ThumbnailExists';
// in case we only need medium or large, because of if clause bellow
}
//Medium thumbnail
if ($medium == 1) {
PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], $thumbNameM->abs, 'medium', $frontUpload, $errorMsgM);
if ($additional_thumbnails == 1 || $additional_thumbnails == 3) {
PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_m_', 'phoca_thumb_m1_', $thumbNameM->abs), 'medium1', $frontUpload, $errorMsgM);
PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_m_', 'phoca_thumb_m2_', $thumbNameM->abs), 'medium2', $frontUpload, $errorMsgM);
PhocaGalleryFileThumbnail::createFileThumbnail($file['name_original_abs'], str_replace('phoca_thumb_m_', 'phoca_thumb_m3_', $thumbNameM->abs), 'medium3', $frontUpload, $errorMsgM);
}
} else {
//.........这里部分代码省略.........
示例7: getFiles
public function getFiles()
{
$result = array();
jimport('joomla.filesystem.folder');
$paths = PhocaGalleryPath::getPath();
$path = JPath::clean($paths->media_css_abs . '/main/');
if (is_dir($path)) {
$files = JFolder::files($path, '\\.css$', false, false);
foreach ($files as $file) {
$fileO = new stdClass();
$fileO->filename = $file;
$fileO->exists = file_exists($path . $file);
$fileO->type = 1;
$result[] = $fileO;
}
} else {
$this->setError(JText::_('COM_PHOCAGALLERY_ERROR_CSS_FOLDER_NOT_FOUND') . ' (1)');
return false;
}
$path = JPath::clean($paths->media_css_abs . '/custom/');
if (is_dir($path)) {
$files = JFolder::files($path, '\\.css$', false, false);
foreach ($files as $file) {
$fileO = new stdClass();
$fileO->filename = $file;
$fileO->exists = file_exists($path . $file);
$fileO->type = 2;
$result[] = $fileO;
}
} else {
$this->setError(JText::_('COM_PHOCAGALLERY_ERROR_CSS_FOLDER_NOT_FOUND') . ' (2)');
return false;
}
return $result;
}
示例8: imageMagic
/**
* need GD library (first PHP line WIN: dl("php_gd.dll"); UNIX: dl("gd.so");
* www.boutell.com/gd/
* interval.cz/clanky/php-skript-pro-generovani-galerie-obrazku-2/
* cz.php.net/imagecopyresampled
* www.linuxsoft.cz/sw_detail.php?id_item=871
* www.webtip.cz/art/wt_tech_php/liquid_ir.html
* php.vrana.cz/zmensovani-obrazku.php
* diskuse.jakpsatweb.cz/
*
* @param string $fileIn Vstupni soubor (mel by existovat)
* @param string $fileOut Vystupni soubor, null ho jenom zobrazi (taky kdyz nema pravo se zapsat :)
* @param int $width Vysledna sirka (maximalni)
* @param int $height Vysledna vyska (maximalni)
* @param bool $crop Orez (true, obrazek bude presne tak velky), jinak jenom Resample (udane maximalni rozmery)
* @param int $typeOut IMAGETYPE_type vystupniho obrazku
* @return bool Chyba kdyz vrati false
*/
public static function imageMagic($fileIn, $fileOut = null, $width = null, $height = null, $crop = null, $typeOut = null, $watermarkParams = array(), $frontUpload = 0, &$errorMsg)
{
$params = JComponentHelper::getParams('com_phocagallery');
$jfile_thumbs = $params->get('jfile_thumbs', 1);
$jpeg_quality = $params->get('jpeg_quality', 85);
$jpeg_quality = PhocaGalleryImage::getJpegQuality($jpeg_quality);
$fileWatermark = '';
// While front upload we don't display the process page
if ($frontUpload == 0) {
$stopText = PhocaGalleryRenderProcess::displayStopThumbnailsCreating('processpage');
echo $stopText;
}
// Memory - - - - - - - -
$memory = 8;
$memoryLimitChanged = 0;
$memory = (int) ini_get('memory_limit');
if ($memory == 0) {
$memory = 8;
}
// - - - - - - - - - - -
if ($fileIn !== '' && JFile::exists($fileIn)) {
// array of width, height, IMAGETYPE, "height=x width=x" (string)
list($w, $h, $type) = GetImageSize($fileIn);
if ($w > 0 && $h > 0) {
// we got the info from GetImageSize
// size of the image
if ($width == null || $width == 0) {
// no width added
$width = $w;
} else {
if ($height == null || $height == 0) {
// no height, adding the same as width
$height = $width;
}
}
if ($height == null || $height == 0) {
// no height, no width
$height = $h;
}
// miniaturizing
if (!$crop) {
// new size - nw, nh (new width/height)
$scale = $width / $w < $height / $h ? $width / $w : $height / $h;
// smaller rate
$src = array(0, 0, $w, $h);
$dst = array(0, 0, floor($w * $scale), floor($h * $scale));
} else {
// will be cropped
$scale = $width / $w > $height / $h ? $width / $w : $height / $h;
// greater rate
$newW = $width / $scale;
// check the size of in file
$newH = $height / $scale;
// which side is larger (rounding error)
if ($w - $newW > $h - $newH) {
$src = array(floor(($w - $newW) / 2), 0, floor($newW), $h);
} else {
$src = array(0, floor(($h - $newH) / 2), $w, floor($newH));
}
$dst = array(0, 0, floor($width), floor($height));
}
// Watermark - - - - - - - - - - -
if (!empty($watermarkParams) && ($watermarkParams['create'] == 1 || $watermarkParams['create'] == 2)) {
$thumbnailSmall = false;
$thumbnailMedium = false;
$thumbnailLarge = false;
$thumbnailMedium = preg_match("/phoca_thumb_m_/i", $fileOut);
$thumbnailLarge = preg_match("/phoca_thumb_l_/i", $fileOut);
$path = PhocaGalleryPath::getPath();
$fileName = PhocaGalleryFile::getTitleFromFile($fileIn, 1);
// Which Watermark will be used
// If watermark is in current directory use it else use Default
$fileWatermarkMedium = str_replace($fileName, 'watermark-medium.png', $fileIn);
$fileWatermarkLarge = str_replace($fileName, 'watermark-large.png', $fileIn);
clearstatcache();
// Which Watermark will be used
if ($thumbnailMedium) {
if (JFile::exists($fileWatermarkMedium)) {
$fileWatermark = $fileWatermarkMedium;
} else {
if ($watermarkParams['create'] == 2) {
$fileWatermark = $path->image_abs . 'watermark-medium.png';
//.........这里部分代码省略.........
示例9: display
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) {
//.........这里部分代码省略.........
示例10: themeName
function themeName()
{
// Get an array of all the xml files from teh installation directory
$path = PhocaGalleryPath::getPath();
$xmlFiles = JFolder::files($path->image_abs_front, '.xml$', 1, true);
// If at least one xml file exists
if (count($xmlFiles) > 0) {
foreach ($xmlFiles as $file) {
// Is it a valid joomla installation manifest file?
$manifest = $this->_isManifest($file);
if (!is_null($manifest)) {
foreach ($manifest->children() as $key => $value) {
if ((string) $value->name() == 'name') {
return (string) $value;
}
}
}
return false;
}
return false;
} else {
return false;
}
}
示例11: createfolder
function createfolder()
{
$app = JFactory::getApplication();
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');
$paramsC = JComponentHelper::getParams('com_phocagallery');
$folder_permissions = $paramsC->get('folder_permissions', 0755);
//$folder_permissions = octdec((int)$folder_permissions);
$path = PhocaGalleryPath::getPath();
$folderNew = JRequest::getCmd('foldername', '');
$folderCheck = JRequest::getVar('foldername', null, '', 'string', JREQUEST_ALLOWRAW);
$parent = JRequest::getVar('folderbase', '', '', 'path');
$tab = JRequest::getVar('tab', '', '', 'string');
$field = JRequest::getVar('field');
$viewBack = JRequest::getVar('viewback', '', '', '');
$link = '';
switch ($viewBack) {
case 'phocagalleryi':
$link = 'index.php?option=com_phocagallery&view=phocagalleryi&tmpl=component&folder=' . $parent . '&tab=' . (string) $tab . '&field=' . $field;
break;
case 'phocagallerym':
$link = 'index.php?option=com_phocagallery&view=phocagallerym&layout=edit&hidemainmenu=1&tab=' . (string) $tab . '&folder=' . $parent;
break;
case 'phocagalleryf':
$link = 'index.php?option=com_phocagallery&view=phocagalleryf&tmpl=component&folder=' . $parent . '&field=' . $field;
break;
default:
$app->redirect('index.php?option=com_phocagallery', JText::_('COM_PHOCAGALLERY_ERROR_CONTROLLER'));
break;
}
JRequest::setVar('folder', $parent);
if ($folderCheck !== null && $folderNew !== $folderCheck) {
$app->redirect($link, JText::_('COM_PHOCAGALLERY_WARNING_DIRNAME'));
}
if (strlen($folderNew) > 0) {
$folder = JPath::clean($path->image_abs . DS . $parent . DS . $folderNew);
if (!JFolder::exists($folder) && !JFile::exists($folder)) {
//JFolder::create($path, $folder_permissions );
switch ((int) $folder_permissions) {
case 777:
JFolder::create($folder, 0777);
break;
case 705:
JFolder::create($folder, 0705);
break;
case 666:
JFolder::create($folder, 0666);
break;
case 644:
JFolder::create($folder, 0644);
break;
case 755:
default:
JFolder::create($folder, 0755);
break;
}
if (isset($folder)) {
$data = "<html>\n<body bgcolor=\"#FFFFFF\">\n</body>\n</html>";
JFile::write($folder . DS . "index.html", $data);
}
$app->redirect($link, JText::_('COM_PHOCAGALLERY_SUCCESS_FOLDER_CREATING'));
} else {
$app->redirect($link, JText::_('COM_PHOCAGALLERY_ERROR_FOLDER_CREATING_EXISTS'));
}
//JRequest::setVar('folder', ($parent) ? $parent.'/'.$folder : $folder);
}
$app->redirect($link);
}
示例12: display
function display($tpl = null)
{
if (!JRequest::checkToken('request')) {
$response = array('status' => '0', 'error' => JText::_('JINVALID_TOKEN'));
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$params = $app->getParams();
$commentValue = $app->input->get('commentValue', '', 'string');
$commentId = $app->input->get('commentId', 0, 'int');
// ID of File
$format = $app->input->get('format', '', 'string');
$task = $app->input->get('task', '', 'string');
$view = $app->input->get('view', '', 'string');
$paramsC = JComponentHelper::getParams('com_phocagallery');
$param['display_comment_img'] = $paramsC->get('display_comment_img', 0);
if ($task == 'refreshcomment' && ((int) $param['display_comment_img'] == 2 || (int) $param['display_comment_img'] == 3)) {
$user =& JFactory::getUser();
//$view = JRequest::getVar( 'view', '', 'get', '', JREQUEST_NOTRIM );
//$Itemid = JRequest::getVar( 'Itemid', 0, '', 'int');
$neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels();
$access = PhocaGalleryAccess::isAccess($user->getAuthorisedViewLevels(), $neededAccessLevels);
$post['imgid'] = (int) $commentId;
$post['userid'] = $user->id;
$post['comment'] = strip_tags($commentValue);
if ($format != 'json') {
$msg = JText::_('COM_PHOCAGALLERY_ERROR_WRONG_COMMENT');
$response = array('status' => '0', 'error' => $msg);
echo json_encode($response);
return;
}
if ((int) $post['imgid'] < 1) {
$msg = JText::_('COM_PHOCAGALLERY_ERROR_IMAGE_NOT_EXISTS');
$response = array('status' => '0', 'error' => $msg);
echo json_encode($response);
return;
}
$model = $this->getModel();
$checkUserComment = PhocaGalleryCommentImage::checkUserComment($post['imgid'], $post['userid']);
// User has already commented this category
if ($checkUserComment) {
$msg = JText::_('COM_PHOCAGALLERY_COMMENT_ALREADY_SUBMITTED');
$response = array('status' => '0', 'error' => '', 'message' => $msg);
echo json_encode($response);
return;
} else {
if ($access > 0 && $user->id > 0) {
if (!$model->comment($post)) {
$msg = JText::_('COM_PHOCAGALLERY_ERROR_COMMENTING_IMAGE');
$response = array('status' => '0', 'error' => $msg);
echo json_encode($response);
return;
} else {
$o = '<div class="pg-cv-comment-img-box-item">';
$o .= '<div class="pg-cv-comment-img-box-avatar">';
$avatar = PhocaGalleryCommentImage::getUserAvatar($user->id);
$this->tmpl['path'] = PhocaGalleryPath::getPath();
$img = '<div style="width: 20px; height: 20px;"> </div>';
if (isset($avatar->avatar) && $avatar->avatar != '') {
$pathAvatarAbs = $this->tmpl['path']->avatar_abs . 'thumbs' . DS . 'phoca_thumb_s_' . $avatar->avatar;
$pathAvatarRel = $this->tmpl['path']->avatar_rel . 'thumbs/phoca_thumb_s_' . $avatar->avatar;
if (JFile::exists($pathAvatarAbs)) {
$avSize = getimagesize($pathAvatarAbs);
$avRatio = $avSize[0] / $avSize[1];
$avHeight = 20;
$avWidth = 20 * $avRatio;
$img = '<img src="' . JURI::base() . '/' . $pathAvatarRel . '" width="' . $avWidth . '" height="' . $avHeight . '" alt="" />';
}
}
$o .= $img;
$o .= '</div>';
$o .= '<div class="pg-cv-comment-img-box-comment">' . $user->name . ': ' . $post['comment'] . '</div>';
$o .= '<div style="clear:both"></div>';
$o .= '</div>';
$msg = $o . '<br />' . JText::_('COM_PHOCAGALLERY_SUCCESS_COMMENT_SUBMIT');
$response = array('status' => '1', 'error' => '', 'message' => $msg);
echo json_encode($response);
return;
}
} else {
$msg = JText::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION');
$response = array('status' => '0', 'error' => $msg);
echo json_encode($response);
return;
}
}
} else {
$msg = JText::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION');
$response = array('status' => '0', 'error' => $msg);
echo json_encode($response);
return;
}
}
示例13: processImages
protected function processImages()
{
if (!empty($this->items)) {
$params = JComponentHelper::getParams('com_phocagallery');
$pagination_thumbnail_creation = $params->get('pagination_thumbnail_creation', 0);
$clean_thumbnails = $params->get('clean_thumbnails', 0);
//Server doesn't have CPU power
//we do thumbnail for all images - there is no pagination...
//or we do thumbanil for only listed images
if (empty($this->items_thumbnail)) {
if ($pagination_thumbnail_creation == 1) {
$this->items_thumbnail = $this->items;
} else {
$this->items_thumbnail = $this->get('ItemsThumbnail');
}
}
// - - - - - - - - - - - - - - - - - - - -
// Check if the file stored in database is on the server. If not please refer to user
// Get filename from every object there is stored in database
// file - abc.img, file_no - folder/abc.img
// Get folder variables from Helper
$path = PhocaGalleryPath::getPath();
$origPath = $path->image_abs;
$origPathServer = str_replace(DS, '/', $path->image_abs);
//-----------------------------------------
//Do all thumbnails no limit no pagination
if (!empty($this->items_thumbnail)) {
foreach ($this->items_thumbnail as $key => $value) {
$fileOriginalThumb = PhocaGalleryFile::getFileOriginal($value->filename);
//Let the user know that the file doesn't exists and delete all thumbnails
if (JFile::exists($fileOriginalThumb)) {
$refreshUrlThumb = 'index.php?option=com_phocagallery&view=phocagalleryimgs';
$fileThumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail($value->filename, $refreshUrlThumb, 1, 1, 1);
}
}
}
$this->items_thumbnail = null;
// delete data to reduce memory
//Only the the site with limitation or pagination...
if (!empty($this->items)) {
foreach ($this->items as $key => $value) {
$fileOriginal = PhocaGalleryFile::getFileOriginal($value->filename);
//Let the user know that the file doesn't exists and delete all thumbnails
if (!JFile::exists($fileOriginal)) {
$this->items[$key]->filename = JText::_('COM_PHOCAGALLERY_IMG_FILE_NOT_EXISTS');
$this->items[$key]->fileoriginalexist = 0;
} else {
//Create thumbnails small, medium, large
$refresh_url = 'index.php?option=com_phocagallery&view=phocagalleryimgs';
$fileThumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail($value->filename, $refresh_url, 1, 1, 1);
$this->items[$key]->linkthumbnailpath = $fileThumb['thumb_name_s_no_rel'];
$this->items[$key]->fileoriginalexist = 1;
}
}
}
//Clean Thumbs Folder if there are thumbnail files but not original file
if ($clean_thumbnails == 1) {
PhocaGalleryFileFolder::cleanThumbsFolder();
}
}
}
示例14: getFileOriginal
function getFileOriginal($filename, $rel = 0)
{
$path = PhocaGalleryPath::getPath();
if ($rel == 1) {
return str_replace('//', '/', $path->image_rel . $filename);
} else {
return JPath::clean($path->image_abs . $filename);
}
}
示例15: getPath
function getPath()
{
$instance =& PhocaGalleryPath::getInstance();
return $instance;
}