WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Easy Timer] How to format a timer’s title?

[Plugin: Easy Timer] How to format a timer’s title?

Viewing 1 replies (of 1 total)
  • You can insert this line:

    $T = date('d/m/Y H:i:s', $T);

    in the easy-timer.php file just before:

    $content = str_ireplace('[timer]', '<span class="dhmscount'.$way.'" title="'.$T.'">'.$stringDhms.'</span>', $content);

    But the reactualization will not work and to solve this problem, you will have to edit the easy-timer.js file or remove this line:

    add_action('wp_footer', 'easy_timer_js');

    in the easy-timer.php file.

    In fact, the timer’s title is only an information for the easy-timer.js file. The easy-timer.js file calculates the difference between event timestamp (the timer’s title) and actual timestamp to know the remaining/elapsed time:

    function dhmstimer_decrease(el) {
    var T = Math.round(((new Date()).getTime())/1000);
    var S = dhmscountdown[el].title - T;
    if (S == 0) { window.location.reload(); }
    dhmscountdown[el].innerHTML = timer(S, 'dhms'); }

    For your visitors, it’s not an important visual detail and the majority of them will never realize that your timers have a title attribute.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Easy Timer] How to format a timer’s title?’ is closed to new replies.
Skip to toolbar