/** * add points to user based on the action. */ function assignPoint($action, $userId = null) { //get the rule points $user = CFactory::getUser($userId); $points = CKarma::getActionPoint($action, $user->gid); $points += $user->getKarmaPoint(); $user->_points = $points; $user->save(); }