Closed (fixed)
Project:
User Stats
Version:
5.x-1.x-dev
Component:
Documentation
Priority:
Critical
Category:
Support request
Assigned:
Reporter:
Created:
30 Nov 2007 at 11:10 UTC
Updated:
14 May 2008 at 18:12 UTC
Jump to comment: Most recent file
Comments
Comment #1
liam mcdermott commentedDocumentation will be written, am just a bit busy at the moment. To get you started:
print user_stats_get_stats('post_count', $node->uid);print user_stats_get_stats('post_count', $comment->uid);If you want something other than post count, just enter another call to user_stats_get_stats() replacing 'post_count' with one of the following:
There's also the workflow-ng integration, that's useful if you want to change the users role after they've written a number of posts, or been a member for a number of days. I'll explain more of that if required.
Comment #2
liam mcdermott commentedSorry, this was a double-post. Drupal seems to be overzealously caching so replies may not appear immediately.
Don't submit stuff again if it doesn't appear after you hit 'Post comment', it's just the cache being slow, wait 5–15 minutes. :)
Comment #3
nainainai commentedToo bad it count every post count only if there is a way to make it only count for the forum post.
Comment #4
tannerjfco commentedI'm a little confused on the aspect of the workflow-ng integration. I've enabled the module but I don't see how I can configure a new workflow in workflow-ng based on user stats options.
I'd basically like to use this in conjunction with workflow-ng to show a page to users on their first time logging in, is that something user stats can help with?
Comment #5
liam mcdermott commentedHi there nainainai, this is not the way to get a new feature into this project. This is the discussion on the topic of documentation, if you have a feature request (and yours seems like a good idea) please submit it as a new bug using the 'Request new feature' link from the project front page. :)
I am busy--not to mention strapped for cash--at the moment, so will probably not be able to work on any new features for the next couple of months. I am available for paid Drupal work, if you need this urgently.
Now this is on-topic. :)
Everything user_stats provides is added automagically to the workflow-ng user interface. As you probably know, that's under: Administer -> Site building -> Workflow-ng When selecting 'Add a new configuration', you'll see some extra events that are provided by user_stats, you'll also notice some extra conditions too.
user_stats and workflow-ng cannot tell you if a user is logging in for the first time, unfortunately. What they can tell you is:
Would one of these offer a suitable compromise? For example, you could redirect the user to a special welcome page if they have 0 posts and their account was created in the last 10 days. I like the idea of having a 'first_login' feature though, if you need this feature would you mind creating a feature request? As mentioned above, am a little strapped for cash at the moment, but I am available for paid work if it's a priority.
I should get some documentation written before adding any new features though! :D
*** EDIT ***
Just a quick thought, Tannerjf. Have you looked at Login destination? That may be able to do what you need.
Comment #6
placebo333 commentedcheers for the info, got it running finally :)
Comment #7
tannerjfco commentedLiam, thanks for the response. The alternatives you suggested could possibly work, however I'm just not seeing those conditions listed in workflow-ng. Am I missing something here?
Comment #8
liam mcdermott commentedMaybe a screenie will help. Can you see these options under workflow-ng's 'Add a new configuration' screen? These are what you'd use, I didn't post the exact configuration names above, more an explanation of what can be done. :)
Hope this helps.
Comment #9
liam mcdermott commentedJust thought of a way to do this, you don't actually need user_stats. I'll export the workflow-ng configurations here, hopefully you should be able to use them by pasting them, one-by-one, into the Import page.
Firstly, this adds the 'New user' role to members when they sign up (see at the bottom of this is a roles array, you'll need to change the '1000059' to the id of the role to add when the user signs up in your system):
The next configuration is fired when a user logs in. If they have the 'New user' role, we remove it and redirect them to a page:
Again, you'll probably need to change the role arrays so the '1000059' matches whatever 'New user' role you're assigning. Hope this makes sense.
Comment #10
tannerjfco commentedMakes sense, and looks like that will work. Thanks a lot! :)
Comment #11
liam mcdermott commentedGlad to hear it. Good idea too, might use that configuration myself: thanks for the idea! :)
Comment #12
cs8c commentedThis module doesn't work as advertised above (post #1), I'm using this for the comment.tpl.php and the 'join date' gives me a huge string of numbers and 'online' and 'last_post' show nothing at all.
Comment #13
icecreamyou commentedHow would I get these variables to show up on the user profile, if I'm not using Bio or Nodeprofile?
Comment #14
liam mcdermott commentedThis is possible with just the profile module. See under Administer -> User management -> Profiles, on that page is a list of options labelled 'Visibility'. Change that to one of the Public field options and save. Fixed. :)
Comment #15
CompShack commentedReply to comment #12
Use the following custom date to format your date
Comment #16
Flying Drupalist commentedThanks for the doc. The online code:
print user_stats_get_stats('online', $comment->uid);only displays a single digit for online. How do I make it display an icon in place of the digit.
Thanks.
Comment #17
liam mcdermott commented@#16 try this:
Comment #18
CompShack commentedLiam, I'm a programmer in real life - not in PHP though :( and i don't see "if statements" written this way that often. I'm all about making less and less lines of code and your approche above does just that. If it is true (value 1) then online, else offline.
Well done my friend.
Comment #19
Flying Drupalist commentedThanks a bunch Liam, that works well. How do I get an image in there?
Comment #20
liam mcdermott commentedIn reply to #19 I've got documentation already written, it'll be released shortly. This is taken from there:
Well I'd love to claim credit for thinking that one up, but you'll see it in quite a few themes. Not recommended for modules though, as it reduces readability. :)
Comment #21
Flying Drupalist commentedImmensely helpful, thank you again.
Comment #22
Flying Drupalist commentedAnon users also see no post counts and an incorrect join date. The off/online thing works though.
Comment #23
liam mcdermott commentedI've written documentation for this module! Please have a look at it and raise support/bug/feature requests for anything you're trying to do that I've missed. :)
http://www.apaddedcell.com/an-introduction-user-stats-module-drupal
Comment #24
liam mcdermott commentedComment #25
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.