871867e44de333212458a77b564c1efcad04b38a
2 /********************************************************************************
3 * include/groups.inc.php : class for group lists
4 * ------------------------
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
10 /** class for group lists
20 * @param $_nntp RESOURCE handle to NNTP socket
23 function groups(&$_nntp) {
24 $desc=$_nntp->xgtitle();
25 $list=$_nntp->liste();
31 foreach ($desc as $g=>$d) {
32 $this->overview
[$g][0]=$d;
33 $this->overview
[$g][1]=$list[$g][0];
35 foreach (array_diff(array_keys($list),array_keys($desc)) as $g) {
36 $this->overview
[$g][0]="-";
37 $this->overview
[$g][1]=$list[$g][0];
40 foreach ($list as $g=>$l) {
41 $this->overview
[$g][0]="-";
42 $this->overview
[$g][1]=$l[0];
49 * @param $_nntp RESOURCE handle to NNTP socket
50 * @param date INTEGER date of last update
52 function update(&$_nntp,$_date) {
53 $serverdate = $_nntp->date();
54 if (!$serverdate) $serverdate=time();
55 $newlist = $_nntp->newgroups($_date);
56 if (!$newlist) return false
;
57 $this->date
= $serverdate;
58 foreach (array_keys($newlist) as $g) {
59 $groupstat = $_nntp->group($g);
60 $groupdesc = $_nntp->xgtitle($g);
61 $this->overview
[$g][0]=($groupdesc?
$groupdesc:"-");
62 $this->overview
[$g][1]=$groupstat[0];