I would like to offer user points for people logging into my system. There should be an option for restrictions on how many points can be earned per day. Points for other similar actions (Like getting X number of points for being on the system X amount of hours) should also be considered.

CommentFileSizeAuthor
#3 userpoints_login.zip_.txt1.87 KBAnomaly07
#2 patch_15.patch2.67 KBAnomaly07

Comments

Anomaly07’s picture

Status: Active » Needs review

Points for Login is done, code may need a little review. Code for "being on the site" may be harder than what it's worth. I realized I don't really want this functionality. So I'll pass that along to someone else to decide.

Anomaly07’s picture

StatusFileSize
new2.67 KB

I have attached the patch (on the entire userpoints folder) to add the "userpoints login" module.

Anomaly07’s picture

StatusFileSize
new1.87 KB

Here is a zip of the module.

derjochenmeyer’s picture

I dont really know how to review a patch, so i took the "zip" file. First of all its not a zip file but a text file ;-) so i had to remove the _.txt Extension.

I give it a try:
- in Line 65 you dont use {userpoints_login} but simply userpoints_login that creates an error message if you have a table prefix set (as i have in my sandboxes)
- when calling userpoints_userpointsapi() the optional $description should be given. It turns up in the moderation table if moderation is set (even if it doesnt make much sense to moderate login points) -> is it possible that you add a checkbox whether or not points due to login events should go into the point moderation or not?

Its not 100% clear to me what the "Time Period" is. Maybe a better description is needed.

THANKS FOR SHARING THIS CODE. hope my comment can help.

berdir’s picture

Component: Code: userpoints » Code: userpoints API
Status: Needs review » Closed (won't fix)

Sorry for spamming the participants in this issue. Due to the release of Drupal 7 and the lack of time from the maintainers, I'm closing all remaining 5.x issues for Userpoints.

Feel free to re-open this issue or create a new one for 6.x or even better 7.x if this bug is still open or feature is missing for these versions.