PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
themes
/
wpnull24
/
framework
/
templates
/
elements
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' ); /** * Counter * * Dev note: if you want to change some of the default values or acceptable attributes, overload the shortcodes config. * */ $classes = $value_inline_css = ''; $classes .= ' color_' . $color; $classes .= ' align_' . $align; if ( ! empty( $css ) AND function_exists( 'vc_shortcode_custom_css_class' ) ) { $classes .= ' ' . vc_shortcode_custom_css_class( $css ); } $classes .= ( ! empty( $el_class ) ) ? ( ' ' . $el_class ) : ''; $el_id = ( ! empty( $el_id ) ) ? ( ' id="' . esc_attr( $el_id ) . '"' ) : ''; // Generate inline styles for Value $value_inline_css .= us_prepare_inline_css( array( 'font-family' => $font, 'font-weight' => $font_weight, 'text-transform' => $text_transform, 'font-style' => $font_style, 'font-size' => $size, 'color' => $custom_color, ) ); // Generate inline styles for Title $title_inline_css = us_prepare_inline_css( array( 'font-size' => $title_size, 'color' => $title_color, ) ); // Finding numbers positions in both initial and final strings $pos = array(); foreach ( array( 'initial', 'final' ) as $key ) { $pos[ $key ] = array(); // In this array we'll store the string's character number, where primitive changes from letter to number or back preg_match_all( '~(\(\-?\d+([\.,\'· ]\d+)*\))|(\-?\d+([\.,\'· ]\d+)*)~u', $$key, $matches, PREG_OFFSET_CAPTURE ); foreach ( $matches[0] as $match ) { $pos[ $key ][] = $match[1]; $pos[ $key ][] = $match[1] + strlen( $match[0] ); } }; // Making sure we have the equal number of numbers in both strings if ( count( $pos['initial'] ) != count( $pos['final'] ) ) { // Not-paired numbers will be treated as letters if ( count( $pos['initial'] ) > count( $pos['final'] ) ) { $pos['initial'] = array_slice( $pos['initial'], 0, count( $pos['final'] ) ); } else/*if ( count( $positions['initial'] ) < count( $positions['final'] ) )*/ { $pos['final'] = array_slice( $pos['final'], 0, count( $pos['initial'] ) ); } } // Position boundaries foreach ( array( 'initial', 'final' ) as $key ) { array_unshift( $pos[ $key ], 0 ); $pos[ $key ][] = strlen( $$key ); } // Output the element $output = '<div class="w-counter' . $classes . '" data-duration="' . intval( $duration ) * 1000 . '"' . $el_id . '>'; $output .= '<div class="w-counter-value"' . $value_inline_css . '>'; // Determining if we treat each part as a number or as a letter combination for ( $index = 0, $length = count( $pos['initial'] ) - 1; $index < $length; $index++ ) { $part_type = ( $index % 2 ) ? 'number' : 'text'; $part_initial = substr( $initial, $pos['initial'][ $index ], $pos['initial'][ $index + 1 ] - $pos['initial'][ $index ] ); $part_final = substr( $final, $pos['final'][ $index ], $pos['final'][ $index + 1 ] - $pos['final'][ $index ] ); $output .= '<span class="w-counter-value-part type_' . $part_type . '" data-final="' . esc_attr( $part_final ) . '">' . $part_initial . '</span>'; } $output .= '</div>'; if ( ! empty ( $title ) ) { $output .= '<' . $title_tag .' class="w-counter-title"' . $title_inline_css . '>'; $output .= $title; $output .= '</' . $title_tag . '>'; } $output .= '</div>'; // If we are in front end editor mode, apply JS to logos if ( function_exists( 'vc_is_page_editable' ) AND vc_is_page_editable() ) { $output .= '<script> jQuery(function($){ if (typeof $.fn.wCounter === "function") { jQuery(".w-counter").wCounter(); } }); </script>'; } echo $output;
[+]
..
[-] person.php
[edit]
[-] separator.php
[edit]
[-] post_custom_field.php
[edit]
[-] post_image.php
[edit]
[-] page_block.php
[edit]
[-] image_slider.php
[edit]
[-] cform.php
[edit]
[-] progbar.php
[edit]
[-] btn.php
[edit]
[-] product_field.php
[edit]
[-] socials.php
[edit]
[-] cta.php
[edit]
[-] message.php
[edit]
[-] vc_wp_custommenu.php
[edit]
[-] contacts.php
[edit]
[-] post_taxonomy.php
[edit]
[-] flipbox.php
[edit]
[-] grid.php
[edit]
[-] post_comments.php
[edit]
[-] gallery.php
[edit]
[-] sharing.php
[edit]
[-] post_date.php
[edit]
[-] product_ordering.php
[edit]
[-] post_navigation.php
[edit]
[-] add_to_cart.php
[edit]
[-] product_gallery.php
[edit]
[-] gmaps.php
[edit]
[-] vc_tta_tabs.php
[edit]
[-] breadcrumbs.php
[edit]
[-] page_title.php
[edit]
[-] counter.php
[edit]
[-] vc_video.php
[edit]
[-] cart.php
[edit]
[-] post_content.php
[edit]
[-] image.php
[edit]
[-] vc_row_inner.php
[edit]
[-] dropdown.php
[edit]
[-] iconbox.php
[edit]
[-] vc_column.php
[edit]
[-] post_title.php
[edit]
[-] hwrapper.php
[edit]
[-] .elements.php
[edit]
[-] vc_column_text.php
[edit]
[-] additional_menu.php
[edit]
[-] vc_tta_section.php
[edit]
[-] popup.php
[edit]
[-] scroller.php
[edit]
[-] menu.php
[edit]
[-] pricing.php
[edit]
[-] search.php
[edit]
[-] text.php
[edit]
[-] post_author.php
[edit]
[-] vc_row.php
[edit]
[-] itext.php
[edit]
[-] html.php
[edit]