Hello Drupal friends !
1. I´ve written a module which gets an extra node type
2. there is a cron job in this module, which imports from external sources data and creates new nodes of this type automaticly if new data has arrived
For now i have written a little function, that makes the sql queries for adding the right entries in the right tables
looks like:
db_query("INSERT INTO {node} (nid, vid, title, type, uid, status, created, changed, comment, promote, moderate, sticky) VALUES (%d, %d, '%s', '%s', %d, %d, %d, %d, %d, %d, %d, %d)", $l_sNId, $l_sVId, $l_sTitle, 'mixl', 85, 1, $l_date, time(), 2, 0, 0, 0);
db_query("INSERT INTO {node_revisions} (nid, vid, title, timestamp, uid, format) VALUES (%d, %d, '%s', %d, %d, %d)", $l_sNId, $l_sVId, $l_sTitle, $l_date, 85, 0);
db_query("INSERT INTO {mixl}_nodes (nid, url, import_url, parked, pid) VALUES (%d, '%s', '%s', %d, %d)", $l_sNId, $p_sLink, $p_sLink, 0, $p_iPId);
db_query("INSERT INTO node_comment_statistics (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) VALUES (%d,%d,%d,%d,%d)", $l_sNId, $l_date, NULL, 85, 0);
db_query("DELETE FROM {node_access} WHERE nid=%d AND (realm = 'nodeaccess_uid' or realm = 'nodeaccess_rid')", $l_sNId);