Changeset 2736901
- Timestamp:
- 06/03/2022 11:17:21 AM (4 years ago)
- Location:
- halloween-countdown/trunk
- Files:
-
- 2 edited
-
halloween-countdown.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
halloween-countdown/trunk/halloween-countdown.php
r2676231 r2736901 6 6 Author: Halloween Blog 7 7 Author URI: https://halloweenlove.com/ 8 Version: 2022 8 Version: 2022.1 9 9 Requires at least: 5.0 10 10 License: https://www.gnu.org/licenses/gpl.html … … 16 16 } 17 17 18 add_action( 'admin_notices', 'hcount_admin_notice' ); 19 function hcount_admin_notice() { 20 $user_id = get_current_user_id(); 21 if ( !get_user_meta( $user_id, 'hcount_notice_dismissed_2' ) && current_user_can( 'manage_options' ) ) 22 echo '<div class="notice notice-info"><p>' . __( '<big><strong>🎃 Happy Halloween!</strong></big> Help support us by <a href="https://halloweenlove.com/donate" class="button-primary" target="_blank">Making a Donation</a>', 'hcount' ) . '<a href="?notice-dismiss" class="alignright">Dismiss</a></p></div>'; 18 add_action( 'admin_notices', 'hcount_notice' ); 19 function hcount_notice() { 20 $user_id = get_current_user_id(); 21 $admin_url = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http' ) . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; 22 $param = ( count( $_GET ) ) ? '&' : '?'; 23 if ( !get_user_meta( $user_id, 'hcount_notice_dismissed_3' ) && current_user_can( 'manage_options' ) ) { 24 echo '<div class="notice notice-info"><p><a href="' . esc_url( $admin_url ), esc_html( $param ) . 'dismiss" class="alignright" style="text-decoration:none"><big>' . esc_html__( 'Ⓧ', 'hcount' ) . '</big></a>' . wp_kses_post( __( '<big><strong>🎃 Happy Halloween!</strong> | </big>', 'hcount' ) ) . 'Help support us by <a href="https://halloweenlove.com/donate" class="button-primary" target="_blank">' . esc_html__( 'Making a Donation', 'hcount' ) . '</a></p></div>'; 25 } 23 26 } 24 27 … … 26 29 function hcount_notice_dismissed() { 27 30 $user_id = get_current_user_id(); 28 if ( isset( $_GET['notice-dismiss'] ) ) 29 add_user_meta( $user_id, 'hcount_notice_dismissed_2', 'true', true ); 31 if ( isset( $_GET['dismiss'] ) ) { 32 add_user_meta( $user_id, 'hcount_notice_dismissed_3', 'true', true ); 33 } 30 34 } 31 35 … … 38 42 function hcount_shortcode() { 39 43 return ' 40 <style>@import url(https://fonts.googleapis.com/css?family=Griffy);#hcount{font-family:"Griffy",georgia,serif;font-size:20px;color:#f57f00;text-align:center;line-height:normal;padding:20px;margin:20px 0;background:#000}#hcount .time{display:inline-block;font-size:40px}#hcount .dur{}#hcount #until{}#hcount #the-day, #hcount #here{font-size:40px}#hcount #the-day{}#hcount #here{}</style>41 <div id="hcount"></div>42 <script>function countdown(e,t,n){theyear=e;themonth=t;theday=n;var r=new Date;var i=r.getYear();if(i<1e3)i+=1900;var s=r.getMonth();var o=r.getDate();var u=r.getHours();var a=r.getMinutes();var f=r.getSeconds();var l=montharray[s]+" "+o+", "+i+" "+u+":"+a+":"+f;futurestring=montharray[t-1]+" "+n+", "+e;dd=Date.parse(futurestring)-Date.parse(l);dday=Math.floor(dd/(60*60*1e3*24)*1);dhour=Math.floor(dd%(60*60*1e3*24)/(60*60*1e3)*1);dmin=Math.floor(dd%(60*60*1e3*24)%(60*60*1e3)/(60*1e3)*1);dsec=Math.floor(dd%(60*60*1e3*24)%(60*60*1e3)%(60*1e3)/1e3*1);if(dday==0&&dhour==0&&dmin==0&&dsec==1){document.getElementById("hcount").innerHTML=current;return}else document.getElementById("hcount").innerHTML="<span class=\"time\">"+dday+"</span> <span class=\"dur\">days</span> <span class=\"time\">"+dhour+"</span> <span class=\"dur\">hours</span> <span class=\"time\">"+dmin+"</span> <span class=\"dur\">minutes</span> <span class=\"time\">"+dsec+"</span> <span class=\"dur\">seconds</span><br /> <span id=\"until\">until</span> "+before;setTimeout("countdown(theyear,themonth,theday)",1e3)}var before="<span id=\"the-day\">Halloween</span>";var current="<span id=\"here\">Happy Halloween!</span>";var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");countdown(2022,10,31)</script>44 <style>@import url(https://fonts.googleapis.com/css?family=Griffy);#hcount{max-width:600px;font-family:"Griffy",georgia,serif;font-size:20px;color:#f57f00;text-align:center;line-height:normal;padding:5%;margin:30px auto;background:#000}#hcount .time{display:inline-block;font-size:40px}#hcount.here{background-color:#f57f00;background:linear-gradient(-45deg, #883ce7, #f57f00, #f6952c, #40d523);background-size:400% 400%;animation:hgradient 15s ease infinite}@keyframes hgradient{0%{background-position:0% 50%}50%{background-position:100% 50%;}100%{background-position:0% 50%}}#hcount .happy-halloween{color:#000;animation:hfade linear 1.5s}@keyframes hfade{0%{font-size:0;opacity:0}70%{font-size:50px;opacity:1}80%{font-size:40px}90%{font-size:45px}100%{font-size:40px}}</style> 45 <div id="hcount"></div> 46 <script>var countDownDate=new Date("Oct 31, 2022 00:00:00").getTime();var x=setInterval(function(){var now=new Date().getTime();var distance=countDownDate-now;var days=Math.floor(distance/(1000*60*60*24));var hours=Math.floor((distance%(1000*60*60*24))/(1000*60*60));var minutes=Math.floor((distance%(1000*60*60))/(1000*60));var seconds=Math.floor((distance%(1000*60))/1000);document.getElementById("hcount").innerHTML="<span class=\"time days\">"+days+"</span><span class=\"duration days\">days</span> <span class=\"time hours\">"+hours+"</span><span class=\"duration hours\">hours</span> <span class=\"time minutes\">"+minutes+"</span><span class=\"duration minutes\">minutes</span> <span class=\"time seconds\">"+seconds+"</span><span class=\"duration seconds\">seconds</span><br /><span class=\"duration until\">until</span> <span class=\"time halloween\">Halloween</span>";if(distance<0){clearInterval(x);var d=document.getElementById("hcount");d.className+="here";document.getElementById("hcount").innerHTML="<span class=\"time happy-halloween\">Happy Halloween!</span>"}},1000);</script> 43 47 '; 44 48 } -
halloween-countdown/trunk/readme.txt
r2676231 r2736901 6 6 Tags: halloween, countdown 7 7 Requires at least: 5.0 8 Tested up to: 5.99 Stable tag: 2022 8 Tested up to: 6.0 9 Stable tag: 2022.1 10 10 License: GPL 11 11 License URI: https://www.gnu.org/licenses/gpl.html
Note: See TracChangeset
for help on using the changeset viewer.