// remove expired messages
$msgids=array_flip($this->ids);
for ($id=min(array_keys($this->overview)); $id<$first; $id++) {
- $this->delid[$id];
+ $this->delid($id);
}
$this->ids=array_flip($msgids);
$first=max(array_keys($this->overview))+1;
"$first-$last"));
$refs = $_nntp->xhdr("References","$first-$last");
# $this->date=$nntp->date;
- if ($this->ids) {
+ if (isset($this->ids)) {
$this->ids=array_merge($this->ids,array_flip($msgids));
} else {
$this->ids=array_flip($msgids);
}
foreach ($msgids as $id=>$msgid) {
- $msg = new spoolhead($dates[$id],$subjects[$id],$froms[$id],
- (isset($this->overview[$id]->desc)?
- $this->overview[$id]->desc+1:1));
+ if (isset($this->overview[$id])) {
+ $msg = $this->overview[$id];
+ $msg->desc++;
+ } else {
+ $msg = new spoolhead($dates[$id],$subjects[$id],$froms[$id],1);
+ }
$refs[$id]=str_replace("><","> <",$refs[$id]);
$msgrefs=preg_split("/( |\t)/",strtr($refs[$id],$this->ids));
$parents=preg_grep("/^\d+$/",$msgrefs);
$msg->parent=array_pop($parents);
$p = $msg->parent;
while ($p) {
- $this->overview[$p]->desc++;
- $p = $this->overview[$p]->parent;
+ if (isset($this->overview[$p])) {
+ $this->overview[$p]->desc++;
+ if (isset($this->overview[$p]->parent)) {
+ $p = $this->overview[$p]->parent;
+ } else {
+ $p = false;
+ }
+ } else {
+ $this->overview[$p] = new spoolhead($dates[$p],$subjects[$p],$froms[$p],1);
+ $p = false;
+ }
}
if ($msg->parent!="")
$this->overview[$msg->parent]->children[]=$id;
switch ($_display) {
case 1:
foreach ($this->overview as $i=>$p) {
- if (!isset($this->overview[$i]->parent) &&
+ if (isset($this->overview[$i]) &&
+ !isset($this->overview[$i]->parent) &&
($this->overview[$i]->descunread==0)) {
$this->killdesc($i);
}
function disp_desc($_id,$_index="",$_first=0,$_last=0,$_ref="",
$_pfx_node="", $_pfx_end="",$_head=true) {
+ global $css;
$debug = false;
$spfx_f = '<img src="img/k1.gif" height="21" width="9" alt="o" />';
$spfx_n = '<img src="img/k2.gif" height="21" width="9" alt="*" />';
if (!sizeof($this->overview[$_id]->children) && ($_index<=$_last)
&& ($_index>=$_first)) {
- echo '<tr class="'.($_index%2?"pair":"impair")."\">\n";
- echo "<td class=\"date\">"
+ echo '<tr class="'.($_index%2?$css["pair"]:$css["impair"])."\">\n";
+ echo "<td class=\"{$css['date']}\">"
.formatSpoolHeader("date",$this->overview[$_id]->date,$_id,
$this->group,($_index==$_ref),$this->overview[$_id]->isread)
." </td>\n";
- echo "<td class=\"subject\"><div class=\"tree\">"
+ echo "<td class=\"{$css['subject']}\"><div class=\"{$css['tree']}\">"
.$_pfx_node.($_head?$spfx_f:$spfx_s)."</div>"
.formatSpoolHeader("subject",$this->overview[$_id]->subject,$_id,
$this->group,($_index==$_ref),$this->overview[$_id]->isread)
.($debug?" $_id $_index ".
$this->overview[$_id]->desc." ".$this->overview[$_id]->descunread." ":"")." </td>\n";
- echo "<td class=\"author\">"
+ echo "<td class=\"{$css['author']}\">"
.formatSpoolHeader("from",$this->overview[$_id]->from,$_id,
$this->group,($_index==$_ref),$this->overview[$_id]->isread)
." </td>\n</tr>";
}
$children = $this->overview[$_id]->children;
if (($_index<=$_last) && ($_index>=$_first)) {
- echo '<tr class="'.($_index%2?"pair":"impair")."\">\n";
- echo "<td class=\"date\">"
+ echo '<tr class="'.($_index%2?$css["pair"]:$css["impair"])."\">\n";
+ echo "<td class=\"{$css['date']}\">"
.formatSpoolHeader("date",$this->overview[$_id]->date,$_id,
$this->group,($_index==$_ref),$this->overview[$_id]->isread)
." </td>\n";
- echo "<td class=\"subject\"><div class=\"tree\">"
+ echo "<td class=\"{$css['subject']}\"><div class=\"{$css['tree']}\">"
.$_pfx_node.$spfx_n."</div>"
.formatSpoolHeader("subject",$this->overview[$_id]->subject,$_id,
$this->group,($_index==$_ref),$this->overview[$_id]->isread)
.($debug?" $_id $_index ".
$this->overview[$_id]->desc." ".$this->overview[$_id]->descunread." ":"")." </td>\n";
- echo "<td class=\"author\">"
+ echo "<td class=\"{$css['author']}\">"
.formatSpoolHeader("from",$this->overview[$_id]->from,$_id,
$this->group,($_index==$_ref),$this->overview[$_id]->isread)
." </td>\n</tr>";
*/
function disp($_first=0,$_last=0,$_ref="") {
+ global $css;
$index=1;
if (sizeof($this->overview)) {
foreach ($this->overview as $id=>$msg) {
}
}
} else {
- echo "<tr class=\"pair\">\n";
+ echo "<tr class=\"{$css['pair']}\">\n";
echo "\t<td colspan=\"3\">\n";
echo "\t\tNo post in this newsgroup\n";
echo "\t</td>\n";