You are here

function revenue_sharing_basic_get_node_info in Google AdSense integration 5.3

Same name and namespace in other branches
  1. 5.2 revenue_sharing_basic.module \revenue_sharing_basic_get_node_info()
  2. 6 old/revenue_sharing_basic/revenue_sharing_basic.module \revenue_sharing_basic_get_node_info()
  3. 7 old/revenue_sharing_basic/revenue_sharing_basic.module \revenue_sharing_basic_get_node_info()

Provide the node type and the User ID of the author of the current page

Return value

User ID of author, or NULL if it wasn't possible to discover one

1 call to revenue_sharing_basic_get_node_info()
revenue_sharing_basic_choose_client in old/revenue_sharing_basic/revenue_sharing_basic.module
Provide the applicable Publisher ID, based on the configured probabilities

File

old/revenue_sharing_basic/revenue_sharing_basic.module, line 198
Main file of the revenue_sharing_basic module

Code

function revenue_sharing_basic_get_node_info() {
  static $info = array();
  if (!$info && arg(0) == 'node' && is_numeric(arg(1))) {
    $node = node_load(arg(1));

    // Cache the results
    $info = array(
      'uid' => $node->uid,
      'type' => $node->type,
    );
  }
  return $info;
}