I am using version: 1.13.2.4 and I have revenue sharing enabled for book pages, images, pages ... but not for the forum.
Currently there are adsense i'ds of other users showing in the forum. Not even if the user started the thread but the id of the user who made the most recent post.

Comments

andre75’s picture

Um. I am not sure about the last post thing anymore (need to investigate) but defenitely its showing up in the forums when it shouldn't (found out since one user messed up their ad id and no ads would show up).

jcnventura’s picture

Status: Active » Closed (won't fix)

This is no longer supported in post 4.7 releases of the module.

kbahey’s picture

Version: 4.7.x-1.0 » 6.x-1.x-dev
Category: support » feature
Priority: Critical » Normal
Status: Closed (won't fix) » Active

Reopening this as a feature request. It is a good thing to have.

This is the code for the settings (Drupal 5.x):

  $form['revenue']['content'] = array(
    '#type'        => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed'   => TRUE,
    '#title'       => t('Content types'),
    '#description' => t('Content types that have revenue sharing enabled.'),
    );

  foreach (node_get_types() as $type => $name) {
    $form['revenue']['content'][REVENUE_SHARING_BASIC_NODE_TYPE . $type] = array(
      '#type'          => 'checkbox',
      '#title'         => $name->name,
      '#return_value'  => 1,
      '#default_value' => variable_get(REVENUE_SHARING_BASIC_NODE_TYPE . $type, 0),
    );
  }

And this is the code that uses it :

  $node_info = revenue_sharing_basic_get_node_info();
  if (!count($node_info)) {
    // If it is not a node, check if it is a blog page
    if (arg(0) == 'blog' && is_numeric(arg(1))) {
      $uid = arg(1);
    }
    else {
      // Cache it
      $client = $site_client;
      return $site_client;
    }
  }

  list($uid, $type) = $node_info;

  // Check the content type we are displaying
  $content = variable_get(REVENUE_SHARING_BASIC_NODE_TYPE . $type, 0);
  if (!$content) {
    // Revenue sharing is disabled for this content, use the site wide client id
    // Cache it
    $client = $site_client;
    return $client;
  }

  // Check the percentage and choose one
  $client = revenue_sharing_basic_choose_client($uid);

  return $client;
}    

function revenue_sharing_basic_get_node_info() {
  static $nodeinfo = array();

  if ($nodeinfo['type'] && $nodeinfo['uid']) {
    return $nodeinfo;
  }

  if (arg(0) == 'node' && is_numeric(arg(1))) {
    $node = node_load(arg(1));

    // Cache the results
    $nodeinfo['type'] = $node->type;
    $nodeinfo['uid']  = $node->uid;

    return $nodeinfo;
  }
  return array();
}

Perhaps someone who need it will create a patch for D6.

jcnventura’s picture

Status: Active » Postponed
jcnventura’s picture

Status: Postponed » Fixed

Added the ability to select content types in which revenue sharing is active.

This will be in CVS in a couple of hours.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.