Last updated May 4, 2009. Created by punboy@aaron.pu... on June 10, 2005.
Edited by bekasu, pwolanin, puregin. Log in to edit this page.
PLEASE NOTE! The following snippet is user submitted. Use at your own risk!
<?php
/**
* 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)) {
$output .= node_view(node_load(array('nid' => $node->nid)), 1);
}
print $output;
?>Paged Results
You can page the results by adding this line right before printing the $output:
$output .= theme('pager', NULL, $listlength);
Comments
I need this for Drupal 7
Hello can someone direct me to a link that will help me do the same task using Drupal 7?
Responses are highly appreciated. Thank you!
Use Views
Use Views http://drupal.org/project/views
Taniwha Solutions- Drupal Consulting and Implementation. Site design and construction, module development, customization, etc.