Hi everybody,

I am a novice in Drupal and PHP programming. Would be grateful for help.

I have created a block which will input node of a certain kind. The PHP code to do this task is:

“

$sql = "SELECT node.title, node.nid FROM node WHERE type='page' ORDER BY node.created DESC LIMIT 50" ;
$output .= "<ul>";
$result = db_query($sql);
while ($anode = db_fetch_object($result)) {
$output .= "<li>".l($anode->title, "node/$anode->nid")."</li>";
}
$output .= "</ul>";
$output .='<div class="more-link"><a href="" class="small">more</a></div>';
print $output;

”

However, the code above only generates the title of the node. Would be very grateful if someone could develop this code so it could also input the teaser, a few first lines from the each node plus ‘more’ link to the rest of the node.

Thanks.

Comments

bwv’s picture

Have you thought about creating a View with the views module to display this sort of block?
----------------------------------------------------------------------
http://classicvinyl.biz
http://music.bwv810.com
http://davidhertzberg.com
http://association.drupal.org/user/1207

I am a writer, researcher and solo drupal freelancer

Newsance’s picture

I guess 'view' is too heavy for this comparatevy easy task.