function get_topic_posts_link($id = 0) { $topic = get_topic(get_topic_id($id)); $post_num = get_topic_posts($id); $posts = sprintf(__ngettext('%s post', '%s posts', $post_num), $post_num); $r = ''; if (('all' == @$_GET['view'] || bb_is_admin()) && bb_current_user_can('browse_deleted')) { $r .= "<a href='" . esc_attr(get_topic_link($id)) . "'>{$posts}</a>"; } else { $r .= $posts; } if (bb_current_user_can('browse_deleted')) { $user_id = bb_get_current_user_info('id'); if (isset($topic->bozos[$user_id]) && 'all' != @$_GET['view']) { add_filter('get_topic_deleted_posts', create_function('$a', "\$a -= {$topic->bozos[$user_id]}; return \$a;")); } if ($deleted = get_topic_deleted_posts($id)) { $extra = sprintf(__('+%d more'), $deleted); if ('all' == @$_GET['view']) { $r .= " {$extra}"; } else { $r .= " <a href='" . esc_attr(add_query_arg('view', 'all', get_topic_link($id))) . "'>{$extra}</a>"; } } } return $r; }
<span id="topic_posts">(<?php topic_posts_link(); ?> )</span> <span id="topic_voices">(<?php printf(_n('%s voice', '%s voices', bb_get_topic_voices()), bb_get_topic_voices()); ?> )</span> <ul class="topicmeta"> <li><?php printf(__('Asked %1$s ago by %2$s'), get_topic_start_time(), get_topic_author()); ?> </li> <?php if (1 < get_topic_posts()) { ?> <li><?php printf(__('<a href="%1$s">Latest answer</a> from %2$s'), esc_attr(get_topic_last_post_link()), get_topic_last_poster()); ?> </li> <?php } if (bb_is_user_logged_in()) { ?> <li<?php echo $class; ?> id="favorite-toggle"><?php user_favorites_link(); ?>
</h3> <ol> <?php foreach ($popular as $topic) { ?> <li><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?> "><?php topic_title(); ?> </a> — <?php printf(_n('%s post', '%s posts', get_topic_posts()), bb_number_format_i18n(get_topic_posts())); ?> </li> <?php } ?> </ol> <?php } ?> <?php do_action('bb_stats_right'); ?> </div>