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


PHP RevSlider类代码示例

本文整理汇总了PHP中RevSlider的典型用法代码示例。如果您正苦于以下问题:PHP RevSlider类的具体用法?PHP RevSlider怎么用?PHP RevSlider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: import_revslider

 function import_revslider($other_data)
 {
     $is_import = false;
     if ($handle = opendir(THEME_DIR . "assets" . DIRECTORY_SEPARATOR . "data-demo" . DIRECTORY_SEPARATOR . "revslider")) {
         $arr_other_data = explode('||', $other_data);
         while (false !== ($entry = readdir($handle))) {
             if (in_array($entry, $arr_other_data)) {
                 continue;
             }
             if ($entry != "." && $entry != "..") {
                 $rev_import_file = THEME_DIR . "assets" . DIRECTORY_SEPARATOR . "data-demo" . DIRECTORY_SEPARATOR . "revslider" . DIRECTORY_SEPARATOR . $entry;
                 if (class_exists('RevSlider')) {
                     $slider = new RevSlider();
                     $response = $slider->importSliderFromPost(true, true, $rev_import_file);
                     /*if (is_array($response) && isset($response['success']) && !$response['success']) {
                     			return $other_data;
                     		}*/
                     if (!empty($other_data)) {
                         $other_data .= '||';
                     }
                     $other_data .= $entry;
                     $is_import = true;
                     break;
                 } else {
                     return 'done';
                 }
             }
         }
         closedir($handle);
     } else {
         return 'done';
     }
     if ($is_import) {
         return $other_data;
     }
     return 'done';
 }
开发者ID:adwleg,项目名称:site,代码行数:37,代码来源:g5plus_import_class.php

示例2: ot_type_revslider_select

 function ot_type_revslider_select($args = array())
 {
     extract($args);
     $has_desc = $field_desc ? true : false;
     echo '<div class="format-setting type-revslider-select ' . ($has_desc ? 'has-desc' : 'no-desc') . '">';
     echo $has_desc ? '<div class="description">' . htmlspecialchars_decode($field_desc) . '</div>' : '';
     echo '<div class="format-setting-inner">';
     // Add This only if RevSlider is Activated
     if (class_exists('RevSliderAdmin')) {
         echo '<select name="' . esc_attr($field_name) . '" id="' . esc_attr($field_id) . '" class="option-tree-ui-select ' . $field_class . '">';
         /* get revolution array */
         $slider = new RevSlider();
         $arrSliders = $slider->getArrSlidersShort();
         /* has slides */
         if (!empty($arrSliders)) {
             echo '<option value="">-- ' . __('Choose One', 'option-tree') . ' --</option>';
             foreach ($arrSliders as $rev_id => $rev_slider) {
                 echo '<option value="' . esc_attr($rev_id) . '"' . selected($field_value, $rev_id, false) . '>' . esc_attr($rev_slider) . '</option>';
             }
         } else {
             echo '<option value="">' . __('No Sliders Found', 'option-tree') . '</option>';
         }
         echo '</select>';
     } else {
         echo '<span style="color: red;">' . __('Sorry! Revolution Slider is not Installed or Activated', 'ventus') . '</span>';
     }
     echo '</div>';
     echo '</div>';
 }
开发者ID:adampdarcy,项目名称:paola,代码行数:29,代码来源:ot-themeoptions.php

示例3: add_eg_additional_meta_field

    /**
     * Adds custom meta field into the essential grid meta box for post/pages
     */
    public function add_eg_additional_meta_field($values)
    {
        $sld = new RevSlider();
        $sliders = $sld->getArrSliders();
        $shortcodes = array();
        if (!empty($sliders)) {
            $first = true;
            foreach ($sliders as $slider) {
                $name = $slider->getParam('shortcode', 'false');
                if ($name != 'false') {
                    $shortcodes[$slider->getID()] = $name;
                    $first = false;
                }
            }
        }
        $selected_slider = isset($values['eg_sources_revslider']) ? $values['eg_sources_revslider'] : '';
        if ($selected_slider == '') {
            $selected_slider[0] = '';
        }
        ?>

		<p>
			<strong style="font-size:14px"><?php 
        _e('Choose Revolution Slider', REVSLIDER_TEXTDOMAIN);
        ?>
</strong>
		</p>
		<p>
			<select name="eg_sources_revslider" id="eg_sources_revslider">
				<option value=""<?php 
        selected($selected_slider[0], '');
        ?>
><?php 
        _e('--- Choose Slider ---', REVSLIDER_TEXTDOMAIN);
        ?>
</option>
				<?php 
        if (!empty($shortcodes)) {
            foreach ($shortcodes as $id => $name) {
                ?>

						<option value="<?php 
                echo $id;
                ?>
"<?php 
                selected($selected_slider[0], $id);
                ?>
><?php 
                echo $name;
                ?>
</option>
						<?php 
            }
        }
        ?>

			</select>
		</p>
		<?php 
    }
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:63,代码来源:extension.class.php

示例4: zenite_contingut_stripe

function zenite_contingut_stripe($post)
{
    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), 'zenite_noncename');
    // The actual fields for data entry
    echo '<label for="zenite_white">';
    _e("Show WhiteStripe?:", 'zenite');
    echo '</label> ';
    echo '<input type="checkbox" id="zenite_white" name="zenite_white" value="on"';
    if (get_post_meta($post->ID, 'zenite_whitestripe', true) == 'on') {
        echo ' checked="checked"';
    }
    echo ' /><br><br>';
    echo '<label for="zenite_slider">';
    _e("Slider:", 'zenite');
    echo '</label> ';
    echo '<select name="zenite_slider" id="zenite_slider"><option value="0">No Slider</option>';
    if (class_exists('RevSlider')) {
        $slider = new RevSlider();
        $arrSliders = $slider->getArrSliders();
        foreach ($arrSliders as $revSlider) {
            //		$revolutionslider[$revSlider->getAlias()] = $revSlider->getTitle();
            echo '<option value="' . $revSlider->getAlias() . '"';
            if (get_post_meta($post->ID, 'zenite_slider', true) == $revSlider->getAlias()) {
                echo " selected='selected'";
            }
            echo '>' . $revSlider->getTitle() . '</option>';
        }
    }
    echo '</select>';
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:31,代码来源:panels.php

示例5: register

 function register()
 {
     // Init Post Type
     $post = new SpyropressCustomPostType('Page');
     $menus = wp_get_nav_menus();
     $menu_options = array();
     if (isset($menus) && count($menus) > 0) {
         foreach ($menus as $menu) {
             $menu_options[$menu->term_id] = $menu->name;
         }
     }
     // Add Meta Boxes
     $meta_fields['options'] = array(array('label' => __('Slider', 'spyropress'), 'type' => 'heading', 'slug' => 'options'), array('label' => __('OnePage Navigation Menu', 'spyropress'), 'id' => 'onepage_menu', 'type' => 'select', 'class' => 'page_template one-page-php', 'options' => $menu_options), array('label' => __('Slider', 'spyropress'), 'type' => 'sub_heading'), array('label' => __('Slider Type', 'spyropress'), 'id' => 'slider', 'type' => 'select', 'class' => 'enable_changer', 'options' => array('nivo' => __('Nivo Slider', 'spyropress'), 'rev' => __('Revolution Slider', 'spyropress'))), array('label' => __('Nivo Slider', 'spyropress'), 'id' => 'nivo_slider', 'type' => 'select', 'class' => 'slider nivo', 'options' => spyropress_get_sliders()));
     if (class_exists('RevSlider')) {
         $slider = new RevSlider();
         $arrSliders = $slider->getArrSlidersShort();
         $meta_fields['options'][] = array('label' => __('Revolution Slider', 'spyropress'), 'id' => 'rev_slider', 'type' => 'select', 'class' => 'slider rev', 'options' => $arrSliders);
         $meta_fields['options'][] = array('label' => __('Revolution Slider Skin', 'spyropress'), 'id' => 'rev_slider_skin', 'type' => 'select', 'class' => 'slider rev', 'options' => array('dark' => __('Dark', 'spyropress'), 'light' => __('Light', 'spyropress'), 'full' => __('FullScreen', 'spyropress'), 'dark dark-video' => __('Video - Dark', 'spyropress'), 'light dark-light' => __('Video - Light', 'spyropress')), 'std' => 'dark');
     }
     $meta_fields['options'][] = array('label' => __('Header', 'spyropress'), 'type' => 'sub_heading');
     $meta_fields['options'][] = array('label' => __('Header Type', 'spyropress'), 'id' => 'top_header', 'type' => 'select', 'class' => 'enable_changer', 'options' => array('none' => __('None', 'spyropress'), 'default' => __('Default', 'spyropress'), 'custom' => __('Custom Header', 'spyropress')), 'std' => 'default');
     $meta_fields['options'][] = array('label' => __('Custom Header Bucket', 'spyropress'), 'id' => 'bucket', 'type' => 'select', 'class' => 'top_header custom', 'desc' => __('Either use Bucket or Content', 'spyropress'), 'options' => spyropress_get_buckets());
     $meta_fields['options'][] = array('label' => __('Custom Header Content', 'spyropress'), 'id' => 'header_content', 'type' => 'editor', 'desc' => __('Either use Bucket or Content', 'spyropress'), 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Custom Header Background', 'spyropress'), 'id' => 'background', 'type' => 'background', 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Top Border color', 'spyropress'), 'id' => 'border_top', 'type' => 'colorpicker', 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Bottom Border color', 'spyropress'), 'id' => 'border_bottom', 'type' => 'colorpicker', 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Layout', 'spyropress'), 'type' => 'sub_heading');
     $meta_fields['options'][] = array('label' => __('Layout Type', 'spyropress'), 'id' => 'layout_type', 'type' => 'select', 'options' => array('full' => __('Full Width', 'spyropress'), 'left' => __('Left Sidebar', 'spyropress'), 'right' => __('Right Sidebar', 'spyropress')), 'std' => 'full');
     $post->add_meta_box('page_options', __('Page Options', 'spyropress'), $meta_fields, '_page_options', false, 'normal', 'high');
 }
开发者ID:rinodung,项目名称:myfreetheme,代码行数:30,代码来源:page-init.php

示例6: my_print_shortcodes_in_js

    public static function my_print_shortcodes_in_js()
    {
        $sld = new RevSlider();
        $sliders = $sld->getArrSliders();
        $shortcodes = '';
        if (!empty($sliders)) {
            $first = true;
            foreach ($sliders as $slider) {
                $shortcode = $slider->getParam('shortcode', 'false');
                if ($shortcode != 'false') {
                    if (!$first) {
                        $shortcodes .= ',';
                    }
                    $shortcodes .= "'" . $shortcode . "'";
                    $first = false;
                }
            }
        }
        ?>

		<script type="text/javascript">
			var revslider_shortcodes = [<?php 
        echo $shortcodes;
        ?>
];
		</script>
		<?php 
    }
开发者ID:IDOAgency,项目名称:PAHClinic,代码行数:28,代码来源:revslider_tinybox.class.php

示例7: getRevSlider

 public function getRevSlider()
 {
     if (!$this->slider && ($alias = $this->getParam('activeRevSlider'))) {
         $this->slider = new RevSlider();
         $this->slider->initByMixed($alias);
     }
     return $this->slider;
 }
开发者ID:nikolaskarica,项目名称:bds-alliance,代码行数:8,代码来源:revolution_slider.php

示例8: revSliderCharityDataImport

 public function revSliderCharityDataImport() {
 	if (class_exists('RevSlider')) {
 		$slider = new RevSlider();
 		$response = $slider->importSliderFromPost(true, true, CHY_THEME_DIR . '/vendor/data/home_slder2.zip');
 		$response = $slider->importSliderFromPost(true, true, CHY_THEME_DIR . '/vendor/data/home_slder3.zip');
 		$response = $slider->importSliderFromPost(true, true, CHY_THEME_DIR . '/vendor/data/home_slder1.zip');
 		$response = $slider->importSliderFromPost(true, true, CHY_THEME_DIR . '/vendor/data/ShopLandingSlider.zip');
 	}
 }
开发者ID:kautzar,项目名称:drpp4,代码行数:9,代码来源:oneclick.php

示例9: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $revSliderAdmin = Mage::getSingleton('RevSliderAdmin');
     $revSliderAdmin->requireSettings("slider_settings");
     $settingsMain = $revSliderAdmin->getSettings("slider_main");
     $settingsParams = $revSliderAdmin->getSettings("slider_params");
     $settingsSliderMain = new RevSliderSettingsProduct();
     $settingsSliderParams = new UniteSettingsProductSidebarRev();
     //get taxonomies with cats
     $postTypesWithCats = RevOperations::getPostTypesWithCatsForClient();
     $jsonTaxWithCats = UniteFunctionsRev::jsonEncodeForClientSide($postTypesWithCats);
     //check existing slider data:
     $sliderID = $this->getRequest()->getParam('id');
     if (!empty($sliderID)) {
         $slider = new RevSlider();
         $slider->initByID($sliderID);
         //get setting fields
         $settingsFields = $slider->getSettingsFields();
         $arrFieldsMain = $settingsFields["main"];
         $arrFieldsParams = $settingsFields["params"];
         //modify arrows type for backword compatability
         $arrowsType = UniteFunctionsRev::getVal($arrFieldsParams, "navigation_arrows");
         switch ($arrowsType) {
             case "verticalcentered":
                 $arrFieldsParams["navigation_arrows"] = "solo";
                 break;
         }
         //set custom type params values:
         $settingsMain = RevSliderSettingsProduct::setSettingsCustomValues($settingsMain, $arrFieldsParams, $postTypesWithCats);
         //set setting values from the slider
         $settingsMain->setStoredValues($arrFieldsParams);
         $settingsParams->setStoredValues($arrFieldsParams);
         //update short code setting
         $shortcode = $slider->getShortcode();
         $settingsMain->updateSettingValue("shortcode", htmlentities($shortcode));
         $linksEditSlides = $this->helper("adminhtml")->getUrl('adminhtml/nwdrevslider/slides/id/' . $sliderID);
         $settingsSliderParams->init($settingsParams);
         $settingsSliderMain->init($settingsMain);
         $settingsSliderParams->isAccordion(true);
         $this->assign('sliderID', $sliderID);
         $this->assign('linksEditSlides', $linksEditSlides);
         $this->assign('arrFieldsParams', $arrFieldsParams);
         $this->setTemplate('nwdthemes/revslider/templates/slider_edit.phtml');
     } else {
         //set custom type params values:
         $settingsMain = RevSliderSettingsProduct::setSettingsCustomValues($settingsMain, array(), $postTypesWithCats);
         $settingsSliderParams->init($settingsParams);
         $settingsSliderMain->init($settingsMain);
         $settingsSliderParams->isAccordion(true);
         $this->setTemplate('nwdthemes/revslider/templates/slider_new.phtml');
     }
     $this->assign('sliderTemplate', $this->_sliderTemplate);
     $this->assign('settingsSliderMain', $settingsSliderMain);
     $this->assign('settingsSliderParams', $settingsSliderParams);
     $this->assign('jsonTaxWithCats', $jsonTaxWithCats);
 }
开发者ID:perseusl,项目名称:kingdavid,代码行数:60,代码来源:Edit.php

示例10: yit_get_revolution_sliders

function yit_get_revolution_sliders()
{
    global $wpdb;
    if (!yit_if_thereis_revslider()) {
        return array();
    }
    $tableName = GlobalsRevSlider::$table_sliders;
    $slider = new RevSlider();
    return $slider->getArrSlidersShort();
}
开发者ID:zgomotos,项目名称:Bazar,代码行数:10,代码来源:config.php

示例11: wbc_extended_example

 function wbc_extended_example($demo_active_import, $demo_directory_path)
 {
     reset($demo_active_import);
     $current_key = key($demo_active_import);
     /************************************************************************
      * Import slider(s) for the current demo being imported
      *************************************************************************/
     if (class_exists('RevSlider')) {
         //If it's demo3 or demo5
         $wbc_sliders_array = array('demo1' => 'newslider2014.zip');
         if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && array_key_exists($demo_active_import[$current_key]['directory'], $wbc_sliders_array)) {
             $wbc_slider_import = $wbc_sliders_array[$demo_active_import[$current_key]['directory']];
             if (file_exists($demo_directory_path . $wbc_slider_import)) {
                 $slider = new RevSlider();
                 $slider->importSliderFromPost(true, true, $demo_directory_path . $wbc_slider_import);
             }
         }
     }
     /************************************************************************
      * Setting Menus
      *************************************************************************/
     // If it's demo1 - demo6
     $wbc_menu_array = array('demo1');
     if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && in_array($demo_active_import[$current_key]['directory'], $wbc_menu_array)) {
         $top_menu = get_term_by('name', 'Top Menu', 'nav_menu');
         $main_menu = get_term_by('name', 'Header Menu', 'nav_menu');
         $footer_menu = get_term_by('name', 'Footer Menu', 'nav_menu');
         if (isset($top_menu->term_id)) {
             set_theme_mod('nav_menu_locations', array('top-menu' => $top_menu->term_id, 'primary-menu' => $main_menu->term_id, 'footer-menu' => $footer_menu->term_id));
         }
     }
     /************************************************************************
      * Set HomePage
      *************************************************************************/
     // array of demos/homepages to check/select from
     $wbc_home_pages = array('demo1' => 'Home');
     $wbc_blog_pages = array('demo1' => 'Blog');
     if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && array_key_exists($demo_active_import[$current_key]['directory'], $wbc_home_pages)) {
         $page = get_page_by_title($wbc_home_pages[$demo_active_import[$current_key]['directory']]);
         if (isset($page->ID)) {
             update_option('page_on_front', $page->ID);
             update_option('show_on_front', 'page');
             //Update Widgets Switch to On
             $all_widgets_on = 'a:34:{s:6:"button";b:1;s:10:"google-map";b:1;s:5:"image";b:1;s:6:"slider";b:1;s:13:"post-carousel";b:1;s:6:"editor";b:1;s:12:"alert-widget";b:1;s:14:"counter-widget";b:1;s:21:"featured-block-widget";b:1;s:19:"gallery-grid-widget";b:1;s:4:"icon";b:1;s:15:"carousel-widget";b:1;s:17:"posts-list-widget";b:1;s:18:"progressbar-widget";b:1;s:19:"sermons-list-widget";b:1;s:21:"sermons-albums-widget";b:1;s:17:"staff-grid-widget";b:1;s:13:"spacer-widget";b:1;s:11:"tabs-widget";b:1;s:8:"taxonomy";b:1;s:13:"toggle-widget";b:1;s:11:"testimonial";b:1;s:30:"upcoming-events-listing-widget";b:1;s:5:"video";b:1;s:14:"simple-masonry";b:1;s:20:"social-media-buttons";b:1;s:11:"price-table";b:1;s:13:"layout-slider";b:1;s:10:"image-grid";b:1;s:4:"hero";b:1;s:8:"headline";b:1;s:8:"features";b:1;s:7:"contact";b:1;s:3:"cta";b:1;}';
             $all_widgets_on = unserialize($all_widgets_on);
             update_option('siteorigin_widgets_active', $all_widgets_on);
         }
     }
     if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && array_key_exists($demo_active_import[$current_key]['directory'], $wbc_blog_pages)) {
         $bpage = get_page_by_title($wbc_blog_pages[$demo_active_import[$current_key]['directory']]);
         if (isset($bpage->ID)) {
             update_option('page_for_posts', $bpage->ID);
         }
     }
 }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:55,代码来源:extension_wbc_importer.php

示例12: toOptionArray

 public function toOptionArray()
 {
     new RevSliderAdmin();
     $slider = new RevSlider();
     $arrSliders = $slider->getArrSliders();
     $options = array();
     foreach ($arrSliders as $item) {
         $options[] = array('value' => $item->getAlias(), 'label' => $item->getAlias());
     }
     return $options;
 }
开发者ID:perseusl,项目名称:kingdavid,代码行数:11,代码来源:Revslider.php

示例13: ac_get_revsliders

function ac_get_revsliders()
{
    $rev_sliders = array();
    if (ac_revslider_is_installed()) {
        $slider = new RevSlider();
        $arrSliders = $slider->getArrSliders();
        foreach ($arrSliders as $arrSlider) {
            $rev_sliders[$arrSlider->getAlias()] = $arrSlider->getTitle();
        }
    }
    return $rev_sliders;
}
开发者ID:Jhorton4,项目名称:Bohldfeys_Portfolio,代码行数:12,代码来源:ac-sliders.php

示例14: import_revsliders

 public function import_revsliders($file)
 {
     if (!file_exists($file)) {
         return 'Revolution Slider file not found';
         return;
     }
     if (class_exists('RevSlider')) {
         ob_start();
         $rev = new RevSlider();
         $response = $rev->importSliderFromPost(false, false, $file);
         ob_end_clean();
         return 'Revolution Slider imported';
     }
 }
开发者ID:AlchemyMomentum,项目名称:public_html,代码行数:14,代码来源:radium-importer.php

示例15: x_revolution_slider_get_slider_meta

function x_revolution_slider_get_slider_meta()
{
    $rs = new RevSlider();
    $sliders = $rs->getArrSliders();
    $data = array();
    foreach ($sliders as $s) {
        $key = 'x-slider-rs-' . $s->getID();
        $data[$key]['id'] = $s->getID();
        $data[$key]['slug'] = $s->getAlias();
        $data[$key]['name'] = $s->getTitle();
        $data[$key]['source'] = 'Revolution Slider';
    }
    return $data;
}
开发者ID:skywindzz,项目名称:blue_leopard,代码行数:14,代码来源:revolution-slider.php


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