I made a couple of changes to archive.module to facilitate browsing the archives by date.

  • Opening an archive URL without specifying a day will display the full month, eg www.example.com/archive/2004/07
  • Selecting the 0th day of the month in the archive page drop down selects the full month
  • Using the previous/next raquo's in the calender block now uses full month browsing

The attached patch is against 4.4.2 and is untested against CVS.

Comments

Anonymous’s picture

Patch don't work with archive.module (drupal 4.4.2).

Hunk #1 FAILED at 1.
Hunk #2 FAILED at 26.
Hunk #3 FAILED at 49.
Hunk #4 FAILED at 64.
Hunk #5 FAILED at 85.
Hunk #6 FAILED at 131.
Hunk #7 FAILED at 218.
Hunk #8 FAILED at 236.
Hunk #9 FAILED at 245.
9 out of 9 hunks FAILED

ahoeben’s picture

Version: » 4.6.0
StatusFileSize
new4.78 KB

Blast from the past... Not sure what I did wrong to have my original patch fail, but here is a new patch applying the same changes to Drupal 4.6

Cvbge’s picture

Hello,

thanks for your patch, that's a feature I wanted :)

But please change day "0" to "ANY" or similar.

ahoeben’s picture

StatusFileSize
new5.15 KB

New patch. Changed '0' in day dropdown to 'All days'. You should be able to change that string using a locale (but I have no experience with locales in Drupal).

Also fixed a tiny bug that would cause the year dropdown to stop being useful on jan 1st 2006.

ahoeben’s picture

Version: 4.6.0 »

Patch applies to cvs version as well...

morbus iff’s picture

StatusFileSize
new5.09 KB

Attached updated patch for HEAD. I'll be fiddling with it some more too.

morbus iff’s picture

Title: Browse by month » Browse by entire month, not just day
adrian’s picture

I vote we completely ditch the legacy archive module and go with codemonkeyx' module (it's in contrib as archive)
(example : http://codemonkeyx.net/archive)

adrian’s picture

The module in contrib needs very little love actually ..

The biggest thing is that there is no css in most themes for it, meaning it can be hard to browse.
If we do use this module, it means we can remove most of the calendar css out of drupal.css , and perhaps move it to modules/event/event.css (provided event still uses it).

The module is also a lot simpler =)

junyor’s picture

I'm all for it. Open up a new issue and you'll get my +1. :)

morbus iff’s picture

Yep - I started that issue at http://drupal.org/node/29676.

There's a bit to do with it re: HEAD - I don't like the arch_data CSS classes (especially when his other entries use archive), there's no documentation, and it has the same GMT problem as the existing one does. Also, I'm getting bunk dates on my HEAD dev server (days highlighted, but no posts showing when clicked, etc.). I'll be working with all that stuff over on the other issue.

matt_paz’s picture

As long as we're adding this, any chance of adding in an optional block that displays a list of links to archives by month?

* August 2005 (244 Items)
* July 2005 (100 Items)
* June 2005 (80 Items)
* May 2005 (60 Items)
* April 2005 (32 Items)
* March 2005 (20 Items)
* February 2005 (10 items)
* January 2005 (2 Items)

morbus iff’s picture

It's not a block, but something very similar to that is in the codemonkeyx version.

Crell’s picture

Status: Needs review » Needs work

This uses the old form code instead of the new Form API, so no longer applies.

Did we ever get around to using the codemonkeyx archive module instead of the old one? If so, is this patch needed anymore? I don't want to close it, but someone who knows the archive module status better than I do should take a quick look. :-)

gábor hojtsy’s picture

Status: Needs work » Fixed

Archive module now removed from core. The codemonkey version was picked by some people, and I created a project for it. Work continues there. Submit feature requests there. BTW this one is already handled because of the nature of that module.

http://drupal.org/project/archive

Anonymous’s picture

Status: Fixed » Closed (fixed)