Overview
And UserPoints, OG, Rules integration.
Each og has own's userpoints branding.
When workflows changes with rules module, updating points to the og by og_group_ref.
Features
- If og node create, automatic create term in userpoints category, and related to this og node.
- Have a batch page, batch the old og node.
- At the config page, you can customize userpoints category term 'name, this is userpoints branding in this og.
- Rules integration, create actions in the rules, the new data selector is 'node:userpoints-og-tid', When workflows changes with rules module, updating points to the og by og_group_ref.
- ...
Example
1)
A user in og1, og2, og3, he add a news to the og1 and add a comment to the og2, his og1 points increase 100 and og2 points decrease 20.
2)
Add a news(og content nodetype) to the og1, user in og1 points increase 100.
- 1)Go to admin/config/workflow/rules/reaction/add, add rules.
- 2)React on event, select optgroup of Node and Comment.
- 3)Add actions, Select the action is "grant points to a user".
- 4)Data selector is "site:current-user", Points category is click
the "Switch to data selection", if you event is "Node" optgroup,
select "node:userpoints-og-tid", if you event is "Comment" optgroup,
select "comment:node:userpoints-og-tid". - 5)Other settings according to your needs.
Node:
-After deleting content
-After saving new content
-After updating existing content
...
Comment:
-A comment is viewed
-After deleting a comment
-After saving a new comment
If action execute, points is add to the og userpoints category term tid.
Sandbox URL
https://www.drupal.org/sandbox/willietse/2294987
Git Repository
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/willietse/2294987.git
Code Review
http://pareview.sh/pareview/httpgitdrupalorgsandboxwillietse2294987git
Manual reviews of other projects:
https://www.drupal.org/node/2143157#comment-8931363
https://www.drupal.org/node/2295595#comment-8932427
https://www.drupal.org/node/2238015#comment-8941011
https://www.drupal.org/node/2275511#comment-8990151
Comments
Comment #1
willietse CreditAttribution: willietse commentedComment #2
willietse CreditAttribution: willietse commentedComment #3
PA robot CreditAttribution: PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #4
gisle"Active" is not used in this issue queue. You set status to "Needs review" to request a review.
Comment #5
willietse CreditAttribution: willietse commentedI have a reviews. edit to body.
Comment #6
willietse CreditAttribution: willietse commentedChange assigned.
Comment #7
willietse CreditAttribution: willietse commentedExample change.
Comment #8
willietse CreditAttribution: willietse commentedComment #9
willietse CreditAttribution: willietse commentedEdit add PAReview: review bonus.
Comment #10
willietse CreditAttribution: willietse commentedComment #11
willietse CreditAttribution: willietse commentedComment #12
willietse CreditAttribution: willietse commentedComment #13
willietse CreditAttribution: willietse commentedComment #14
willietse CreditAttribution: willietse commentedComment #15
er.pushpinderrana CreditAttribution: er.pushpinderrana commented@willietse, thanks for your contribution.
Your module looks good to me and given are my assumptions after manual review:
1. In .module file, following code use variable_get() function twice but it can be used once.
Load
$vid = variable_get(USERPOINTS_CATEGORY_DEFAULT_VID, '');
once and use $vid at 102 line.2. You are using batch api and defining same operation number of times in loop.
I am not sure whether it's correct because it's looks like a wrong approach to define the same operation number of times. It is recommend at number of places, you should only add the operation once, and let the operation iterate over a set number of results.
please add your comment on this.
Rest looks good to me, thanks again!
Comment #16
mpdonadioAssigning to myself for next review.
Comment #17
mpdonadioAutomated Review
Review of the 7.x-1.x branch (commit 06b4de1):
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
Manual Review
In userpoints_og_config_edit_title(), $group->title is user input that needs to be sanitized. The proper thing to do here
is to pass $group->title as a parameter to the t() call instead of using string concatenation.
Why is the PK in your schema composite? You only seem to be using nid as a condition, so I think only nid needs to be the PK.
You can add foreign key definitions to your hook_schema. D7 doesn't use them, but they can be handy for documentation.
In userpoints_og_requirements(), is using the `!` portable SQL? I honest't don't know.
Why the path check in userpoints_og_help? Comment needed.
Your helper functions need proper docblocks. See https://www.drupal.org/coding-standards/docs
The query in userpoints_og_config_load() is static, you can change this to a db_query(). See https://www.drupal.org/node/310072
The docblock on userpoints_og_entity_property_info_alter is incorrect; you don't need the 'on top of comment module'. See link above.
In userpoints_og_property_tid, is it always appropriate to use LANGUAGE_NONE for $node->og_group_ref instead of the node's language? Can you use the Field API for this?
(+) In userpoints_og_node_insert() and userpoints_og_batch_old_group_op(), when you save a new term, use the untranslated name. Translation gets done for output. This also appears in
In userpoints_og_node_insert(), you should check $term->tid and not just $term to see if the term actually saved.
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
Comment #18
PA robot CreditAttribution: PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.