Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to see both sort handlers for members_count and post_count so groups can be sorted by it, which is a very sensible feature.
i would like to write the class but i can't find documentation how to add_orderby but not just a field
If you have a tip i would write the patch
Comment | File | Size | Author |
---|---|---|---|
#12 | og_statistics.tar_.gz | 3.46 KB | dawehner |
#10 | og_statistics.tar_.gz | 3.49 KB | dawehner |
#6 | og_statistics.tar_.gz | 8.19 KB | dawehner |
#5 | og_statistics_install_1.patch | 2.2 KB | dawehner |
#1 | og_views_sort_handler_member_posts_1.patch | 5.58 KB | dawehner |
Comments
Comment #1
dawehnerThis patch adds a sort handler for
- count members
- posts
- new posts
Sponsored by erdfisch
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedI'm concerned about the performance of this. I know we use subqueries in the field definition but sorting by a subquery is even worse for performance. We really need to introduce a summary table for each group which holds a sum of posts and members. Like node_comment_statistics.
Comment #3
dawehnerBrainstorm:
Table: og_statistics
Field:
How many members does the group has
How many posts are in this group
Counts the comments in the group
// not really important i think
When was the last node created/changed in the group
When did the last user joined the group
When was the last comment created on one of the nodes in the group
Additional/ other ideas?
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedThose fields look very nice.
Comment #5
dawehnerso i created a scheme definition for this data
Comment #6
dawehnerso i managed to write this module
i created also some tests, but the fail, even real world using works well, as far as i testet it
very important the views integration is only started yet, but it works
this is a tar.gz which should be placed into og/modules/ because CVS cannot add dirs for patches
Comment #7
dawehnerupdated code:
much more views integration
fixed bug in the update handling
Changed title
Anyone want to review test?
Comment #8
ekes CreditAttribution: ekes commentedHi, cheers for this. I was just about to write a simple module to make a table of statistics for og on a site! And found this, it's the great thing about Drupal, so often someone has already thought about it. Anyway this site's Drupal 5 so I've backported your work - and extended it a bit.
Big notes:
Smaller notes.
If I get time, which I'm not sure I will I'm afraid, I'll port my changes back to the D6 version. The biggy that's still there is still the deleting nodes with comments thing though.
Ah the code is in my sandbox: http://cvs.drupal.org/viewvc.py/drupal/contributions/sandbox/ekes/og_sta...
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedSeems like there is not a complete version for d6 yet.
Comment #10
dawehnerhere is a new version, which merges the stuff from ekes into the d6 version.
@TODO: writing tests for all functionality.
Comment #11
bernland CreditAttribution: bernland commentedI added that folder to og/modules and the module "Organic groups statistics" shows up on the modules page. However, I can't enable it because of:
Depends on: Array (missing)
Any ideas?
Comment #12
dawehnerquite strange.
btw here is the new version
if you want to have the newest version you could also try out using https://code.launchpad.net/~dereine/+junk/og_statistics
Comment #13
bernland CreditAttribution: bernland commentedOk. I just downloaded the latest version and changed
dependencies[] = og
dependencies[] = og_views
to
dependencies = og og_views
in og_statistics.info, now the status line reads
Depends on: Organic groups (enabled), Og_views (missing)
How do I install og_views???
Comment #14
dawehnermy version of the module is for drupal6, therefore the Version is set to HEAD.
Comment #15
moshe weitzman CreditAttribution: moshe weitzman commentedI'd be really pleased if this lived in Contrib on its own for a while so the bugs get shaken out and we learn how popular it is. I'm not planning on taking it into og itself just yet. I do think it is very valuable.
Comment #16
dawehneri created a project for this
http://drupal.org/project/og_statistics
i would like to have more feedback tests etc.
Comment #17
squinternata CreditAttribution: squinternata commentedmore idea for og_statistics
counter for member daily visits to the community.
thanks
A
someone asked me :)