]>
git.p6c8.net - selfforum.git/blob - selfforum-cgi/shared/Template/_thread.pm
8c3cbbb240cf9d17b222fb92e2adb722a7c9ae96
3 # ====================================================
4 # Autor: n.d.p. / 2001-01-11
5 # lm : n.d.p. / 2001-01-11
6 # ====================================================
8 # HTML-Darstellung eines Threads
9 # ====================================================
13 package Template
::_thread
;
15 use vars
qw(@ISA @EXPORT);
17 use Encode::Plain; $Encode::Plain::utf8 = 1;
18 use Posting::_lib qw(short_hr_time);
22 # ====================================================
24 # ====================================================
28 @EXPORT = qw(html_thread);
30 ################################
34 ################################
36 sub html_thread
($$$) {
37 my ($msg, $template, $par) = @_;
39 return \'' unless @$msg;
41 my $temp = $par -> {template};
42 my $i = $par -> {cgi} -> {user};
43 my $t = $par -> {cgi} -> {thread};
44 my $p = $par -> {cgi} -> {posting};
45 my $c = $par -> {cgi} -> {command};
46 my $tid = $par -> {thread};
53 if ($par -> {start} == -1) {
55 @indexes = (1..$_ -> {answers});
57 if ($_ -> {answers}) {
58 $html = '<dd
><dl
><dt
>'
59 .${$template -> scrap ($temp -> {(length $_ -> {cat})?'start
':'startNC
'},
60 {$temp -> {name} => $_ -> {name},
61 $temp -> {subject} => $_ -> {subject},
62 $temp -> {cat} => $_ -> {cat},
63 $temp -> {time} => plain(short_hr_time ($_ -> {time})),
64 $temp -> {link} => query_string({$t => $tid, $p => $_ -> {mid}})},
70 .${$template -> scrap ($temp -> {(length $_ -> {cat})?'start
':'startNC
'},
71 {$temp -> {name} => $_ -> {name},
72 $temp -> {subject} => $_ -> {subject},
73 $temp -> {cat} => $_ -> {cat},
74 $temp -> {time} => plain(short_hr_time ($_ -> {time})),
75 $temp -> {link} => query_string({$t => $tid, $p => $_ -> {mid}})},
84 for (@$msg) {$start++; last if ($_ -> {mid} == $par -> {start});}
85 my $end = $start + $msg -> [$start] -> {answers};
87 @indexes = ($start..$end);
88 $oldlevel = $startlevel = $msg -> [$par -> {start}] -> {level};}
91 for (@$msg[@indexes]) {
93 if ($_ -> {level} < $oldlevel) {
94 $html.='</dl></dd>' x ($oldlevel - $_ -> {level});}
96 $oldlevel = $_ -> {level};
98 if ($_ -> {answers}) {
100 .${$template -> scrap ($temp -> {(length $_ -> {cat})?'line
':'lineNC
'},
101 {$temp -> {name} => $_ -> {name},
102 $temp -> {subject} => $_ -> {subject},
103 $temp -> {cat} => $_ -> {cat},
104 $temp -> {time} => plain(short_hr_time ($_ -> {time})),
105 $temp -> {link} => query_string({$t => $tid, $p => $_ -> {mid}})},
111 .${$template -> scrap ($temp -> {(length $_ -> {cat})?'line
':'lineNC
'},
112 {$temp -> {name} => $_ -> {name},
113 $temp -> {subject} => $_ -> {subject},
114 $temp -> {cat} => $_ -> {cat},
115 $temp -> {time} => plain(short_hr_time ($_ -> {time})),
116 $temp -> {link} => query_string({$t => $tid, $p => $_ -> {mid}})},
122 $html.='</dl></dd>' x ($oldlevel - $startlevel);
127 # ====================================================
128 # Modulinitialisierung
129 # ====================================================
131 # making require happy
134 # ====================================================
135 # end of Template::_thread
136 # ====================================================
patrick-canterino.de