| Server IP : 87.229.120.60 / Your IP : 216.73.216.86 Web Server : Apache System : Linux outside 5.4.8_Algonet_ZeroMAC_0.9.4.8 #6 SMP Mon Feb 3 20:36:07 CET 2020 x86_64 User : server ( 1002) PHP Version : 8.3.20 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/faktorteam/www/wp-content/plugins/apollo13-framework-extensions/shortcodes/ |
Upload File : |
<?php
function a13fe_countdown_render( $atts ) {
$output = $fcolor = $bcolor = $style = $year = $month = $day = $hour = $minute = $el_class = $gap = '';
extract( shortcode_atts( array(
'style' => 'simple',
'year' => '',
'month' => '',
'day' => '',
'hour' => '00',
'minute' => '00',
'fcolor' => '',
'bcolor' => '',
'gap' => '',
'el_class' => ''
), $atts ) );
$gap = ( $gap != '' ? '0 ' . $gap . 'px' : '0' );
$unique_class = 'a13_class_' . rand();
//check for script in theme version < 1.8.0
if(wp_script_is( 'jquery.countdown', 'registered' ) || wp_script_is( 'jquery.countdown', 'enqueued' )){
wp_enqueue_script( 'jquery.countdown' );
}
//check for script in theme version >= 1.8.0
elseif(wp_script_is( 'jquery-countdown', 'registered' ) || wp_script_is( 'jquery-countdown', 'enqueued' )){
wp_enqueue_script( 'jquery-countdown' );
}
$date_str = sprintf( '%s/%s/%s %s:%s:00', $year, $month, $day, $hour, $minute );
$output .= '<style> .' . $unique_class . ' .block{margin:' . $gap . ';color:' . $fcolor . ';background-color:' . $bcolor . ';} </style>';
$output .= '<div class="a13_count_down ' . $unique_class . ' ' . $style . ' ' . $el_class . '" data-style="' . $style . '" data-weeks="' . esc_html__( 'Weeks', 'apollo13-framework-extensions' ) . '" data-days="' . esc_html__( 'Days', 'apollo13-framework-extensions' ) . '" data-hours="' . esc_html__( 'Hours', 'apollo13-framework-extensions' ) . '" data-minutes="' . esc_html__( 'Minutes', 'apollo13-framework-extensions' ) . '" data-seconds="' . esc_html__( 'Seconds', 'apollo13-framework-extensions' ) . '" data-date="' . $date_str . '"></div>';
if ( $style == 'flipping' ) {
$output .= '<script type="text/template" id="main-example-template">';
$output .= '<div class="time <%= label %>" style="margin:' . $gap . ';">';
$output .= '<span class="count curr top"><%= curr %></span>';
$output .= '<span class="count next top"><%= next %></span>';
$output .= '<span class="count next bottom"><%= next %></span>';
$output .= '<span class="count curr bottom"><%= curr %></span>';
$output .= '<span class="label"><%= label %></span>';
$output .= '</div>';
$output .= '</script>';
}
return $output;
}
//@deprecated
add_shortcode( 'a13_countdown', 'a13fe_countdown_render' );
//@since 1.0.8
add_shortcode( 'a13fe_countdown', 'a13fe_countdown_render' );