I would like to allow revenue sharing on user blogs not just on their content. Is there a way to modify the code to do this?

Comments

netentropy’s picture

wow i figured it out , at least I think

I just added an || blog to revenue_sharing_basic.module

/**
 * Provide the User ID of the author of the current page
 *
 * @return
 *   User ID of author, or NULL if it wasn't possible to discover one
 */
function revenue_sharing_basic_get_node_uid() {
  static $node_uid = NULL;

  if ((!$node_uid) && (arg(0) == 'node' || 'blog') && is_numeric(arg(1))) {
    $node = node_load(arg(1));

    // Cache the results
    $node_uid = $node->uid;
  }

  return $node_uid;
}

please let me know if you see potential problems anywhere

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Well, according to this your new expression is the same as:

if ((!$node_uid) && (arg(0) == 'node' || TRUE) && is_numeric(arg(1)))

which simplifies to:

if ((!$node_uid) && is_numeric(arg(1)))

This obviously has severe side-effects on the code.

Can you try:

if ((!$node_uid) && ((arg(0) == 'node') || (arg(0) == 'blog')) && is_numeric(arg(1)))

and see if that still works for you?

João

netentropy’s picture

ok i will stick it in tomorrow morning and let you know!

jcnventura’s picture

Did it work?? I'm thinking about marking this as a duplicate of #120141: revenue sharing content types not working.

João

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No info received in two weeks. Closing the issue.