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

SenthilMohith’s picture

sorry friends..

hook_page_load instead of hook_node_load
sorry..

SenthilMohith’s picture

in 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.

SenthilMohith’s picture

Status: Active » Closed (fixed)