Rendering test
authorArt Cancro <ajc@citadel.org>
Tue, 12 Oct 2010 20:11:24 +0000 (16:11 -0400)
committerArt Cancro <ajc@citadel.org>
Tue, 12 Oct 2010 20:11:24 +0000 (16:11 -0400)
webcit/blogview_renderer.c

index 1a18297f07ec035bfbbfb4ede8c688936e5ba72d..42cf1abb0751588853664719730673622b26d59c 100644 (file)
@@ -146,7 +146,7 @@ void blogview_learn_thread_references(struct blogpost *bp)
 int blogview_render(SharedMessageStatus *Stat, void **ViewSpecific, long oper)
 {
        struct blogview *BLOG = (struct blogview *) *ViewSpecific;
-       int i;
+       int i, j;
 
        /* Pass #1 - sort */
        if (Stat->nummsgs > 0) {
@@ -172,21 +172,36 @@ int blogview_render(SharedMessageStatus *Stat, void **ViewSpecific, long oper)
         * * Comments
         * * etc
         */
+
+
        for (i=0; (i<BLOG->num_msgs); ++i) {
                if (BLOG->msgs[i].msgnum > 0L) {
-                       if (BLOG->msgs[i].refs == 0) {
-                               wc_printf("<b>");
-                       }
-                       wc_printf("Message %d, #%ld, id %d, refs %d",
+                       wc_printf("Message %d, #%ld, id %d, refs %d<br>\n",
                                i,
                                BLOG->msgs[i].msgnum,
                                BLOG->msgs[i].id,
                                BLOG->msgs[i].refs
                        );
+               }
+       }
+
+       wc_printf("<hr>\n");
+
+       for (i=0; (i<BLOG->num_msgs); ++i) {
+               if (BLOG->msgs[i].msgnum > 0L) {
                        if (BLOG->msgs[i].refs == 0) {
-                               wc_printf("</b>");
+                               wc_printf("<b>Message %d, #%ld, id %d, refs %d</b><br>\n",
+                                       i,
+                                       BLOG->msgs[i].msgnum,
+                                       BLOG->msgs[i].id,
+                                       BLOG->msgs[i].refs
+                               );
+                               for (j=0; (j<BLOG->num_msgs); ++j) {
+                                       if (BLOG->msgs[j].refs == BLOG->msgs[i].id) {
+                                               wc_printf("* comment %d<br>\n", j);
+                                       }
+                               }
                        }
-                       wc_printf("<br>\n");
                }
        }