but you can turn back now, matter of fact i strongly recommend it. see, i needed to theraputically obsess on something pointless last night, and — the chronology archives? over there on the side? yeah. & then as if that wasn’t bad enough, i now am compelled to tell you how it works. i’m sorry.
i needed weekly archives. i did! i needed … different. weekly. i wanted week 1, week 2, (not with integers! integers no! oh no.)
i did want the actual dates, but only onmouseover. it’s what the largest portion of the code you see below is doing. it’s saying, print the month of the first day of the week, followed by the spelled out ordinal of the day of the month. then print through. then check if the week begins and ends in different months, if it does, print the ending month and the spelled out ordinal month day, if not just do the month day. that’s the mouseover.
so i get the month number by calling a PHP function from my little library which takes the date in integer form (two digit form of the day and month, and the four digit year) (which i give it in the form of formatted MT Archive Date variables) and returns which week of the year it is. but i wanted weeks of feckless, not weeks of the year. and i’m not proud of this, in fact … *gulp* ok look, it was ridiculous o’clock at the time, and yes i cheated and subtracted eleven from the result rather than rewrite the thing to take the date difference – which is quite simple however it requires the ability to actually see the function, and … it’s still no excuse.
<!--this part is the link, the mouseover starts with title=" -->
title="<$MTArchiveDate format="%B" lower_case="1"$> <?php ordinalNum('<$MTArchiveDate format="%d" $>'); ?> through <MTIfNotEqual a="[MTArchiveDate format='%B']" b="[MTArchiveDateEnd format='%B']"><$MTArchiveDateEnd format="%B" lower_case="1"></MTIfNotEqual> <?php ordinalNum('<$MTArchiveDateEnd format="%d" $>');?>">
<!--this is the part that says which week it is.-->
<?php ordinalNum(week_of_year('<$MTArchiveDate format="%d" $>', '<$MTArchiveDate format="%m" $>', '<$MTArchiveDate format="%Y" $>')-11); ?></a><br />
//this is the function that does the week thingy, i need to fix it:
function week_of_year($nDay, $nMonth, $nYear)
$date = getdate(mktime(9, 0, 0, $nMonth + 1, $nDay, $nYear)); // 9:00AM
return floor($date["yday"]/7) + 1);