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


PHP avia_new_section函数代码示例

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


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

示例1: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $skipSecond = false;
     avia_sc_layerslider::$slide_count++;
     //check if we got a layerslider
     global $wpdb;
     // Table name
     $table_name = $wpdb->prefix . "layerslider";
     // Get slider
     $slider = $wpdb->get_row("SELECT * FROM {$table_name}\n\t\t\t\t\t\t\t\t\t\tWHERE id = " . (int) $atts['id'] . " AND flag_hidden = '0'\n\t\t\t\t\t\t\t\t\t\tAND flag_deleted = '0'\n\t\t\t\t\t\t\t\t\t\tORDER BY date_c DESC LIMIT 1", ARRAY_A);
     if (!empty($slider)) {
         $slides = json_decode($slider['data'], true);
         $height = $slides['properties']['height'];
         $width = $slides['properties']['width'];
         $responsive = !empty($slides['properties']['responsive']) ? $slides['properties']['responsive'] : '';
         $responsiveunder = !empty($slides['properties']['responsiveunder']) ? $slides['properties']['responsiveunder'] : '';
         $params['style'] = " style='height: " . ($height + 1) . "px;' ";
     }
     $params['class'] = "avia-layerslider main_color avia-shadow " . $meta['el_class'];
     $params['open_structure'] = false;
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if (empty($meta['index'])) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if (!empty($meta['index'])) {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "layer_slider_" . avia_sc_layerslider::$slide_count;
     $output .= avia_new_section($params);
     $output .= function_exists('layerslider_init') ? layerslider_init($atts) : '';
     //fix for search results page
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_layer_slider_" . avia_sc_layerslider::$slide_count));
     }
     return $output;
 }
开发者ID:erynet,项目名称:SUAWEBv2,代码行数:58,代码来源:slideshow_layerslider.php

示例2: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts['class'] = !empty($meta['custom_class']) ? $meta['custom_class'] : "";
     if (current_theme_supports('avia_template_builder_custom_post_type_grid')) {
         if (isset($atts['link'])) {
             $atts['link'] = explode(',', $atts['link'], 2);
             $atts['taxonomy'] = $atts['link'][0];
             if (isset($atts['link'][1])) {
                 $atts['categories'] = $atts['link'][1];
             }
         }
         if (empty($atts['post_type']) || !current_theme_supports('add_avia_builder_post_type_option')) {
             $atts['post_type'] = get_post_types();
         }
         if (is_string($atts['post_type'])) {
             $atts['post_type'] = explode(',', $atts['post_type']);
         }
     }
     $atts['fullscreen'] = ShortcodeHelper::is_top_level();
     $grid = new avia_post_grid($atts);
     $grid->query_entries();
     $portfolio_html = $grid->html();
     if (!ShortcodeHelper::is_top_level()) {
         return $portfolio_html;
     }
     $params['class'] = "main_color avia-no-border-styling avia-fullwidth-portfolio " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : "";
     $params['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     $output = avia_new_section($params);
     $output .= $portfolio_html;
     $output .= avia_section_after_element_content($meta, 'after_portfolio');
     return $output;
 }
开发者ID:DylanPeti,项目名称:socialize,代码行数:49,代码来源:portfolio.php

示例3: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $skipSecond = false;
     //check if we got a layerslider
     global $wpdb;
     $params['class'] = "main_color " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : "";
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " masonry-not-first";
     }
     if ($meta['index'] == 0 && get_post_meta(get_the_ID(), 'header', true) != "no") {
         $params['class'] .= " masonry-not-first";
     }
     if ($atts['gap'] == 'no') {
         $params['class'] .= " avia-no-border-styling";
     }
     $atts['container_class'] = "av-masonry-gallery";
     $masonry = new avia_masonry($atts);
     $masonry->query_entries_by_id();
     $masonry_html = $masonry->html();
     if (!ShortcodeHelper::is_top_level()) {
         return $masonry_html;
     }
     $output .= avia_new_section($params);
     $output .= $masonry_html;
     $output .= "</div><!-- close section -->";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_masonry"));
     }
     return $output;
 }
开发者ID:erikdukker,项目名称:medisom,代码行数:57,代码来源:masonry_gallery.php

示例4: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $class = "";
     $alt = "";
     $title = "";
     $src = "";
     $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $hotspots = ShortcodeHelper::shortcode2array($content, 1);
     extract(shortcode_atts(array('animation' => 'no-animation', 'attachment' => '', 'attachment_size' => '', 'hotspot_layout' => 'numbered', 'hotspot_mobile' => '', 'hotspot_tooltip_display' => ''), $atts, $this->config['shortcode']));
     if (!empty($attachment)) {
         $attachment_entry = get_post($attachment);
         if (!empty($attachment_entry)) {
             $alt = get_post_meta($attachment_entry->ID, '_wp_attachment_image_alt', true);
             $alt = !empty($alt) ? esc_attr($alt) : '';
             $title = trim($attachment_entry->post_title) ? esc_attr($attachment_entry->post_title) : "";
             if (!empty($attachment_size)) {
                 $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size);
                 $src = !empty($src[0]) ? $src[0] : "";
             }
         }
     }
     //no src? return
     if (!empty($src)) {
         if (!ShortcodeHelper::is_top_level()) {
             $meta['el_class'] .= " av-non-fullwidth-hotspot-image";
         }
         $hotspot_html = "";
         $tooltip_html = "";
         $counter = 1;
         foreach ($hotspots as $hotspot) {
             if (!empty($hotspot_mobile)) {
                 $tooltip_html .= $this->add_fallback_tooltip($hotspot, $counter);
             }
             $extraClass = !empty($hotspot_mobile) ? " av-mobile-fallback-active " : "";
             $extraClass .= !empty($hotspot_tooltip_display) ? " {$hotspot_tooltip_display}-single " : "";
             $hotspot_html .= $this->add_hotspot($hotspot, $counter, $extraClass);
             $counter++;
         }
         //some custom classes
         $class .= $animation == "no-animation" ? "" : " avia_animated_image avia_animate_when_almost_visible " . $animation;
         $class .= " av-hotspot-" . $hotspot_layout;
         $class .= !empty($hotspot_mobile) ? " av-mobile-fallback-active " : "";
         $class .= " " . $hotspot_tooltip_display;
         $output .= "<div class='av-hotspot-image-container avia_animate_when_almost_visible {$class} " . $meta['el_class'] . " ' {$markup} >";
         $output .= "<div class='av-hotspot-container'>";
         $output .= "<div class='av-hotspot-container-inner-cell'>";
         $output .= "<div class='av-hotspot-container-inner-wrap'>";
         $output .= $hotspot_html;
         $output .= "<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}'  {$markup_url} />";
         $output .= "</div>";
         $output .= "</div>";
         $output .= "</div>";
         $output .= $tooltip_html;
         $output .= "</div>";
     }
     if (!ShortcodeHelper::is_top_level()) {
         return $output;
     }
     $skipSecond = false;
     $params['class'] = "main_color av-fullwidth-hotspots " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : "";
     $params['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     $image = $output;
     $output = avia_new_section($params);
     $output .= $image;
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_image_hotspots"));
     }
     return $output;
 }
开发者ID:erikdukker,项目名称:medisom,代码行数:98,代码来源:image_hotspots.php

示例5: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('size' => 'featured', 'animation' => 'slide', 'ids' => '', 'autoplay' => 'false', 'interval' => 5, 'handle' => $shortcodename, 'stretch' => '', 'bg_slider' => 'true', 'slide_height' => "100", 'content' => ShortcodeHelper::shortcode2array($content)), $atts);
     extract($atts);
     $output = "";
     $class = "";
     $skipSecond = false;
     avia_sc_slider_full::$slide_count++;
     $params['class'] = "avia-fullscreen-slider main_color " . $meta['el_class'] . $class;
     $params['open_structure'] = false;
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     if ($meta['index'] == 0 && get_post_meta(get_the_ID(), 'header', true) != "no") {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "fullscreen_slider_" . avia_sc_slider_fullscreen::$slide_count;
     $output .= avia_new_section($params);
     $slider = new avia_slideshow($atts);
     $slider->set_extra_class($stretch);
     $output .= $slider->html();
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], array('av_layerslider', 'av_section', 'av_slideshow_full', 'av_fullscreen'))) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_full_slider_" . avia_sc_slider_fullscreen::$slide_count));
     }
     return $output;
 }
开发者ID:bluedrone,项目名称:plugins,代码行数:47,代码来源:slideshow_fullscreen.php

示例6: avia_section_after_element_content

 function avia_section_after_element_content($meta, $second_id = "", $skipSecond = false, $extra = "")
 {
     $output = "</div>";
     //close section
     $output .= $extra;
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => $second_id));
     }
     return $output;
 }
开发者ID:spokehq,项目名称:emprise,代码行数:18,代码来源:obeysection.php

示例7: avia_title

//check if we want to display breadcumb and title
if (get_post_meta(get_the_ID(), 'header', true) != 'no') {
    echo avia_title();
}
do_action('ava_after_main_title');
//filter the content for content builder elements
$content = apply_filters('avia_builder_precompile', get_post_meta(get_the_ID(), '_aviaLayoutBuilderCleanData', true));
//if user views a preview me must use the content because WordPress doesn't update the post meta field
if (is_preview()) {
    $content = apply_filters('avia_builder_precompile', get_the_content());
}
//check first builder element. if its a section or a fullwidth slider we dont need to create the default openeing divs here
$first_el = isset(ShortcodeHelper::$tree[0]) ? ShortcodeHelper::$tree[0] : false;
$last_el = !empty(ShortcodeHelper::$tree) ? end(ShortcodeHelper::$tree) : false;
if (!$first_el || !in_array($first_el['tag'], AviaBuilder::$full_el)) {
    echo avia_new_section(array('close' => false, 'main_container' => true));
}
$content = apply_filters('the_content', $content);
$content = apply_filters('avf_template_builder_content', $content);
echo $content;
$avia_wp_link_pages_args = apply_filters('avf_wp_link_pages_args', array('before' => '<nav class="pagination_split_post">' . __('Pages:', 'avia_framework'), 'after' => '</nav>', 'pagelink' => '<span>%</span>', 'separator' => ' '));
wp_link_pages($avia_wp_link_pages_args);
//only close divs if the user didnt add fullwidth slider elements at the end. also skip sidebar if the last element is a slider
if (!$last_el || !in_array($last_el['tag'], AviaBuilder::$full_el_no_section)) {
    $cm = avia_section_close_markup();
    echo "</div>";
    echo "</div>{$cm} <!-- section close by builder template -->";
    //get the sidebar
    if (is_singular('post')) {
        $avia_config['currently_viewing'] = 'blog';
    } else {
开发者ID:erikdukker,项目名称:medisom,代码行数:31,代码来源:template-builder.php

示例8: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('slide_type' => 'image-based', 'link' => '', 'size' => '', 'items' => '', 'autoplay' => 'false', 'title' => 'active', 'excerpt' => '', 'interval' => 5, 'offset' => 0, 'handle' => $shortcodename, 'content' => ShortcodeHelper::shortcode2array($content, 1)), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $class = "";
     $skipSecond = false;
     avia_sc_slider_accordion::$slide_count++;
     $params['class'] = "avia-accordion-slider-wrap main_color avia-shadow " . $meta['el_class'] . $class;
     $params['open_structure'] = false;
     $params['custom_markup'] = $atts['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "accordion_slider_" . avia_sc_slider_full::$slide_count;
     $slider = new aviaccordion($atts);
     $slide_html = $slider->html();
     //if the element is nested within a section or a column dont create the section shortcode around it
     if (!ShortcodeHelper::is_top_level()) {
         return $slide_html;
     }
     $output .= avia_new_section($params);
     $output .= $slide_html;
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_full_slider_" . avia_sc_slider_full::$slide_count));
     }
     return $output;
 }
开发者ID:DylanPeti,项目名称:socialize,代码行数:53,代码来源:slideshow_accordion.php

示例9: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     if (isset($atts['link'])) {
         $atts['link'] = explode(',', $atts['link'], 2);
         $atts['taxonomy'] = $atts['link'][0];
         if (isset($atts['link'][1])) {
             $atts['categories'] = $atts['link'][1];
         }
     }
     // $atts['class'] = $meta['el_class'];
     extract($atts);
     $output = "";
     $class = "";
     $skipSecond = false;
     avia_sc_featureimage_slider::$slide_count++;
     $params['class'] = "avia-featureimage-slider-wrap main_color  " . $meta['el_class'] . $class;
     $params['open_structure'] = false;
     $params['custom_markup'] = $atts['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "avia_feature_image_slider_" . avia_sc_slider_full::$slide_count;
     $slider = new avia_feature_image_slider($atts);
     $slider->query_entries();
     $slide_html = $slider->html();
     //if the element is nested within a section or a column dont create the section shortcode around it
     if (!ShortcodeHelper::is_top_level()) {
         return $slide_html;
     }
     // $slide_html  = "<div class='container'>" . $slide_html . "</div>";
     $output .= avia_new_section($params);
     $output .= $slide_html;
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_full_slider_" . avia_sc_slider_full::$slide_count));
     }
     return $output;
 }
开发者ID:erikdukker,项目名称:medisom,代码行数:62,代码来源:slideshow_feature_image.php

示例10: get_header

 */
get_header();
// set up post data
setup_postdata($post);
//check if we want to display breadcumb and title
if (get_post_meta(get_the_ID(), 'header', true) != 'no') {
    echo avia_title();
}
//filter the content for content builder elements
$content = apply_filters('avia_builder_precompile', get_post_meta(get_the_ID(), '_aviaLayoutBuilderCleanData', true));
$content = apply_filters('the_content', $content);
//check first builder element. if its a section or a fullwidth slider we dont need to create the default openeing divs here
$first_el = isset(ShortcodeHelper::$tree[0]) ? ShortcodeHelper::$tree[0] : false;
$last_el = !empty(ShortcodeHelper::$tree) ? end(ShortcodeHelper::$tree) : false;
if (!$first_el || !in_array($first_el['tag'], array('av_section', 'av_layerslider', 'av_slideshow_full', 'av_fullscreen'))) {
    echo avia_new_section(array('close' => false));
}
echo $content;
//only close divs if the user didnt add fullwidth slider elements at the end. also skip sidebar if the last element is a slider
if (!$last_el || !in_array($last_el['tag'], array('av_layerslider', 'av_slideshow_full', 'av_fullscreen'))) {
    echo "\t\t\t</div>";
    echo "\t\t</div>";
    echo "\t</div>";
    //get the sidebar
    $avia_config['currently_viewing'] = 'page';
    get_sidebar();
} else {
    echo "<div><div>";
}
echo "\t</div><!--end builder template-->";
get_footer();
开发者ID:bluedrone,项目名称:plugins,代码行数:31,代码来源:template-builder.php

示例11: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     avia_sc_section::$section_count++;
     extract(shortcode_atts(array('src' => '', 'position' => 'top left', 'repeat' => 'no-repeat', 'attach' => 'scroll', 'color' => 'main_color', 'custom_bg' => '', 'padding' => 'default', 'shadow' => 'shadow', 'id' => ''), $atts));
     $output = "";
     $class = "avia-section " . $color . " avia-section-" . $padding . " avia-" . $shadow;
     $background = "";
     if ($src != "") {
         if ($repeat == 'stretch') {
             $background .= "background-repeat: no-repeat; ";
             $class .= " avia-full-stretch";
         } else {
             $background .= "background-repeat: {$repeat}; ";
         }
         $background .= "background-image: url({$src}); ";
         $background .= "background-attachment: {$attach}; ";
         $background .= "background-position: {$position}; ";
     }
     if ($custom_bg != "") {
         $background .= "background-color: {$custom_bg}; ";
     }
     if ($background) {
         $background = "style = '{$background}'";
     }
     $params['class'] = $class . " " . $meta['el_class'];
     $params['bg'] = $background;
     $params['id'] = !empty($id) ? AviaHelper::save_string($id, '-') : "av_section_" . avia_sc_section::$section_count;
     if (isset($meta['index'])) {
         if ($meta['index'] == 0 || isset($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], array('av_layerslider', 'av_slideshow_full', 'av_fullscreen'))) {
             $params['close'] = false;
         }
     }
     $output .= avia_new_section($params);
     $output .= ShortcodeHelper::avia_remove_autop($content, true);
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], array('av_layerslider', 'av_section', 'av_slideshow_full', 'av_fullscreen'))) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section. if we got a sidebar always create a next section at the bottom
     if (empty($meta['siblings']['next']['tag']) && !avia_has_sidebar()) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $new_params['id'] = "after_section_" . avia_sc_section::$section_count;
         $output .= avia_new_section($new_params);
     }
     return $output;
 }
开发者ID:bluedrone,项目名称:plugins,代码行数:56,代码来源:section.php

示例12: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $skipSecond = false;
     avia_sc_revolutionslider::$slide_count++;
     //check if we got a Revolution Slider
     global $wpdb;
     // Table name
     $table_name = $wpdb->prefix . "revslider_sliders";
     // Get slider
     $slider = $wpdb->get_row("SELECT * FROM {$table_name} WHERE id = '" . (int) $atts['id'] . "'", ARRAY_A);
     if (!empty($slider)) {
         $slides = json_decode($slider['params'], true);
         $height = $slides['height'];
         $params['style'] = " style='height: " . ($height + 1) . "px;' ";
     }
     $params['class'] = "avia-layerslider main_color avia-shadow " . $meta['el_class'];
     $params['open_structure'] = false;
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "layer_slider_" . avia_sc_revolutionslider::$slide_count;
     $output .= avia_new_section($params);
     $output .= do_shortcode('[rev_slider ' . $atts['id'] . ']');
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_layer_slider_" . avia_sc_revolutionslider::$slide_count));
     }
     return $output;
 }
开发者ID:erikdukker,项目名称:medisom,代码行数:54,代码来源:slideshow_revolution.php

示例13: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $skipSecond = false;
     avia_sc_layerslider::$slide_count++;
     //check if we got a layerslider
     global $wpdb;
     // Table name
     $table_name = $wpdb->prefix . "layerslider";
     // Get slider
     $slider = $wpdb->get_row("SELECT * FROM {$table_name}\n\t\t\t\t\t\t\t\t\t\tWHERE id = " . (int) $atts['id'] . " AND flag_hidden = '0'\n\t\t\t\t\t\t\t\t\t\tAND flag_deleted = '0'\n\t\t\t\t\t\t\t\t\t\tORDER BY date_c DESC LIMIT 1", ARRAY_A);
     if (!empty($slider)) {
         $slides = json_decode($slider['data'], true);
         $height = $slides['properties']['height'];
         $width = $slides['properties']['width'];
         $responsive = $slides['properties']['responsive'];
         $responsiveunder = $slides['properties']['responsiveunder'];
         $params['style'] = " style='height: " . ($height + 1) . "px;' ";
     }
     $params['class'] = "avia-layerslider main_color avia-shadow " . $meta['el_class'];
     $params['open_structure'] = false;
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     if ($meta['index'] == 0 && get_post_meta(get_the_ID(), 'header', true) != "no") {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "layer_slider_" . avia_sc_layerslider::$slide_count;
     $output .= avia_new_section($params);
     $output .= layerslider_init($atts);
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], array('av_layerslider', 'av_section', 'av_slideshow_full', 'av_fullscreen'))) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_layer_slider_" . avia_sc_layerslider::$slide_count));
     }
     return $output;
 }
开发者ID:bluedrone,项目名称:plugins,代码行数:56,代码来源:slideshow_layerslider.php

示例14: shortcode_handler

 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     avia_sc_button_full::$count++;
     $atts = shortcode_atts(array('label' => 'Click me', 'link' => '', 'link_target' => '', 'color' => 'theme-color', 'color_hover' => 'theme-color-subtle', 'custom_bg' => '#444444', 'custom_bg_hover' => '#444444', 'custom_font' => '#ffffff', 'position' => 'center', 'icon_select' => 'no', 'icon' => '', 'font' => '', 'icon_hover' => '', 'description_pos' => ''), $atts, $this->config['shortcode']);
     $display_char = av_icon($atts['icon'], $atts['font']);
     $style = "color:" . $atts['custom_font'] . "; ";
     $style_hover = "";
     if ($atts['color'] == "custom") {
         $style .= "background-color:" . $atts['custom_bg'] . ";  ";
     }
     if ($atts['color_hover'] == "custom") {
         $style_hover = "style='background-color:" . $atts['custom_bg_hover'] . "; '";
     }
     $extraClass = $atts['icon_hover'] ? "av-icon-on-hover" : "";
     $blank = strpos($atts['link_target'], '_blank') !== false ? ' target="_blank" ' : "";
     $blank .= strpos($atts['link_target'], 'nofollow') !== false ? ' rel="nofollow" ' : "";
     $link = AviaHelper::get_url($atts['link']);
     $link = $link == "http://" ? "" : $link;
     if ($style) {
         $style = "style='{$style}'";
     }
     $content_html = "";
     if ($content && $atts['description_pos'] == 'above') {
         $content_html .= "<div class='av-button-description av-button-description-above'>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>";
     }
     if ('yes-left-icon' == $atts['icon_select']) {
         $content_html .= "<span class='avia_button_icon avia_button_icon_left ' {$display_char}></span>";
     }
     $content_html .= "<span class='avia_iconbox_title' >" . $atts['label'] . "</span>";
     if ('yes-right-icon' == $atts['icon_select']) {
         $content_html .= "<span class='avia_button_icon avia_button_icon_right' {$display_char}></span>";
     }
     if ($content && $atts['description_pos'] == 'below') {
         $content_html .= "<div class='av-button-description av-button-description-below'>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>";
     }
     $output = "";
     $output .= "<a href='{$link}' class='avia-button avia-button-fullwidth {$extraClass} " . $this->class_by_arguments('icon_select, color', $atts, true) . "' {$blank} {$style} >";
     $output .= $content_html;
     $output .= "<span class='avia_button_background avia-button avia-button-fullwidth avia-color-" . $atts['color_hover'] . "' {$style_hover}></span>";
     $output .= "</a>";
     $output = "<div class='avia-button-wrap avia-button-" . $atts['position'] . " " . $meta['el_class'] . "'>" . $output . "</div>";
     $params['class'] = "main_color av-fullscreen-button avia-no-border-styling " . $meta['el_class'];
     $params['open_structure'] = false;
     $id = AviaHelper::save_string($atts['label'], '-');
     $params['id'] = !empty($id) ? $id : "av-fullwidth-button-" . avia_sc_button_full::$count;
     $params['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if (!ShortcodeHelper::is_top_level()) {
         return $output;
     }
     $button_html = $output;
     $output = avia_new_section($params);
     $output .= $button_html;
     $output .= avia_section_after_element_content($meta, 'after_fullwidth_button');
     return $output;
     return $output;
 }
开发者ID:erikdukker,项目名称:medisom,代码行数:71,代码来源:buttons_fullwidth.php

示例15: shortcode_handler


//.........这里部分代码省略.........
                 $attachment_class .= " avia-full-stretch";
             }
             $class .= " av-parallax-section";
             $speed = apply_filters('avf_parallax_speed', "0.3", $params['id']);
             $params['attach'] .= "<div class='av-parallax' data-avia-parallax-ratio='{$speed}' >";
             $params['attach'] .= "<div class='av-parallax-inner {$color} {$attachment_class}' style = '{$background}' >";
             $params['attach'] .= "</div>";
             $params['attach'] .= "</div>";
             $background = "";
         }
         $params['data'] = "data-section-bg-repeat='{$repeat}'";
     } else {
         $attach = "scroll";
     }
     if ($custom_bg != "") {
         $background .= "background-color: {$custom_bg}; ";
     }
     if ($background) {
         $background = "style = '{$background}'";
     }
     /*check/create overlay*/
     $overlay = "";
     $pre_wrap = "<div class='av-section-color-overlay-wrap'>";
     if (!empty($overlay_enable)) {
         $overlay_src = "";
         $overlay = "opacity: {$overlay_opacity}; ";
         if (!empty($overlay_color)) {
             $overlay .= "background-color: {$overlay_color}; ";
         }
         if (!empty($overlay_pattern)) {
             if ($overlay_pattern == "custom") {
                 $overlay_src = $overlay_custom_pattern;
             } else {
                 $overlay_src = str_replace('{{AVIA_BASE_URL}}', AVIA_BASE_URL, $overlay_pattern);
             }
         }
         if (!empty($overlay_src)) {
             $overlay .= "background-image: url({$overlay_src}); background-repeat: repeat;";
         }
         $overlay = "<div class='av-section-color-overlay' style='{$overlay}'></div>";
         $class .= " av-section-color-overlay-active";
         $params['attach'] .= $pre_wrap . $overlay;
     }
     if (!empty($scroll_down)) {
         if (!$overlay) {
             $params['attach'] .= $pre_wrap;
         }
         $params['attach'] .= "<a href='#next-section' title='' class='scroll-down-link' " . av_icon_string('scrolldown') . "></a>";
     }
     $class .= " avia-bg-style-" . $attach;
     $params['class'] = $class . " " . $meta['el_class'];
     $params['bg'] = $background;
     $params['min_height'] = $min_height;
     $params['min_height_px'] = $min_height_px;
     $params['video'] = $video;
     $params['video_ratio'] = $video_ratio;
     $params['video_mobile_disabled'] = $video_mobile_disabled;
     if (isset($meta['index'])) {
         if ($meta['index'] == 0) {
             $params['main_container'] = true;
         }
         if ($meta['index'] == 0 || isset($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
             $params['close'] = false;
         }
     }
     $avia_config['layout_container'] = "section";
     $output .= avia_new_section($params);
     $output .= ShortcodeHelper::avia_remove_autop($content, true);
     /*set extra arrow element*/
     if (strpos($bottom_border, 'border-extra') !== false) {
         $backgroundEl = "";
         $backgroundElColor = !empty($custom_bg) ? $custom_bg : $avia_config['backend_colors']['color_set'][$color]['bg'];
         if ($backgroundElColor) {
             $backgroundEl = " style='background-color:{$backgroundElColor};' ";
         }
         avia_sc_section::$add_to_closing = "<div class='av-extra-border-element {$bottom_border}'><div class='av-extra-border-outer'><div class='av-extra-border-inner' {$backgroundEl}></div></div></div>";
     } else {
         avia_sc_section::$add_to_closing = "";
     }
     //next section needs an extra closing tag if overlay with wrapper was added:
     if ($overlay || !empty($scroll_down)) {
         avia_sc_section::$close_overlay = "</div>";
     } else {
         avia_sc_section::$close_overlay = "";
     }
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section. if we got a sidebar always create a next section at the bottom
     if (empty($meta['siblings']['next']['tag']) && !avia_has_sidebar()) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $new_params['id'] = "after_section_" . avia_sc_section::$section_count;
         $output .= avia_new_section($new_params);
     }
     unset($avia_config['layout_container']);
     return $output;
 }
开发者ID:fredpaw,项目名称:chuguo,代码行数:101,代码来源:section.php


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