From 21d5c0d3a33e8b21527f990935b68dd8dd0ecf42 Mon Sep 17 00:00:00 2001 From: zlax Date: Mon, 2 Feb 2026 01:21:07 +0300 Subject: [PATCH] version 3.5 --- ddatefunc.php | 70 +++++++++++++++++++++++++++++++++++++-------------- readme.txt | 12 ++++++--- 2 files changed, 60 insertions(+), 22 deletions(-) diff --git a/ddatefunc.php b/ddatefunc.php index 64cd176..c8b146b 100644 --- a/ddatefunc.php +++ b/ddatefunc.php @@ -1,11 +1,11 @@ 'discordian_date_func', 'description' => 'Display the current date according to the Discordian Calendar.'); + function __construct() { + $widget_ops = array('classname' => 'discordian_date_func', 'name' => 'Discordian Date Widget', 'description' => 'Display the current date according to the Discordian Calendar.'); $control_ops = array('width' => 200, 'height' => 120); - $this->WP_Widget('discordian_date_func', 'Discordian Date Widget', $widget_ops, $control_ops); + parent::__construct( 'Discordian_Date_Widget', 'Discordian Date Widget', $widget_ops ); } function widget($args, $instance) { @@ -280,7 +290,7 @@ class Discordian_Date_Widget extends WP_Widget { extract($args); $title = $instance['title']; - $body = apply_filters('widget_text', $instance['body']); + $body = apply_filters('widget_text', isset($instance['body'])); ob_start(); echo "
"; @@ -292,7 +302,7 @@ class Discordian_Date_Widget extends WP_Widget { echo "

"; } echo "Today is "; - echo get_ddate($content, $format, "now")."."; + echo get_ddate(isset($content), isset($format), "now")."."; if ($holiday) echo "
".$holiday.""; echo "
"; $body2 = ob_get_contents(); @@ -309,7 +319,7 @@ class Discordian_Date_Widget extends WP_Widget { } function form($instance) { - $title = $instance['title']; + $title = isset($instance['title']); $title_id = $this->get_field_id('title'); $title_name = $this->get_field_name('title'); ?> @@ -382,6 +392,10 @@ function ddatefunc_admin() { update_option('dtime_widgetsec', "1"); else update_option('dtime_widgetsec', "0"); + if (isset($_POST['ee_widget_checkbox'])) + update_option('ee_widget', "1"); + else + update_option('ee_widget', "0"); echo '

'.__('Settings saved.').'

'; } ?> @@ -396,8 +410,10 @@ function ddatefunc_admin() { Legend: +%EY - Erisian era year (example: 180)
%DY - Discordian yold (example: 3180)
-%DS - Erisian season name (example: Chaos)
+%DS - Discordian season name (example: Chaos)
+%ES - Erisian season number (example: 1)
%DD - Discordian season day (example: 5th)
%DC - Clear erisian day number (example: 5)
%DW - Discordian week day (example: Setting Orange)
@@ -406,15 +422,17 @@ function ddatefunc_admin() { %GN - Gregorian month number (example: 1)
%GD - Gregorian month day (example: 5)
%GW - Gregorian weekday (example: Friday)
-%DT - Discordian (decimal) time (example: 5:67)
-%CT - Christian time (example: 23:00)
-%UT - Unix time (example: 1555222555)
+%DT - Erisian (decimal) time (example: 5:67)
+%CT - Christian time (example: 18:37)
+%UT - Unix time (example: 1388947033)

Examples

-%DW, the %DD day of %DS, in the yold %DY
returns:
Setting Orange, the 5th day of Chaos, in the yold 3180
+%EY.%ES.%DC %DT ee (unittime: %UT) (returns: 180.1.5 5:67 ee (unixtime: 1388947033))

-%DC %DS, %DY (%GN.%GN.%GY)
returns:
5 Chaos, 3180 (5.1.2014)
+%DW, the %DD day of %DS, in the yold %DY (returns: Setting Orange, the 5th day of Chaos, in the yold 3180)
+
+%DC %DS, %DY (%GN.%GN.%GY) (returns: 5 Chaos, 3180 (5.1.2014))
@@ -482,6 +500,19 @@ Examples
+ + Use the erisian era in the widget: + +
+ + Erisian era + + +
+ +
@@ -507,6 +538,7 @@ function ddatefunc_deinstall() { delete_option('dtime_convert'); delete_option('dtime_widget'); delete_option('dtime_widgetsec'); + delete_option('ee_widget'); } function ddatefunc_init() { @@ -521,7 +553,7 @@ add_option('dtimefunc_change', '1'); add_option('dtime_convert', '1'); add_option('dtime_widget', '1'); add_option('dtime_widgetsec', '1'); - +add_option('ee_widget', '1'); add_filter('plugin_action_links', 'ddatefunc_settings', 10, 2); add_action('admin_menu', 'ddatefunc_add_admin'); diff --git a/readme.txt b/readme.txt index 3e594fb..8a5da45 100644 --- a/readme.txt +++ b/readme.txt @@ -1,9 +1,9 @@ === Discordian Date Function === Contributors: zlaxyi -Donate link: https://is3.soundragon.su/discordian-date-function +Donate link: https://is3.ussr.win/discordian-date-function Tags: date, time, discordian, erisian, widget, eris, discordia, calendar, ddate, dtime Requires at least: 2.0 -Tested up to: 6.6 +Tested up to: 7.0 Stable tag: trunk License: DWTWL 2.55 License URI: https://soundragon.su/license/license.html @@ -33,7 +33,7 @@ Also you can add the shortcode [today_ddate] in posts or pages for show the Disc = Do you have any questions? = -Feel free to ask any questions about this plugin at the [Discordian Date Function plugin web page](https://is3.soundragon.su/discordian-date-function/). +Feel free to ask any questions about this plugin at the [Discordian Date Function plugin web page](https://is3.ussr.win/discordian-date-function/). == Screenshots == @@ -41,6 +41,12 @@ Feel free to ask any questions about this plugin at the [Discordian Date Functio == Changelog == += 3.5 = +*Release Date - 32th day of Chaos 3192* + +* Add Erisian era year +* php8 and wp7 fixes + = 2.5555 = *Release Date - 17th day of Confusion 3190*