You are here

function _notifications_content_node_username in Notifications 6.4

Same name and namespace in other branches
  1. 7 notifications_content/notifications_content.module \_notifications_content_node_username()

Get username from node (and add it to the node object)

1 call to _notifications_content_node_username()
notifications_content_notifications_object_node in notifications_content/notifications_content.module
Implementation of hook_notifications_object_node()

File

notifications_content/notifications_content.module, line 670
Subscriptions to content events

Code

function _notifications_content_node_username($node) {

  // If the node comes from a page query, it may have an author name, otherwise we set it
  if (empty($node->name)) {
    if ($author = notifications_load_user($node->uid)) {
      $node->name = $author->name;
    }
    else {
      $node->name = t('Unknown');
    }
  }
  return $node->name;
}