本文整理汇总了PHP中RevSliderOperations::getFullCustomAnimationByID方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderOperations::getFullCustomAnimationByID方法的具体用法?PHP RevSliderOperations::getFullCustomAnimationByID怎么用?PHP RevSliderOperations::getFullCustomAnimationByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderOperations
的用法示例。
在下文中一共展示了RevSliderOperations::getFullCustomAnimationByID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exportSlider
//.........这里部分代码省略.........
if(isset($video_data['urlOgv']) && $video_data['urlOgv'] != '') $usedVideos[$video_data['urlOgv']] = true;
}elseif(!empty($video_data) && isset($video_data['video_type']) && $video_data['video_type'] != 'html5'){ //video cover image
if(isset($video_data['previewimage']) && $video_data['previewimage'] != '') $usedImages[$video_data['previewimage']] = true;
}
}
}
}
}
}*/
$arrSliderExport = array("params" => $sliderParams, "slides" => $arrSlides);
if (!empty($arrStaticSlide)) {
$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) {
示例2: exportSlider
//.........这里部分代码省略.........
}
if (isset($sliderParams['navigation_bullets_style'])) {
$usedNavigations[$sliderParams['navigation_bullets_style']] = true;
}
if (isset($sliderParams['thumbnails_style'])) {
$usedNavigations[$sliderParams['thumbnails_style']] = true;
}
if (isset($sliderParams['tabs_style'])) {
$usedNavigations[$sliderParams['tabs_style']] = true;
}
$navs = false;
if (!empty($usedNavigations)) {
$navs = RevSliderNavigation::export_navigation($usedNavigations);
if ($navs !== false) {
$navs = serialize($navs);
}
}
$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[] = $anima;
}
}
if (!empty($animation)) {
$animations = serialize($animation);
}
}
$usedImages = array_merge($usedImages, $usedVideos);
$usepcl = false;
if (class_exists('ZipArchive')) {
$zip = new ZipArchive();
$success = $zip->open(RevSliderGlobals::$uploadsUrlExportZip, ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE);
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