本文整理汇总了PHP中RevSliderBase::check_file_in_zip方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderBase::check_file_in_zip方法的具体用法?PHP RevSliderBase::check_file_in_zip怎么用?PHP RevSliderBase::check_file_in_zip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderBase
的用法示例。
在下文中一共展示了RevSliderBase::check_file_in_zip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importSliderFromPost
//.........这里部分代码省略.........
//set a new alias and title if its existing in database
$talias = $arrInsert['alias'] . $ti;
$ti++;
}
if ($talias !== $arrInsert['alias']) {
$arrInsert['title'] = $talias;
$arrInsert['alias'] = $talias;
}
}
if ($is_template !== false) {
//add that we are an template
$arrInsert['type'] = 'template';
}
$sliderID = $this->db->insert(RevSliderGlobals::$table_sliders, $arrInsert);
}
//-------- Slides Handle -----------
//delete current slides
if ($sliderExists) {
$this->deleteAllSlides();
}
//create all slides
$arrSlides = $arrSlider["slides"];
$alreadyImported = array();
//wpml compatibility
$slider_map = array();
foreach ($arrSlides as $sl_key => $slide) {
$params = $slide["params"];
$layers = $slide["layers"];
$settings = @$slide["settings"];
//convert params images:
if ($importZip === true) {
//we have a zip, check if exists
if (isset($params["image"])) {
$params["image"] = RevSliderBase::check_file_in_zip($zip, $params["image"], $filepath, $sliderParams["alias"], $alreadyImported);
$params["image"] = RevSliderFunctionsWP::getImageUrlFromPath($params["image"]);
}
if (isset($params["background_image"])) {
$params["background_image"] = RevSliderBase::check_file_in_zip($zip, $params["background_image"], $filepath, $sliderParams["alias"], $alreadyImported);
$params["background_image"] = RevSliderFunctionsWP::getImageUrlFromPath($params["background_image"]);
}
if (isset($params["slide_thumb"])) {
$params["slide_thumb"] = RevSliderBase::check_file_in_zip($zip, $params["slide_thumb"], $filepath, $sliderParams["alias"], $alreadyImported);
$params["slide_thumb"] = RevSliderFunctionsWP::getImageUrlFromPath($params["slide_thumb"]);
}
if (isset($params["show_alternate_image"])) {
$params["show_alternate_image"] = RevSliderBase::check_file_in_zip($zip, $params["show_alternate_image"], $filepath, $sliderParams["alias"], $alreadyImported);
$params["show_alternate_image"] = RevSliderFunctionsWP::getImageUrlFromPath($params["show_alternate_image"]);
}
if (isset($params['background_type']) && $params['background_type'] == 'html5') {
if (isset($params['slide_bg_html_mpeg']) && $params['slide_bg_html_mpeg'] != '') {
$params['slide_bg_html_mpeg'] = RevSliderFunctionsWP::getImageUrlFromPath(RevSliderBase::check_file_in_zip($zip, $params["slide_bg_html_mpeg"], $filepath, $sliderParams["alias"], $alreadyImported, true));
}
if (isset($params['slide_bg_html_webm']) && $params['slide_bg_html_webm'] != '') {
$params['slide_bg_html_webm'] = RevSliderFunctionsWP::getImageUrlFromPath(RevSliderBase::check_file_in_zip($zip, $params["slide_bg_html_webm"], $filepath, $sliderParams["alias"], $alreadyImported, true));
}
if (isset($params['slide_bg_html_ogv']) && $params['slide_bg_html_ogv'] != '') {
$params['slide_bg_html_ogv'] = RevSliderFunctionsWP::getImageUrlFromPath(RevSliderBase::check_file_in_zip($zip, $params["slide_bg_html_ogv"], $filepath, $sliderParams["alias"], $alreadyImported, true));
}
}
}
//convert layers images:
foreach ($layers as $key => $layer) {
//import if exists in zip folder
if ($importZip === true) {
//we have a zip, check if exists
if (isset($layer["image_url"])) {
示例2: importSliderFromPost
//.........这里部分代码省略.........
//add that we are an template
$arrInsert['type'] = 'template';
$sliderParams['uid'] = $is_template;
$json_params = json_encode($sliderParams);
$arrInsert['params'] = $json_params;
}
$sliderID = $this->db->insert(RevSliderGlobals::$table_sliders, $arrInsert);
}
//-------- Slides Handle -----------
//delete current slides
if ($sliderExists) {
$this->deleteAllSlides();
}
//create all slides
$arrSlides = $arrSlider["slides"];
$alreadyImported = array();
//$content_url = content_url();
$upload_dir = wp_upload_dir();
$content_url = $upload_dir['baseurl'] . '/revslider/assets/svg/';
//wpml compatibility
$slider_map = array();
foreach ($arrSlides as $sl_key => $slide) {
$params = $slide["params"];
$layers = $slide["layers"];
$settings = isset($slide["settings"]) ? $slide["settings"] : '';
//convert params images:
if ($importZip === true) {
//we have a zip, check if exists
//remove image_id as it is not needed in import
if (isset($params['image_id'])) {
unset($params['image_id']);
}
if (isset($params["image"])) {
$params["image"] = RevSliderBase::check_file_in_zip($d_path, $params["image"], $sliderParams["alias"], $alreadyImported);
$params["image"] = RevSliderFunctionsWP::getImageUrlFromPath($params["image"]);
}
if (isset($params["background_image"])) {
$params["background_image"] = RevSliderBase::check_file_in_zip($d_path, $params["background_image"], $sliderParams["alias"], $alreadyImported);
$params["background_image"] = RevSliderFunctionsWP::getImageUrlFromPath($params["background_image"]);
}
if (isset($params["slide_thumb"])) {
$params["slide_thumb"] = RevSliderBase::check_file_in_zip($d_path, $params["slide_thumb"], $sliderParams["alias"], $alreadyImported);
$params["slide_thumb"] = RevSliderFunctionsWP::getImageUrlFromPath($params["slide_thumb"]);
}
if (isset($params["show_alternate_image"])) {
$params["show_alternate_image"] = RevSliderBase::check_file_in_zip($d_path, $params["show_alternate_image"], $sliderParams["alias"], $alreadyImported);
$params["show_alternate_image"] = RevSliderFunctionsWP::getImageUrlFromPath($params["show_alternate_image"]);
}
if (isset($params['background_type']) && $params['background_type'] == 'html5') {
if (isset($params['slide_bg_html_mpeg']) && $params['slide_bg_html_mpeg'] != '') {
$params['slide_bg_html_mpeg'] = RevSliderFunctionsWP::getImageUrlFromPath(RevSliderBase::check_file_in_zip($d_path, $params["slide_bg_html_mpeg"], $sliderParams["alias"], $alreadyImported, true));
}
if (isset($params['slide_bg_html_webm']) && $params['slide_bg_html_webm'] != '') {
$params['slide_bg_html_webm'] = RevSliderFunctionsWP::getImageUrlFromPath(RevSliderBase::check_file_in_zip($d_path, $params["slide_bg_html_webm"], $sliderParams["alias"], $alreadyImported, true));
}
if (isset($params['slide_bg_html_ogv']) && $params['slide_bg_html_ogv'] != '') {
$params['slide_bg_html_ogv'] = RevSliderFunctionsWP::getImageUrlFromPath(RevSliderBase::check_file_in_zip($d_path, $params["slide_bg_html_ogv"], $sliderParams["alias"], $alreadyImported, true));
}
}
}
//convert layers images:
foreach ($layers as $key => $layer) {
//import if exists in zip folder
if ($importZip === true) {
//we have a zip, check if exists
if (isset($layer["image_url"])) {