ossp-web/SHARE/ossp_newsflash.wml
##
## ossp_newsflash.wml -- News Flash
## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com>
##
<define-tag newsflash>
<preserve from max more nohead>
<set-var nohead=*>
<set-var %attributes>
<table width=400 cellspacing=0 cellpadding=1 border=0>
<ifeq "<get-var nohead>" "" "" "
<tr><td><font face="Arial,Helvetica"><b>Date</b></font></td> <td> <font face="Arial,Helvetica"><b>Newsflash</b></font></td></tr>
<tr><td><hr noshade size=1></td> <td><hr noshade size=1></td></tr>
">
<:
open(FP, "< <get-var from>") || die;
my $max = ("<get-var max>" eq '' ? 9999 : "<get-var max>");
@COL = (
'#e5e5e0',
'NONE',
);
$ncol = 1;
$n = 0;
while (<FP>) {
s/T<(((?:OSSP|GNU)\s+)?([^>]+))>/<a href="\/pkg\/tool\/$3\/">$1<\/a>/g;
s/L<(((?:OSSP|GNU)\s+)?([^>]+))>/<a href="\/pkg\/lib\/$3\/">$1<\/a>/g;
s/P<([^>]+)>/<a href="ftp:\/\/ftp.openpkg.org\/current\/SRC\/$1.src.rpm">$1<\/a>/g;
s/N<([^>]+)>/<b>$1<\/b>/g;
s/B<([^>]+)>/<b>$1<\/b>/g;
s/I<([^>]+)>/<i>$1<\/i>/g;
s/H<([^>]+)>/<b><font color="#cc3333">$1<\/font><\/b>/g;
$ncol = ($ncol + 1) % 2;
$col = $COL[$ncol];
#$col = '#e5e5e5' if ($n == 0);
if (m|^(.+?):(.+)|) {
if ($col ne 'NONE') {
print "<tr bgcolor=\"$col\">\n";
}
else {
print "<tr>\n";
}
print " <td align=right><font color=\"#000000\"><tt>$1:</tt></font></td> <td> $2</td>\n";
print "</tr>\n";
}
$n++;
last if ($n >= $max);
}
close(FP);
:>
<ifeq "<get-var more>" "" "" "
<tr>
<td> </td> <td align=right><a href="<get-var more>">[more...]</a></td>
</tr>
">
</table>
<restore from max more nohead>
</define-tag>