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


PHP PhocaGalleryImage::correctSize方法代码示例

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


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

示例1: display


//.........这里部分代码省略.........
                $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&amp;' . $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&amp;' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&amp;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);
    }
开发者ID:sansandeep143,项目名称:av,代码行数:101,代码来源:view.html.php

示例2: onPrepareContent


//.........这里部分代码省略.........
                                $image->link = $imgLink;
                                $image->link2 = $imgLink;
                                $image->linkother = $siteLink;
                                $image->linkorig = $imgLinkOrig;
                            } else {
                                if ($detail_window == 5) {
                                    $image->link = $imgLink;
                                    $image->link2 = $siteLink;
                                    $image->linkother = $siteLink;
                                    $image->linkorig = $imgLinkOrig;
                                } else {
                                    $image->link = $siteLink;
                                    $image->link2 = $siteLink;
                                    $image->linkother = $siteLink;
                                    $image->linkorig = $imgLinkOrig;
                                }
                            }
                        }
                        // Float
                        $float_code = '';
                        if ($float != '') {
                            $float_code = 'position:relative;float:' . $float . ';';
                        }
                        // Maximum size of module image is 100 x 100
                        jimport('joomla.filesystem.file');
                        $imageWidth['size'] = 100;
                        $imageHeight['size'] = 100;
                        $imageHeight['boxsize'] = 100;
                        $imageWidth['boxsize'] = 120;
                        $imageOrigHeight = 100;
                        $imageOrigWidth = 100;
                        if (JFile::exists($image->linkthumbnailpathabs)) {
                            list($width, $height) = GetImageSize($image->linkthumbnailpathabs);
                            $imageHeight = PhocaGalleryImage::correctSize($height, 100, 100, 0);
                            $imageWidth = PhocaGalleryImage::correctSize($width, 100, 120, 20);
                            $imageOrigHeight = $height;
                            $imageOrigWidth = $width;
                        }
                        $imageHeight['boxsize'] = PhocaGalleryImage::setBoxSize($imageHeight, $imageWidth, $display_name, $display_icon_detail, $display_icon_download, 0, 0, 0, 0, 0, 0, 0, 0, $category_box_space, $image_background_shadow, 0);
                        if ($image_background_shadow != 'none') {
                            $imageHeight['size'] = $imageHeight['size'] + 18;
                            $imageWidth['size'] = $imageWidth['size'] + 18;
                            $image_background_color = 'url(\'' . JURI::base(true) . '/components/com_phocagallery/assets/images/' . $image_background_shadow . '.' . $tmpl['formaticon'] . '\') 0 0 no-repeat;';
                        }
                        $output .= '<div class="phocagallery-box-file pgplugin' . $iCss . '" style="height:' . $imageHeight['boxsize'] . 'px; width:' . $imageWidth['boxsize'] . 'px;' . $float_code . '">' . "\n" . '<center>' . "\n" . '<div class="phocagallery-box-file-first" style="background: ' . $image_background_color . ';height:' . $imageHeight['size'] . 'px;width:' . $imageWidth['size'] . 'px;">' . "\n" . '<div class="phocagallery-box-file-second">' . "\n" . '<div class="phocagallery-box-file-third">' . "\n" . '<center>' . "\n" . '<a class="' . $button->methodname . '" title="' . $image->title . '" href="' . JRoute::_($image->link) . '"';
                        // DETAIL WINDOW
                        if ($detail_window == 1) {
                            $output .= ' onclick="' . $button->options . '"';
                        } else {
                            if ($detail_window == 4 || $detail_window == 5) {
                                $highSlideOnClick = str_replace('[phocahsfullimg]', $image->linkorig, $tmpl['highslideonclick']);
                                $output .= ' onclick="' . $highSlideOnClick . '"';
                            } else {
                                $output .= ' rel="' . $button->options . '"';
                            }
                        }
                        // Enable the switch image
                        if ($enable_switch == 1) {
                            $output .= ' onmouseover="PhocaGallerySwitchImage(\'PhocaGalleryobjectPicture\', \'' . str_replace('phoca_thumb_m_', 'phoca_thumb_l_', JURI::root() . $image->linkthumbnailpath) . '\');" onmouseout="PhocaGallerySwitchImage(\'PhocaGalleryobjectPicture\', \'' . str_replace('phoca_thumb_m_', 'phoca_thumb_l_', JURI::root() . $image->linkthumbnailpath) . '\');"';
                        } else {
                            // Overlib
                            if (!empty($image->description)) {
                                $divPadding = 'padding:5px;';
                            } else {
                                $divPadding = 'padding:0px;margin:0px;';
                            }
开发者ID:planetangel,项目名称:Planet-Angel-Website,代码行数:67,代码来源:phocagallery.php

示例3: onContentPrepare


//.........这里部分代码省略.........
                             case 7:
                             case 5:
                                 $imageBg = $mediumCSS;
                                 break;
                             case 6:
                             case 4:
                                 $imageBg = $smallCSS;
                                 break;
                             default:
                                 $imageBg = '';
                                 break;
                         }
                         // Display Key Icon (in case we want to display unaccessable categories in list view)
                         $rightDisplayKey = 1;
                         // we simulate that we want not to display unaccessable categories
                         // so we get rightDisplayKey = 0 then the key will be displayed
                         if (isset($category)) {
                             //$rightDisplayKey = PhocaGalleryAccess::getUserRight ('accessuserid', $category->accessuserid ,$category->access, $user->get('aid', 0), $user->get('id', 0), 0);
                             $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $category->accessuserid, $category->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0);
                         }
                         if (isset($category->extid) && $category->extid != '') {
                             $file_thumbnail = PhocaGalleryImageFront::displayCategoriesExtImgOrFolder($category->exts, $category->extm, $category->extw, $category->exth, (int) $img_cat_size, $rightDisplayKey);
                             $category->linkthumbnailpath = $file_thumbnail->rel;
                             $category->extw = $file_thumbnail->extw;
                             $category->exth = $file_thumbnail->exth;
                             $category->extpic = $file_thumbnail->extpic;
                         } else {
                             $file_thumbnail = PhocaGalleryImageFront::displayCategoriesImageOrFolder($category->filename, (int) $img_cat_size, $rightDisplayKey);
                             $category->linkthumbnailpath = $file_thumbnail->rel;
                         }
                         //Output
                         $output .= '<tr>' . '<td align="center" valign="middle" style="' . $imageBg . '"><a href="' . $category->link . '">';
                         if (isset($category->extpic) && $category->extpic != '') {
                             $correctImageRes = PhocaGalleryPicasa::correctSizeWithRate($category->extw, $category->exth, $tmpl['picasa_correct_width'], $tmpl['picasa_correct_height']);
                             $output .= '<img class="pg-image" src="' . $category->linkthumbnailpath . '" alt="' . $category->title . '" style="border:0" width="' . $correctImageRes['width'] . '" height="' . $correctImageRes['height'] . '" />';
                         } else {
                             $output .= '<img class="pg-image" src="' . JURI::base(true) . '/' . $category->linkthumbnailpath . '" alt="' . $category->title . '" style="border:0" />';
                         }
                         $output .= '</a></td>' . '<td><a href="' . $category->link . '" class="category' . $this->params->get('pageclass_sfx') . '">' . $category->title . '</a>&nbsp;' . '<span class="small">(' . $category->numlinks . ')</span></td>' . '</tr>';
                     }
                     $output .= '</table>';
                 } else {
                     $output .= '<ul>';
                     foreach ($data_outcome_array as $category) {
                         // ROUTE
                         $category->link = JRoute::_(PhocaGalleryRoute::getCategoryRoute($category->id, $category->alias));
                         $output .= '<li>' . '<a href="' . $category->link . '" class="category' . $this->params->get('pageclass_sfx') . '">' . $category->title . '</a>&nbsp;<span class="small">(' . $category->numlinks . ')</span>' . '</li>';
                     }
                     $output .= '</ul>';
                 }
             }
             //-----------------------
             // DISPLAYING OF IMAGES
             //-----------------------
             if ($view == 'category') {
                 $where = '';
                 // Only one image
                 if ($imageid > 0) {
                     $where = ' AND a.id = ' . $imageid;
                 }
                 // Random image
                 if ($imagerandom == 1 && $catid > 0) {
                     $query = 'SELECT id' . ' FROM #__phocagallery' . ' WHERE catid = ' . (int) $catid . ' AND published = 1' . ' AND approved = 1' . ' ORDER BY RAND()';
                     $db->setQuery($query);
                     $idQuery =& $db->loadObject();
                     if (!empty($idQuery)) {
开发者ID:01J,项目名称:skazkipronebo,代码行数:67,代码来源:phocagallery.php


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