$i=0;
@x=();
$padding = "";
$x[0] = 0;
open(IN,"$logfile") || &error("Open Error: $logfile");
if ($mode ne "past") { $top = <IN>; }
while (<IN>) {
($no,$reno,$lx,$sub,$email,$url,$name,$dat,$msg,$t,$h,$pw,$w,$oya,$sml,$child) = split(/<>/);
if ($reno == 0) { $i++; }
if ($i < $page + 1) { next; }
if ($i > $page + $p_tree) { next; }
$x[$lx+1]=$child;
$x[$lx]--;
$padding = " ";
for ($j=0;$j<$lx;$j++){
$padding .= ($x[$j]<=0)?" ":"┃";
}
$padding .= ($x[$lx]<=0)?"┗":"┣";
# 所定時間以内の投稿は[NEWマーク]表示
if ($time - $t > $new_time * 3600) { $newsign = ""; }
else { $newsign = $newmark; }
# 記事タイトル長調整
$sub = &cut_subject($sub);
# 過去記事
if ($mode eq "past") {
if ($lx == 0) {
print "<a href=\"$script?mode=allread&no=$no&page=$page\">$treehead</a> ";
} else {
print "$padding";
}
print "<a href=\"$script?mode=allread&pastlog=$in{'pastlog'}&no=$oya&page=$page&act=past\#$no\">$no\.$sub</a> - <strong>$name</strong> $dat \n";
# 削除記事
} elsif ($pw eq 'DEL') {
if ($lx == 0) {
if ($i != $page + 1) {print "</td></tr></table>";}
print "<dd><br><table summary=\"$sub\"><tr>$td_nowrap<a href=\"$script?mode=allread&no=$no&page=$page\">$treehead</a> - ";
print "$no\.$sub - $dat\n";
} else {
print "$padding";
print "$no\.$sub - $dat\n";
}
# レス記事
} elsif ($lx != 0) {
print "$padding";
print "<a href=\"$script?mode=msgview&no=$no&reno=$reno&oya=$oya&page=$page\">$no\.$sub</a> - <strong>$name</strong> $dat $newsign\n";
# 親記事
} else {
if ($i != $page + 1) {print "</td></tr></table>";}
print "<dd><br><table summary=\"$sub\"><tr>$td_nowrap<a href=\"$script?mode=allread&no=$no&page=$page\">$treehead</a> ";
print "<a href=\"$script?mode=msgview&no=$no&reno=$reno&oya=$oya&page=$page\">$no\.$sub</a> - <strong>$name</strong> $dat $newsign\n";
}
print "<br>";
}
close(IN);
print "</td></tr></table></dd>\n";
if ($mode ne "past") { print "</DL>\n"; }
|