Your Location is: Home > Pagination

Changing per page pagination to infinite scroll

From: Monaco View: 3434 V1T0x 

Question

I currently have Per Page Pagination using Simple Machines Forum ( SMF ) I would love to change it to Infinite Scroll ( https://infinite-scroll.com/ ) But have no Idea how to...

This is how SMF creates pages

Display.php

$context['page_index'] = constructPageIndex($scripturl . '?topic=' . $topic . '.%1$d', $_REQUEST['start'], $context['total_visible_posts'], $context['messages_per_page'], true);
$context['start'] = $_REQUEST['start'];

// This is information about which page is current, and which page we're on - in case you don't like the constructed page index. (again, wireles..)
$context['page_info'] = array(
    'current_page' => $_REQUEST['start'] / $context['messages_per_page'] + 1,
    'num_pages' => floor(($context['total_visible_posts'] - 1) / $context['messages_per_page']) + 1,
); 

MessageIndex.template.php

<div class="pagesection">
    ', template_button_strip($context['normal_buttons'], 'right'), '
    ', $context['menu_separator'], '
    <div class="pagelinks floatleft">
        <a href="#main_content_section" class="button" id="bot">', $txt['go_up'], '</a>
        ', $context['page_index'], '
    </div>
</div>';

Best answer