Skip to main content
Remove noise
Source Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

Maybe this can help someone, I found how to do it.

I have asked many questions but no one commented or did anything, that's not a problem. Working hard can solve many problems.

So my use case iscustom module to create a form and I want to make "timespent" work and track user time spend on this: page.

  • I have a custom module to create a form and I want to make "timespent" work and track user time spend on this page.

I use URL to get it work.

$nodetypes = variable_get('time_spent_node_types', 'all');
if ($node = menu_get_object()) {
  if (($nodetypes == 'all' || $nodetypes[$node->type] === $node->type )) {
    $mynide = $node->nid;
  }
}

This code searches the id of the node, for my purposes I replace this like that

if (arg(0) == 'module' && arg(1) == 'form') {
  $mynide = arg(3); // for me arg(3) is the nid i want to track
}

Maybe this can help someone, I found how to do it.

I have asked many questions but no one commented or did anything, that's not a problem. Working hard can solve many problems.

So my use case is this:

  • I have a custom module to create a form and I want to make "timespent" work and track user time spend on this page.

I use URL to get it work.

$nodetypes = variable_get('time_spent_node_types', 'all');
if ($node = menu_get_object()) {
  if (($nodetypes == 'all' || $nodetypes[$node->type] === $node->type )) {
    $mynide = $node->nid;
  }
}

This code searches the id of the node, for my purposes I replace this like that

if (arg(0) == 'module' && arg(1) == 'form') {
  $mynide = arg(3); // for me arg(3) is the nid i want to track
}

Maybe this can help someone, I found how to do it.

I have a custom module to create a form and I want to make "timespent" work and track user time spend on this page.

I use URL to get it work.

$nodetypes = variable_get('time_spent_node_types', 'all');
if ($node = menu_get_object()) {
  if (($nodetypes == 'all' || $nodetypes[$node->type] === $node->type )) {
    $mynide = $node->nid;
  }
}

This code searches the id of the node, for my purposes I replace this like that

if (arg(0) == 'module' && arg(1) == 'form') {
  $mynide = arg(3); // for me arg(3) is the nid i want to track
}
Formatting and spelling
Source Link
berliner
  • 2.9k
  • 1
  • 21
  • 29

maybe that'sMaybe this can help yousomeone, iI found how to do it.

I askhave asked many questionquestions but no one commentcommented or dodid anything, that's not a problem. workingWorking hard can solve many problems.

So mymy use case is this:

  • iI have a custom module to create a form and iI want to make timespent"timespent" work and track user time spend on this page.

I use URL to get it work.

$nodetypes = variable_get('time_spent_node_types', 'all');
if ($node = menu_get_object()) {
  if (($nodetypes == 'all' || $nodetypes[$node->type] === $node->type )) {
    $mynide = $node->nid;
  }
}

This code searchsearches the id of the node, for me imy purposes I replace this like that

if (arg(0) == 'module' && arg(1) == 'form') {
   $mynide = arg(3); // for me arg(3) is the nid i want to track
 }

Thanks :)

maybe that's can help you, i found how to do it.

I ask many question but no one comment or do anything, that's not a problem. working hard can solve many problems.

So my use case is :

  • i have a custom module to create a form and i want to make timespent work and track user time spend on this page.

I use URL to get it work.

$nodetypes = variable_get('time_spent_node_types', 'all');
if ($node = menu_get_object()) {
  if (($nodetypes == 'all' || $nodetypes[$node->type] === $node->type )) {
    $mynide = $node->nid;
  }
}

This code search the id of node, for me i replace this like that

if(arg(0) == 'module' && arg(1) == 'form'){
   $mynide = arg(3); // for me arg(3) is the nid i want  track
 }

Thanks :)

Maybe this can help someone, I found how to do it.

I have asked many questions but no one commented or did anything, that's not a problem. Working hard can solve many problems.

So my use case is this:

  • I have a custom module to create a form and I want to make "timespent" work and track user time spend on this page.

I use URL to get it work.

$nodetypes = variable_get('time_spent_node_types', 'all');
if ($node = menu_get_object()) {
  if (($nodetypes == 'all' || $nodetypes[$node->type] === $node->type )) {
    $mynide = $node->nid;
  }
}

This code searches the id of the node, for my purposes I replace this like that

if (arg(0) == 'module' && arg(1) == 'form') {
  $mynide = arg(3); // for me arg(3) is the nid i want to track
}
Source Link

maybe that's can help you, i found how to do it.

I ask many question but no one comment or do anything, that's not a problem. working hard can solve many problems.

So my use case is :

  • i have a custom module to create a form and i want to make timespent work and track user time spend on this page.

I use URL to get it work.

$nodetypes = variable_get('time_spent_node_types', 'all');
if ($node = menu_get_object()) {
  if (($nodetypes == 'all' || $nodetypes[$node->type] === $node->type )) {
    $mynide = $node->nid;
  }
}

This code search the id of node, for me i replace this like that

if(arg(0) == 'module' && arg(1) == 'form'){
   $mynide = arg(3); // for me arg(3) is the nid i want  track
 }

Thanks :)