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


PHP JCckDevHelper::createFolder方法代码示例

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


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

示例1: createThumb

 public function createThumb($image, $tnumber, $twidth, $theight, $tformat, $quality = 100)
 {
     if (!($twidth && trim($twidth) != '' && is_numeric($twidth)) && !($theight && trim($theight) != '' && is_numeric($theight))) {
         return false;
     }
     $path = $this->_pathinfo['dirname'];
     $resImage = $this->_resource;
     // Calcul Thumb Size
     $values = $this->_prepareDimensions($this->_width, $this->_height, $twidth, $theight, $tformat);
     list($thumbX, $thumbY, $newX, $newY, $thumbWidth, $thumbHeight, $newWidth, $newHeight) = $values;
     // Add transparence for PNG
     $thumbImage = imageCreateTrueColor($thumbWidth, $thumbHeight);
     if ($this->_extension == 'png') {
         imagealphablending($thumbImage, false);
     }
     // Generate thumb ressource
     imagecopyresampled($thumbImage, $resImage, $thumbX, $thumbY, $newX, $newY, $thumbWidth, $thumbHeight, $newWidth, $newHeight);
     // Set Folder
     // $file_path ='';
     if ($tnumber == 0) {
         $thumbLocation = $path . '/' . $this->_pathinfo['basename'];
     } else {
         JCckDevHelper::createFolder($path . '/_thumb' . $tnumber);
         $thumbLocation = $path . '/_thumb' . $tnumber . '/' . $this->_pathinfo['basename'];
     }
     // Create image
     $this->_generateThumb($this->_extension, $thumbImage, $thumbLocation, $quality);
     return true;
 }
开发者ID:kolydart,项目名称:SEBLOD,代码行数:29,代码来源:image.php

示例2: onCCK_FieldConstruct

 public function onCCK_FieldConstruct($type, &$data = array())
 {
     if (self::$type != $type) {
         return;
     }
     if ($data['json']['options2']['path'][strlen($data['json']['options2']['path']) - 1] != '/') {
         $data['json']['options2']['path'] .= '/';
     }
     $data['json']['options2']['path'] = trim($data['json']['options2']['path']);
     JCckDevHelper::createFolder(JPATH_SITE . '/' . $data['json']['options2']['path']);
     parent::g_onCCK_FieldConstruct($data);
 }
开发者ID:pctechnikch,项目名称:SEBLOD,代码行数:12,代码来源:upload_image.php

示例3: JCckDevImage

            } else {
                //FieldX
                $search = '::' . $true_name . '|' . $x2k . '|' . $parent_name . '::' . '{"image_location":"' . $old_path . $file_name . '","image_title":"' . $file_title . '","image_description":"' . $file_descr . '"}' . '::/' . $true_name . '|' . $x2k . '|' . $parent_name . '::';
                $replace = '::' . $true_name . '|' . $x2k . '|' . $parent_name . '::' . '{"image_location":"' . $file_location . '","image_title":"' . $file_title . '","image_description":"' . $file_descr . '"}' . '::/' . $true_name . '|' . $x2k . '|' . $parent_name . '::';
            }
        } else {
            $search_v = '{"image_location":"' . $old_path . $file_name . '","image_title":"' . $file_title . '","image_description":"' . $file_descr . '"}';
            $replace_v = '{"image_location":"' . $file_location . '","image_title":"' . $file_title . '","image_description":"' . $file_descr . '"}';
        }
    }
    $doSave = 1;
} else {
    $file_location = $file_path . $file_name;
    $location = JPATH_SITE . '/' . $file_path . $file_name;
}
JCckDevHelper::createFolder(JPATH_SITE . '/' . $file_path, $permissions);
if (JFile::upload($tmp_name, $location)) {
    $thumb_count = 11;
    $image = new JCckDevImage($location);
    $src_w = $image->getWidth();
    $src_h = $image->getHeight();
    $value = $file_location;
    $fields[$name]->value = $value;
    $options['thumb0_process'] = $options['image_process'];
    $options['thumb0_width'] = $options['image_width'];
    $options['thumb0_height'] = $options['image_height'];
    for ($i = 0; $i < $thumb_count; $i++) {
        $format_name = 'thumb' . $i . '_process';
        $width_name = 'thumb' . $i . '_width';
        $height_name = 'thumb' . $i . '_height';
        if ($i == 0 && $src_w == $options[$width_name] && $src_h == $optixons[$height_name]) {
开发者ID:pctechnikch,项目名称:SEBLOD,代码行数:31,代码来源:afterstore.php


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