Replacing wordpress plug-in "Business Day Calendar" (CMSxWP) and fixing programs

update Last updated: December 16, 2023 at 10:37 PM

Until now, I had used the free WordPress plug-in "Biz Calandar" to display my attendance shift, but this time I replaced it with a paid plug-in "Business Day Calendar" (CMSxWP).
Biz Calandar is a lightweight and well-made plug-in, but unfortunately in addition to not being able to write shortcodes and embed Widgets in the article, I felt the inconvenience of not being able to register multiple events and setting holidays in the management screen was troublesome, so I took the time to change the plug-in.

Business day calendar you can register multiple events, and click the date the event was set up to open the page for that blog. In addition, in the management screen, you can set the holiday with just one click.
However, since there was some inconvenience for paid plug-ins, such as the fact that there is no function to display the current month after displaying the previous month and the next month on the widget screen, the following PHP programs (such as adding a script to switch the display month in Ajax) and CSS were corrected.

		$output = '
<table class="business-calendar bc'.$u." ".$type.'">
<caption>';
		if ( !empty($past) || (!empty($future) && $past_unixtime >= $current_unixtime) ) :
			$output .= '<span class="business-calendar-past"><a href="javascript:void(0);" onclick="jQuery(this).parent().parent().parent().parent().load(\''.plugins_url().'/business-calendar/business-calendar.php?loadbcm=1&bc_id='.$bc_id.'&year_in='.$past_year.'&month_in='.$past_month.'&day_in='.($today-7).'¬ooltip='.$notooltip.'&event='.$event.'&future='.$future.'&past='.$past.'&starting='.$starting.'¢er='.$center.'&badate='.$badate.'&type='.$type.'&term='.$term.'&event_ul_before='.urlencode($event_ul_before).'&event_ul_after='.urlencode($event_ul_after).'&event_li_before='.urlencode($event_li_before).'&event_li_after='.urlencode($event_li_after).'\');"><img src="https://www.senris.com/images/icon-backward.png" border="0" width="12" height="12" title="前の月へ"></a> </span>';		endif;

		$output .= $year_month;
		if ( !empty($future) || (!empty($past) && $future_unixtime <= $current_unixtime) ) {
			$output .= '<span class="business-calendar-future"> <a href="javascript:void(0);" onclick="jQuery(this).parent().parent().parent().parent().load(\''.plugins_url().'/business-calendar/business-calendar.php?loadbcm=1&bc_id='.$bc_id.'&year_in='.$future_year.'&month_in='.$future_month.'&day_in='.($today+7).'¬ooltip='.$notooltip.'&event='.$event.'&future='.$future.'&past='.$past.'&starting='.$starting.'¢er='.$center.'&badate='.$badate.'&type='.$type.'&term='.$term.'&event_ul_before='.urlencode($event_ul_before).'&event_ul_after='.urlencode($event_ul_after).'&event_li_before='.urlencode($event_li_before).'&event_li_after='.urlencode($event_li_after).'\');"><img src="https://www.senris.com/images/icon-forward.png" border="0" width="12" height="12" title="次の月へ"></a></span> ';
		}

# Added by Senri Miura on 15 March 2021

		$year_now  = date_i18n("Y");
		$month_now = date_i18n("n");

		if ( !(!(is_numeric($month_in)) || $month_in < 1 || $month_in > 12) && $month_in != $month_now ) {
			$output .= '<span class="business-calendar-future">  今月 <a href="javascript:void(0);" onclick="jQuery(this).parent().parent().parent().parent().load(\''.plugins_url().'/business-calendar/business-calendar.php?loadbcm=1&bc_id='.$bc_id.'&year_in='.$year_now.'&month_in='.$month_now.'&day_in='.($today+7).'¬ooltip='.$notooltip.'&event='.$event.'&future='.$future.'&past='.$past.'&starting='.$starting.'¢er='.$center.'&badate='.$badate.'&type='.$type.'&term='.$term.'&event_ul_before='.urlencode($event_ul_before).'&event_ul_after='.urlencode($event_ul_after).'&event_li_before='.urlencode($event_li_before).'&event_li_after='.urlencode($event_li_after).'\');"><img src="https://www.senris.com/images/icon-stop.png" border="0" width="12" height="12" title="今月へ"></a></span> ';
		}

		$output .= '</caption>';
		
		if ( $type == 'calendar' ) :
			$output .= '
<thead>
<tr>
<th>' . $daynames[($starting+7)%7] . '</th>
<th>' . $daynames[($starting+8)%7] . '</th>
<th>' . $daynames[($starting+9)%7] . '</th>
<th>' . $daynames[($starting+10)%7] . '</th>
<th>' . $daynames[($starting+11)%7] . '</th>
<th>' . $daynames[($starting+12)%7] . '</th>
<th>' . $daynames[($starting+13)%7] . '</th>
</tr>
</thead>';
		endif;
		$output .= '
<tbody>';

*The above is part of the PHP program "business-calendar.php" in the business day calendar, and the marked line is a correction and postscript.

For your reference, the WordPress plug-in used on this site is explained in the following article, so if you are interested, please.

2022.08.05 update
Since the plugin "Business Day Calendar" no longer works in WordPress 6.0, I replaced it with the following plugin "XO Event Calendar".

Add this entry to the hasebookmark
X (post)

Leave a Reply