-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.block.latest_comments.php
26 lines (24 loc) · 1.48 KB
/
dashboard.block.latest_comments.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
namespace Habari;
if ( !defined( 'HABARI_PATH' ) ) { die( 'No direct access' ); }
?>
<ul class="items">
<?php foreach ( $content->latestcomments_posts as $post ): ?>
<li class="item">
<span class="comments"><a href="<?php echo $post->permalink; ?>#comments" title="<?php printf(_n('%1$d comment', '%1$d comments', $post->comments->approved->comments->count), $post->comments->approved->comments->count); ?>"><?php echo $post->comments->approved->comments->count; ?></a></span>
<span class="titleanddate"><span class="title"><a href="<?php echo $post->permalink; ?>" class="title"><?php echo $post->title; ?></a></span> <span class="date"><?php $post->pubdate->out( 'M j' ); ?></span></span>
<ul class="commentauthors">
<?php
$comment_count = 0;
foreach( $content->latestcomments[$post->id] as $comment):
$comment_count++;
$opa = 'opa' . (100 - $comment_count * 15);
?>
<?php /* @locale Time formats according to http://php.net/manual/en/function.date.php */ $ctime = $comment->date->get( _t( 'g:ia' ) ); ?>
<?php /* @locale Date formats according to http://php.net/manual/en/function.date.php */ $cdate = $comment->date->get( _t( 'F jS, Y' ) ); ?>
<li><a href="<?php echo $comment->post->permalink; ?>#comment-<?php echo $comment->id; ?>" title="<?php printf( _t( 'Posted at %1$s on %2$s' ), $ctime, $cdate ); ?>" class="<?php echo $opa; ?>"><?php echo $comment->name; ?></a></li>
<?php endforeach; ?>
</ul>
</li>
<?php endforeach; ?>
</ul>