๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #26703

Re: slrn: wish list

#26703
From: Olly Betts
Date: Mon, 07 Oct 1996 00:00
47 lines
2041 bytes
In article <slrn55dcmv.8b4.ralf@Magrathea.bj-ig.de>, Ralf M๏ฟฝller wrote:
>3. It would be nice to have a chance to sort threads by the average score of
>   their articles and not only by maximum article score.

I wrote the "sort by score" patch.  The reason it sorts threads by the
maximum score of any article in each thread is because that's what I find
most useful.  Here's a (completely untested as I'm rather busy) patch which
is something like what you'll need to do to get the average score.

--- art.c~	Mon Oct  7 16:26:42 1996
+++ art.c	Mon Oct  7 16:29:08 1996
@@ -3766,6 +3766,7 @@
 	if (h->child == NULL) h->num_children = 0;
 	else
 	  {
+	     long total_score = 0;
 	     Slrn_Header_Type *next;
 	     h->num_children = compute_num_children (h);
 	     next = h->next;
@@ -3774,8 +3775,7 @@
 #if SLRN_HAS_SORT_BY_SCORE
 		  if (next->flags & HEADER_HIGH_SCORE)
 		    h->flags |= FAKE_HEADER_HIGH_SCORE;
-		  if (next->score > h->thread_score)
-		    h->thread_score = next->score;
+		  total_score += next->score;
 #else
 		  if (next->flags & HEADER_HIGH_SCORE)
 		    {
@@ -3785,6 +3785,9 @@
 #endif
 		  next = next->next;
 	       }
+#if SLRN_HAS_SORT_BY_SCORE
+	     h->thread_score = total_score / h->num_children;
+#endif
 	  }
 	h = h->sister;
      }

Olly
-- 
cool wet grass  cool wet grass  cool wet grass  cool wet grass  cool wet grass


Technical Details
Message-ID: <slrn55i8uf.133.olly@mantis.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <slrn55dcmv.8b4.ralf@Magrathea.bj-ig.de>

Show Full Headers
Complete Article Headers
Message-ID: <slrn55i8uf.133.olly@mantis.co.uk>
Subject: Re: slrn: wish list
Date: Mon, 07 Oct 1996 00:00:00 +0000
From: olly@mantis.co.uk (Olly Betts)
References: <slrn55dcmv.8b4.ralf@Magrathea.bj-ig.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 187344641
Content-type: text/plain; charset=iso-8859-1
Organization: Mantis Consultants Ltd, Cambridge. UK.
Mime-version: 1.0
Newsgroups: news.software.readers