This question has been answered by BobRay. See the first response.
[[+prevLink]] [[+nextLink]]
<?php
$docId = $modx->resource->get('id');
$siteStart = $modx->getOption('site_start');
if ($docId != $siteStart) {
$pageCount = $modx->getPlaceholder('pageCount');
$page = $modx->getPlaceholder('page');
/* Calculate what you want in the prevLink and nextLink placeholders here
based on $docId, $page, and $pageCount -- then set them in the
$prevLink and $nextLink variables
*/
$modx->setPlaceholder('prevLink', $prevLink);
$modx->setPlaceholder('nextLink', $nextLink);
}
return '';