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


PHP RevSliderFunctionsWP::getPathUploads方法代码示例

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


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

示例1: getImageRealPathFromUrl

 /**
  * get image real path physical on disk from url
  */
 public static function getImageRealPathFromUrl($urlImage)
 {
     $filepath = self::getImagePathFromURL($urlImage);
     $realPath = RevSliderFunctionsWP::getPathUploads() . $filepath;
     return $realPath;
 }
开发者ID:iq007,项目名称:MadScape,代码行数:9,代码来源:functions-wordpress.class.php

示例2: exportSlider


//.........这里部分代码省略.........
             $arrSliderExport['static_slides'] = $arrStaticSlide;
         }
         $strExport = serialize($arrSliderExport);
         //$strExportAnim = serialize(RevSliderOperations::getFullCustomAnimations());
         $exportname = !empty($this->alias) ? $this->alias . '.zip' : "slider_export.zip";
         $styles = '';
         if (!empty($usedCaptions)) {
             $captions = array();
             foreach ($usedCaptions as $class => $val) {
                 $cap = RevSliderOperations::getCaptionsContentArray($class);
                 //set also advanced styles here...
                 if (!empty($cap)) {
                     $captions[] = $cap;
                 }
             }
             $styles = RevSliderCssParser::parseArrayToCss($captions, "\n", true);
         }
         $animations = '';
         if (!empty($usedAnimations)) {
             $animation = array();
             foreach ($usedAnimations as $anim => $val) {
                 $anima = RevSliderOperations::getFullCustomAnimationByID($anim);
                 if ($anima !== false) {
                     $animation[] = RevSliderOperations::getFullCustomAnimationByID($anim);
                 }
             }
             if (!empty($animation)) {
                 $animations = serialize($animation);
             }
         }
         $usedImages = array_merge($usedImages, $usedVideos);
         //add images to zip
         if (!empty($usedImages)) {
             $upload_dir = RevSliderFunctionsWP::getPathUploads();
             $upload_dir_multisiteless = wp_upload_dir();
             $cont_url = $upload_dir_multisiteless['baseurl'];
             $cont_url_no_www = str_replace('www.', '', $upload_dir_multisiteless['baseurl']);
             $upload_dir_multisiteless = $upload_dir_multisiteless['basedir'] . '/';
             foreach ($usedImages as $file => $val) {
                 if ($useDummy == "true") {
                     //only use dummy images
                 } else {
                     //use the real images
                     if (strpos($file, 'http') !== false) {
                         $remove = false;
                         $checkpath = str_replace(array($cont_url, $cont_url_no_www), '', $file);
                         if (is_file($upload_dir . $checkpath)) {
                             $zip->addFile($upload_dir . $checkpath, 'images/' . $checkpath);
                             $remove = true;
                         } elseif (is_file($upload_dir_multisiteless . $checkpath)) {
                             $zip->addFile($upload_dir_multisiteless . $checkpath, 'images/' . $checkpath);
                             $remove = true;
                         }
                         if ($remove) {
                             //as its http, remove this from strexport
                             $strExport = str_replace(array($cont_url . $checkpath, $cont_url_no_www . $checkpath), $checkpath, $strExport);
                         }
                     } else {
                         if (is_file($upload_dir . $file)) {
                             $zip->addFile($upload_dir . $file, 'images/' . $file);
                         } elseif (is_file($upload_dir_multisiteless . $file)) {
                             $zip->addFile($upload_dir_multisiteless . $file, 'images/' . $file);
                         }
                     }
                 }
             }
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:67,代码来源:slider.class.php

示例3: previewOutputMarkup


//.........这里部分代码省略.........

		<article class="small-history"> 
			<h2 class="textaligncenter" style="margin-bottom:25px;">Slideshow Gallery</h2>
			<p>The Slider below is a classic slideshow with timer, bullet and arrow navigation. Slider Revolution offers millions of layout combinations.</p>
		</article>

		<!-- SLIDER EXAMPLE -->
		<section class="example">
			<article class="content">
		<?php 
        }
        ?>
	<?php 
        $head = ob_get_contents();
        ob_clean();
        ob_end_clean();
        ob_start();
        ?>
	<?php 
        if (!$export_real) {
            ?>
			</article>
		</section>
	<?php 
        }
        ?>
	</body>
</html>
<?php 
        $footer = ob_get_contents();
        ob_clean();
        ob_end_clean();
        $slider_html = $head . "\n" . $content . "\n" . $scripts . "\n" . $footer;
        $upload_dir = RevSliderFunctionsWP::getPathUploads();
        $upload_dir_multisiteless = wp_upload_dir();
        $cont_url = $upload_dir_multisiteless['baseurl'];
        $cont_url_no_www = str_replace('www.', '', $upload_dir_multisiteless['baseurl']);
        $upload_dir_multisiteless = $upload_dir_multisiteless['basedir'] . '/';
        $search = array($cont_url, $cont_url_no_www, RS_PLUGIN_URL);
        $added = array();
        foreach ($search as $s) {
            preg_match_all("/(\"|')" . str_replace('/', '\\/', $s) . "\\S+(\"|')/", $slider_html, $_files);
            if (!empty($_files) && isset($_files[0]) && !empty($_files[0])) {
                //go through all files, check for existance and add to the zip file
                foreach ($_files[0] as $_file) {
                    $o = $_file;
                    $_file = str_replace(array('"', "'", $s), '', $_file);
                    //check if video or image
                    $use_path = $path_assets;
                    $use_path_raw = $path_assets_raw;
                    preg_match('/.*?.(?:jpg|jpeg|gif|png)/i', $_file, $match);
                    preg_match('/.*?.(?:ogv|webm|mp4)/i', $_file, $match2);
                    $f = false;
                    if (!empty($match) && isset($match[0]) && !empty($match[0])) {
                        //image
                        $use_path = $path_assets;
                        $use_path_raw = $path_assets_raw;
                        $f = true;
                    }
                    if (!empty($match2) && isset($match2[0]) && !empty($match2[0])) {
                        //video
                        $use_path = $path_assets_vid;
                        $use_path_raw = $path_assets_raw_vid;
                        $f = true;
                    }
                    if ($f == false) {
开发者ID:Sibzsolutions,项目名称:Schiffrinpa,代码行数:67,代码来源:operations.class.php

示例4: exportSlider


//.........这里部分代码省略.........
         if ($success !== true) {
             throwError("Can't create zip file: " . RevSliderGlobals::$uploadsUrlExportZip);
         }
     } else {
         //fallback to pclzip
         require_once ABSPATH . 'wp-admin/includes/class-pclzip.php';
         $pclzip = new PclZip(RevSliderGlobals::$uploadsUrlExportZip);
         //either the function uses die() or all is cool
         $usepcl = true;
     }
     //add svg to the zip
     if (!empty($usedSVG)) {
         $content_url = content_url();
         $content_path = ABSPATH . 'wp-content';
         $ud = wp_upload_dir();
         $up_dir = $ud['baseurl'];
         foreach ($usedSVG as $file => $val) {
             if (strpos($file, 'http') !== false) {
                 //remove all up to wp-content folder
                 $checkpath = str_replace($content_url, '', $file);
                 $checkpath2 = str_replace($up_dir, '', $file);
                 if ($checkpath2 === $file) {
                     //we have an SVG like whiteboard, fallback to older export
                     $checkpath2 = $checkpath;
                 }
                 if (is_file($content_path . $checkpath)) {
                     $strExport = str_replace($file, str_replace('/revslider/assets/svg', '', $checkpath2), $strExport);
                 }
             }
         }
     }
     //add images to zip
     if (!empty($usedImages)) {
         $upload_dir = RevSliderFunctionsWP::getPathUploads();
         $upload_dir_multisiteless = wp_upload_dir();
         $cont_url = $upload_dir_multisiteless['baseurl'];
         $cont_url_no_www = str_replace('www.', '', $upload_dir_multisiteless['baseurl']);
         $upload_dir_multisiteless = $upload_dir_multisiteless['basedir'] . '/';
         foreach ($usedImages as $file => $val) {
             if ($useDummy == "true") {
                 //only use dummy images
             } else {
                 //use the real images
                 if (strpos($file, 'http') !== false) {
                     $remove = false;
                     $checkpath = str_replace(array($cont_url, $cont_url_no_www), '', $file);
                     if (is_file($upload_dir . $checkpath)) {
                         if (!$usepcl) {
                             $zip->addFile($upload_dir . $checkpath, 'images/' . $checkpath);
                         } else {
                             $v_list = $pclzip->add($upload_dir . $checkpath, PCLZIP_OPT_REMOVE_PATH, $upload_dir, PCLZIP_OPT_ADD_PATH, 'images/');
                         }
                         $remove = true;
                     } elseif (is_file($upload_dir_multisiteless . $checkpath)) {
                         if (!$usepcl) {
                             $zip->addFile($upload_dir_multisiteless . $checkpath, 'images/' . $checkpath);
                         } else {
                             $v_list = $pclzip->add($upload_dir_multisiteless . $checkpath, PCLZIP_OPT_REMOVE_PATH, $upload_dir_multisiteless, PCLZIP_OPT_ADD_PATH, 'images/');
                         }
                         $remove = true;
                     }
                     if ($remove) {
                         //as its http, remove this from strexport
                         $strExport = str_replace(array($cont_url . $checkpath, $cont_url_no_www . $checkpath), $checkpath, $strExport);
                     }
                 } else {
开发者ID:ksan5835,项目名称:maadithottam,代码行数:67,代码来源:slider.class.php


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