& now, i shall bore the snot right out of you.

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.

<MTArchiveList archive_type="Weekly">
<!--this part is the link, the mouseover starts with title=" -->
<a href="<$MTArchiveLink$>"
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 />
</MTArchiveList>

//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);
}

13 thoughts on “& now, i shall bore the snot right out of you.

  1. actually i do this for a living. well, at one job. i just haven’t quite, erm, well that’s not very impressive as far as geeklyness is concerned. i get paid somewhere close to what i’m worth.

    but i did figure it all out on my own.

  2. Okay folks, to see the tiling you may have to actually leave a comment and then “check yourself”…

    …but it’s way cool!

  3. tiling? what … do you mean? using the check yourself function takes you to a page that was meant to be in a popup — it’s actually not a good thing at all.

    it should look like this, but with a preview and some text meant to poke at you.

    i should go fix that.

  4. Damn you are one smart lady…. Make that fucking smart and not lady…

    Okay, start over.. You are one fucking smart human.

    HUGS
    Smooches
    Vince

  5. I admit I’m curious about the comment changes, and I’m half past boggled by the archive effort. I’ll just enjoy the result.

  6. *slack-jawed* how can you not program the vcr after this? 😉 i am still bumbling around with css and you produce this… wow is an understatement.

Leave a Reply

Your email address will not be published. Required fields are marked *