Immigration



/**
* This php snippet displays content of a specified type, with teasers
*
* To change the type of content listed, change the $content_type.
*
* Works with drupal 4.6
*/
$content_type = 'story';
$result1 = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = '$content_type' AND n.status = 1 ORDER BY n.created ASC"));
while ($node = db_fetch_object($result1)) {
$output1 .= node_view(node_load(array('nid' => $node->nid)), 1);
}
print $output1;
?>

print $output1;
?>
/* list of recent posts of node type 'flexinode-1'
** output in descending chronological order
*/
unset ($output2); // clear previous output
$node_type = "story";
$list_no =5;
$sql = "SELECT node.title, node.type, node.nid FROM node WHERE node.type = '$node_type' AND node.status = 1 ORDER BY node.created DESC LIMIT $list_no";
$output2 .= "
    “;
    $result = db_query($sql);
    while ($anode = db_fetch_object($result)) {
    $output2 .= “
  • “.l($anode->title, “node/$anode->nid”).”
  • “;
    }
    $output2 .= “

“;
print $output2;
?>

/**
* the following displays a list of the 10 most recent weblog titles
* and links to the full weblogs. If you want to increase/reduce
* the number of titles displayed..simply change $listlength value
*
* This php snippet works with drupal 4.6.
*
*/
$listlength="10";
$output3 = node_title_list(db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, $listlength));
print $output3;
?>