Constructs a page list.
- builds the page list, e.g. 1 ... 6 7 [8] 9 10 ... 15.
- flexible_start causes it to use "url.page" instead of "url;start=page".
- very importantly, cleans up the start value passed, and forces it to
be a multiple of num_per_page.
- checks that start is not more than max_value.
- base_url should be the URL without any start parameter on it.
- uses the compactTopicPagesEnable and compactTopicPagesContiguous
settings to decide how to display the menu.
an example is available near the function definition.
$pageindex = constructPageIndex($scripturl . '?board=' . $board, $_REQUEST['start'], $num_messages, $maxindex, true);