All pastes #419111 Raw Edit

Recent Comments

public text v1 · immutable
·published 2007-04-01 01:36 UTC
rendered paste body
In theme.php:

Controller::get_handler()->handler_vars['recent_comments']= Comments::get( array('limit'=>25, 'status'=>Comment::STATUS_APPROVED, 'orderby'=>'date DESC' ) );


In the theme template itself:

<h3>Recent Comments</h3>
<ul>
<?php foreach($recent_comments as $comment): ?>
<li><a href="<?= $comment->url ?>"><?= $comment->name ?></a> on <a href="<?= $comment->post->permalink; ?>"><?= $comment->post->title; ?></a></li>
<?php endforeach; ?>
</ul>