Check it friends! Probably has a few glitches (I want to see as the days pass), but attached is an automated calendar.
http://codydodd.ca/hermertia/cal.phpTo anyone with access to the server files: I can help you paste the code in to any place on the site. It's actually super simple. Or, if someone gives me temporary access I can load it in.
Before that, it's worth asking the community. Where should this simple text go? We can stylize it depending on where we are putting it. It could be super optimized. I did this from start to scratch in under an hour. It was a fun little challenge re: a new hobby i've been learning.
Code:
<?php
$day = date('d');
$mercannum = $day / 6;
$base_year = -2;
if ($mercannum >= 0 && $mercannum < 1) {
$extra_year = $base_year;
} else if ($mercannum >= 1 && $mercannum < 2) {
$extra_year = $base_year +1;
} else if ($mercannum >= 2 && $mercannum < 3) {
$extra_year = $base_year +2;
} else if ($mercannum >= 3 && $mercannum < 4) {
$extra_year = $base_year +3;
} else if ($mercannum >= 4 && $mercannum < 5) {
$extra_year = $base_year +4; }
?><BR><?php
$date1 = '2009-07-31';
//$date2 = '2016-08-03';
$date2 = date('Y-m-d');
$ts1 = strtotime($date1);
$ts2 = strtotime($date2);
$year1 = date('Y', $ts1);
$year2 = date('Y', $ts2);
$month1 = date('m', $ts1);
$month2 = date('m', $ts2);
$month_diff = (($year2 - $year1) * 12) + ($month2 - $month1);
$canonyears_diff = $month_diff * 6;
$current_year = $canonyears_diff + $extra_year;
echo "Years of the Emperor: " . $current_year . " AI ";
$date3 = '2016-08-31';
$ts1 = strtotime($date3);
$ts2 = strtotime($date2);
$year1 = date('Y', $ts1);
$year2 = date('Y', $ts2);
$month1 = date('m', $ts1);
$month2 = date('m', $ts2);
$cycle_check_month_diff = (($year2 - $year1) * 12) + ($month2 - $month1);
//echo $month_diff;
?><BR><?php
$cycle_base = '2015-06-01';
$ts1 = strtotime($cycle_base);
$ts2 = strtotime($date2);
$year1 = date('Y', $ts1);
$year2 = date('Y', $ts2);
$month1 = date('m', $ts1);
$month2 = date('m', $ts2);
$cycle_month_diff = (($year2 - $year1) * 12) + ($month2 - $month1);
$cycle_merc = round($cycle_month_diff / 12);
$cycle_year = $cycle_month_diff % 12;
$cycle_merc_padded = sprintf("%02d", $cycle_merc);
$cycle_year_padded = sprintf("%02d", $cycle_year);
?><BR><?php
if ($cycle_check_month_diff > 1) {
echo "Cycle of the Tides: " . $cycle_merc_padded . "-" . $cycle_year_padded;
} else {
echo "Cycle of the Phoenix: " . $cycle_merc_padded . "-" . $cycle_year_padded;
}
?>