diff -u -r -N yasuck-0.0.8/docs/ChangeLog yasuck-0.0.9/docs/ChangeLog --- yasuck-0.0.8/docs/ChangeLog 2005-07-17 17:11:32.000000000 -0500 +++ yasuck-0.0.9/docs/ChangeLog 2005-07-17 15:08:33.000000000 -0500 @@ -2,8 +2,22 @@ # Copyright (c)2004 badpenguins.com; Distributed under the GPL v2 # +*yasuck-0.0.9 (17 Jul 2005) + *yasuck-0.0.8 (5 Jan 2005) + 17 Jul 2005: Mike Green docs/ChangeLog, + includes/app.functions.php, includes/globals.php, + yasuck, patch-0.0.8-02: + + Bug brought to my attention by ColonelZen. Posts with no/invalid + authors or subjects were assumed to be non-existant. Actually these + posts did have valid messages. Fixed it to enter !!UNKNOWN AUTHOR!! or + !!NO SUBJECT!! in these cases. Removed --listgaps option since I + cannot recall what purpose it served and it did not appear to + produce useful results. Added --listmissing to list msgids that are + missing from the database as a replacement. Bumped version to 0.0.9. + 06 Jan 2005: Mike Green docs/ChangeLog, docs/README, includes/app.functions.php, includes/globals.php, patch-0.0.8-01: diff -u -r -N yasuck-0.0.8/includes/app.functions.php yasuck-0.0.9/includes/app.functions.php --- yasuck-0.0.8/includes/app.functions.php 2005-07-17 17:11:32.000000000 -0500 +++ yasuck-0.0.9/includes/app.functions.php 2005-07-17 17:14:16.000000000 -0500 @@ -79,14 +79,14 @@ define(ACTION,"init"); return true; break; - case "--listgaps": + case "--listmissing": if (defined('ACTION')) { return false; } - if (defined('BOARD')) { return false; } + if (defined('BOARD')) { return false; } $j++; - $board = $args[$j]; + $board = $args[$j]; if (empty($board)) { return false; } if (substr($board,0,2) == "--") { return false; } - define(ACTION,"listgaps"); + define(ACTION,"listmissing"); define(BOARD,$board); return true; break; @@ -570,7 +570,7 @@ --get BOARD Retrieve messages from board BOARD --help Display this help message --init Initialize database (destructive) - --listgaps BOARD List possible missing messages + --listmissing BOARD List each missing msgid from database --merge BOARD DB merge all database entries from DB into database --plugholes BOARD Resuck blank messages --poster POSTER Only retrieve messages posted by POSTER @@ -718,10 +718,10 @@ /***************************************************************************** * * *****************************************************************************/ -function listGaps($board_name='') { +function listMissing($board_name='') { if ($board_name == '') { - echo "What board do you want to list gaps for?"; + echo "What board do you want to list missing msgs for?"; return false; } if (!checkDatabase()) { @@ -751,30 +751,23 @@ return false; } -defined('GAPMAX') ? $gapmax = GAPMAX : $gapmax = 10; -if (!is_numeric($gapmax)) { $gapmax = 10; } - -$lowest = db_result($qid,0,0); -$highest = db_result($qid,$num - 1,0); -$last = $lowest; -$gaps = array(); - +$tmp_ar = array(); for($j=0; $j < $num; $j++) { - $mid = db_result($qid,$j,0); - $gap = $mid - $last; - if ( $gap > $gapmax ) { - $gaps[] = "$last - $mid ($gap)"; - } - $last = $mid; - } + $key = db_result($qid,$j,0); + $tmp_ar[$key] = ''; + } +$low = db_result($qid,0,0); +$cnt = $num - 1; +$high = db_result($qid,$cnt,0); +db_free_result($qid); -echo "lowest: $lowest\n"; -if (count($gaps) > 0) { - foreach($gaps as $gap) { - echo "gap: $gap\n"; - } - } -echo "highest: $highest\n"; +echo "low: $low high: $high\n"; + +for ($j = $low; $j < $high; $j++) { + if (!array_key_exists($j,$tmp_ar)) { + echo "$j\n"; + } + } return true; @@ -2007,16 +2000,18 @@ return false; } if (!$subject = parseMsgSubject($page)) { - echo "ERROR: ID: $message_id: subject\n"; - return false; + //echo "ERROR: ID: $message_id: subject\n"; + //return false; + $subject = "!!NO SUBJECT!!"; } if (SUBJECT_SEARCH and defined('SUBJECT_TEXT')) { $pos = strpos(strtolower($subject),strtolower(SUBJECT_TEXT)); if ($pos === false) { return true; } } if (!$author = parseMsgAuthor($page)) { - echo "ERROR: ID: $message_id: author\n"; - return false; + //echo "ERROR: ID: $message_id: author\n"; + //return false; + $author = '!!UNKNOWN AUTHOR!!'; } if (AUTHOR_SEARCH and defined('AUTHOR_TEXT')) { $pos = strpos(strtolower($author),strtolower(AUTHOR_TEXT)); @@ -2071,7 +2066,7 @@ } } if (! $ds = date('Y-m-d H:i:s',strtotime($msgdate))) { - echo "ERROR: ID: $message_id: msgdate\n"; + echo "ERROR: ID: $message_id: msgdate convert\n"; } $message_id = addslashes($message_id); diff -u -r -N yasuck-0.0.8/includes/globals.php yasuck-0.0.9/includes/globals.php --- yasuck-0.0.8/includes/globals.php 2005-07-17 17:11:32.000000000 -0500 +++ yasuck-0.0.9/includes/globals.php 2005-07-17 15:00:24.000000000 -0500 @@ -33,7 +33,6 @@ define(MAXMISSES,50); define(VERSION,"0.0.8"); define(PATCHLEVEL,""); -define(GAPMAX,15); // // nntp export related settings diff -u -r -N yasuck-0.0.8/yasuck yasuck-0.0.9/yasuck --- yasuck-0.0.8/yasuck 2005-01-05 09:25:52.000000000 -0600 +++ yasuck-0.0.9/yasuck 2005-07-17 14:49:00.000000000 -0500 @@ -57,8 +57,8 @@ echo $status; exit(); break; - case "listgaps": - $rc = listGaps(BOARD); + case "listmissing": + $rc = listMissing(BOARD); if ($rc === true) { $status = "Done (success)\n"; } else {