Specifications

// display + or - or a spacer
if ( !$sublist && $this->m_children && sizeof($this->m_childlist))
// we’re on the main page, have some children, and they’re expanded
{
// we are expanded - offer button to collapse
echo “<a href = ‘index.php?collapse=”.
$this->m_postid.”#$this->m_postid’
><img src = ‘images/minus.gif’ valign = bottom
height = 22 width = 22 alt = ‘Collapse Thread’ border = 0></a>”;
}
else if(!$sublist && $this->m_children)
{
// we are collapsed - offer button to expand
echo “<a href = ‘index.php?expand=”.
$this->m_postid.”#$this->m_postid’><img src = ‘images/plus.gif’
height = 22 width = 22 alt = ‘Expand Thread’ border = 0></a>”;
}
else
{
// we have no children, or are in a sublist, do not give button
echo “<img src = ‘images/spacer.gif’ height = 22 width = 22
alt = ‘’valign = bottom>”;
}
echo “ <a name = $this->m_postid ><a href =
‘view_post.php?postid=$this->m_postid’>$this->m_title -
$this->m_poster - “.reformat_date($this->m_posted).”</a>”;
echo “</td></tr>”;
// increment row counter to alternate colors
$row++;
}
// call display on each of this node’s children
// note a node will only have children in its list if expanded
$num_children = sizeof($this->m_childlist);
for($i = 0; $i<$num_children; $i++)
{
$row = $this->m_childlist[$i]->display($row, $sublist);
}
return $row;
}
};
?>
Building Web Forums
C
HAPTER 29
29
BUILDING WEB
FORUMS
727
LISTING 29.5 Continued
35 7842 CH29 3/6/01 3:34 PM Page 727