7 Commits

Author SHA1 Message Date
4ea02f909d add 3 holidays, widget tib's day shift fix 2020-03-13 09:10:29 +01:00
0fa6636b0e Update 'readme.txt' 2020-03-01 13:27:35 +01:00
fbed282ae1 remove obsoleted part of code 2020-03-01 15:24:45 +03:00
f32e9d7fdd Update 'readme.txt' 2020-03-01 10:59:50 +01:00
b23f60ca66 version 0.555 2020-03-01 12:47:54 +03:00
1ec1203a26 version 0.555 2020-03-01 12:46:42 +03:00
9bd12fb4d3 php warning fix
"PHP Warning:  Missing argument 2" fix in 259 and 262 strings
2019-08-04 22:00:05 +00:00
3 changed files with 54 additions and 38 deletions

View File

@@ -1,6 +1,6 @@
Discordian Date Function Discordian Date Function
under DWTWL 2.5 license: https://soundragon.su/license/license.html under DWTWL 2.55 license: https://soundragon.su/license/license.html
https://wordpress.org/plugins/discordian-date-function/ https://wordpress.org/plugins/discordian-date-function/
@@ -8,6 +8,6 @@ This plugin allows WordPress to easily show Erisian dates instead of the standar
This functional based on the Discordian Date plugin by Dan Johnson. This functional based on the Discordian Date plugin by Dan Johnson.
Also provides a widget which displays the current date according to the Discordian calendar, with notification of 70 holydays. Also provides a widget which displays the current date according to the Discordian calendar, with notification of more than 70 holydays.
And you can add the shortcode [todаy_ddate] in posts or pages for show the Discordian date of today. And you can add the shortcode [todаy_ddate] in posts or pages for show the Discordian date of today.

View File

@@ -3,7 +3,7 @@
Plugin Name: Discordian Date Function Plugin Name: Discordian Date Function
Plugin URI: https://is3.soundragon.su/discordian-date-function Plugin URI: https://is3.soundragon.su/discordian-date-function
Description: Convert dates in Wordpress to customizable Discordian dates. Also, this plugin provides shortcode and widget used to display the current erisian date with notification of 70 holydays. Based on the Discordian Date plugin by Dan Johnson. Description: Convert dates in Wordpress to customizable Discordian dates. Also, this plugin provides shortcode and widget used to display the current erisian date with notification of 70 holydays. Based on the Discordian Date plugin by Dan Johnson.
Version: 0.55 Version: 0.555
Author: ivan zlax Author: ivan zlax
Author URI: https://is3.soundragon.su/about Author URI: https://is3.soundragon.su/about
*/ */
@@ -31,7 +31,13 @@ function get_ddate($content, $format = "", $originalRequest = null) {
} }
$dyear=$standard_date["year"]+1166; $dyear=$standard_date["year"]+1166;
$gyear=$standard_date["year"];
$yday=$standard_date["yday"]; $yday=$standard_date["yday"];
// Check Tib's day according to Gregorian calendar
if ($gyear%4==0&&$gyear%100!=0 || $gyear%400==0) {
if ($standard_date["yday"]==59) $sttib="St. Tib's";
if ($standard_date["yday"]>59) $yday=$standard_date["yday"]-1;
}
$mon=$standard_date["mon"]; $mon=$standard_date["mon"];
$mday=$standard_date["mday"]; $mday=$standard_date["mday"];
$dseason=(int)($yday/73); $dseason=(int)($yday/73);
@@ -58,6 +64,7 @@ function get_ddate($content, $format = "", $originalRequest = null) {
if ($originalRequest == "now") { if ($originalRequest == "now") {
$ddate=$dweekday.", the ".$dday." day of ".$name_season.", in the yold ".$dyear; $ddate=$dweekday.", the ".$dday." day of ".$name_season.", in the yold ".$dyear;
if (isset($sttib)) $ddate=$sttib." day, in the yold ".$dyear;
} else { } else {
$patterns = array(); $patterns = array();
$patterns[0] = '%DY'; $patterns[0] = '%DY';
@@ -75,6 +82,10 @@ function get_ddate($content, $format = "", $originalRequest = null) {
$replacements[1] = $name_season; $replacements[1] = $name_season;
$replacements[2] = $dday; $replacements[2] = $dday;
$replacements[3] = $clear_dday; $replacements[3] = $clear_dday;
if (isset($sttib)) {
$replacements[2] = $sttib;
$replacements[3] = "tib";
}
$replacements[4] = $dweekday; $replacements[4] = $dweekday;
$replacements[5] = $standard_date["year"]; $replacements[5] = $standard_date["year"];
$replacements[6] = $standard_date["month"]; $replacements[6] = $standard_date["month"];
@@ -101,6 +112,8 @@ class Discordian_Date_Widget extends WP_Widget {
$mon=$now["mon"]; $mon=$now["mon"];
$mday=$now["mday"]; $mday=$now["mday"];
$dseason=(int)($yday/73); $dseason=(int)($yday/73);
if ($now["year"]%4==0&&$now["year"]%100!=0 || $now["year"]%400==0)
if ($now["yday"]>59) $yday=$now["yday"]-1;
$dday=($yday-(73*$dseason))+1; $dday=($yday-(73*$dseason))+1;
$a_holiday=array("Mungday", "Mojoday", "Syaday", "Zaraday", "Maladay"); $a_holiday=array("Mungday", "Mojoday", "Syaday", "Zaraday", "Maladay");
$s_holiday=array("Chaoflux", "Discoflux", "Confuflux", "Bureflux", "Afflux"); $s_holiday=array("Chaoflux", "Discoflux", "Confuflux", "Bureflux", "Afflux");
@@ -111,28 +124,24 @@ class Discordian_Date_Widget extends WP_Widget {
if ($dday==5) { if ($dday==5) {
$holyday = " Celebrate Apostle Day, ".$a_holiday[$dseason]."."; $holyday = " Celebrate Apostle Day, ".$a_holiday[$dseason].".";
} elseif ($dday==50) {
$holyday = " Celebrate Flux Day, ".$s_holiday[$dseason].".";
} elseif ($mon==2 && $mday==29) {
$holyday = " Celebrate St. Tib's Day.";
} elseif ($dseason==2 && $dday==28) {
$holyday = " Celebrate St. Georges Day.";
} elseif ($dseason==2 && $dday==57) {
$holyday = " Celebrate John Dillinger Day.";
} elseif ($dseason==4 && $dday==65) {
$holyday = " Celebrate Circlemas.";
} elseif ($dday==23) { } elseif ($dday==23) {
$holyday = " Celebrate Synaptyclypse Day, ".$m_holiday[$dseason]."."; $holyday = " Celebrate Synaptyclypse Day, ".$m_holiday[$dseason].".";
} elseif ($dday==27) { } elseif ($dday==27) {
$holyday = " Celebrate Sloth Day, ".$t_holiday[$dseason]."."; $holyday = " Celebrate Sloth Day, ".$t_holiday[$dseason].".";
} elseif ($dday==50) {
$holyday = " Celebrate Flux Day, ".$s_holiday[$dseason].".";
} elseif ($dday==73) { } elseif ($dday==73) {
$holyday = " Celebrate Eye Day, ".$e_holiday[$dseason]."."; $holyday = " Celebrate Eye Day, ".$e_holiday[$dseason].".";
} elseif ($mon==2 && $mday==29) {
$holyday = " Celebrate St. Tib's Day.";
} elseif ($dseason==0 && $dday==8) { } elseif ($dseason==0 && $dday==8) {
$holyday = " Celebrate Death of Emperor Norton."; $holyday = " Celebrate Death of Emperor Norton.";
} elseif ($dseason==0 && $dday==10) { } elseif ($dseason==0 && $dday==10) {
$holyday = " Celebrate Backwards Day, Reformed / Binary Day."; $holyday = " Celebrate Backwards/Binary Day.";
} elseif ($dseason==0 && $dday==11) { } elseif ($dseason==0 && $dday==11) {
$holyday = " Celebrate RAW Day."; $holyday = " Celebrate RAW Day.";
} elseif ($dseason==0 && $dday==14) {
$holyday = " Celebrate Golden Apple Presentation Day.";
} elseif ($dseason==0 && $dday==17) { } elseif ($dseason==0 && $dday==17) {
$holyday = " Celebrate Joshmas."; $holyday = " Celebrate Joshmas.";
} elseif ($dseason==0 && $dday==18) { } elseif ($dseason==0 && $dday==18) {
@@ -156,11 +165,9 @@ class Discordian_Date_Widget extends WP_Widget {
} elseif ($dseason==1 && $dday==11) { } elseif ($dseason==1 && $dday==11) {
$holyday = " Celebrate Discordians for Jesus/Love Your Neighbor Day."; $holyday = " Celebrate Discordians for Jesus/Love Your Neighbor Day.";
} elseif ($dseason==1 && $dday==18) { } elseif ($dseason==1 && $dday==18) {
$holyday = " Celebrate April Fools Day."; $holyday = " Celebrate Fools Day.";
} elseif ($dseason==1 && $dday==19) { } elseif ($dseason==1 && $dday==19) {
$holyday = " Celebrate St John the Blasphemists Day."; $holyday = " Celebrate St. John the Blasphemists Day.";
} elseif ($dseason==1 && $dday==23) {
$holyday = " Celebrate Jake Day.";
} elseif ($dseason==1 && $dday==34) { } elseif ($dseason==1 && $dday==34) {
$holyday = " Celebrate Omarmas."; $holyday = " Celebrate Omarmas.";
} elseif ($dseason==1 && $dday==43) { } elseif ($dseason==1 && $dday==43) {
@@ -173,20 +180,30 @@ class Discordian_Date_Widget extends WP_Widget {
$holyday = " Celebrate Towel Day."; $holyday = " Celebrate Towel Day.";
} elseif ($dseason==2 && $dday==26) { } elseif ($dseason==2 && $dday==26) {
$holyday = " Celebrate Imaginary Friend/Captain Tuttle Day."; $holyday = " Celebrate Imaginary Friend/Captain Tuttle Day.";
} elseif ($dseason==2 && $dday==28) {
$holyday = " Celebrate St. Georges Day.";
} elseif ($dseason==2 && $dday==30) {
$holyday = " Celebrate Zoog Day.";
} elseif ($dseason==2 && $dday==36) {
$holyday = " Celebrate June 31st for Popes.";
} elseif ($dseason==2 && $dday==37) { } elseif ($dseason==2 && $dday==37) {
$holyday = " Celebrate Mid-Years Day."; $holyday = " Celebrate Mid-Years Day.";
} elseif ($dseason==2 && $dday==40) { } elseif ($dseason==2 && $dday==40) {
$holyday = " Celebrate X-Day."; $holyday = " Celebrate X-Day.";
} elseif ($dseason==2 && $dday==55) { } elseif ($dseason==2 && $dday==55) {
$holyday = " Celebrate Mal-2 Day."; $holyday = " Celebrate Mal-2 Day.";
} elseif ($dseason==2 && $dday==57) {
$holyday = " Celebrate John Dillinger Day.";
} elseif ($dseason==3 && $dday==3) { } elseif ($dseason==3 && $dday==3) {
$holyday = " Celebrate Multiversal Underwear Day."; $holyday = " Celebrate Multiversal Underwear Day.";
} elseif ($dseason==3 && $dday==18) { } elseif ($dseason==3 && $dday==18) {
$holyday = " Celebrate Festival of Hanky-Panky Spankies."; $holyday = " Celebrate Festival of Hanky-Panky Spankies.";
} elseif ($dseason==3 && $dday==33) { } elseif ($dseason==3 && $dday==33) {
$holyday = " Celebrate Cat Dancing & Foot Fetish Day aka Pussyfoot Day."; $holyday = " Celebrate Cat Dancing & Pussyfoot Day.";
} elseif ($dseason==3 && $dday==37) { } elseif ($dseason==3 && $dday==37) {
$holyday = " Celebrate Mass of Planet Eris/Eristotle."; $holyday = " Celebrate Mass of Planet Eris/Eristotle.";
} elseif ($dseason==3 && $dday==39) {
$holyday = " Celebrate St. Mammes's Day.";
} elseif ($dseason==3 && $dday==41) { } elseif ($dseason==3 && $dday==41) {
$holyday = " Celebrate Emperor Norton Proclamation Day."; $holyday = " Celebrate Emperor Norton Proclamation Day.";
} elseif ($dseason==3 && $dday==57) { } elseif ($dseason==3 && $dday==57) {
@@ -205,25 +222,18 @@ class Discordian_Date_Widget extends WP_Widget {
$holyday = " Celebrate 537 Day, sometimes Turkey Day."; $holyday = " Celebrate 537 Day, sometimes Turkey Day.";
} elseif ($dseason==4 && $dday==40) { } elseif ($dseason==4 && $dday==40) {
$holyday = " Celebrate Omars Day."; $holyday = " Celebrate Omars Day.";
} elseif ($dseason==4 && $dday==43) {
$holyday = " Celebrate Day D.";
} elseif ($dseason==4 && $dday==46) { } elseif ($dseason==4 && $dday==46) {
$holyday = " Celebrate Hug Day II."; $holyday = " Celebrate Hug Day II.";
} elseif ($dseason==4 && $dday==67) { } elseif ($dseason==4 && $dday==65) {
$holyday = " Celebrate Santa Claus Day."; $holyday = " Celebrate Circlemas.";
} elseif ($dseason==4 && $dday==72) {
$holyday = " Celebrate New Years Eve Eve.";
} }
extract($args); extract($args);
$title = $instance['title']; $title = $instance['title'];
$body = apply_filters('widget_text', $instance['body']); $body = apply_filters('widget_text', $instance['body']);
if (!empty($title)) {
ob_start();
eval(" ?>$title<?php ");
$title2 = ob_get_contents();
ob_end_clean();
}
ob_start(); ob_start();
echo "<div class=\"discordian_date_func\" style=\"width:100%;text-align:center;font-size:18px;line-height:36px;padding-top:40px;padding-bottom:40px;\"> Today is "; echo "<div class=\"discordian_date_func\" style=\"width:100%;text-align:center;font-size:18px;line-height:36px;padding-top:40px;padding-bottom:40px;\"> Today is ";
echo get_ddate($content, $format, "now")."."; echo get_ddate($content, $format, "now").".";
@@ -256,10 +266,10 @@ class Discordian_Date_Widget extends WP_Widget {
} }
} }
function get_the_ddate_post($content, $format) { function get_the_ddate_post($content, $format = null) {
return get_ddate($content, $format, "get_the_date"); } return get_ddate($content, $format, "get_the_date"); }
function get_the_ddate_comment($content, $format) { function get_the_ddate_comment($content, $format = null) {
return get_ddate($content, $format, "get_comment_date"); } return get_ddate($content, $format, "get_comment_date"); }
function register_ddatefunc_widget() { function register_ddatefunc_widget() {

View File

@@ -1,14 +1,14 @@
=== Discordian Date Function === === Discordian Date Function ===
Contributors: zlaxyi Contributors: zlaxyi
Donate link: https://is3.soundragon.su/discordian-date-function Donate link: https://is3.soundragon.su/discordian-date-function
Tags: date, discordian, erisian, widget Tags: date, discordian, erisian, widget, eris, discordia, calendar
Requires at least: 2.0 Requires at least: 2.0
Tested up to: 4.7.3 Tested up to: 5.3.2
Stable tag: trunk Stable tag: trunk
License: DWTWL 2.5 License: DWTWL 2.55
License URI: https://soundragon.su/license/license.html License URI: https://soundragon.su/license/license.html
This plugin provides Discordian dates in Wordpress. This plugin provides Erisian (Discordian) dates in Wordpress.
Also provides shortcode and widget which displays the current date according to the Discordian calendar, with notification of 70 holydays. Also provides shortcode and widget which displays the current date according to the Discordian calendar, with notification of 70 holydays.
== Description == == Description ==
@@ -41,6 +41,12 @@ Feel free to ask any questions about this plugin at the [Discordian Date Functio
== Changelog == == Changelog ==
= 0.555 =
*Release Date - 60th day of Chaos, 3186*
* Fixed Tib's day shift according Gregorian calendar's leap year.
* Add St. Mammes's day, fixed some other holiday strings.
= 0.55 = = 0.55 =
*Release Date - 5th day of Discord, 3183* *Release Date - 5th day of Discord, 3183*
@@ -55,5 +61,5 @@ Feel free to ask any questions about this plugin at the [Discordian Date Functio
== Upgrade Notice == == Upgrade Notice ==
= 0.55 = = 0.555 =
This version is actual. This version is actual.