function userpoints_nc_get_setting in User points Nodes and Comments 7
Helper function to return a setting.
If a node type is passed in, the specific setting will be used with a fallback to the global settings.
Parameters
$name: Name of the setting: points, category, comment_points, comment_category.
$type: Node type, if passed in, the function looks for a node type specific setting.
Return value
The configured setting value.
11 calls to userpoints_nc_get_setting()
- userpoints_nc_comment_delete in ./
userpoints_nc.module - Implements hook_comment_delete().
- userpoints_nc_comment_insert in ./
userpoints_nc.module - Implements hook_comment_insert().
- userpoints_nc_comment_presave in ./
userpoints_nc.module - Implements hook_comment_insert().
- userpoints_nc_form_node_type_form_alter in ./
userpoints_nc.module - userpoints_nc_node_delete in ./
userpoints_nc.module - Implements hook_node_delete().
File
- ./
userpoints_nc.module, line 286
Code
function userpoints_nc_get_setting($name, $type = NULL, $default = 0) {
if (!empty($type)) {
return variable_get('userpoints_nc_' . $name . '_' . $type, variable_get('userpoints_nc_' . $name, $default));
}
else {
return variable_get('userpoints_nc_' . $name, $default);
}
}