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


PHP UniteFunctionsWPRev::getImageUrlFromPath方法代码示例

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


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

示例1: fusion_importer


//.........这里部分代码省略.........
            // widgets data file
            $widgets_json = wp_remote_get($widgets_json);
            $widget_data = $widgets_json['body'];
            $import_widgets = fusion_import_widget_data($widget_data);
            // Import Layerslider
            if (function_exists('layerslider_import_sample_slider')) {
                // if layerslider is activated
                $ls_txt = get_template_directory_uri() . '/framework/plugins/importer/data/layerslider.txt';
                // layerslider data file
                $ls_txt = wp_remote_get($ls_txt);
                $data = json_decode(base64_decode($ls_txt['body']), true);
                avada_import_sample_slider($data);
                // update theme options
                // Get all sliders
                // Table name
                $table_name = $wpdb->prefix . "layerslider";
                // Get sliders
                $sliders = $wpdb->get_results("SELECT * FROM {$table_name}\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE flag_hidden = '0' AND flag_deleted = '0'\n\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY date_c ASC");
                if (!empty($sliders)) {
                    foreach ($sliders as $key => $item) {
                        $slides[$item->id] = $item->name;
                    }
                }
                if ($slides) {
                    foreach ($slides as $key => $val) {
                        $slides_array[$val] = $key;
                    }
                }
                // Assign LayerSlider
                $lspage = get_page_by_title('Layer Slider');
                if ($lspage->ID && $slides_array['Avada Full Width']) {
                    update_post_meta($lspage->ID, 'pyre_slider', $slides_array['Avada Full Width']);
                }
            }
            // Import Revslider
            if (class_exists('UniteFunctionsRev')) {
                // if revslider is activated
                $rev_directory = get_template_directory() . '/framework/plugins/importer/data/revsliders/';
                // layerslider data dir
                foreach (glob($rev_directory . '*.txt') as $filename) {
                    // get all files from revsliders data dir
                    $filename = basename($filename);
                    $rev_files[] = get_template_directory_uri() . '/framework/plugins/importer/data/revsliders/' . $filename;
                }
                foreach ($rev_files as $rev_file) {
                    // finally import rev slider data files
                    $get_file = wp_remote_get($rev_file);
                    $arrSlider = unserialize($get_file['body']);
                    $sliderParams = $arrSlider["params"];
                    if (isset($sliderParams["background_image"])) {
                        $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
                    }
                    $json_params = json_encode($sliderParams);
                    $arrInsert = array();
                    $arrInsert["params"] = $json_params;
                    $arrInsert["title"] = UniteFunctionsRev::getVal($sliderParams, "title", "Slider1");
                    $arrInsert["alias"] = UniteFunctionsRev::getVal($sliderParams, "alias", "slider1");
                    $wpdb->insert(GlobalsRevSlider::$table_sliders, $arrInsert);
                    $sliderID = mysql_insert_id();
                    //create all slides
                    $arrSlides = $arrSlider["slides"];
                    foreach ($arrSlides as $slide) {
                        $params = $slide["params"];
                        $layers = $slide["layers"];
                        //convert params images:
                        if (isset($params["image"])) {
                            $params["image"] = UniteFunctionsWPRev::getImageUrlFromPath($params["image"]);
                        }
                        //convert layers images:
                        foreach ($layers as $key => $layer) {
                            if (isset($layer["image_url"])) {
                                $layer["image_url"] = UniteFunctionsWPRev::getImageUrlFromPath($layer["image_url"]);
                                $layers[$key] = $layer;
                            }
                        }
                        //create new slide
                        $arrCreate = array();
                        $arrCreate["slider_id"] = $sliderID;
                        $arrCreate["slide_order"] = $slide["slide_order"];
                        $arrCreate["layers"] = json_encode($layers);
                        $arrCreate["params"] = json_encode($params);
                        $wpdb->insert(GlobalsRevSlider::$table_slides, $arrCreate);
                    }
                }
            }
            // Set reading options
            $homepage = get_page_by_title('Home Version 13');
            $posts_page = get_page_by_title('Blog Large');
            if ($homepage->ID && $posts_page->ID) {
                update_option('show_on_front', 'page');
                update_option('page_on_front', $homepage->ID);
                // Front Page
                update_option('page_for_posts', $posts_page->ID);
                // Blog Page
            }
            // finally redirect to success page
            wp_redirect(admin_url('themes.php?page=optionsframework&imported=success#of-option-generaloptions'));
        }
    }
}
开发者ID:shieldsdesignstudio,项目名称:trilogic,代码行数:101,代码来源:importer.php

示例2: cmo_import_sliders_ajax


//.........这里部分代码省略.........
                        if (strpos($class, ':hover') === false && strpos($class, ':') !== false || strpos($class, " ") !== false || strpos($class, ".tp-caption") === false || (strpos($class, ".") === false || strpos($class, "#") !== false) || strpos($class, ">") !== false) {
                            //.tp-caption>.imageclass or .tp-caption.imageclass>img or .tp-caption.imageclass .img
                            continue;
                        }
                        //is a dynamic style
                        if (strpos($class, ':hover') !== false) {
                            $class = trim(str_replace(':hover', '', $class));
                            $arrInsert = array();
                            $arrInsert["hover"] = json_encode($styles);
                            $arrInsert["settings"] = json_encode(array('hover' => 'true'));
                        } else {
                            $arrInsert = array();
                            $arrInsert["params"] = json_encode($styles);
                        }
                        //check if class exists
                        $result = $db->fetch(GlobalsRevSlider::$table_css, "handle = '" . $class . "'");
                        if (!empty($result)) {
                            //update
                            $db->update(GlobalsRevSlider::$table_css, $arrInsert, array('handle' => $class));
                        } else {
                            //insert
                            $arrInsert["handle"] = $class;
                            $db->insert(GlobalsRevSlider::$table_css, $arrInsert);
                        }
                    }
                } else {
                }
            }
            $content = preg_replace('!s:(\\d+):"(.*?)";!e', "'s:'.strlen('\$2').':\"\$2\";'", $content);
            //clear errors in string
            $arrSlider = @unserialize($content);
            $sliderParams = $arrSlider["params"];
            if (isset($sliderParams["background_image"])) {
                $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
            }
            $json_params = json_encode($sliderParams);
            $arrInsert = array();
            $arrInsert["params"] = $json_params;
            $arrInsert["title"] = UniteFunctionsRev::getVal($sliderParams, "title", "Slider1");
            $arrInsert["alias"] = UniteFunctionsRev::getVal($sliderParams, "alias", "slider1");
            $sliderID = $wpdb->insert(GlobalsRevSlider::$table_sliders, $arrInsert);
            $sliderID = $wpdb->insert_id;
            $arrSlides = $arrSlider["slides"];
            $alreadyImported = array();
            foreach ($arrSlides as $slide) {
                $params = $slide["params"];
                $layers = $slide["layers"];
                if (isset($params["image"])) {
                    if (trim($params["image"]) !== '') {
                        if ($importZip === true) {
                            $image = $zip->getStream('images/' . $params["image"]);
                            if (!$image) {
                                echo esc_html($params["image"]) . ' not found!<br>';
                            } else {
                                if (!isset($alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]])) {
                                    $importImage = UniteFunctionsWPRev::import_media('zip://' . $filepath . "#" . 'images/' . $params["image"], $sliderParams["alias"] . '/');
                                    if ($importImage !== false) {
                                        $alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]] = $importImage['path'];
                                        $params["image"] = $importImage['path'];
                                    }
                                } else {
                                    $params["image"] = $alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]];
                                }
                            }
                        }
                    }
开发者ID:supahseppe,项目名称:ashley-travel,代码行数:67,代码来源:demo-importer-ajax.php

示例3: importSliderFromPost


//.........这里部分代码省略.........
                         $arrInsert = array();
                         $arrInsert["params"] = json_encode($styles);
                     }
                     //check if class exists
                     $result = $db->fetch(GlobalsRevSlider::$table_css, "handle = '" . $class . "'");
                     if (!empty($result)) {
                         //update
                         $db->update(GlobalsRevSlider::$table_css, $arrInsert, array('handle' => $class));
                     } else {
                         //insert
                         $arrInsert["handle"] = $class;
                         $db->insert(GlobalsRevSlider::$table_css, $arrInsert);
                     }
                 }
                 dmp(__("dynamic styles imported!", REVSLIDER_TEXTDOMAIN));
             } else {
                 dmp(__("no dynamic styles found, if slider uses dynamic styles, the provided export may be broken...", REVSLIDER_TEXTDOMAIN));
             }
         }
         $content = preg_replace('!s:(\\d+):"(.*?)";!e', "'s:'.strlen('\$2').':\"\$2\";'", $content);
         //clear errors in string
         $arrSlider = @unserialize($content);
         if (empty($arrSlider)) {
             UniteFunctionsRev::throwError("Wrong export slider file format!");
         }
         //update slider params
         $sliderParams = $arrSlider["params"];
         if ($sliderExists) {
             $sliderParams["title"] = $this->arrParams["title"];
             $sliderParams["alias"] = $this->arrParams["alias"];
             $sliderParams["shortcode"] = $this->arrParams["shortcode"];
         }
         if (isset($sliderParams["background_image"])) {
             $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
         }
         $json_params = json_encode($sliderParams);
         //update slider or craete new
         if ($sliderExists) {
             $arrUpdate = array("params" => $json_params);
             $this->db->update(GlobalsRevSlider::$table_sliders, $arrUpdate, array("id" => $sliderID));
         } else {
             //new slider
             $arrInsert = array();
             $arrInsert["params"] = $json_params;
             $arrInsert["title"] = UniteFunctionsRev::getVal($sliderParams, "title", "Slider1");
             $arrInsert["alias"] = UniteFunctionsRev::getVal($sliderParams, "alias", "slider1");
             $sliderID = $this->db->insert(GlobalsRevSlider::$table_sliders, $arrInsert);
         }
         //-------- Slides Handle -----------
         //delete current slides
         if ($sliderExists) {
             $this->deleteAllSlides();
         }
         //create all slides
         $arrSlides = $arrSlider["slides"];
         $alreadyImported = array();
         foreach ($arrSlides as $slide) {
             $params = $slide["params"];
             $layers = $slide["layers"];
             //convert params images:
             if (isset($params["image"])) {
                 //import if exists in zip folder
                 if (trim($params["image"]) !== '') {
                     if ($importZip === true) {
                         //we have a zip, check if exists
                         $image = $zip->getStream('images/' . $params["image"]);
开发者ID:ConceptHaus,项目名称:huasca,代码行数:67,代码来源:revslider_slider.class.php

示例4: fusion_importer


//.........这里部分代码省略.........
                                if (strpos($class, ':hover') === false && strpos($class, ':') !== false || strpos($class, " ") !== false || strpos($class, ".tp-caption") === false || (strpos($class, ".") === false || strpos($class, "#") !== false) || strpos($class, ">") !== false) {
                                    //.tp-caption>.imageclass or .tp-caption.imageclass>img or .tp-caption.imageclass .img
                                    continue;
                                }
                                //is a dynamic style
                                if (strpos($class, ':hover') !== false) {
                                    $class = trim(str_replace(':hover', '', $class));
                                    $arrInsert = array();
                                    $arrInsert["hover"] = json_encode($styles);
                                    $arrInsert["settings"] = json_encode(array('hover' => 'true'));
                                } else {
                                    $arrInsert = array();
                                    $arrInsert["params"] = json_encode($styles);
                                }
                                //check if class exists
                                $result = $db->fetch(GlobalsRevSlider::$table_css, "handle = '" . $class . "'");
                                if (!empty($result)) {
                                    //update
                                    $db->update(GlobalsRevSlider::$table_css, $arrInsert, array('handle' => $class));
                                } else {
                                    //insert
                                    $arrInsert["handle"] = $class;
                                    $db->insert(GlobalsRevSlider::$table_css, $arrInsert);
                                }
                            }
                        } else {
                        }
                    }
                    $content = preg_replace('!s:(\\d+):"(.*?)";!e', "'s:'.strlen('\$2').':\"\$2\";'", $content);
                    //clear errors in string
                    $arrSlider = @unserialize($content);
                    $sliderParams = $arrSlider["params"];
                    if (isset($sliderParams["background_image"])) {
                        $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
                    }
                    $json_params = json_encode($sliderParams);
                    //new slider
                    $arrInsert = array();
                    $arrInsert["params"] = $json_params;
                    $arrInsert["title"] = UniteFunctionsRev::getVal($sliderParams, "title", "Slider1");
                    $arrInsert["alias"] = UniteFunctionsRev::getVal($sliderParams, "alias", "slider1");
                    $sliderID = $wpdb->insert(GlobalsRevSlider::$table_sliders, $arrInsert);
                    $sliderID = $wpdb->insert_id;
                    //-------- Slides Handle -----------
                    //create all slides
                    $arrSlides = $arrSlider["slides"];
                    $alreadyImported = array();
                    foreach ($arrSlides as $slide) {
                        $params = $slide["params"];
                        $layers = $slide["layers"];
                        //convert params images:
                        if (isset($params["image"])) {
                            //import if exists in zip folder
                            if (trim($params["image"]) !== '') {
                                if ($importZip === true) {
                                    //we have a zip, check if exists
                                    $image = $zip->getStream('images/' . $params["image"]);
                                    if (!$image) {
                                        echo $params["image"] . ' not found!<br>';
                                    } else {
                                        if (!isset($alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]])) {
                                            $importImage = UniteFunctionsWPRev::import_media('zip://' . $filepath . "#" . 'images/' . $params["image"], $sliderParams["alias"] . '/');
                                            if ($importImage !== false) {
                                                $alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]] = $importImage['path'];
                                                $params["image"] = $importImage['path'];
                                            }
开发者ID:rvelezc,项目名称:drpelaezgo.com,代码行数:67,代码来源:importer.php

示例5: hb_importer


//.........这里部分代码省略.........
                                    continue;
                                }
                                //is a dynamic style
                                if (strpos($class, ':hover') !== false) {
                                    $class = trim(str_replace(':hover', '', $class));
                                    $arrInsert = array();
                                    $arrInsert["hover"] = json_encode($styles);
                                    $arrInsert["settings"] = json_encode(array('hover' => 'true'));
                                } else {
                                    $arrInsert = array();
                                    $arrInsert["params"] = json_encode($styles);
                                }
                                //check if class exists
                                $result = $db->fetch(GlobalsRevSlider::$table_css, "handle = '" . $class . "'");
                                if (!empty($result)) {
                                    //update
                                    $db->update(GlobalsRevSlider::$table_css, $arrInsert, array('handle' => $class));
                                } else {
                                    //insert
                                    $arrInsert["handle"] = $class;
                                    $db->insert(GlobalsRevSlider::$table_css, $arrInsert);
                                }
                            }
                            //dmp(__("dynamic styles imported!",REVSLIDER_TEXTDOMAIN));
                        } else {
                            //dmp(__("no dynamic styles found, if slider uses dynamic styles, the provided export may be broken...",REVSLIDER_TEXTDOMAIN));
                        }
                    }
                    $content = preg_replace('!s:(\\d+):"(.*?)";!e', "'s:'.strlen('\$2').':\"\$2\";'", $content);
                    //clear errors in string
                    $arrSlider = @unserialize($content);
                    $sliderParams = $arrSlider["params"];
                    if (isset($sliderParams["background_image"])) {
                        $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
                    }
                    $json_params = json_encode($sliderParams);
                    //new slider
                    $arrInsert = array();
                    $arrInsert["params"] = $json_params;
                    $arrInsert["title"] = UniteFunctionsRev::getVal($sliderParams, "title", "Slider1");
                    $arrInsert["alias"] = UniteFunctionsRev::getVal($sliderParams, "alias", "slider1");
                    $sliderID = $wpdb->insert(GlobalsRevSlider::$table_sliders, $arrInsert);
                    $sliderID = $wpdb->insert_id;
                    //-------- Slides Handle -----------
                    //create all slides
                    $arrSlides = $arrSlider["slides"];
                    $alreadyImported = array();
                    foreach ($arrSlides as $slide) {
                        $params = $slide["params"];
                        $layers = $slide["layers"];
                        //convert params images:
                        if (isset($params["image"])) {
                            //import if exists in zip folder
                            if (trim($params["image"]) !== '') {
                                if ($importZip === true) {
                                    //we have a zip, check if exists
                                    $image = $zip->getStream('images/' . $params["image"]);
                                    if (!$image) {
                                        echo $params["image"] . ' not found!<br>';
                                    } else {
                                        if (!isset($alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]])) {
                                            $importImage = UniteFunctionsWPRev::import_media('zip://' . $filepath . "#" . 'images/' . $params["image"], $sliderParams["alias"] . '/');
                                            if ($importImage !== false) {
                                                $alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]] = $importImage['path'];
                                                $params["image"] = $importImage['path'];
                                            }
开发者ID:phupx,项目名称:genco,代码行数:67,代码来源:importer.php

示例6: importSliderFromPost

 /**
  * 
  * import slider from multipart form
  */
 public function importSliderFromPost()
 {
     try {
         $sliderID = UniteFunctionsRev::getPostVariable("sliderid");
         $this->initByID($sliderID);
         $filepath = $_FILES["import_file"]["tmp_name"];
         if (file_exists($filepath) == false) {
             UniteFunctionsRev::throwError("Import file not found!!!");
         }
         //get content array
         $content = @file_get_contents($filepath);
         $arrSlider = @unserialize($content);
         if (empty($arrSlider)) {
             UniteFunctionsRev::throwError("Wrong export slider file format!");
         }
         //update slider params
         $sliderParams = $arrSlider["params"];
         $sliderParams["title"] = $this->arrParams["title"];
         $sliderParams["alias"] = $this->arrParams["alias"];
         $sliderParams["shortcode"] = $this->arrParams["shortcode"];
         if (isset($sliderParams["background_image"])) {
             $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
         }
         $json_params = json_encode($sliderParams);
         $arrUpdate = array("params" => $json_params);
         $this->db->update(GlobalsRevSlider::$table_sliders, $arrUpdate, array("id" => $sliderID));
         //-------- Slides Handle -----------
         //delete current slides
         $this->deleteAllSlides();
         //create all slides
         $arrSlides = $arrSlider["slides"];
         foreach ($arrSlides as $slide) {
             $params = $slide["params"];
             $layers = $slide["layers"];
             //convert params images:
             if (isset($params["image"])) {
                 $params["image"] = UniteFunctionsWPRev::getImageUrlFromPath($params["image"]);
             }
             //convert layers images:
             foreach ($layers as $key => $layer) {
                 if (isset($layer["image_url"])) {
                     $layer["image_url"] = UniteFunctionsWPRev::getImageUrlFromPath($layer["image_url"]);
                     $layers[$key] = $layer;
                 }
             }
             //create new slide
             $arrCreate = array();
             $arrCreate["slider_id"] = $sliderID;
             $arrCreate["slide_order"] = $slide["slide_order"];
             $arrCreate["layers"] = json_encode($layers);
             $arrCreate["params"] = json_encode($params);
             $this->db->insert(GlobalsRevSlider::$table_slides, $arrCreate);
         }
     } catch (Exception $e) {
         $errorMessage = $e->getMessage();
         return array("success" => false, "error" => $errorMessage, "sliderID" => $sliderID);
     }
     return array("success" => true, "sliderID" => $sliderID);
 }
开发者ID:ashanrupasinghe,项目名称:govforuminstalledlocal,代码行数:63,代码来源:revslider_slider.class.php

示例7: royal_revslider_import


//.........这里部分代码省略.........
                        $class = trim($class);
                        if (strpos($class, ':hover') === false && strpos($class, ':') !== false || strpos($class, " ") !== false || strpos($class, ".tp-caption") === false || (strpos($class, ".") === false || strpos($class, "#") !== false) || strpos($class, ">") !== false) {
                            //.tp-caption>.imageclass or .tp-caption.imageclass>img or .tp-caption.imageclass .img
                            continue;
                        }
                        //is a dynamic style
                        if (strpos($class, ':hover') !== false) {
                            $class = trim(str_replace(':hover', '', $class));
                            $arrInsert = array();
                            $arrInsert["hover"] = json_encode($styles);
                            $arrInsert["settings"] = json_encode(array('hover' => 'true'));
                        } else {
                            $arrInsert = array();
                            $arrInsert["params"] = json_encode($styles);
                        }
                        //check if class exists
                        $result = $db->fetch(GlobalsRevSlider::$table_css, "handle = '" . $class . "'");
                        if (!empty($result)) {
                            //update
                            $db->update(GlobalsRevSlider::$table_css, $arrInsert, array('handle' => $class));
                        } else {
                            //insert
                            $arrInsert["handle"] = $class;
                            $db->insert(GlobalsRevSlider::$table_css, $arrInsert);
                        }
                    }
                }
            }
            $content = preg_replace('!s:(\\d+):"(.*?)";!e', "'s:'.strlen('\$2').':\"\$2\";'", $content);
            //clear errors in string
            $arrSlider = @unserialize($content);
            $sliderParams = $arrSlider["params"];
            if (isset($sliderParams["background_image"])) {
                $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
            }
            $json_params = json_encode($sliderParams);
            //new slider
            $arrInsert = array();
            $arrInsert["params"] = $json_params;
            $arrInsert["title"] = UniteFunctionsRev::getVal($sliderParams, "title", "Slider1");
            $arrInsert["alias"] = UniteFunctionsRev::getVal($sliderParams, "alias", "slider1");
            $sliderID = $wpdb->insert(GlobalsRevSlider::$table_sliders, $arrInsert);
            $sliderID = $wpdb->insert_id;
            //-------- Slides Handle -----------
            //create all slides
            $arrSlides = $arrSlider["slides"];
            $alreadyImported = array();
            foreach ($arrSlides as $slide) {
                $params = $slide["params"];
                $layers = $slide["layers"];
                //convert params images:
                if (isset($params["image"])) {
                    //import if exists in zip folder
                    if (trim($params["image"]) !== '') {
                        if ($importZip === true) {
                            //we have a zip, check if exists
                            $image = $zip->getStream('images/' . $params["image"]);
                            if (!$image) {
                                // echo 'Not Found';
                            } else {
                                if (!isset($alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]])) {
                                    $importImage = UniteFunctionsWPRev::import_media('zip://' . $filepath . "#" . 'images/' . $params["image"], $sliderParams["alias"] . '/');
                                    if ($importImage !== false) {
                                        $alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]] = $importImage['path'];
                                        $params["image"] = $importImage['path'];
                                    }
开发者ID:timb1981,项目名称:ChamferZone,代码行数:67,代码来源:royal-importer.php

示例8: ut_demo_importer


//.........这里部分代码省略.........
                 update_option('show_on_front', 'page');
                 update_option('page_on_front', $homepage->ID);
                 // Front Page
                 update_option('page_for_posts', $posts_page->ID);
                 // Blog Page
             }
             /*
             |--------------------------------------------------------------------------
             | Update Theme Options
             |--------------------------------------------------------------------------
             */
             if (isset($_POST['ut-import-options']) && $_POST['ut-import-options'] == 'yes') {
                 /* run layout loader */
                 ut_load_layout_into_ot($demo_file . '.txt');
             }
             /*
             |--------------------------------------------------------------------------
             | Revolution Slider Import
             |--------------------------------------------------------------------------
             */
             if (isset($_POST['ut-import-revslider']) && $_POST['ut-import-revslider'] == 'yes') {
                 if (class_exists('UniteFunctionsRev')) {
                     $rev_directory = THEME_DOCUMENT_ROOT . '/admin/assets/optionsdata/revslider/';
                     $rev_files = array();
                     foreach (glob($rev_directory . '*.txt') as $filename) {
                         $filename = basename($filename);
                         $rev_files[] = THEME_WEB_ROOT . '/admin/assets/optionsdata/revslider/' . $filename;
                     }
                     foreach ($rev_files as $rev_file) {
                         $get_file = wp_remote_get($rev_file);
                         $arrSlider = unserialize($get_file['body']);
                         $sliderParams = $arrSlider["params"];
                         if (isset($sliderParams["background_image"])) {
                             $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
                         }
                         $json_params = json_encode($sliderParams);
                         $arrInsert = array();
                         $arrInsert["params"] = $json_params;
                         $arrInsert["title"] = UniteFunctionsRev::getVal($sliderParams, "title", "Slider1");
                         $arrInsert["alias"] = UniteFunctionsRev::getVal($sliderParams, "alias", "slider1");
                         $wpdb->insert(GlobalsRevSlider::$table_sliders, $arrInsert);
                         $sliderID = $wpdb->insert_id;
                         //create all slides
                         $arrSlides = $arrSlider["slides"];
                         foreach ($arrSlides as $slide) {
                             $params = $slide["params"];
                             $layers = $slide["layers"];
                             //convert params images:
                             if (isset($params["image"])) {
                                 $params["image"] = UniteFunctionsWPRev::getImageUrlFromPath($params["image"]);
                             }
                             //convert layers images:
                             foreach ($layers as $key => $layer) {
                                 if (isset($layer["image_url"])) {
                                     $layer["image_url"] = UniteFunctionsWPRev::getImageUrlFromPath($layer["image_url"]);
                                     $layers[$key] = $layer;
                                 }
                             }
                             //create new slide
                             $arrCreate = array();
                             $arrCreate["slider_id"] = $sliderID;
                             $arrCreate["slide_order"] = $slide["slide_order"];
                             $arrCreate["layers"] = json_encode($layers);
                             $arrCreate["params"] = json_encode($params);
                             $wpdb->insert(GlobalsRevSlider::$table_slides, $arrCreate);
                         }
开发者ID:waqasraza123,项目名称:wpgeeks,代码行数:67,代码来源:ut-demo-importer.php

示例9: array

                             if (!$image_url) {
                                 echo $layer["image_url"] . ' not found!<br>';
                             } else {
                                 if (!isset($alreadyImported['zip://' . $filepath . "#" . 'images/' . $layer["image_url"]])) {
                                     $importImage = UniteFunctionsWPRev::import_media('zip://' . $filepath . "#" . 'images/' . $layer["image_url"], $sliderParams["alias"] . '/');
                                     if ($importImage !== false) {
                                         $alreadyImported['zip://' . $filepath . "#" . 'images/' . $layer["image_url"]] = $importImage['path'];
                                         $layer["image_url"] = $importImage['path'];
                                     }
                                 } else {
                                     $layer["image_url"] = $alreadyImported['zip://' . $filepath . "#" . 'images/' . $layer["image_url"]];
                                 }
                             }
                         }
                     }
                     $layer["image_url"] = UniteFunctionsWPRev::getImageUrlFromPath($layer["image_url"]);
                     $layers[$key] = $layer;
                 }
             }
             //create new slide
             $arrCreate = array();
             $arrCreate["slider_id"] = $sliderID;
             $arrCreate["slide_order"] = $slide["slide_order"];
             $arrCreate["layers"] = json_encode($layers);
             $arrCreate["params"] = json_encode($params);
             $wpdb->insert(GlobalsRevSlider::$table_slides, $arrCreate);
             //}
         }
     }
 }
 _e('<strong>Import Complete.</strong> The Demo content has been imported, <strong>please wait for page reload.</strong>', 'themeva-admin');
开发者ID:jgeletka,项目名称:simskin,代码行数:31,代码来源:themeva-importer.php

示例10: importSlider

 /**
  * Import slider
  * @param $config
  * @throws Exception
  * @return array
  */
 protected function importSlider($config)
 {
     global $wpdb;
     //we take name/alias/shortcode from file name
     $name = str_replace(array('revolution_slider_', '.txt'), '', basename($config));
     $slider = new RevSlider();
     try {
         $sliderId = $slider->createSliderFromOptions(array('main' => array('title' => $name, 'alias' => $name), 'params' => array()));
     } catch (Exception $e) {
         //already exists - let's leave it as is
         return;
     }
     //create a slider
     try {
         $slider->initByID($sliderId);
         //get content array
         $content = @file_get_contents($config);
         $arrSlider = @unserialize($content);
         if (empty($arrSlider)) {
             UniteFunctionsRev::throwError("Wrong export slider file format!");
         }
         //update slider params
         $sliderParams = $arrSlider["params"];
         $sliderParams["title"] = $name;
         $sliderParams["alias"] = $name;
         $sliderParams["shortcode"] = '[rev_slider ' . $name . ']';
         if (isset($sliderParams["background_image"])) {
             $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
         }
         $json_params = json_encode($sliderParams);
         $arrUpdate = array("params" => $json_params);
         $wpdb->update(GlobalsRevSlider::$table_sliders, $arrUpdate, array("id" => $sliderId));
         //-------- Slides Handle -----------
         //create all slides
         $arrSlides = $arrSlider["slides"];
         foreach ($arrSlides as $slide) {
             $params = $slide["params"];
             $layers = $slide["layers"];
             //convert params images:
             if (isset($params["image"])) {
                 $params["image"] = UniteFunctionsWPRev::getImageUrlFromPath($params["image"]);
             }
             //convert layers images:
             foreach ($layers as $key => $layer) {
                 if (isset($layer["image_url"])) {
                     $layer["image_url"] = UniteFunctionsWPRev::getImageUrlFromPath($layer["image_url"]);
                     $layers[$key] = $layer;
                 }
             }
             //create new slide
             $arrCreate = array();
             $arrCreate["slider_id"] = $sliderId;
             $arrCreate["slide_order"] = $slide["slide_order"];
             $arrCreate["layers"] = json_encode($layers);
             $arrCreate["params"] = json_encode($params);
             $wpdb->insert(GlobalsRevSlider::$table_slides, $arrCreate);
         }
     } catch (Exception $e) {
         if (WP_DEBUG) {
             throw $e;
         }
     }
 }
开发者ID:clevervaughn,项目名称:dottiesbiscuitbarn,代码行数:69,代码来源:ctRevolutionSliderImporter.class.php

示例11: importSliderFromPost


//.........这里部分代码省略.........
                     if (strpos($class, ':hover') !== false) {
                         $class = trim(str_replace(':hover', '', $class));
                         $arrInsert = array();
                         $arrInsert["hover"] = json_encode($styles);
                         $arrInsert["settings"] = json_encode(array('hover' => 'true'));
                     } else {
                         $arrInsert = array();
                         $arrInsert["params"] = json_encode($styles);
                     }
                     $result = $db->fetch(GlobalsRevSlider::$table_css, "handle = '" . $class . "'");
                     if (!empty($result)) {
                         $db->update(GlobalsRevSlider::$table_css, $arrInsert, array('handle' => $class));
                     } else {
                         $arrInsert["handle"] = $class;
                         $db->insert(GlobalsRevSlider::$table_css, $arrInsert);
                     }
                 }
                 dmp(__("dynamic styles imported!", REVSLIDER_TEXTDOMAIN));
             } else {
                 dmp(__("no dynamic styles found, if slider uses dynamic styles, the provided export may be broken...", REVSLIDER_TEXTDOMAIN));
             }
         }
         $content = preg_replace('!s:(\\d+):"(.*?)";!e', "'s:'.strlen('\$2').':\"\$2\";'", $content);
         $arrSlider = @unserialize($content);
         if (empty($arrSlider)) {
             UniteFunctionsRev::throwError("Wrong export slider file format! This could be caused because the ZipArchive extension is not enabled.");
         }
         $sliderParams = $arrSlider["params"];
         if ($sliderExists) {
             $sliderParams["title"] = $this->arrParams["title"];
             $sliderParams["alias"] = $this->arrParams["alias"];
         }
         if (isset($sliderParams["background_image"])) {
             $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
         }
         $json_params = json_encode($sliderParams);
         if ($sliderExists) {
             $arrUpdate = array("params" => $json_params);
             $this->db->update(GlobalsRevSlider::$table_sliders, $arrUpdate, array("id" => $sliderID));
         } else {
             $arrInsert = array();
             $arrInsert["params"] = $json_params;
             $arrInsert["title"] = UniteFunctionsRev::getVal($sliderParams, "title", "Slider1");
             $arrInsert["alias"] = UniteFunctionsRev::getVal($sliderParams, "alias", "slider1");
             $sliderID = $this->db->insert(GlobalsRevSlider::$table_sliders, $arrInsert);
         }
         if ($sliderExists) {
             $this->deleteAllSlides();
         }
         $arrSlides = $arrSlider["slides"];
         $alreadyImported = array();
         foreach ($arrSlides as $slide) {
             $params = $slide["params"];
             $layers = $slide["layers"];
             if (isset($params["image"])) {
                 if (strpos($params["image"], 'http') !== false) {
                 } else {
                     if (trim($params["image"]) !== '') {
                         if ($importZip === true) {
                             $image = $zip->getStream('images/' . $params["image"]);
                             if (!$image) {
                                 echo $params["image"] . __(' not found!<br>');
                             } else {
                                 if (!isset($alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]])) {
                                     $importImage = UniteFunctionsWPRev::import_media('zip://' . $filepath . "#" . 'images/' . $params["image"], $sliderParams["alias"] . '/');
                                     if ($importImage !== false) {
开发者ID:rinodung,项目名称:opencart-15x-flat-admin,代码行数:67,代码来源:revslider_slider.class.php

示例12: import_revolution_slider


//.........这里部分代码省略.........
                 }
                 $dynamicCss = UniteCssParserRev::parseCssToArray($dynamic);
                 if (is_array($dynamicCss) && $dynamicCss !== false && count($dynamicCss) > 0) {
                     foreach ($dynamicCss as $class => $styles) {
                         $class = trim($class);
                         if (strpos($class, ':hover') === false && strpos($class, ':') !== false || strpos($class, " ") !== false || strpos($class, ".tp-caption") === false || (strpos($class, ".") === false || strpos($class, "#") !== false) || strpos($class, ">") !== false) {
                             continue;
                         }
                         if (strpos($class, ':hover') !== false) {
                             $class = trim(str_replace(':hover', '', $class));
                             $arrInsert = array();
                             $arrInsert["hover"] = json_encode($styles);
                             $arrInsert["settings"] = json_encode(array('hover' => 'true'));
                         } else {
                             $arrInsert = array();
                             $arrInsert["params"] = json_encode($styles);
                         }
                         $result = $db->fetch(GlobalsRevSlider::$table_css, "handle = '" . $class . "'");
                         if (!empty($result)) {
                             $db->update(GlobalsRevSlider::$table_css, $arrInsert, array('handle' => $class));
                         } else {
                             $arrInsert["handle"] = $class;
                             $db->insert(GlobalsRevSlider::$table_css, $arrInsert);
                         }
                     }
                 } else {
                 }
             }
             $content = preg_replace('!s:(\\d+):"(.*?)";!e', "'s:'.strlen('\$2').':\"\$2\";'", $content);
             //clear errors in string
             $arrSlider = @unserialize($content);
             $sliderParams = $arrSlider["params"];
             if (isset($sliderParams["background_image"])) {
                 $sliderParams["background_image"] = UniteFunctionsWPRev::getImageUrlFromPath($sliderParams["background_image"]);
             }
             $json_params = json_encode($sliderParams);
             $arrInsert = array();
             $arrInsert["params"] = $json_params;
             $arrInsert["title"] = UniteFunctionsRev::getVal($sliderParams, "title", "Slider1");
             $arrInsert["alias"] = UniteFunctionsRev::getVal($sliderParams, "alias", "slider1");
             $sliderID = $wpdb->insert(GlobalsRevSlider::$table_sliders, $arrInsert);
             $sliderID = $wpdb->insert_id;
             /* create all slides */
             $arrSlides = $arrSlider["slides"];
             $alreadyImported = array();
             foreach ($arrSlides as $slide) {
                 $params = $slide["params"];
                 $layers = $slide["layers"];
                 if (isset($params["image"])) {
                     if (trim($params["image"]) !== '') {
                         if ($importZip === true) {
                             $image = $zip->getStream('images/' . $params["image"]);
                             if (!$image) {
                                 echo $params["image"] . ' not found!<br>';
                             } else {
                                 if (!isset($alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]])) {
                                     $importImage = UniteFunctionsWPRev::import_media('zip://' . $filepath . "#" . 'images/' . $params["image"], $sliderParams["alias"] . '/');
                                     if ($importImage !== false) {
                                         $alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]] = $importImage['path'];
                                         $params["image"] = $importImage['path'];
                                     }
                                 } else {
                                     $params["image"] = $alreadyImported['zip://' . $filepath . "#" . 'images/' . $params["image"]];
                                 }
                             }
                         }
开发者ID:mynein,项目名称:myne,代码行数:67,代码来源:importer.php


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