Пример #1
0
    echo $post->getTitle();
    ?>
    <?php 
}
?>
  </h2>
  
  <div class="details">
  <?php 
echo __('Posted by %1% on %2%', array('%1%' => $post->getAuthor(), '%2%' => format_date($post->getPublishedAt('U'))));
?>
  <?php 
if ($tags = $post->getSfSimpleBlogTags(null, null, ESC_RAW)) {
    ?>
    <?php 
    echo __('in %1%', array('%1%' => get_tag_links($tags)));
    ?>
  <?php 
}
?>
  <?php 
if ($in_list) {
    ?>
  - <?php 
    echo link_to_post($post, format_number_choice('[0]no comment|[1]one comment|(1,+Inf]%1% comments', array('%1%' => $post->getNbComments()), $post->getNbComments()), '#comments');
    ?>
  <?php 
}
?>
  </div>
  
      <?php echo format_date(strtotime($post->getPublishedAt()), 'P') ?>
      <?php if ($sf_user->isAuthenticated()): ?>
        <?php $user_id = $sf_user->getAttribute('user_id', null, 'sfGuardSecurityUser') ?>
        <?php if ($post->getAuthorId() == $user_id): ?>
          <a href="<?php echo cross_app_url_for('backend', '@sf_simple_blog_post_edit?id='.$post->getId()) ?>">(<?php echo __('Edit') ?>)</a>
        <?php endif; ?>
      <?php endif; ?>
    </abbr>
  </div>
  <div class="entry-content">
    <?php echo $post->getExtract(ESC_RAW) ?>
  </div>
  <div class="entry-meta">
    <span class="entry-category">
      <?php echo __('Posted in ') ?>&rsaquo;
      <?php echo __('%1%', array('%1%' => get_category_links($post->getsfSimpleBlogCategorys()))) ?>
    </span>
    <span class="meta-sep">|</span>
    <span class="tag-links">
      <?php echo __('Tagged ') ?>&rsaquo;
      <?php if($tags = $post->getTags()): ?>
        <?php echo __('%1%', array('%1%' => get_tag_links($tags))) ?>
      <?php endif; ?>
    </span>
    <span class="meta-sep">|</span>
    <span class="comments-link">
      <?php echo link_to_post($post, format_number_choice('[0]no comment|[1]one comment|(1,+Inf]%1% comments', array('%1%' => $post->getNbApprovedComments()), $post->getNbApprovedComments()), '#comments') ?>
    </span>
  </div>
</div>