I currently have a blog with links that I post as well blog entries. I wanted both of these to be filterable in the archives, as it would be nice to see only all of the links I posted in February, not both the links and the blog posts. I also didn't want pages showing up in the archives.

This patch I have attached adds an admin settings page that allows the user to select what node types can be filtered in the archives. It places a dt/dd pair below the date to allow the user to select what node types they wish to see.

I have also added a setting to change the main path to the archives. I like mine at "archives," while the default is at "archive." I would think people may want to change this to other things, also, so that can be done.

Comments

somes’s picture

tired that though Im getting an error as follow

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND t.type IN ("image", "weblink", "blurb") n.status = 1' at line 1 query: SELECT MIN(n.created) AS min_date, MAX(n.created) AS max_date FROM node n JOIN node_type t ON t.type = n.type WHERE AND t.type IN ("image", "weblink", "blurb") n.status = 1 in C:\SERVER\xampp\htdocs\*********\database.mysql.inc on line 172.

though i am using a custom node type ie blurb

any ideas

somes’s picture

Looks more like an SQL calling error as I removed the custom type and still getting a similar syntax error

gábor hojtsy’s picture

Status: Needs review » Needs work

- This code includes generated pieces like t('Describes what the settings generally do.') as a description...
- The archive_page_path setting seems to be insane to me. Why duplicate path alias functionality?
- The patch does not conform to Drupal coding styles... Lines like the following violate code style rules in every possible place
}else if($date->days[$date->day] > 0){ // Otherwise redirect the user to the same day viewing all node types
- Other parts of the code, like archive_node_types() and _archive_validate_type() even use tabs.
- You also have a lot of date related changes included in the patch, which are not related to type handling.

gábor hojtsy’s picture

By the way issue #75543 (http://drupal.org/node/75543) is an interesting prior art.

Susurrus’s picture

Title: Also filter by types and specify path to archive » Filter by types
StatusFileSize
new3.39 KB

I've patched the latest version of my code against the 5.x-1.2 version of this module. I have also removed all changes that I've made to the module EXCEPT the node types changes.

Since my patch against this module, it's been split into two separate files. Attached here is the .module patch

Susurrus’s picture

StatusFileSize
new14.87 KB

This patch is for archive.inc and is current against 5.x-1.2. It matches changes in my post above.

Susurrus’s picture

Version: 5.x-1.0 » 5.x-1.2

The latest code revisions I attached in the last 2 posts are also live at: http://thrashtheswap.com/archive.

Susurrus’s picture

Status: Needs work » Needs review
Caleb G2’s picture

A big +1 to these patches. I've add them to the site and it is very nice to be able to eliminate the 'admin' content-types from the archives (frankly the module is a bit useless for some sites without this feature).

A small nit - somewhere it needs to be documented that the path to the configuration page is /admin/settings/archive

Caleb G2’s picture

Status: Needs review » Reviewed & tested by the community

Setting to rtbc to encourage things along...

Caleb G2’s picture

Nevermind about the forementioned nit - I see that the link to the archive settings does indeed appear on admin/settings.

cburschka’s picture

What's the status on it? Is it in fact ready to be committed (and has been for a month)? Has it been committed (so this should be set to fixed)? Or does it still need work (and should be set accordingly)? Just wondering because a RTBC patch has been untouched for more than a month...

gábor hojtsy’s picture

Unfortunately the Archive module maintainer (namely myself) is very busy with final Drupal 6 core feature patches (being one of the Drupal 6 committers too). I tried to find people to take over (among other modules) the Archive module from me, so it can be properly maintained. Until this happens, unfortunately there is a big lag in responses to Archive module issues.

Susurrus’s picture

If you're looking for some help with maintaining this module, I would definitely be willing to provide it.

gábor hojtsy’s picture

susurrus, you don't seem like having a CVS account at all, so you effectively cannot get maintainership of this module just yet.

Susurrus’s picture

I now have a CVS account, if you're interested in letting me contribute to this module.

bfdexp’s picture

Would love to use this module with this patch. However I do not have shell access to run this on my server. Can someone send me the updated compiled files for this module?

Susurrus’s picture

I'm now the maintainer of this module and I will try to have a new version ready with this patch available tomorrow night after work.

bfdexp’s picture

Thanks, I really appreciate you taking on this module. This module will allow a lot of power to allow users to easily archive nodes by date and in the next few days by date and/or node type. I also just posted a new request that hopefully we can work on, filtering by taxonomy term (and/or). Thanks again...

Susurrus’s picture

Status: Reviewed & tested by the community » Fixed

Patch applied and released in version 1.3

Anonymous’s picture

Status: Fixed » Closed (fixed)