Untested, but this should work:
First use get_pages to find all other pages (or CPT) with the same parent as the current page. Then find the 'previous' and 'next' pages.
function wpse5422_the_page_siblings(){
$post_id = get_the_ID();
$parent_id = wp_get_post_parent_id( $post_ID );
$post_type = get_post_type($post_id);
$sibling_list = get_pages(array(
'sort_column'=>'menu_order',
'sort_order' =>'asc',
'child_of' =>$parent_id,
'post_type'=> $post_type
))
if( !$sibling_list || is_wp_error($sibling_list) )
return false;
$pages = array();
foreach ($sibling_list as $sibling ) {
$pages[] = $sibling->ID;
}
$current = array_search($post_id, $pages);
$prevID = isset($pages[$current-1]) ? $pages[$current-1] : false;
$nextID = isset($pages[$current+1]) ? $pages[$current+1] : false;
echo wpse5422_display_prev_next($prevID, $nextID);
}
The above function must be used inside the loop - it takes the current page (or any hierarchical post type) and finds the previous and next sibling page (i.e. of same parent as current page) according to their menu order (this can be changed to date, or title).
It then uses the following function which takes two IDs as an argument and is simply responsible for producing the output:
function wpse5422_display_prev_next($prevID=false, $nextID=false){
if( empty($prevID) && empty($nextID) )
return false;
$html = '<div class="navigation">';
if( !empty($prevID) ){
$html .= '<div class="alignleft">';
$html .= '<a href="'.get_permalink($prevID).'">Previous</a>';
$html .= '</div>';
}
if( !empty($nextID) ){
$html .= '<div class="alignright">';
$html .= '<a href="'.get_permalink($nextID).'">Next</a>';
$html .= '</div>';
}
$html .= '</div><!-- .navigation -->';
return $html;
}
Where to put this code
Ideally you should create a plug-in out of it. It will work in functions.php - but really, it shouldn't be living there.
Usage
Inside the Loop, whether you want to display the page links: wpse5422_the_page_siblings();.