Changeset 1452174
- Timestamp:
- 07/10/2016 04:40:05 PM (10 years ago)
- File:
-
- 1 edited
-
countdown-flipclock/trunk/FlipClock.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
countdown-flipclock/trunk/FlipClock.php
r1435262 r1452174 6 6 Author: Bluelevel 7 7 Author URI: http://www.bluelevel.in 8 version: 2. 08 version: 2.5 9 9 */ 10 10 function clock_files(){ … … 37 37 $font = get_post_meta($id, "my_meta_box_select", true); 38 38 $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); 42 if($mnth == '01'){ 43 $mnth2 = 'January'; 44 } 45 elseif($mnth == '02'){ 46 $mnth2 = 'February'; 47 48 } 49 elseif($mnth == '03'){ 50 $mnth2 = 'March'; 51 52 } 53 elseif($mnth == '04'){ 54 $mnth2 = 'April'; 55 56 } 57 elseif($mnth == '05'){ 58 $mnth2 = 'May'; 59 60 } 61 elseif($mnth == '06'){ 62 $mnth2 = 'June'; 63 } 64 elseif($mnth == '07'){ 65 $mnth2 = 'July'; 66 } 67 elseif($mnth == '08'){ 68 $mnth2 = 'August'; 69 70 } 71 elseif($mnth == '09'){ 72 $mnth2 = 'September'; 73 74 } 75 elseif($mnth == '10'){ 76 $mnth2 = 'October'; 77 78 } 79 elseif($mnth == '11'){ 80 $mnth2 = 'November'; 81 82 } 83 elseif($mnth == '12'){ 84 $mnth2 = 'December'; 85 86 } 39 87 return'<style>.flip-clock-wrapper ul li a div div.inn{color:'.$color.';background-color:'.$bgcolor.';font-family:'.$font.'}.flip-clock-dot{background-color:'.$bgcolor.'} 40 88 </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>'; 42 119 } 43 120 add_shortcode('FlipClock', 'clock_shortcode'); … … 129 206 <option value="Dg7" <?php selected( $selected, 'Dg7' ); ?> style="font-family: Dg7">Digital 7</option> 130 207 <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> 131 211 </select> 132 212 </p>
Note: See TracChangeset
for help on using the changeset viewer.