Needs review
Project:
User Stats
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Nov 2009 at 16:05 UTC
Updated:
7 Apr 2015 at 16:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ñull commentedFrom the code I see that login_count is implemented as a token, but how on earth do you include a token in a view?
Comment #2
ñull commentedAttached a hack to include login count in a view. I had a problem with duplicate values and apparently the DISTINCT function in views is not doing what it should ). The only work around I found was to remove the left join relation from the query. Either use the included patch user_stats.views.inc or patch it with login_count.user_stats.views.inc.patch
If there is a more elegant solution for the duplicate problem, then please contribute it. When a new Views release comes out, I will remove the work around and re-upload my patch here.
Comment #3
ñull commentedComment #4
ñull commentedComment #5
ñull commentedAfter views 6.x-2.8 was released my work around became obsolete. Attached the new patch without it.
Comment #6
ñull commentedPlease could someone review it?
Comment #7
liam mcdermott commentedAh, thanks for posting this! I'm really swamped at the moment, but it'll get reviewed at some point in the near future.
User login count does suck pretty badly at the moment though; it literally only counts logins, not when someone leaves, comes back and resumes a previous session. Would be great if you created a new issue (and maybe even a patch) for that. If it's a problem.
Comment #8
aliciatheduff commentedI tried this patch out, am I supposed to see the new field appear under the users category in views?
Comment #9
chuckbar77 commented+1 subscribing
Comment #10
YK85 commentedsubscribing
Comment #11
open social commentedsubscribing,
I can't find the item in the views field list. What should I do?
I used views custom php field to include it via the api
But it looks like views chart doesn't like that
Comment #12
lukus@goalgorilla;
The custom PHP fields aren't actually calculated until the view is rendered as far as I know, which might be why it's not working the way you hope.
Comment #13
hockey2112 commentedHow would I modify the php code from #11 so that it is compatible with Drupal 7?
Comment #14
cferthorney@hockey2112 I'm going to work on this over the Easter break (This coming weekend) I think, as I need the feature for a work site. I'll apply a 7.x compatible patch (Haven't coded for D6 in years so won't be tackling that I'm afraid)
Comment #15
hockey2112 commentedThat sounds great, thanks!
Comment #16
liam mcdermott commentedcferthorney, that sounds great. Hope you're having some luck getting this done, the Views integration was quite badly done in the first place (by me) and has suffered bitrot too, so I have a bad feeling quite a lot may need to be rewritten in the Views integration.
Also bumping the version to 7.x, as I can understand why you wouldn't want to work with 6.x.