Page is a not externally linkable
Casethejoint - 7:27 pm on Mar 21, 2006 (gmt 0)
I've not had much luck with it on the D forums as yet. The question is how to display aggregated blog posts (cf. Metafilter) like this: etc Here's a php snippet [drupal.org] to display recent blog posts by date in descending order. ?> AND, here's Drupal user Eaton's isolation [drupal.org] of the date header: So how can I combine the two into a single snippet to return in descending order, date-separated blog entries from multiple users, preferably paging entries after a certain threshold value? (Try saying that without breathing!) Case.
Hi there -- A PHP question for your infinitely erudite perusal :-)
WEDNESDAY, MARCH 22nd
> Node 1
> Node 2
> Node 3
TUESDAY, MARCH 21st
> Node 4
> Node 5
> Node 6
<?PHP
/**
* This php snippet displays the 10 most recent weblog entries with
* teaser & info.
*
* To increase/decrease the number of weblogs listed
* change the list_length field to suit.
*
* Works with drupal 4.6
*/
$list_length="10";
$result1 = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), variable_get('default_nodes_main', $list_length));
while ($node = db_fetch_object($result1)) {
$output .= node_view(node_load(array('nid' => $node->nid)), 1);
}
print $output;
function date_header($timestamp, $format = 'F j, Y') {
static $last;
$date = format_date($timestamp, 'custom', $format);
if ($date!= $last) {
$last = $date;
return $date;
}
}