]>
git.p6c8.net - selfforum.git/blob - selfforum-cgi/shared/Template/_thread.pm
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 Encode
::Plain
; $Encode::Plain
::utf8
= 1;
16 use Posting
::_lib
qw(short_hr_time);
20 # ====================================================
22 # ====================================================
24 use base
qw(Exporter);
25 @Template::_thread
::EXPORT
= qw(html_thread);
27 ################################
31 ################################
33 sub html_thread
($$$) {
34 my ($msg, $template, $par) = @_;
36 return \'' unless @$msg;
38 my $temp = $par -> {template};
39 my $i = $par -> {cgi} -> {user};
40 my $t = $par -> {cgi} -> {thread};
41 my $p = $par -> {cgi} -> {posting};
42 my $c = $par -> {cgi} -> {command};
43 my $tid = $par -> {thread};
50 if ($par -> {start} == -1) {
52 @indexes = (1..$_ -> {answers});
54 if ($_ -> {answers}) {
55 $html = '<dd
><dl
><dt
>'
56 .${$template -> scrap ($temp -> {(length $_ -> {cat})?'start
':'startNC
'},
57 {$temp -> {name} => $_ -> {name},
58 $temp -> {subject} => $_ -> {subject},
59 $temp -> {cat} => $_ -> {cat},
60 $temp -> {time} => plain(short_hr_time ($_ -> {time})),
61 $temp -> {link} => query_string({$t => $tid, $p => $_ -> {mid}})},
67 .${$template -> scrap ($temp -> {(length $_ -> {cat})?'start
':'startNC
'},
68 {$temp -> {name} => $_ -> {name},
69 $temp -> {subject} => $_ -> {subject},
70 $temp -> {cat} => $_ -> {cat},
71 $temp -> {time} => plain(short_hr_time ($_ -> {time})),
72 $temp -> {link} => query_string({$t => $tid, $p => $_ -> {mid}})},
81 for (@$msg) {$start++; last if ($_ -> {mid} == $par -> {start});}
82 my $end = $start + $msg -> [$start] -> {answers};
84 @indexes = ($start..$end);
85 $oldlevel = $startlevel = $msg -> [$start] -> {level};}
88 for (@$msg[@indexes]) {
90 if ($_ -> {level} < $oldlevel) {
91 $html.='</dl></dd>' x ($oldlevel - $_ -> {level});}
93 $oldlevel = $_ -> {level};
95 if ($_ -> {answers}) {
97 .${$template -> scrap ($temp -> {(length $_ -> {cat})?'line
':'lineNC
'},
98 {$temp -> {name} => $_ -> {name},
99 $temp -> {subject} => $_ -> {subject},
100 $temp -> {cat} => $_ -> {cat},
101 $temp -> {time} => plain(short_hr_time ($_ -> {time})),
102 $temp -> {link} => query_string({$t => $tid, $p => $_ -> {mid}})},
108 .${$template -> scrap ($temp -> {(length $_ -> {cat})?'line
':'lineNC
'},
109 {$temp -> {name} => $_ -> {name},
110 $temp -> {subject} => $_ -> {subject},
111 $temp -> {cat} => $_ -> {cat},
112 $temp -> {time} => plain(short_hr_time ($_ -> {time})),
113 $temp -> {link} => query_string({$t => $tid, $p => $_ -> {mid}})},
119 $html.='</dl></dd>' x ($oldlevel - $startlevel);
124 # ====================================================
125 # Modulinitialisierung
126 # ====================================================
128 # making require happy
131 # ====================================================
132 # end of Template::_thread
133 # ====================================================
patrick-canterino.de