It would be nice to have a date filter for activity_get_activity. This way we can get all activities for the past week only, for instance (still respecting the $limit).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | activity_filters.patch | 1.84 KB | Roman S |
It would be nice to have a date filter for activity_get_activity. This way we can get all activities for the past week only, for instance (still respecting the $limit).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | activity_filters.patch | 1.84 KB | Roman S |
Comments
Comment #1
Roman S commentedIn fact, it might be even better to have two filters - BEFORE and AFTER.
If only the BEFORE timestamp is supplied, we show all activities before that datetime.
If only the AFTER timestamp is supplied, we show all activities after that datetime.
If both filters are supplied, we show all activities within that date range
Comment #2
Roman S commentedOK, added the feature myself :) Added the following filter operations - less than, greater than, less than or equal to, greater than or equal to. Should be backwards-compatbile. I call it like so to get all activities for the last week:
Comment #3
Roman S commentedjaydub - any chance of getting this patch (and possibly my other patches) into the build soon?
Apologies for rushing - I understand you're doing this whenever you get free time, but I haven't seen any activity (err, pun not intended) in the past few days and I really need this in order to move forward. :(
Thanks!
Comment #4
sirkitree commentedI noticed the documentation link wasn't added to the project, so I've added it to the project node.
Also, please do not blame a module developer for not making progress on your own. You obviously have enough skills to modify the code, and we appreciate the patches, but not getting these committed to the module should not hinder you from making any progress. When I'm modifying features of a module I usually keep a patches folder of my own that apply to that module and update/remove them as they are changed/implemented through a module's issue queue. Putting undue pressure on a maintainer just makes for unhappy maintainers I find.
That being said, I really like the idea of your filter ops as a general solution here. I've thought that Activity should utilize views for it's display and provide filters such as this to views, but this is a good first step.
Patch applies cleanly.
Comment #5
Roman S commentedHi sirkitree - thanks for your response. I really don't mean to cause any undue stress. I'm new to the concept of contributing to open source code, so I'm still working out all the dos and don'ts :)
I guess to me a patched up module is in a "incomplete" state (as far as my local code is concerned anyways) and I'm just having a difficult time moving past that. Apologies again - I'll follow your suggestion regarding the patches.
Comment #6
sirkitree commentedNo damage done ;)
Comment #7
jaydub commentedI'll get this into my testing soon! As mentioned we'll be able to add in quite a bit more flexibility to building activity lists once we work in Views 2 integration (d6 only). However since we want to get a d6 module out the door the addition of Views 2 would probably have to be a 6.2 branch.
Comment #8
Roman S commentedJust to be sure we're on the same page - this particular patch has nothing to do with Views and just builds upon existing filter code.
Comment #9
jaydub commentedyes I didn't mean your patch should be held up for Views 2 integration...Just saying that we won't have to bother writing our own query builders when we get to the point where we can use Views2!
Comment #10
jaydub commentedApplied and tested. Now committed.
Comment #11
Roman S commentedGotcha. Thanks!
Just wondering - when the D6 branch goes to Views2, will the D5 one stay with the current filter system?
Comment #12
jaydub commentedWell it would still be nice to roll a better query builder for the d5 version so it could move on from the current filter system. But it won't be based on Views as it's only Views 2 that allows for bringing in tables that don't have links to the node tables.
Comment #14
bflora commentedIs there a way to do this with Views 2 in D6? I can't seem to find a filter to show only activity from the last week, for example. Without that, I'm loading up a crap ton of stuff every time I load my activity page.
Comment #15
sirkitree commentedThere is not a filter, but there is a sort. Maybe just sort and limit the view to a certain number fo results. Or put in another issue to have a filter added for that field.
Comment #16
bflora commentedThat doesn't make sense. There's no way to limit a view to a certain number of results. How is that done? You can limit a view to display X results per page, but the view will still count them all up in the query and take forever. Bleh.
Comment #17
adf1969 commentedIf you want to add Views filter for filtering on Activity: Creation Date you can add the following:
in: views\activity.views.inc
That's it. If you add that, you will be able to filter in Views by Activity: Creation date
Be aware that since activity uses a timestamp, you will *not* be able to use the "popup" date-picker, but for most tasks, this is adequate.
Also, note that the above mod is for the 6.x-2.x-dev - I didn't want to change the version (if someone wants to, that is fine).
Good luck,
Andrew.