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


PHP RevOperations::extractImageToSliderFolder方法代码示例

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


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

示例1: importSliderFromPost


//.........这里部分代码省略.........
         //delete current slides
         if ($sliderExists) {
             $this->deleteAllSlides();
         }
         //create all slides
         $arrSlides = $arrSlider["slides"];
         $alreadyImported = array();
         $sliderAlias = UniteFunctionsRev::getVal($sliderParams, "alias");
         $sliderAlias = trim($sliderAlias);
         if (empty($sliderAlias)) {
             $sliderAlias = "defaultslider";
         }
         foreach ($arrSlides as $slide) {
             $params = $slide["params"];
             $layers = $slide["layers"];
             $image = UniteFunctionsRev::getVal($params, "image");
             $image = trim($image);
             //convert params images:
             if (!empty($image)) {
                 if ($importZip === true) {
                     //we have a zip, check if exists
                     //import from wp format
                     $entryPath = 'images/' . $image;
                     $imageEntry = $zip->getStream($entryPath);
                     //import from joomla format
                     if (!$imageEntry) {
                         $entryPath = $image;
                         $imageEntry = $zip->getStream($entryPath);
                     }
                     if (!$imageEntry) {
                         echo "{$image} not found!<br>";
                     } else {
                         try {
                             $pathImage = RevOperations::extractImageToSliderFolder($zip, $sliderAlias, $entryPath, $image);
                             $params["image"] = $pathImage;
                         } catch (Exception $e) {
                             echo "can't extract image: {$image} <br>";
                             $params["image"] = UniteFunctionsWPRev::getImageUrlFromPath($image);
                         }
                     }
                 } else {
                     $params["image"] = UniteFunctionsWPRev::getImageUrlFromPath($image);
                 }
             }
             //convert layers images:
             foreach ($layers as $key => $layer) {
                 $image = UniteFunctionsRev::getVal($layer, "image_url");
                 $image = trim($image);
                 if (!empty($image)) {
                     if ($importZip === true) {
                         //we have a zip, check if exists
                         //import from wp format
                         $entryPath = 'images/' . $image;
                         $imageEntry = $zip->getStream($entryPath);
                         //import from joomla format
                         if (!$imageEntry) {
                             $entryPath = $image;
                             $imageEntry = $zip->getStream($entryPath);
                         }
                         if (!$imageEntry) {
                             echo $image . ' not found!<br>';
                         } else {
                             try {
                                 $pathImage = RevOperations::extractImageToSliderFolder($zip, $sliderAlias, $entryPath, $image);
                                 $layer["image_url"] = $pathImage;
                             } catch (Exception $e) {
开发者ID:networksoft,项目名称:networksoft.com.co,代码行数:67,代码来源:revslider_slider.class.php


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