Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am using drupal 7 cck and views. In views am using one argument Node: Nid.I need to get the node id and store that nid into a custom table.
please help me how to get the nid with views page argument.Its possible in d6 with the help of hook function hook_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL).
thanks in advance
Comments
Comment #1
SenthilMohith CreditAttribution: SenthilMohith commentedsorry friends..
hook_page_load instead of hook_node_load
sorry..
Comment #2
SenthilMohith CreditAttribution: SenthilMohith commentedin d6 get page arguments like,
function mymodule_nodeapi($op, $node, $f, $g) {
if($op == 'insert'){
if($node->type == 'file_upload'){
$prevoiusNode = arg(3);
if(is_numeric($prevoiusNode)){
db_query('INSERT INTO {sample_table} (current_nid, prev_nid) VALUES (%d, %d)', $node->nid, $prevoiusNode);
}
}
}
}
i need d7 coding like above.. please help me.
Comment #3
SenthilMohith CreditAttribution: SenthilMohith commented