Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @file
- * TODO: Removes the "Login to post comments" from posts promoted to the frontpage.
- */
- /**
- * Implements hook_node_view().
- */
- require_once(DRUPAL_ROOT . '/modules/node/node.module');
- function hide_login_post_comments_node_view($node, $view_mode) {
- // For anonymous users, use a watchdog statement.
- watchdog('fix', '<pre>'.print_r($node->content['links']['comment']['#links']['comment_forbidden'], TRUE).'</pre>');
- // Tell it which view_mode to change, 'full', 'teaser', etc.
- if($view_mode == 'full' || $view_mode == 'teaser') {
- // Take out the link by unsetting it.
- unset($node->content['links']['comment']['#links']['comment_forbidden']);
- }
- }
Add Comment
Please, Sign In to add comment