<?php $Comments = new PerchBlog_Comments($API); $pending_comment_count = $Comments->get_count('PENDING'); echo $HTML->subnav($CurrentUser, array(array('page' => array('perch_blog', 'perch_blog/delete', 'perch_blog/edit'), 'label' => 'Add/Edit'), array('page' => array('perch_blog/comments', 'perch_blog/comments/edit'), 'label' => 'Comments', 'badge' => $pending_comment_count, 'priv' => 'perch_blog.comments.moderate'), array('page' => array('perch_blog/authors', 'perch_blog/authors/edit', 'perch_blog/authors/delete'), 'label' => 'Authors', 'priv' => 'perch_blog.authors.manage'), array('page' => array('perch_blog/sections', 'perch_blog/sections/edit', 'perch_blog/sections/delete'), 'label' => 'Sections', 'priv' => 'perch_blog.sections.manage')));
<?php include 'PerchBlog_Posts.class.php'; include 'PerchBlog_Post.class.php'; include 'PerchBlog_Authors.class.php'; include 'PerchBlog_Author.class.php'; include 'PerchBlog_Comments.class.php'; include 'PerchBlog_Comment.class.php'; $API = new PerchAPI(1, 'perch_blog'); $Lang = $API->get('Lang'); $Posts = new PerchBlog_Posts($API); $posts = $Posts->get_recent(5); $Comments = new PerchBlog_Comments($API); $comment_count = $Comments->get_count(); $comments = array(); $comments['Pending'] = $Comments->get_count('PENDING'); $comments['Live'] = $Comments->get_count('LIVE'); $comments['Rejected'] = $Comments->get_count('REJECTED'); $comments['Spam'] = $Comments->get_count('SPAM'); ?> <div class="widget"> <h2> <?php echo $Lang->get('Blog'); ?> <a href="<?php echo PerchUtil::html(PERCH_LOGINPATH . '/addons/apps/perch_blog/edit/'); ?> " class="add button"><?php echo $Lang->get('Add Post'); ?>