These lines go in the Loop to save the page ID and the child page list:
$current_page = $post->ID;
$pagelist = wp_list_pages("title_li=&child_of=$post->post_parent&echo=0");
Here is a sample of how you could use the saved values after the Loop:
$pagearray = explode('<li ',$pagelist);
$junk = array_shift($pagearray); // First entry is empty
for ($i=0;$i<sizeof($pagearray);++$i) {
if (strpos($pagearray[$i],"$current_page")) {
break;
}
}
if ($i < sizeof($pagearray)) {
echo '<p>';
// $i points to current page entry in $pagearray
if ($i > 0) { // Is there a previous entry?
$prevlink = $pagearray[$i - 1];
$prevlink = preg_replace('/^.+<a/','<a',$prevlink);
$prevlink = preg_replace('/<\/li>$/','',$prevlink);
echo "« $prevlink";
}
if ($i < (sizeof($pagearray) - 1)) { // Is there a next entry?
$nextlink = $pagearray[$i + 1];
$nextlink = preg_replace('/^.+<a/','<a',$nextlink);
$nextlink = preg_replace('/<\/li>$/','',$nextlink);
echo "    $nextlink »";
}
echo '</p>';
}