[Mailman-Users] Re: Displaying Total Member Count

Paul H Byerly paul at thcwd.com
Thu Nov 6 03:14:59 CET 2003


AllKnightAccess wrote:

> > Is there a way to display the total member count for each mailing list on
> > the
> > list admin overview and the mailing list overview pages (without having to
> > login), similiar to how the list name and description is already displayed?

      Yes, but you will have to get a bit dirty.  I've done it on the 
public list info page, but I think doing the same to the admin page would 
be about the same.  The code you want to add is:

Link(mlist.GetScriptURL('listinfo'), Bold(mlist.real_name)),
                  len(mlist.members) + len(mlist.digest_members)

For reference, below is my 
<prefix>/mailman/Mailman/Cgi/listinfo.py  starting with line 132

     if advertised:
         table.AddRow(['&nbsp;', '&nbsp;', '&nbsp;', '&nbsp;'])
         table.AddRow([Bold(FontAttr(_('List Information'), size='+2')),
                       Bold(FontAttr(_('Members'), size='+2')),
                       Bold(FontAttr(_('List Archive'), size='+2')),
                       Bold(FontAttr(_('Description'), size='+2'))
                       ])
         highlight = 1
         for mlist in advertised:
             table.AddRow(
                 [Link(mlist.GetScriptURL('listinfo'), Bold(mlist.real_name)),
                  len(mlist.members) + len(mlist.digest_members),
                  Link(mlist.GetBaseArchiveURL(), Bold('Archives')),
                  mlist.description or Italic(_('[no description 
available]'))])
             if highlight and mm_cfg.WEB_HIGHLIGHT_COLOR:
                 table.AddRowInfo(table.GetCurrentRowIndex(),
                                  bgcolor="#e3bda3")
             highlight = not highlight

     doc.AddItem(table)
     doc.AddItem('<hr>')
     doc.AddItem(MailmanLogo())
     print doc.Format()

You can see the results at http://svr01.thcwd.com/mailman/listinfo .


<>< Paul 


More information about the Mailman-Users mailing list