I fiddled with the get_all_series() function to fix the problem -- I hope. I'm no PHP hacker, so I'd be glad for someone to correct me. Here's a patch to in-series.php version 2.0:
--- in-series.php 2006/12/11 20:52:18 1.1
+++ in-series.php 2006/12/11 21:19:56
@@ -3,7 +3,7 @@
Plugin Name: In Series
Plugin URI: http://www.skippy.net/
Description: Provides navigation controls for next/previous within a connected series of posts
-Version: 2.0
+Version: 2.0+
Author: Scott Merrill
Author URI: http://www.skippy.net/
@@ -94,13 +94,24 @@
AND b.meta_key='series_order')
GROUP BY a.post_id
ORDER BY CAST(b.meta_value AS SIGNED)
- ASC LIMIT 1;");
+ ASC LIMIT 10;");
if ( (! $result) || ( count($result) == 0 ) ) {
return FALSE;
}
foreach ($result as $r) {
+ /*
+ * Suppress duplicates (by Jerry Peek, 11 Dec 2006):
+ */
+ if ($all) {
+ foreach ($all as $id => $title) {
+ if (strcmp($r->meta_value, $title) == 0) {
+ continue 2;
+ }
+ }
+ }
+ // If we get here, no existing value matches, so this isn't a duplicate:
$all[$r->post_id] = $r->meta_value;
}
The indentation above doesn't appear, and this system doesn't seem to allow <pre> tags, so you'll just have to follow the braces. (I guess a bunch of entities would do the job...)
In case you haven't seen patches before, this one says:
- Change the plugin version number (on line 6) from
2.0 to 2.0+. (This is an unofficial change, so I added a +.)
- In the call to
$wpdb->get_results (line 97), change the LIMIT of 1 to 10. This returns up to 10 results. (I think it should be much higher -- probably the total number of post_ids in the database -- but I'm thinking that there must be a better way. Suggestions, please.)
- Add code before line 104 that doesn't add a new member to
$all unless that series_name doesn't exist yet in $all.
This is a hack, so I'm hoping someone who knows PHP and WP coding can fix it and show me a better way. Thanks.