I've been a drupal site user/admin for over a year and have found all kinds of great things to use it for. Just upgraded my site to 4.5.2 and I have to say it doesn't leave me wanting for much. There are a few things I wish it could do so I figured it was about time to roll up my sleves and dive in...
The first thing I am attempting to do is to make the archive.module block and page blogcentric - that is to say context sensitive to the currently displayed blog. I've managed to hack archive.module using some keen xtreme programming methodology (read: 5 nights trial and error) and have actually got it to work - however it's pretty ugly. I'd like to a) clean up the code using more drupalese syntax b) perhaps port to a seperate module as that seems the way to do things properly 'round here
1) Ok so the first thing I did was put !^blog\/([0-9]*)! into the block path for archive (neat trick that) so the calendar only shows up on the blog pages.
2) Next, in the archive_calendar function I added a preg_match to hack out the user id of the current blog from $_GET['q'] like this:
// get the users uid from the url
preg_match("/^blog\/([0-9]*)/",$_GET['q'],$blog_uid);
I didn't like this much but I couldn't figure out how to get at the $uid variable or the $node->$uid attribute from the archive module. Is there a better way to do this than what I have above?
3) from there it is a simple matter of changing the SQL to include a peek at the n.uid so as to pull out only nodes for the current blog's user