function subscriptions_ui_nodeapi in Subscriptions 5.2
Same name and namespace in other branches
- 6 subscriptions_ui.module \subscriptions_ui_nodeapi()
Implementation of hook_nodeapi().
Inject the node subform into node pages (depending on the Display Settings).
File
- ./
subscriptions_ui.module, line 16 - Provides a user interface for Subscriptions.
Code
function subscriptions_ui_nodeapi(&$node, $op, $teaser) {
global $user;
if ($op == 'view' && $node->nid && !$teaser && subscriptions_ui_can_subscribe()) {
if (!variable_get('subscriptions_form_in_block', 0) && (!variable_get('subscriptions_form_link_only', 0) && (!arg(2) || arg(2) == 'view') || variable_get('subscriptions_form_link_only', 0) && arg(2) == 'subscribe')) {
if ($form = drupal_get_form('subscriptions_ui_node_form', $node)) {
$node->content['subscriptions'] = array(
'#value' => $form,
'#weight' => 100,
);
}
}
}
}