';
if ($depth == 0) {
// Clear $contlines[]
unset($contlines);
}
for ($i = 0; $i < $depth; $i++) {
$tmpstr .= '';
if ($depth > $prevdepth) {
if ($contlines) {
for ($j = $prevdepth+1; $j < $depth;
$j++) {
$contlines[$j] = 0;
}
}
$contlines[$prevdepth] = 1;
}
if ($i == $depth-1) {
if ($depth == $prevdepth ||
($contlines[$i+1] == 1 &&
$depth < $prevdepth)) {
$tmpstr .= ' ';
} else {
$tmpstr .= ' ';
}
} elseif ($contlines[$i+1] == 1) {
$tmpstr .= ' ';
}
$tmpstr .= ' | ';
$width -= $indent;
}
$tmpstr .= "";
if ($depth == 0) {
$tmpstr .= ' ';
}
// In a real program you would probably put a link here to a
page
// that can show the message and allow you to reply to it
$tmpstr .= 'Subject: ' . $nodes[$id][0];
$tmpstr .= ' Sender: ' . $nodes[$id][1] .
' |
';
$table = $tmpstr . $table;
$prevdepth = $depth;
}
return $table;
}
function tablerevshow (&$threadlist, &$maxdepth, &$nodes, $width, $indent) {
// Traverse through $threadlist in reverse order and construct the table
for (end($threadlist); $id = key($threadlist); prev($threadlist)) {
$depth = $threadlist[$id];
$span = $maxdepth - $depth + 1;
$pixels = $width - ($depth * $indent);
$tmpstr = '