Index: C:/Xampp/htdocs/development/subversion/wordpress/wp-includes/template-functions-links.php
===================================================================
--- C:/Xampp/htdocs/development/subversion/wordpress/wp-includes/template-functions-links.php	(revision 3510)
+++ C:/Xampp/htdocs/development/subversion/wordpress/wp-includes/template-functions-links.php	(working copy)
@@ -250,6 +250,9 @@
 		$join .= ')'; 
 	}
 
+	$join = apply_filters('prev_next_post_join', $join);
+	$where = apply_filters('prev_next_post_where', '');
+
 	$sql_exclude_cats = '';
 	if ( !empty($excluded_categories) ) {
 		$blah = explode(' and ', $excluded_categories);
@@ -261,7 +264,7 @@
 		$posts_in_ex_cats_sql = 'AND ID NOT IN (' . implode($posts_in_ex_cats, ',') . ')';
 	}
 
-	return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join WHERE post_date < '$current_post_date' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql ORDER BY post_date DESC LIMIT 1");
+	return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join WHERE post_date < '$current_post_date' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql $where ORDER BY post_date DESC LIMIT 1");
 }
 
 function get_next_post($in_same_cat = false, $excluded_categories = '') {
@@ -282,6 +285,9 @@
 		}
 		$join .= ')'; 
 	}
+	
+	$join = apply_filters('prev_next_post_join', $join);
+	$where = apply_filters('prev_next_post_where', '');
 
 	$sql_exclude_cats = '';
 	if ( !empty($excluded_categories) ) {
@@ -296,7 +302,7 @@
 
 	$now = current_time('mysql');
 	
-	return @$wpdb->get_row("SELECT ID,post_title FROM $wpdb->posts $join WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql AND ID != $post->ID ORDER BY post_date ASC LIMIT 1");
+	return @$wpdb->get_row("SELECT ID,post_title FROM $wpdb->posts $join WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql AND ID != $post->ID $where ORDER BY post_date ASC LIMIT 1");
 }
 
 

