Rosanne DiMesio : Fix flat comment mode

Jeremy Newman jnewman at winehq.org
Wed Jul 26 10:33:57 CDT 2017


Module: appdb
Branch: master
Commit: b5db619580757b3a93471701f020e6a8dca35c9e
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=b5db619580757b3a93471701f020e6a8dca35c9e

Author: Rosanne DiMesio <dimesio at earthlink.net>
Date:   Wed Jul 26 08:46:59 2017 -0500

Fix flat comment mode

Fixes bug 12927 and makes flat the default mode.

Signed-off-by: Rosanne DiMesio <dimesio at earthlink.net>
Signed-off-by: Jeremy Newman <jnewman at codeweavers.com>

---

 include/comment.php | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/include/comment.php b/include/comment.php
index 3fb8b94..789dd19 100644
--- a/include/comment.php
+++ b/include/comment.php
@@ -673,17 +673,24 @@ class Comment {
     /**
      * display flat comments
      */
-    public static function display_comments_flat($versionId)
+    public static function do_display_comments_flat($hResult)
     {
-        $hResult = Comment::grab_comments($versionId);
-        if ($hResult)
+        while($oRow = query_fetch_object($hResult))
         {
-            while($oRow = query_fetch_object($hResult))
+            Comment::view_app_comment($oRow);
+            $hResult2 = Comment::grab_comments($oRow->versionId, $oRow->commentId);
+            if($hResult && query_num_rows($hResult2))
             {
-                Comment::view_app_comment($oRow);
+                Comment::do_display_comments_flat($hResult2);
             }
         }
     }
+    
+    public static function display_comments_flat($versionId, $threadId)
+    {
+        $hResult = Comment::grab_comments($versionId, $threadId);
+        Comment::do_display_comments_flat($hResult);
+    }
 
     public static function view_app_comments($versionId, $threadId = 0)
     {
@@ -731,9 +738,9 @@ class Comment {
 
         //hide or display depending on pref
         if ($_SESSION['current']->isLoggedIn())
-            $mode = $_SESSION['current']->getPref("comments:mode", "threaded");
+            $mode = $_SESSION['current']->getPref("comments:mode", "flat");
         else
-            $mode = "threaded"; /* default non-logged in users to threaded comment display mode */
+            $mode = "flat"; /* default non-logged in users to flat comment display mode */
 
         if ( isset($aClean['sMode']) && $aClean['sMode']=="nested")
             $mode = "nested";
@@ -741,7 +748,7 @@ class Comment {
         switch ($mode)
         {
         case "flat":
-            Comment::display_comments_flat($versionId);
+            Comment::display_comments_flat($versionId, $threadId);
             break;
         case "nested":
             Comment::display_comments_nested($versionId, $threadId);




More information about the wine-cvs mailing list