{"id":11568,"date":"2010-01-09T03:21:53","date_gmt":"2010-01-09T03:21:53","guid":{"rendered":""},"modified":"2016-08-01T22:17:56","modified_gmt":"2016-08-01T22:17:56","slug":"%d0%bf%d0%bb%d0%b0%d0%b3%d0%b8%d0%bd-born-on-this-day-%d0%bf%d0%be%d0%bc%d0%b5%d0%bd%d1%8f%d1%82%d1%8c-%d0%bc%d0%b5%d1%81%d1%82%d0%b0%d0%bc%d0%b8-%d0%b4%d0%b0%d1%82%d1%83-%d0%b8-%d0%b8%d0%bc%d1%8f","status":"closed","type":"topic","link":"https:\/\/ru.wordpress.org\/support\/topic\/%d0%bf%d0%bb%d0%b0%d0%b3%d0%b8%d0%bd-born-on-this-day-%d0%bf%d0%be%d0%bc%d0%b5%d0%bd%d1%8f%d1%82%d1%8c-%d0%bc%d0%b5%d1%81%d1%82%d0%b0%d0%bc%d0%b8-%d0%b4%d0%b0%d1%82%d1%83-%d0%b8-%d0%b8%d0%bc%d1%8f\/","title":{"rendered":"[\u041f\u043b\u0430\u0433\u0438\u043d: Born On This Day] \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0434\u0430\u0442\u0443 \u0438 \u0438\u043c\u044f   \u0444\u043e\u0440\u043c\u0430\u0442"},"content":{"rendered":"<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0441 \u0430\u0432\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u043c\u043e\u0449\u0438 \u0443 \u0432\u0430\u0441:<br \/>\n\u043f\u043b\u0430\u0433\u0438\u043d &#8212; https:\/\/wordpress.org\/extend\/plugins\/born-on-this-day\/<br \/>\n\u043f\u043e\u043c\u043e\u0433\u0438\u0442\u0435 \u043f\u0436\u043b\u0441\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c:<br \/>\n\u0430) \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u0442\u044b \u043d\u0430 &#8212; (\u0434\u0434.\u043c\u043c.\u0433\u0433\u0433\u0433)<br \/>\n\u0431) \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0430 &#8212; \u0438\u043c\u044f (\u0434\u0430\u0442\u0430)<br \/>\n\u0438\u0442\u043e\u0433\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440) &#8212; <strong>Anton Rodgers (10.01.1933)<\/strong><\/p>\n<p>\u0432\u043e\u0442 \u043a\u043e\u0434 \u0441\u0430\u043c\u043e\u0433\u043e \/wp-content\/plugins\/born-on-this-day\/born-on-this-day.php<\/p>\n<pre><code>&lt;?php\n\n\/*\n *\n *\tPlugin Name: Born On This Day\n *\tPlugin URI: http:\/\/www.joeswebtools.com\/wordpress-plugins\/born-on-this-day\/\n *\tDescription: Adds a sidebar widget that display famous people born on this day in history.\n *\tVersion: 2.0\n *\tAuthor: Joe&#039;s Web Tools\n *\tAuthor URI: http:\/\/www.joeswebtools.com\/\n *\n *\tCopyright (c) 2009 Joe&#039;s Web Tools. All Rights Reserved.\n *\n *\tThis program is free software; you can redistribute it and\/or modify\n *\tit under the terms of the GNU General Public License as published by\n *\tthe Free Software Foundation; either version 2 of the License, or\n *\t(at your option) any later version.\n *\n *\tThis program is distributed in the hope that it will be useful,\n *\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n *\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n *\tGNU General Public License for more details.\n *\n *\tYou should have received a copy of the GNU General Public License\n *\talong with this program; if not, write to the Free Software\n *\tFoundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n *\n *\tIf you are unable to comply with the terms of this license,\n *\tcontact the copyright holder for a commercial license.\n *\n *\tWe kindly ask that you keep links to Joe&#039;s Web Tools so\n *\tother people can find out about this plugin.\n *\n *\/\n\n\/*\n *\n *\tborn_on_this_day_shortcode_handler\n *\n *\/\n\nfunction born_on_this_day_shortcode_handler($atts, $content = nul) {\n\n\t\/\/ Load language file\n\t$current_locale = get_locale();\n\tif(!empty($current_locale)) {\n\t\t$mo_file = dirname(__FILE__) . &#039;\/languages\/born-on-this-day-&#039; . $current_locale . &quot;.mo&quot;;\n\t\tif(@file_exists($mo_file) &amp;&amp; is_readable($mo_file)) {\n\t\t\tload_textdomain(&#039;born-on-this-day&#039;, $mo_file);\n\t\t}\n\t}\n\n\t\/\/ Prepare the date\n\t$current_date = date_i18n(get_option(&#039;date_format&#039;), strtotime(&#039;now&#039;));\n\t$current_date = &#039;&lt;strong&gt;&#039; . $current_date . &#039;&lt;\/strong&gt;&lt;br \/&gt;&#039;;\n\n\t\/\/ Prepare the people\n\t$month_array = file(dirname(__FILE__) . &#039;\/data\/&#039; . date(&#039;n&#039;) . &#039;.dat&#039;);\n\t$day = date(&#039;j&#039;);\n\t$day_line = $month_array[$day + 3];\n\t$day_array = explode(&#039;&lt;month&gt;&#039;, $day_line);\n\t$people_array = explode(&#039;&lt;name&gt;&#039;, $day_array[1]);\n\tfor($i = 0; $i &lt; sizeof($people_array); $i++) {\n\t\t$person_array = explode(&#039;&lt;year&gt;&#039;, $people_array[$i]);\n\t\t$people .= $person_array[0] . &#039; &#039; . $person_array[1] . &#039;&lt;br \/&gt;&#039;;\n\t}\n\n\t\/\/ Display\n\t$content = &#039;&lt;table style=&quot;border-width: thin thin thin thin; border-style: solid solid solid solid;&quot;&gt;&#039;;\n\t$content .= &#039;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;center&gt;&lt;font face=&quot;arial&quot; size=&quot;+1&quot;&gt;&lt;b&gt;&#039; . __(&#039;Born on this day&#039;, &#039;born-on-this-day&#039;) . &#039;&lt;\/b&gt;&lt;\/center&gt;&lt;\/font&gt;&lt;\/th&gt;&lt;\/tr&gt;&lt;\/thead&gt;&#039;;\n\t$content .= &#039;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&#039;;\n\n\t$content .= &#039;&lt;div style=&quot;text-align: left;&quot;&gt;&#039;;\n\t$content .= $current_date;\n\t$content .= $people;\n\t$content .= &#039;&lt;\/div&gt;&#039;;\n\n\t$content .= &#039;&lt;\/td&gt;&lt;\/tr&gt;&lt;\/tbody&gt;&#039;;\n\t$content .= &#039;&lt;tfoot&gt;&lt;tr&gt;&lt;td&gt;&lt;div style=&quot;text-align: right;&quot;&gt;&lt;font face=&quot;arial&quot; size=&quot;-3&quot;&gt;&lt;a href=&quot;http:\/\/www.ka81.com\/&quot;&gt;ka81\\&#039;s&lt;\/a&gt;&lt;\/font&gt;&lt;\/div&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;\/tfoot&gt;&#039;;\n\t$content .= &#039;&lt;\/table&gt;&#039;;\n\n\treturn $content;\n}\n\nadd_shortcode(&#039;born-on-this-day&#039;, &#039;born_on_this_day_shortcode_handler&#039;);\n\n\/*\n *\n *\tWP_Widget_Born_On_This_Day\n *\n *\/\n\nclass WP_Widget_Born_On_This_Day extends WP_Widget {\n\n\tfunction WP_Widget_Born_On_This_Day() {\n\n\t\tparent::WP_Widget(false, $name = &#039;Born On This Day&#039;);\n\t}\n\n\tfunction widget($args, $instance) {\n\n\t\t\/\/ Load language file\n\t\t$current_locale = get_locale();\n\t\tif(!empty($current_locale)) {\n\t\t\t$mo_file = dirname(__FILE__) . &#039;\/languages\/born-on-this-day-&#039; . $current_locale . &quot;.mo&quot;;\n\t\t\tif(@file_exists($mo_file) &amp;&amp; is_readable($mo_file)) {\n\t\t\t\tload_textdomain(&#039;born-on-this-day&#039;, $mo_file);\n\t\t\t}\n\t\t}\n\n\t\t\/\/ Get options\n\t\textract($args);\n\t\t$option_title = apply_filters(&#039;widget_title&#039;, empty($instance[&#039;title&#039;]) ? __(&#039;Born on this day&#039;, &#039;born-on-this-day&#039;) : $instance[&#039;title&#039;]);\n\t\t$option_alignment = empty($instance[&#039;alignment&#039;]) ? &#039;left&#039; : $instance[&#039;alignment&#039;];\n\t\t$option_date_style = empty($instance[&#039;date_style&#039;]) ? &#039;bold&#039; : $instance[&#039;date_style&#039;];\n\n\t\t\/\/ Prepare the date\n\t\t$current_date = date_i18n(get_option(&#039;date_format&#039;), strtotime(&#039;now&#039;));\n\t\tswitch($option_date_style) {\n\t\t\tcase &#039;bold&#039;:\n\t\t\t\t$current_date = &#039;&lt;strong&gt;&#039; . $current_date . &#039;&lt;\/strong&gt;&lt;br \/&gt;&#039;;\n\t\t\t\tbreak;\n\t\t\tcase &#039;bold_italic&#039;:\n\t\t\t\t$current_date = &#039;&lt;strong&gt;&lt;em&gt;&#039; . $current_date . &#039;&lt;\/em&gt;&lt;\/strong&gt;&lt;br \/&gt;&#039;;\n\t\t\t\tbreak;\n\t\t\tcase &#039;italic&#039;:\n\t\t\t\t$current_date = &#039;&lt;em&gt;&#039; . $current_date . &#039;&lt;\/em&gt;&lt;br \/&gt;&#039;;\n\t\t\t\tbreak;\n\t\t\tcase &#039;regular&#039;:\n\t\t\t\t$current_date .= &#039;&lt;br \/&gt;&#039;;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t\/\/ Prepare the people\n\t\t$month_array = file(dirname(__FILE__) . &#039;\/data\/&#039; . date(&#039;n&#039;) . &#039;.dat&#039;);\n\t\t$day = date(&#039;j&#039;);\n\t\t$day_line = $month_array[$day + 3];\n\t\t$day_array = explode(&#039;&lt;month&gt;&#039;, $day_line);\n\t\t$people_array = explode(&#039;&lt;name&gt;&#039;, $day_array[1]);\n\n\t\t\/\/ Help widget to conform to the active theme: before_widget, before_title and after_title\n\t\techo $before_widget;\n\t\techo $before_title . $option_title . $after_title;\n\n\t\tif($option_alignment == &#039;right&#039;) {\n\n\t\t\techo &#039;&lt;div style=&quot;text-align: right;&quot;&gt;&#039;;\n\t\t\tfor($i = 0; $i &lt; sizeof($people_array); $i++) {\n\t\t\t\t$person_array = explode(&#039;&lt;year&gt;&#039;, $people_array[$i]);\n\t\t\t\techo $person_array[1] . &#039; &#039; . $person_array[0] . &#039;&lt;br \/&gt;&#039;;\n\t\t\t}\n\t\t\techo &#039;&lt;\/div&gt;&#039;;\n\t\t\techo &#039;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;font face=&quot;arial&quot; size=&quot;-3&quot;&gt;&lt;a href=&quot;http:\/\/www.ka81.com\/&quot;&gt;ka81\\&#039;s&lt;\/a&gt;&lt;\/font&gt;&lt;\/div&gt;&#039;;\n\t\t} else {\n\n\t\t\techo &#039;&lt;div style=&quot;text-align: left;&quot;&gt;&#039;;\n\t\t\tfor($i = 0; $i &lt; sizeof($people_array); $i++) {\n\t\t\t\t$person_array = explode(&#039;&lt;year&gt;&#039;, $people_array[$i]);\n\t\t\t\techo $person_array[0] . &#039; &#039; . $person_array[1] . &#039;&lt;br \/&gt;&#039;;\n\t\t\t}\n\t\t\techo &#039;&lt;\/div&gt;&#039;;\n\t\t}\n\n\t\techo $after_widget;\n\t}\n\n\tfunction update($new_instance, $old_instance) {\n\n\t\treturn $new_instance;\n\t}\n\n\tfunction form($instance) {\n\n\t\t\/\/ Load language file\n\t\t$current_locale = get_locale();\n\t\tif(!empty($current_locale)) {\n\t\t\t$mo_file = dirname(__FILE__) . &#039;\/languages\/born-on-this-day-&#039; . $current_locale . &quot;.mo&quot;;\n\t\t\tif(@file_exists($mo_file) &amp;&amp; is_readable($mo_file)) {\n\t\t\t\tload_textdomain(&#039;born-on-this-day&#039;, $mo_file);\n\t\t\t}\n\t\t}\n\n\t\t\/\/ Get options\n\t\t$instance = wp_parse_args((array)$instance, array(&#039;title&#039; =&gt; __(&#039;Born on this day&#039;, &#039;born-on-this-day&#039;), &#039;date_style&#039; =&gt; &#039;bold&#039;, &#039;alignment&#039; =&gt; &#039;left&#039;));\n\t\t$option_title = esc_attr($instance[&#039;title&#039;]);\n\n\t\t\/\/ Display form\n\t\techo &#039;&lt;p&gt;&#039;;\n\t\techo \t&#039;&lt;label for=&quot;&#039; . $this-&gt;get_field_id(&#039;title&#039;) . &#039;&quot;&gt;&#039; . __(&#039;Title: &#039;, &#039;born-on-this-day&#039;) . &#039;&lt;\/label&gt;&#039;;\n\t\techo \t&#039;&lt;input class=&quot;widefat&quot; type=&quot;text&quot; value=&quot;&#039; . $option_title . &#039;&quot; id=&quot;&#039; . $this-&gt;get_field_id(&#039;title&#039;) . &#039;&quot; name=&quot;&#039; . $this-&gt;get_field_name(&#039;title&#039;) . &#039;&quot; \/&gt;&#039;;\n\t\techo\t&#039;&lt;br \/&gt;&#039;;\n\t\techo\t&#039;&lt;br \/&gt;&#039;;\n\t\techo \t&#039;&lt;label for=&quot;&#039; . $this-&gt;get_field_id(&#039;date_style&#039;) . &#039;&quot;&gt;&#039; . __(&#039;Date style: &#039;, &#039;born-on-this-day&#039;) . &#039;&lt;\/label&gt;&#039;;\n\t\techo \t&#039;&lt;select class=&quot;widefat&quot; id=&quot;&#039; . $this-&gt;get_field_id(&#039;date_style&#039;) . &#039;&quot; name=&quot;&#039; . $this-&gt;get_field_name(&#039;date_style&#039;) . &#039;&quot;&gt;&#039;;\n\t\techo \t\t&#039;&lt;option value=&quot;bold&quot;&#039; . selected($instance[&#039;date_style&#039;], &#039;bold&#039;) . &#039;&gt;&#039; . __(&#039;Bold&#039;, &#039;born-on-this-day&#039;) . &#039;&lt;\/option&gt;&#039;;\n\t\techo \t\t&#039;&lt;option value=&quot;bold_italic&quot;&#039; . selected($instance[&#039;date_style&#039;], &#039;bold_italic&#039;) . &#039;&gt;&#039; . __(&#039;Bold + Italic&#039;, &#039;born-on-this-day&#039;) . &#039;&lt;\/option&gt;&#039;;\n\t\techo \t\t&#039;&lt;option value=&quot;italic&quot;&#039; . selected($instance[&#039;date_style&#039;], &#039;italic&#039;) . &#039;&gt;&#039; . __(&#039;Italic&#039;, &#039;born-on-this-day&#039;) . &#039;&lt;\/option&gt;&#039;;\n\t\techo \t\t&#039;&lt;option value=&quot;regular&quot;&#039; . selected($instance[&#039;date_style&#039;], &#039;regular&#039;) . &#039;&gt;&#039; . __(&#039;Regular&#039;, &#039;born-on-this-day&#039;) . &#039;&lt;\/option&gt;&#039;;\n\t\techo \t&#039;&lt;\/select&gt;&#039;;\n\t\techo\t&#039;&lt;br \/&gt;&#039;;\n\t\techo\t&#039;&lt;br \/&gt;&#039;;\n\t\techo \t&#039;&lt;label for=&quot;&#039; . $this-&gt;get_field_id(&#039;alignment&#039;) . &#039;&quot;&gt;&#039; . __(&#039;Alignment: &#039;, &#039;born-on-this-day&#039;) . &#039;&lt;\/label&gt;&#039;;\n\t\techo \t&#039;&lt;select class=&quot;widefat&quot; id=&quot;&#039; . $this-&gt;get_field_id(&#039;alignment&#039;) . &#039;&quot; name=&quot;&#039; . $this-&gt;get_field_name(&#039;alignment&#039;) . &#039;&quot;&gt;&#039;;\n\t\techo \t\t&#039;&lt;option value=&quot;left&quot;&#039; . selected($instance[&#039;alignment&#039;], &#039;left&#039;) . &#039;&gt;&#039; . __(&#039;Left&#039;, &#039;born-on-this-day&#039;) . &#039;&lt;\/option&gt;&#039;;\n\t\techo \t\t&#039;&lt;option value=&quot;right&quot;&#039; . selected($instance[&#039;alignment&#039;], &#039;right&#039;) . &#039;&gt;&#039; . __(&#039;Right&#039;, &#039;born-on-this-day&#039;) . &#039;&lt;\/option&gt;&#039;;\n\t\techo \t&#039;&lt;\/select&gt;&#039;;\n\t\techo &#039;&lt;\/p&gt;&#039;;\n\t}\n}\n\nadd_action(&#039;widgets_init&#039;, create_function(&#039;&#039;, &#039;return register_widget(&quot;WP_Widget_Born_On_This_Day&quot;);&#039;));\n\n?&gt;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-11568","topic","type-topic","status-closed","hentry","topic-tag-born-on-this-day"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11568\/revisions"}],"wp:attachment":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}