get next posts url

function get_next_posts_url( $max_page = 0 ) {
        global $paged, $[WP_Query](http://codex.wordpress.org/Class_Reference/WP_Query);

        if( !$paged = intval([get_query_var](http://codex.wordpress.org/Function_Reference/get_query_var)('page'))) {
                $paged = intval([get_query_var](http://codex.wordpress.org/Function_Reference/get_query_var)('paged'));
        }

        if ( !$max_page ) {
                $max_page = $[WP_Query](http://codex.wordpress.org/Class_Reference/WP_Query)->max_num_pages;
        }

        if ( !$paged ) {
                $paged = 1;
        }

        $nextpage = intval($paged) + 1;

        if ( ![is_single](http://codex.wordpress.org/Function_Reference/is_single)() && ( $nextpage <= $max_page ) ) {
                return next_posts( $max_page, false );
        }

        return false;
}