PLEASE NOTE These snippets are user submitted. Use at your own risk. For users who have setup drupal using an alternate database to the default (MYSQL), please note that the snippets may contain some database queries specific to MYSQL.

This very handy snippet written by Heine uses the PAC tree module to list all nodes under a current node. Stuff this code somewhere inside your xxx.tpl.php file, as needed.

$child_list = pacs_child_list($node->nid);
// Fetch titles , suppose child_list is an array of nids
if (!empty($child_list)) {
  $placeholders = implode(', ', array_fill(0, count($child_list), '%d'));
  $result = db_query(db_rewrite_sql("SELECT n.nid, n.created, n.title, n.type FROM {node} n WHERE n.nid IN ($placeholders)"), $child_list);
  while ($row = db_fetch_object($result)) {
  // now $row->nid & $row->title are filled
  // use check_plain($row->title)
   			
				print '<center>';
				print '<a href="?q=node/' . $row->nid . '"><img src="images/nodefiles.png"><BR>';
				print_r(check_plain($row->title) . '</A><div id="folder_time">' . strftime( "%d.%m.%Y", $row->created) . '</div></center>');
			
  }
}

Now, if you wanted to treat different types of nodes differently, say, listing book nodes with a certain icon and file nodes with a different icon, then use the following:

$child_list = pacs_child_list($node->nid);
// Fetch titles , suppose child_list is an array of nids
if (!empty($child_list)) {
  $placeholders = implode(', ', array_fill(0, count($child_list), '%d'));
  $result = db_query(db_rewrite_sql("SELECT n.nid, n.created, n.title, n.type FROM {node} n WHERE n.nid IN ($placeholders)"), $child_list);
  while ($row = db_fetch_object($result)) {
  // now $row->nid & $row->title are filled
  // use check_plain($row->title)
   			if ($row->type == 'flexinode-1'): 
				print '<center>';
				print '<a href="?q=node/' . $row->nid . '"><img src="images/nodefiles.png"><BR>';			                         	print_r(check_plain($row->title) . '</A><div id="folder_time">' . strftime( "%d.%m.%Y", $row->created) . '</div></center>');
			elseif ($row->type == 'flexinode-4'):
				print '<center>';
				print node_view(node_load($row->nid), 1) . '<a href="?q=node/' . $row->nid .'">';
				print_r(check_plain($row->title) . '</A><div id="folder_time">' . strftime( "%d.%m.%Y", $row->created) . '</div></center>');
			endif;
  }
}

Important bits: change ($row->type == 'flexinode-1') to whatever node type is preferable. For this use, I needed to treat two different flexinode types differently, so this code summons the node teaser of flexinode-4 whenever they were child nodes. Just add in or mutate additional elseif's as necessary.

Hope there's someone out there who can find this handy! And thanks again, Heine.