/** * Gets the pagination links of comments pagination * * @return string pagination links */ function osc_comments_pagination() { if (osc_comments_per_page() == 0 || osc_item_comments_page() === 'all') { return ''; } else { $params = array('total' => ceil(osc_item_total_comments() / osc_comments_per_page()), 'selected' => osc_item_comments_page(), 'url' => osc_item_comments_url('{PAGE}')); $pagination = new Pagination($params); return $pagination->doPagination(); } }
/** * Helper to use twitter pagination in item comments */ function twitter_comments_item_pagination() { $params = array('total' => ceil(osc_item_total_comments() / osc_comments_per_page()), 'selected' => osc_item_comments_page(), 'class_first' => '', 'class_last' => '', 'class_prev' => 'prev', 'class_next' => 'next', 'delimiter' => '', 'text_prev' => sprintf(__('%s Previous', 'twitter'), '←'), 'text_next' => sprintf(__('Next %s', 'twitter'), '→'), 'class_selected' => 'active', 'class_non_selected' => '', 'force_limits' => false, 'url' => osc_item_comments_url('{PAGE}')); $pagination = new TwitterPagination($params); return $pagination->doPagination(); }
_e('Share', 'twitter_bootstrap'); ?> </a> </p> <?php osc_run_hook('location'); ?> </div> <!-- item detail end --> <?php if ($is_comments_enabled) { ?> <!-- comments --> <div class="span16 columns comments well"> <?php if ($is_can_comment && osc_item_total_comments() > 0) { ?> <h2><?php _e('Comments', 'twitter_bootstrap'); ?> </h2> <!-- list comments --> <div class="list-comments"> <?php while (osc_has_item_comments()) { ?> <div class="comment"> <h3><?php echo osc_comment_title(); ?> <small><em><?php
_e('Delete your comment', 'twitter'); ?> "><?php _e('Delete', 'twitter'); ?> </a> </p> <?php } ?> </div> <?php } ?> <?php if ((!(osc_comments_per_page() == 0) || osc_item_comments_page() === 'all') && osc_item_total_comments() >= osc_comments_per_page()) { ?> <div class="pagination"> <ul> <?php echo twitter_comments_item_pagination(); ?> </ul> </div> <?php } ?> </div> <!-- list comments end --> <?php }