function link_to_next_post($post, $options = array()) { $next_post = $post->getNextPost(); if ($next_post) { return link_to_post($next_post); } return ''; }
<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> <div class="content"> <?php echo $post->getContent(ESC_RAW); ?> </div> </div>
<?php use_helper('sfSimpleBlog'); ?> <h2><?php echo __('Latest posts'); ?> </h2> <ul> <?php foreach ($post_pager->getResults() as $post) { ?> <li><?php echo link_to_post($post); ?> </li> <?php } ?> </ul>
<?php echo $post->getContent(ESC_RAW); ?> <?php } ?> </p> </div> <p style="padding: 5px 0px 10px 0px";> <?php if ($tags = $post->getSfSimpleBlogTags(null, null, ESC_RAW)) { ?> <?php echo image_tag('bg-ico-tags.png', array('alt' => '>', 'align' => 'baseline')); ?> <?php echo __(' %1%', array('%1%' => get_tag_links($tags))); ?> <?php } ?> <?php echo image_tag('ico_comment.png', array('alt' => '>', 'align' => 'baseline')); ?> <?php echo link_to_post($post, format_number_choice('[0]<strong>nessun</strong> commento|[1]<strong>un</strong> commento|(1,+Inf]<strong>%1%</strong> commenti', array('%1%' => $post->getNbComments()), $post->getNbComments()), '#comments'); ?> </p> </li>
?> <?php $cnt += 1; ?> <li> <div style="font-size:12px; padding: 0px;"><strong><?php echo link_to_post($post); ?> </strong></div> <div style="font-size:10px; padding: 2px;"> pubblicato il <?php echo format_date($post->getPublishedAt('U')); ?> <!-- e' importante tenere tutto su una sola linea, senza spazi tra i tag --> <?php echo image_tag('ico_comment_box.png', array('alt' => '>', 'align' => 'baseline')); ?> <?php echo format_number_choice('[0] nessun |[1,+Inf] %1%', array('%1%' => $post->getNbComments()), $post->getNbComments()); echo link_to_post($post, format_number_choice('[0,1] commento|(1,+Inf] commenti', array(), $post->getNbComments()), $postfix = '#comments'); ?> </div> </li> <?php } ?> </ul> </div> </div>
<?php use_stylesheet('/sfSimpleBlog15Plugin/css/socialbookmark.css', 'last') ?> <?php use_helper('Date', 'sfSimpleBlog', 'crossAppLink', 'SocialBookmarking') ?> <div class="post hentry" id="post-<?php echo $post->getId() ?>"> <h2 class="entry-title"> <?php if ($in_list): ?> <?php echo link_to_post($post) ?> <?php else: ?> <?php echo $post->getTitle() ?> <?php endif; ?> </h2> <div class="entry-date"> <abbr class="published"> <?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 (null !== $user_id && $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->getContent(ESC_RAW)?> </div> <?php $shareOn = sfConfig::get('app_sfSimpleBlog_share_on', false) ?> <?php if ($shareOn): ?> <?php $url = url_for(sfSimpleBlogTools::generatePostUri($post), true) ?> <div id="social_bookmark"> <h3>Share this post</h3> <ul>
<?php use_helper('sfSimpleBlog') ?> <?php foreach($posts as $post): ?> <li><?php echo link_to_post($post, '', null, array('title' => $post['Title'])) ?></li> <?php endforeach; ?>