function comment_activity_access_grants in Activity 6.2
Same name and namespace in other branches
- 7 modules/comment.activity.inc \comment_activity_access_grants()
Implementation of hook_activity_access_grants().
File
- modules/
comment.activity.inc, line 25 - Activity definition file for comment.module
Code
function comment_activity_access_grants($account) {
// tell activity what activities this user has based on the 'comment' realm
$grants = array();
// select the nodes you commented on
$commented_result = db_query("SELECT nid FROM {comments} WHERE uid = %d", $account->uid);
while ($commented = db_fetch_object($commented_result)) {
$grants['comment'][] = $commented->nid;
}
return $grants;
}