From: <re...@us...> - 2003-04-30 23:37:35
|
Update of /cvsroot/tikiwiki/tiki/lib In directory sc8-pr-cvs1:/tmp/cvs-serv4528/lib Modified Files: Tag: release_tauceti-bugfixes commentslib.php Log Message: Performance enhancements. Index: commentslib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/commentslib.php,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -d -r1.10 -r1.10.2.1 --- commentslib.php 28 Mar 2003 20:56:44 -0000 1.10 +++ commentslib.php 30 Apr 2003 23:37:31 -0000 1.10.2.1 @@ -320,7 +320,7 @@ function get_comment_replies($id,$sort_mode,$offset,$max,$threshold=0) { - $query = "select threadId,title,userName,points,commentDate,parentId from tiki_comments where average>=$threshold and parentId=$id order by $sort_mode,commentDate desc limit $offset,$max"; + $query = "select threadId,title,userName,points,commentDate,parentId from tiki_comments where parentId=$id and average>=$threshold order by $sort_mode,commentDate desc limit $offset,$max"; $result = $this->query($query); $retval=Array(); $retval["numReplies"]=$result->numRows(); @@ -404,9 +404,9 @@ $query = "select count(*) from tiki_comments where object='$hash' and average<$threshold"; $below = $this->getOne($query); if($find) { - $mid=" where type='s' and average>=$threshold and object='$hash' and parentId=$parentId and (title like '%".$find."%' or data like '%".$find."%') "; + $mid=" where object='$hash' and parentId=$parentId and type='s' and average>=$threshold and (title like '%".$find."%' or data like '%".$find."%') "; } else { - $mid=" where type='s' and average>=$threshold and object='$hash' and parentId=$parentId "; + $mid=" where object='$hash' and parentId=$parentId and type='s' and average>=$threshold "; } $query = "select * from tiki_comments $mid order by $sort_mode limit $offset,$maxRecords"; //print("$query<br/>"); @@ -443,9 +443,9 @@ // Now the non-sticky $ret = Array(); if($find) { - $mid=" where type<>'s' and average>=$threshold and object='$hash' and parentId=$parentId and (title like '%".$find."%' or data like '%".$find."%') "; + $mid=" where object='$hash' and parentId=$parentId and type<>'s' and average>=$threshold and (title like '%".$find."%' or data like '%".$find."%') "; } else { - $mid=" where type<>'s' and average>=$threshold and object='$hash' and parentId=$parentId "; + $mid=" where object='$hash' and parentId=$parentId and type<>'s' and average>=$threshold "; } $query = "select * from tiki_comments $mid order by $sort_mode limit $offset,$maxRecords"; //print("$query<br/>"); @@ -621,4 +621,4 @@ return $ar2["lastPost"] - $ar1["lastPost"]; } -?> \ No newline at end of file +?> |