type = $_type; $desc = $banana->nntp->xgtitle(); if ($_type == BANANA_GROUP_NEW) { $list = $banana->nntp->newgroups($banana->profile['lastnews']); } else { $list = $banana->nntp->liste(); if ($_type == BANANA_GROUP_SUB) { $mylist = Array(); foreach ($banana->profile['subscribe'] as $g) { if (isset($list[$g])) { $mylist[$g] = $list[$g]; } } $list = $mylist; } } foreach ($list as $g=>$l) { $this->overview[$g][0] = isset($desc[$g]) ? $desc[$g] : '-'; $this->overview[$g][1] = $l[0]; } ksort($this->overview); if (empty($this->overview) && $_type == BANANA_GROUP_SUB) { $this = new BananaGroups(BANANA_GROUP_ALL); } } /** updates overview * @param date INTEGER date of last update */ function update($_date) { global $banana; $serverdate = $banana->nntp->date(); if (!$serverdate) $serverdate=time(); $newlist = $banana->nntp->newgroups($_date); if (!$newlist) return false; $this->date = $serverdate; foreach (array_keys($newlist) as $g) { $groupstat = $banana->nntp->group($g); $groupdesc = $banana->nntp->xgtitle($g); $this->overview[$g][0]=($groupdesc?$groupdesc:"-"); $this->overview[$g][1]=$groupstat[0]; } return true; } function to_html($show_form = false) { global $banana; if (empty($this->overview)) { return; } $html = '
'._b_('Total').' | '; if ($show_form) { $html .= _b_('Abo.').' | '; } elseif ($this->type == BANANA_GROUP_SUB) { $html .= _b_('Nouveaux').' | '; } $html .= _b_('Nom').' | '._b_('Description').' |
---|---|---|---|---|
{$ginfo[0]} | "; if ($show_form) { $html .= 'profile['subscribe'])) { $html .= ' checked="checked"'; } $html .= ' /> | '; } elseif ($this->type == BANANA_GROUP_SUB) { $html .= ''.($new ? $new : '-').' | '; } $html .= "$g | {$d[0]} |