diff -u -r -N glsuck-0.0.1.orig/docs/ChangeLog glsuck-0.0.1/docs/ChangeLog --- glsuck-0.0.1.orig/docs/ChangeLog 2004-11-10 15:48:40.000000000 -0600 +++ glsuck-0.0.1/docs/ChangeLog 2004-11-11 10:38:37.982128776 -0600 @@ -5,13 +5,27 @@ *glsuck-0.0.1 (03 Nov 2004) 11 Nov 2004; Mike Green docs/ChangeLog, - includes/app.functions.php: + includes/app.functions.php, patch-0.0.1-03: + + Added patch numbers to list of changed files in ChangeLog. Fixed bug + that was causing articles with no poster information to be assigned + uid 0, which may or may not exist. Changed code to look up Anonymous + user UID and use that instead. To fix database corruption, find out + what poster_id is Anonymous in poster_ids (2 in this example) and + run the following from a mysql prompt: + + update article_ids set poster_id=2; + + This will change all article_ids to poster_id 2. + + 11 Nov 2004; Mike Green docs/ChangeLog, + includes/app.functions.php, patch-0.0.1-02: Fixed bug in comment parsing where an error would return instead of continue! Woops. 08 Nov 2004; Mike Green docs/ChangeLog, - glsuck, includes/app.functions.php, includes/globals.php: + glsuck, includes/app.functions.php, includes/globals.php, patch-0.0.1-01: Started framework for combing through local browser cache instead of retrieving pages from the internet. Will return "Anonymous" as the author diff -u -r -N glsuck-0.0.1.orig/includes/app.functions.php glsuck-0.0.1/includes/app.functions.php --- glsuck-0.0.1.orig/includes/app.functions.php 2004-11-10 15:47:29.000000000 -0600 +++ glsuck-0.0.1/includes/app.functions.php 2004-11-11 10:27:45.000000000 -0600 @@ -470,6 +470,21 @@ /***************************************************************************** * * *****************************************************************************/ +function getUid($user_name='') { + +if ($user_name == '') { return false; } +$user_name = addslashes($user_name); + +$sql = "select poster_id from poster_ids where poster_name='$user_name'"; +if (!$qid = db_query($sql)) { return false; } + +return db_result($qid,0,0); + +} + +/***************************************************************************** + * * + *****************************************************************************/ function getUrl($url='') { if ($url == '') { return false; } @@ -1177,7 +1192,7 @@ return trim($junk[2]); } -return "0"; +return false; } @@ -1645,7 +1660,7 @@ return false; } } else { - $article_uid = 0; + $article_uid = getUid("Anonymous"); } if (!$msgdate = parseArticleDate($page)) { @@ -1809,7 +1824,7 @@ continue; } } else { - $comment_uid = 0; + $comment_uid = getUid("Anonymous"); } if (!$comment_date = parseCommentDate($comment,$page)) { echo "ERROR: cannot determine date for comment $comment\n";