function paginate_links($args = '')
 {
     bb_log_deprecated('function', __FUNCTION__, 'bb_paginate_links');
     return bb_paginate_links($args);
 }
function get_page_number_links($args)
{
    if (1 < func_num_args()) {
        $_args = func_get_args();
        $args = array('page' => $_args[0], 'total' => $_args[1], 'per_page' => isset($_args[2]) ? $_args[2] : '', 'mod_rewrite' => isset($_args[3]) ? $_args[3] : 'use_option');
    }
    $defaults = array('page' => 1, 'total' => false, 'per_page' => '', 'mod_rewrite' => 'use_option', 'prev_text' => __('&laquo; Previous'), 'next_text' => __('Next &raquo;'));
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    $add_args = array();
    $uri = rtrim($_SERVER['REQUEST_URI'], '?&');
    if ($mod_rewrite === 'use_option') {
        $mod_rewrite = bb_get_option('mod_rewrite');
    }
    if ($mod_rewrite) {
        $format = '/page/%#%';
        if (1 == $page) {
            if (false === ($pos = strpos($uri, '?'))) {
                $uri = $uri . '%_%';
            } else {
                $uri = substr_replace($uri, '%_%', $pos, 0);
            }
        } else {
            $uri = preg_replace('|/page/[0-9]+|', '%_%', $uri);
        }
        $uri = str_replace('/%_%', '%_%', $uri);
    } else {
        if (1 == $page) {
            if (false === ($pos = strpos($uri, '?'))) {
                $uri = $uri . '%_%';
                $format = '?page=%#%';
            } else {
                $uri = substr_replace($uri, '?%_%', $pos, 1);
                $format = 'page=%#%&';
            }
        } else {
            if (false === strpos($uri, '?page=')) {
                $uri = preg_replace('!&page=[0-9]+!', '%_%', $uri);
                $uri = str_replace('&page=', '', $uri);
                $format = '&page=%#%';
            } else {
                $uri = preg_replace('!\\?page=[0-9]+!', '%_%', $uri);
                $uri = str_replace('?page=', '', $uri);
                $format = '?page=%#%';
            }
        }
    }
    if (isset($_GET['view']) && in_array($_GET['view'], bb_get_views())) {
        $add_args['view'] = $_GET['view'];
    }
    if (empty($per_page)) {
        $per_page = bb_get_option('page_topics');
    }
    $links = bb_paginate_links(array('base' => $uri, 'format' => $format, 'total' => ceil($total / $per_page), 'current' => $page, 'add_args' => $add_args, 'type' => 'array', 'mid_size' => 1, 'prev_text' => $prev_text, 'next_text' => $next_text));
    if ($links) {
        $links = join('', $links);
    }
    return $links;
}