Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
I was wondering what would be the best way to go about creating a node from within the cron hook of the same module.
Say you wrote a node that stores RSS from different feeds. In a cron job, I would like that RSS stuff to be inserted in the node.
The first thing that came to my mind was just to use plain "INSERT INTO ..." sql, but then I am lost as to how to get the "next" node id value. After that I thought about using the implemented hook: _insert() but then I was lost as to what kind of parameter does it except and how to go about building a $node object.
I built it successfully, and it appeared almost instantly online under teh 4.7 modules downloads.
however, when i then made mods to the code to support the old style forms,
and tagged it against DRUPAL-4-6, I still do not see anything in the 4.6 downloads section
I am writing a very simple module to learn how to code for Drupal. I am having a problem integrating the result of sql calls into html and then applying the theme to the resulting code and displaying it all. I hope this makes sense. The function included should give an idea of what I am trying to do. I have written many php websites but my coding is completely self taught and I haven't done much with the kind of stuff needed to get this working. I think the answer is probably quite simple, I am just not seeing it.
Basically what I am attempting to do is query the database to get some records and then display the data in a table much like what is displayed when you go to the administration page and it shows the access log.
Here is the funtion, it works with the exception of trying to format the output:
function pipe_show() {
// content variable that will be returned for display
$content = '';
$query = "SELECT client_fname, client_lname FROM " .
"{node_client} ";
// get the data
$queryResult = db_query($query);
while ($output = db_fetch_object($queryResult)) {
$client_fname = $output->client_fname;
$client_lname = $output->client_lname;
$content = print "