Hello,
I am trying to print the latest story from my "news" taxonomy to my front_page. The story prints, but it is only partially formatted. The "posted by" ("div class=posted") is not a link and contains the wrong user information - it says the poster was "Anonymous", when it is not. Also the story content is not printing in a "p" tag, and the feedback links are not printing. Here's the crux of the function:
function printNewest ($type, $limit) {
$result = db_query("SELECT * FROM node n WHERE n.type = '$type' and promote = '1'
ORDER BY n.nid DESC LIMIT $limit");
$node = db_fetch_object($result);
print theme('node', $node);
}
From the front_page I pass in the value of 'story' for $type and the value of '1' for $limit. I get one story back, and it prints, however as I said it's only partially formatted. I feel like I am either missing a step somewhere or the query is wrong, but I can't figure it out as my experience is limited. I've read the relevant module dev articles but I can't seem to put my finger on the problem. The code is in an enabled module. Here's the link to my development directory:
http://www.skatemental.com/drupal-4.6.0
The story is there on the front page. I'll try to see if the code works better within the front_page textareas, but any help or insight would be very, very welcome. This is using the phpTemplate engine.
Thank you,