Пример #1
0
/**
 * 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();
    }
}
Пример #2
0
/**
 * 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();
}