Story module is not even 100 lines and implements 7 hooks. Replace story_ with hook_ and use drupaldocs.org for each.
Unfriendly response posted because of the "it is urgent" phrase.
--
My developer blog. | The news is Now Public | Ask not what Drupal can do for you -- ask what you can do for Drupal.
--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.
I might be mistaken but I think he is asking whether he can create a single module that allows the users to post different types of node within it... and yes it's possible.
First of all use hook_node_types() to define what node types the module contains.
Then for all the other node hooks (insert, update, delete, form etc) remember that $node is always passed as an argument. So to check what the node type is use $node->type
function hook_node_types() {
return array('project-issue', 'project-project');
}
function hook_insert($node) {
switch($node->type) {
case 'project-issue':
db_query("INSERT INTO {mytable} (nid, extra)
VALUES (%d, '%s')", $node->nid, $node->extra);
break;
case 'project-project':
db_query("INSERT INTO {mytable} (nid, extra)
VALUES (%d, '%s')", $node->nid, $node->extra);
break;
}
}
The original poster might have been ungrateful enough to not respond to your answer to his urgent question but it's exactly what I was looking for so thank you very much :)
Comments
read source & drupaldocs
Story module is not even 100 lines and implements 7 hooks. Replace story_ with hook_ and use drupaldocs.org for each.
Unfriendly response posted because of the "it is urgent" phrase.
--
My developer blog. | The news is Now Public | Ask not what Drupal can do for you -- ask what you can do for Drupal.
--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.
How To Ask Questions The Smart Way
http://www.catb.org/~esr/faqs/smart-questions.html
I might be mistaken...
I might be mistaken but I think he is asking whether he can create a single module that allows the users to post different types of node within it... and yes it's possible.
First of all use hook_node_types() to define what node types the module contains.
Then for all the other node hooks (insert, update, delete, form etc) remember that $node is always passed as an argument. So to check what the node type is use $node->type
Hope this helps.
Thanks
The original poster might have been ungrateful enough to not respond to your answer to his urgent question but it's exactly what I was looking for so thank you very much :)