Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27753/include
Modified Files:
functions_comments.inc.php
Log Message:
fix comment.php popup to not loop through an array of all comments.
Index: functions_comments.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_comments.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- functions_comments.inc.php 19 Nov 2004 11:05:29 -0000 1.2
+++ functions_comments.inc.php 23 Nov 2004 16:38:58 -0000 1.3
@@ -112,7 +112,6 @@
ORDER BY
co.id " . ($order != '' ? $order : '') . "
$limit";
-
$comments = serendipity_db_query($query);
if (!is_array($comments)) {
@@ -143,7 +142,7 @@
return $retval;
}
-function serendipity_printComments($comments, $parentid = 0, $depth = 0, $trace = null) {
+function serendipity_printComments(&$comments, $parentid = 0, $depth = 0, $trace = null) {
global $serendipity;
static $_smartyComments;
@@ -161,7 +160,6 @@
$_smartyComments = array();
}
-
$i = 0;
foreach ($comments as $comment) {
if ($parentid === VIEWMODE_LINEAR || !isset($comment['parent_id']) || $comment['parent_id'] == $parentid) {
@@ -190,13 +188,13 @@
$_smartyComments[] = $comment;
if ($comment['id'] && $parentid !== VIEWMODE_LINEAR ) {
- serendipity_printComments($comments, $comment['id'], ($depth+1), ($trace . $i .'.'));
+ serendipity_printComments($comments, $comment['id'], ($depth+1), ($trace . $i . '.'));
}
}
}
/* We are inside a recusive child, and we need to break out */
- if ( $depth !== 0 ) {
+ if ($depth !== 0) {
return true;
}
|