當前位置: 首頁>>代碼示例>>PHP>>正文


PHP RevSliderBase::check_file_in_zip方法代碼示例

本文整理匯總了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"])) {
開發者ID:VLabsInc,項目名稱:WordPressPlatforms,代碼行數:67,代碼來源:slider.class.php

示例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"])) {
開發者ID:ksan5835,項目名稱:maadithottam,代碼行數:67,代碼來源:slider.class.php


注:本文中的RevSliderBase::check_file_in_zip方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。