Okay, building on my previous post, I'm almost done with this, but I can't get it to work. I need help from somebody with experience using document.write to write MT tags.
Here is what I've got:
CODE
var now = new Date();
var today = now.getDay();
if (today == 0)
{
var baseDate = new Date(2004, 3, 25); // the first date that there was a sunday entry
var weeks = (now - baseDate) / (7 * 86400000);
var weeksRounded = Math.round(weeks)
document.write('<MTEntries encode_js="1" lastn="1" category="sunday" offset="');
document.write(weeksRounded);
document.write('"><MTEntryBody></MTEntries>');
}
and so on... but this doesn't work. I can get it to write the weeksRounded variable, and i can get it to write the lastn=1 post, but it doesn't seem to be getting the offset=1 part. What am I doing wrong?
Thanks!