cvs: php-bugs-web /include functions.inc

From: Date: Sun, 10 Feb 2002 05:14:58 +0000
Subject: cvs: php-bugs-web /include functions.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-8659@lists.php.net to get a copy of this message
jimw Sun Feb 10 00:14:58 2002 EDT Modified files: /php-bugs-web/include functions.inc Log: i always wondered where those bugs updates that didn't have any comments came from. Index: php-bugs-web/include/functions.inc diff -u php-bugs-web/include/functions.inc:1.21 php-bugs-web/include/functions.inc:1.22 --- php-bugs-web/include/functions.inc:1.21 Sat Feb 9 22:00:53 2002 +++ php-bugs-web/include/functions.inc Sun Feb 10 00:14:58 2002 @@ -207,7 +207,7 @@ if ($ncomment) $text[] = " New Comment:\n\n".stripslashes($ncomment); - $text[] = get_old_comments($bug['id']); + $text[] = get_old_comments($bug['id'], empty($ncomment)); /* format mail so it looks nice, use 72 to make piners happy */ $wrapped_text = wordwrap(join("\n",$text), 72); @@ -267,7 +267,7 @@ $GLOBALS['bug'][$n]); } -function get_old_comments ($bug_id) +function get_old_comments ($bug_id, $all = 0) { $divider = str_repeat("-", 72); $max_message_length = 10 * 1024; @@ -278,9 +278,11 @@ if (!$res) return ""; - # skip the most recent (this is get_old_comments, not get_all_comments!) - $row = mysql_fetch_row($res); - if (!$row) return ""; + # skip the most recent unless the caller wanted all comments + if (!$all) { + $row = mysql_fetch_row($res); + if (!$row) return ""; + } while (($row = mysql_fetch_row($res)) && strlen($output) < $max_message_length && $count++ < $max_comments) { $output .= "[$row[0]] $row[1]\n\n$row[2]\n\n$divider\n\n";

« previous php.mirrors (#8659) next »