Plugin Directory

Changeset 1452174


Ignore:
Timestamp:
07/10/2016 04:40:05 PM (10 years ago)
Author:
bluelevel
Message:

adding version 2.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • countdown-flipclock/trunk/FlipClock.php

    r1435262 r1452174  
    66Author: Bluelevel
    77Author URI: http://www.bluelevel.in
    8 version: 2.0
     8version: 2.5
    99*/
    1010function clock_files(){
     
    3737$font = get_post_meta($id, "my_meta_box_select", true);
    3838$date = get_post_meta($id, "my_meta_box_text", true);
     39$day = substr($date, 0, 2);
     40$mnth = substr($date, 3, 2);
     41$yr = substr($date, 6, 11);
     42if($mnth == '01'){
     43    $mnth2 = 'January';
     44}
     45elseif($mnth == '02'){
     46    $mnth2 = 'February';
     47 
     48}
     49elseif($mnth == '03'){
     50    $mnth2 = 'March';
     51 
     52}
     53elseif($mnth == '04'){
     54    $mnth2 = 'April';
     55
     56}
     57elseif($mnth == '05'){
     58    $mnth2 = 'May';
     59 
     60}
     61elseif($mnth == '06'){
     62    $mnth2 = 'June';
     63}
     64elseif($mnth == '07'){
     65    $mnth2 = 'July';
     66}
     67elseif($mnth == '08'){
     68    $mnth2 = 'August';
     69 
     70}
     71elseif($mnth == '09'){
     72    $mnth2 = 'September';
     73 
     74}
     75elseif($mnth == '10'){
     76    $mnth2 = 'October';
     77 
     78}
     79elseif($mnth == '11'){
     80    $mnth2 = 'November';
     81 
     82}
     83elseif($mnth == '12'){
     84    $mnth2 = 'December';
     85
     86}
    3987return'<style>.flip-clock-wrapper ul li a div div.inn{color:'.$color.';background-color:'.$bgcolor.';font-family:'.$font.'}.flip-clock-dot{background-color:'.$bgcolor.'}
    4088</style><div class="clock'.$title.'" style="margin:2em;"></div>
    41 <script type="text/javascript">!function(e){var t;e(document).ready(function(){var c=new Date,n=new Date(c.getFullYear()+".$date."),a=n.getTime()/1e3-c.getTime()/1e3;t=e(".clock'.$title.'").FlipClock(a,{clockFace:"DailyCounter",countdown:!0})})}(jQuery);</script>';
     89<script type="text/javascript">!function($){
     90       
     91        $(document).ready(function() {
     92                            var futureDate  = new Date("'.$mnth2.' '.$day.', '.$yr.'");
     93                var currentDate = new Date();
     94
     95                // Calculate the difference in seconds between the future and current date
     96                var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000;
     97
     98                // Calculate day difference and apply class to .clock for extra digit styling.
     99                function dayDiff(first, second) {
     100                    return (second-first)/(1000*60*60*24);
     101                }
     102
     103                if (dayDiff(currentDate, futureDate) < 100) {
     104                    $(".clock").addClass("twoDayDigits");
     105                } else {
     106                    $(".clock").addClass("threeDayDigits");
     107                }
     108
     109                if(diff < 0) {
     110                    diff = 0;
     111                }
     112
     113                // Instantiate a coutdown FlipClock
     114                clock = $(".clock'.$title.'").FlipClock(diff, {
     115                    clockFace: "DailyCounter",
     116                    countdown: true
     117                });
     118})}(jQuery);</script>';
    42119}
    43120add_shortcode('FlipClock', 'clock_shortcode');
     
    129206            <option value="Dg7" <?php selected( $selected, 'Dg7' ); ?> style="font-family: Dg7">Digital 7</option>
    130207            <option value="Gr" <?php selected( $selected, 'Gr' ); ?> style="font-family: Gr">Glamor</option>
     208            <option value="an" <?php selected( $selected, 'an' ); ?> style="font-family: Gr">Anana</option>
     209            <option value="nsp" <?php selected( $selected, 'nsp' ); ?> style="font-family: Gr">None Shall Pass</option>
     210            <option value="spst" <?php selected( $selected, 'spst' ); ?> style="font-family: Gr">Superstar</option>
    131211        </select>
    132212    </p>
Note: See TracChangeset for help on using the changeset viewer.