From owner-freebsd-www@FreeBSD.ORG Wed May 28 03:40:06 2008 Return-Path: Delivered-To: freebsd-www@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AC08106564A for ; Wed, 28 May 2008 03:40:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0E7E58FC17 for ; Wed, 28 May 2008 03:40:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m4S3e5aq091184 for ; Wed, 28 May 2008 03:40:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m4S3e55Q091178; Wed, 28 May 2008 03:40:05 GMT (envelope-from gnats) Resent-Date: Wed, 28 May 2008 03:40:05 GMT Resent-Message-Id: <200805280340.m4S3e55Q091178@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-www@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Edwin Groothuis Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A97881065674 for ; Wed, 28 May 2008 03:35:41 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) by mx1.freebsd.org (Postfix) with ESMTP id 062AF8FC0A for ; Wed, 28 May 2008 03:35:40 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by mail5out.barnet.com.au (Postfix, from userid 1001) id 855842218AA1; Wed, 28 May 2008 13:35:39 +1000 (EST) Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail5auth.barnet.com.au", Issuer "*.barnet.com.au" (verified OK)) by mail5.barnet.com.au (Postfix) with ESMTP id 1A31221B324C for ; Wed, 28 May 2008 13:35:39 +1000 (EST) Received: from k7.mavetju (k7.mavetju.org [10.251.1.18]) by mail5auth.barnet.com.au (Postfix) with ESMTP id 08D952218A7B for ; Wed, 28 May 2008 13:35:36 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id 9CB968C; Wed, 28 May 2008 13:35:36 +1000 (EST) Message-Id: <20080528033536.9CB968C@k7.mavetju> Date: Wed, 28 May 2008 13:35:36 +1000 (EST) From: Edwin Groothuis To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: www/124055: [patch] clean layout www/en/multimedia perl script X-BeenThere: freebsd-www@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Edwin Groothuis List-Id: FreeBSD Project Webmasters List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2008 03:40:06 -0000 >Number: 124055 >Category: www >Synopsis: [patch] clean layout www/en/multimedia perl script >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-www >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed May 28 03:40:04 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Edwin Groothuis >Release: FreeBSD 7.0-RELEASE i386 >Organization: - >Environment: System: FreeBSD k7.mavetju 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: Clean up code, more style compatible (for as far as that is possible with Perl code) >How-To-Repeat: >Fix: Index: multimedia.pl =================================================================== RCS file: /home/dcvs/www/en/multimedia/multimedia.pl,v retrieving revision 1.1 diff -u -r1.1 multimedia.pl --- multimedia.pl 15 May 2007 21:30:41 -0000 1.1 +++ multimedia.pl 28 May 2008 03:34:00 -0000 @@ -2,7 +2,7 @@ # # $Id$ -# $FreeBSD: www/en/multimedia/multimedia.pl,v 1.1 2007/05/15 21:30:41 keramida Exp $ +# $FreeBSD$ # use strict; @@ -10,148 +10,164 @@ use Data::Dumper; use POSIX; -my @months=( - "","January","February","March", - "April","May","June","July", - "August","September","October", - "November","December" +my @months = ( + "", "January", "February", "March", + "April", "May", "June", "July", + "August", "September", "October", + "November", "December" ); -my @createdfiles=(); +my @createdfiles = (); -my @tree=(); -my @values=(); -my $treeindex=-1; +my @tree = (); +my @values = (); +my $treeindex = -1; my @items; -my $ci=-1; +my $ci = -1; my %sources; -my $sid=""; +my $sid = ""; my %tags; sub addtags { - my $tags=shift; + my $tags = shift; if ($tags) { - my @w=split(/,/,$tags); + my @w = split(/,/, $tags); foreach my $w (@w) { - $tags{$w}=0 if (!defined $tags{$w}); + $tags{$w} = 0 if (!defined $tags{$w}); $tags{$w}++; } return; } - my $array=shift; - my @array=@{$array}; + my $array = shift; + my @array = @{$array}; foreach my $w (@array) { - $tags{$w}=0 if (!defined $tags{$w}); + $tags{$w} = 0 if (!defined $tags{$w}); $tags{$w}++; } } sub xml_start { - my $expat=shift; - my $element=shift; + my $expat = shift; + my $element = shift; - $tree[++$treeindex]=$element; - while (defined (my $attribute=shift)) { - $values[$treeindex]{$attribute}=shift; + $tree[++$treeindex] = $element; + while (defined (my $attribute = shift)) { + $values[$treeindex]{$attribute} = shift; } if ($element eq "item" - && $treeindex==2) { + && $treeindex == 2) { $ci++; - $items[$ci]=(); - $items[$ci]{source}=$values[$treeindex]{source}; - $items[$ci]{added}=$values[$treeindex]{added}; - $items[$ci]{ci}=$ci; - $items[$ci]{fc}=-1; + $items[$ci] = (); + $items[$ci]{source} = $values[$treeindex]{source}; + $items[$ci]{added} = $values[$treeindex]{added}; + $items[$ci]{ci} = $ci; + $items[$ci]{fc} = -1; } if ($element eq "source" - && $treeindex==2) { - $sid=$values[$treeindex]{id}; - $sources{$values[$treeindex]{id}}=(); + && $treeindex == 2) { + $sid = $values[$treeindex]{id}; + $sources{$values[$treeindex]{id}} = (); + } + + if ($element eq "url" + && $treeindex == 5) { + $items[$ci]{fc}++; } } sub xml_end { - my $expat=shift; - my $element=shift; + my $expat = shift; + my $element = shift; - $values[$treeindex]=(); + $values[$treeindex] = (); $treeindex--; } sub xml_char { - my $expat=shift; - my $value=shift; + my $expat = shift; + my $value = shift; if ($tree[0] eq "multimedia") { - return if ($treeindex==0); + return if ($treeindex == 0); if ($tree[1] eq "items") { - return if ($treeindex==1); + return if ($treeindex == 1); if ($tree[2] eq "item") { - return if ($treeindex==2); + return if ($treeindex == 2); if ($tree[3] eq "title") { - $items[$ci]{title}=$value; + $items[$ci]{title} = "" if (!defined $items[$ci]{title}); + $items[$ci]{title} .= $value; return; } if ($tree[3] eq "desc") { - $items[$ci]{desc}="" if (!defined $items[$ci]{desc}); - $items[$ci]{desc}.=$value; + $items[$ci]{desc} = "" if (!defined $items[$ci]{desc}); + $items[$ci]{desc} .= $value; return; } if ($tree[3] eq "overview") { - $items[$ci]{overview}=$value; + $items[$ci]{overview} = "" if (!defined $items[$ci]{desc}); + $items[$ci]{overview} .= $value; return; } if ($tree[3] eq "link") { - $items[$ci]{link}=$value; + $items[$ci]{link} = "" if (!defined $items[$ci]{link}); + $items[$ci]{link} .= $value; return; } if ($tree[3] eq "tags") { - @{$items[$ci]{tags}}=split(/,/,$value); + @{$items[$ci]{tags}} = split(/,/, $value); addtags($value); return; } if ($tree[3] eq "files") { - return if ($treeindex==3); + return if ($treeindex == 3); if ($tree[4] eq "prefix") { - $items[$ci]{prefix}="" if (!defined $items[$ci]{prefix}); - $items[$ci]{prefix}.=$value; + $items[$ci]{prefix} = "" if (!defined $items[$ci]{prefix}); + $items[$ci]{prefix} .= $value; return; } if ($tree[4] eq "file") { - return if ($treeindex==4); + return if ($treeindex == 4); if ($tree[5] eq "url") { - $items[$ci]{fc}++; - $items[$ci]{files}{$items[$ci]{fc}}{url}=$value; + # Note that $items[$ci]{fc} gets incremented in xml_start + $items[$ci]{files}{$items[$ci]{fc}}{url} = "" + if (!defined $items[$ci]{files}{$items[$ci]{fc}}{url}); + $items[$ci]{files}{$items[$ci]{fc}}{url} .= $value; return; } if ($tree[5] eq "size") { - $items[$ci]{files}{$items[$ci]{fc}}{size}=$value; + $items[$ci]{files}{$items[$ci]{fc}}{size} = "" + if (!defined $items[$ci]{files}{$items[$ci]{fc}}{size}); + $items[$ci]{files}{$items[$ci]{fc}}{size} .= $value; return; } if ($tree[5] eq "length") { - $items[$ci]{files}{$items[$ci]{fc}}{length}=$value; + $items[$ci]{files}{$items[$ci]{fc}}{length} = "" + if (!defined $items[$ci]{files}{$items[$ci]{fc}}{length}); + $items[$ci]{files}{$items[$ci]{fc}}{length} .= $value; return; } if ($tree[5] eq "desc") { - $items[$ci]{files}{$items[$ci]{fc}}{desc}=$value; + $items[$ci]{files}{$items[$ci]{fc}}{desc} = "" + if (!defined $items[$ci]{files}{$items[$ci]{fc}}{desc}); + $items[$ci]{files}{$items[$ci]{fc}}{desc} .= $value; return; } if ($tree[5] eq "tags") { - @{$items[$ci]{files}{$items[$ci]{fc}}{tags}}=split(/,/,$value); + @{$items[$ci]{files}{$items[$ci]{fc}}{tags}} = split(/,/, $value); addtags($value); - addtags("",$items[$ci]{tags}); + addtags("", $items[$ci]{tags}); return; } goto error; @@ -164,17 +180,17 @@ } if ($tree[1] eq "sources") { - return if ($treeindex==1); + return if ($treeindex == 1); if ($tree[2] eq "source") { - return if ($treeindex==2); + return if ($treeindex == 2); if ($tree[3] eq "name") { - $sources{$sid}{name}=$value; + $sources{$sid}{name} = $value; return; } if ($tree[3] eq "url") { - $sources{$sid}{url}=$value; + $sources{$sid}{url} = $value; return; } goto error; @@ -188,7 +204,7 @@ print "Unknown item at depth $treeindex: $tree[$treeindex]\n"; } -my $p=new XML::Parser( +my $p = new XML::Parser( Handlers => { Start => \&xml_start, End => \&xml_end, @@ -197,64 +213,83 @@ ); $p->parsefile("multimedia-input.xml"); -my @site_order=(); +my @site_order = (); { sub site_sort { - my %a=%{$a}; - my %b=%{$b}; + my %a = %{$a}; + my %b = %{$b}; return $a{source} cmp $b{source} if ($a{source} ne $b{source}); return $a{title} cmp $b{title}; } - @site_order=sort site_sort @items; + @site_order = sort site_sort @items; } -my @date_order=(); +my @date_order = (); { - my %dates=(); + my %dates = (); foreach my $item (@items) { - my %item=%{$item}; - $dates{$item{ci}}=$item{added}; + my %item = %{$item}; + $dates{$item{ci}} = $item{added}; } - my @dates=keys(%dates); - @date_order=sort { $dates{$b} cmp $dates{$a} } @dates; + my @dates = keys(%dates); + @date_order = sort { $dates{$b} cmp $dates{$a} } @dates; } # # HTML overview output # sub print_htmlitem { - my $item=shift; - my %item=%{$item}; - my $source=shift; - my %source=%{$source}; + my $item = shift; + my %item = %{$item}; + my $source = shift; + my %source = %{$source}; print FOUT "
  • "; if (defined $item{overview}) { print FOUT "$item{title}\n"; } else { - my %media=%{$item{files}{0}}; + my %media = %{$item{files}{0}}; print FOUT "$item{title}\n"; if (defined $media{size} || defined $media{length}) { - my $s=""; + my $s = ""; print FOUT "("; if (defined $media{size}) { print FOUT "$media{size}"; - $s=", "; + $s = ", "; } if (defined $media{length}) { print FOUT "$s$media{length}"; - $s=", "; + $s = ", "; } print FOUT ")"; } } - print FOUT "
    Source: ",$source{name},"
    \n"; - print FOUT "Tags: ",join(", ",@{$item{tags}}),"
    \n"; + print FOUT "
    Source: ", + $source{name}, "
    \n"; + print FOUT "Added: ", + substr($item{added}, 6, 2), " ", + $months[substr($item{added}, 4, 2)], " ", + substr($item{added}, 0, 4), "
    \n"; + + print FOUT "Tags: "; + { + my $first = 1; + foreach my $t (@{$item{tags}}) { + print FOUT ", " if (!$first); +# join(", ", @{$item{$t}}), "
    \n"; + my $th = $t; + $th =~ s/ /_/g; + print FOUT "$t"; + $first = 0; + } + } + print FOUT "
    \n"; + if (defined $item{overview} && defined $item{files}) { - my $c=0; + my $c = 0; foreach my $m (keys(%{$item{files}})) { - my %file=%{$item{files}{$m}}; + my %file = %{$item{files}{$m}}; print FOUT ", " if ($c++); if (defined $item{prefix}) { print FOUT "$file{desc}"; @@ -262,15 +297,15 @@ print FOUT "$file{desc}"; } if (defined $file{size} || defined $file{length}) { - my $s=""; + my $s = ""; print FOUT " ("; if (defined $file{size}) { print FOUT "$file{size}"; - $s=", "; + $s = ", "; } if (defined $file{length}) { print FOUT "$s$file{length}"; - $s=", "; + $s = ", "; } print FOUT ")"; } @@ -280,35 +315,35 @@ print FOUT "$item{desc}\n"; } { - $createdfiles[$#createdfiles+1]="multimedia.html"; - open(FOUT,">multimedia.html"); - open(FIN,"multimedia.html.pre"); - my @lines=; + $createdfiles[$#createdfiles+1] = "multimedia.html"; + open(FOUT, ">multimedia.html"); + open(FIN, "multimedia.html.pre"); + my @lines = ; close(FIN); print FOUT @lines; - open(FIN,"multimedia.html.intro"); - @lines=; + open(FIN, "multimedia.html.intro"); + @lines = ; close(FIN); print FOUT @lines; print FOUT "

    Newest resources

    \n"; - my $month=""; + my $month = ""; foreach my $order (@date_order) { - my %item=%{$items[$order]}; - my %source=%{$sources{$item{source}}}; - if (substr($item{added},0,6) ne $month) { - print FOUT "

    ",$months[substr($item{added},4,2)+0]," ",substr($item{added},0,4),"

      "; - $month=substr($item{added},0,6); + my %item = %{$items[$order]}; + my %source = %{$sources{$item{source}}}; + if (substr($item{added}, 0, 6) ne $month) { + print FOUT "

    ", $months[substr($item{added}, 4, 2)+0], " ", substr($item{added}, 0, 4), "

      "; + $month = substr($item{added}, 0, 6); } - print_htmlitem(\%item,\%source); + print_htmlitem(\%item, \%source); } print FOUT "
    \n"; - open(FIN,"multimedia.html.post"); - @lines=; + open(FIN, "multimedia.html.post"); + @lines = ; close(FIN); print FOUT @lines; @@ -319,35 +354,35 @@ # HTML cloud output # { - $createdfiles[$#createdfiles+1]="multimedia-tags.html"; - open(FOUT,">multimedia-tags.html"); - open(FIN,"multimedia.html.pre"); - my @lines=; + $createdfiles[$#createdfiles+1] = "multimedia-tags.html"; + open(FOUT, ">multimedia-tags.html"); + open(FIN, "multimedia.html.pre"); + my @lines = ; close(FIN); print FOUT @lines; - open(FIN,"multimedia.html.intro"); - @lines=; + open(FIN, "multimedia.html.intro"); + @lines = ; close(FIN); print FOUT @lines; print FOUT "

    Tags

    \n"; - my $month=""; + my $month = ""; sub size { - return $b cmp $a if ($tags{$b}==$tags{$a}); + return $b cmp $a if ($tags{$b} == $tags{$a}); return $tags{$b} <=> $tags{$a}; } - my $size=20; - my $c=0; + my $size = 20; + my $c = 0; foreach my $tag (sort size(keys(%tags))) { - my $ftag=$tag; - $ftag=~s/ /_/g; + my $ftag = $tag; + $ftag =~ s/ /_/g; print FOUT "$tag\n"; - $size-- if ($c++%10==0 && $size>2); + $size-- if ($c++%10 == 0 && $size > 2); } - open(FIN,"multimedia.html.post"); - @lines=; + open(FIN, "multimedia.html.post"); + @lines = ; close(FIN); print FOUT @lines; @@ -359,54 +394,54 @@ # { foreach my $tag (keys(%tags)) { - my $ftag=$tag; - $ftag=~s/ /_/g; - $createdfiles[$#createdfiles+1]="multimedia-tag-$ftag.html"; - open(FOUT,">multimedia-tag-$ftag.html"); + my $ftag = $tag; + $ftag =~ s/ /_/g; + $createdfiles[$#createdfiles+1] = "multimedia-tag-$ftag.html"; + open(FOUT, ">multimedia-tag-$ftag.html"); - open(FIN,"multimedia.html.pre"); - my @lines=; + open(FIN, "multimedia.html.pre"); + my @lines = ; close(FIN); print FOUT @lines; - open(FIN,"multimedia.html.intro"); - @lines=; + open(FIN, "multimedia.html.intro"); + @lines = ; close(FIN); print FOUT @lines; print FOUT "

    Tag: $tag

    \n"; print FOUT "
      \n"; foreach my $item (@items) { - my %item=%{$item}; - my %source=%{$sources{$item{source}}}; + my %item = %{$item}; + my %source = %{$sources{$item{source}}}; - my $found=0; + my $found = 0; foreach my $itag (@{$item{tags}}) { if ($itag eq $tag) { - $found=1; + $found = 1; last; } } if (!$found) { foreach my $file (keys(%{$item{files}})) { - my %file=%{$item{files}{$file}}; + my %file = %{$item{files}{$file}}; foreach my $itag (@{$file{tags}}) { if ($itag eq $tag) { - $found=1; + $found = 1; last; } } } } - print_htmlitem(\%item,\%source) if ($found); + print_htmlitem(\%item, \%source) if ($found); } print FOUT "
    \n"; - open(FIN,"multimedia.html.post"); - @lines=; + open(FIN, "multimedia.html.post"); + @lines = ; close(FIN); print FOUT @lines; close(FOUT); @@ -417,31 +452,31 @@ # HTML all-sources output # { - $createdfiles[$#createdfiles+1]="multimedia-sources.html"; - open(FOUT,">multimedia-sources.html"); - open(FIN,"multimedia.html.pre"); - my @lines=; + $createdfiles[$#createdfiles+1] = "multimedia-sources.html"; + open(FOUT, ">multimedia-sources.html"); + open(FIN, "multimedia.html.pre"); + my @lines = ; close(FIN); print FOUT @lines; - open(FIN,"multimedia.html.intro"); - @lines=; + open(FIN, "multimedia.html.intro"); + @lines = ; close(FIN); print FOUT @lines; print FOUT "

    Sources

    \n"; print FOUT "
      \n"; - my $lastsource=""; + my $lastsource = ""; foreach my $item (@site_order) { - my %item=%{$item}; + my %item = %{$item}; next if ($lastsource eq $item{source}); - $lastsource=$item{source}; + $lastsource = $item{source}; - print FOUT "
    • ",$sources{$item{source}}{name},"\n"; + print FOUT "
    • ", $sources{$item{source}}{name}, "\n"; } print FOUT "
    \n"; - open(FIN,"multimedia.html.post"); - @lines=; + open(FIN, "multimedia.html.post"); + @lines = ; close(FIN); print FOUT @lines; close(FOUT); @@ -451,40 +486,40 @@ # HTML per-source output # { - my $lastsource=""; + my $lastsource = ""; foreach my $item (@site_order) { - my %item=%{$item}; - my %source=%{$sources{$item{source}}}; + my %item = %{$item}; + my %source = %{$sources{$item{source}}}; if ($lastsource ne $item{source}) { if ($lastsource) { print FOUT "\n"; - open(FIN,"multimedia.html.post"); - my @lines=; + open(FIN, "multimedia.html.post"); + my @lines = ; close(FIN); print FOUT @lines; close(FOUT); } - $createdfiles[$#createdfiles+1]="multimedia-source-$item{source}.html"; - open(FOUT,">multimedia-source-$item{source}.html"); - open(FIN,"multimedia.html.pre"); - my @lines=; + $createdfiles[$#createdfiles+1] = "multimedia-source-$item{source}.html"; + open(FOUT, ">multimedia-source-$item{source}.html"); + open(FIN, "multimedia.html.pre"); + my @lines = ; close(FIN); print FOUT @lines; - open(FIN,"multimedia.html.intro"); - @lines=; + open(FIN, "multimedia.html.intro"); + @lines = ; close(FIN); print FOUT @lines; - $lastsource=$item{source}; + $lastsource = $item{source}; print FOUT "

    $source{name}

    \n"; print FOUT "
      \n"; } - print_htmlitem(\%item,\%source); + print_htmlitem(\%item, \%source); } print FOUT "
    \n"; - open(FIN,"multimedia.html.post"); - my @lines=; + open(FIN, "multimedia.html.post"); + my @lines = ; close(FIN); print FOUT @lines; close(FOUT); @@ -496,52 +531,53 @@ { sub htmlentities { - my $s=shift; - $s=~s/&/&/g; - $s=~s//>/g; + my $s = shift; + $s =~ s/&/&/g; + $s =~ s//>/g; return $s;; } sub printxml_multiple { - my $item=shift; - my %item=%{$item}; - my $source=shift; - my %source=%{$source}; + my $item = shift; + my %item = %{$item}; + my $source = shift; + my %source = %{$source}; return if ($item{fc}<0); - for (my $i=0;$i<=$item{fc};$i++) { - my %f=%{$item{files}{$i}}; + for (my $i = 0; $i <= $item{fc}; $i++) { + my %f = %{$item{files}{$i}}; - my %tempitem=%item; - $tempitem{title}.=" - $f{desc}"; - $f{url}="$item{prefix}/$f{url}" + my %tempitem = %item; + $tempitem{title} .= " - $f{desc}"; + $f{url} = "$item{prefix}/$f{url}" if (defined $item{prefix}); - printxml_single(\%tempitem,\%source,\%f); + printxml_single(\%tempitem, \%source, \%f); } } sub printxml_single { - my $item=shift; - my %item=%{$item}; - my $source=shift; - my %source=%{$source}; - my $file=shift; - my %file=%{$file}; - - my $date=POSIX::strftime("%a, %d %b %Y %H:%M:%S %Z", - 0,0,0,substr($item{added},6,2),substr($item{added},4,2)-1,substr($item{added},0,4)-1900); - - my $tags=join(", ",@{$item{tags}}); - for my $tag (@{$file{tags}}) { - $tags.=", $tag"; + my $item = shift; + my %item = %{$item}; + my $source = shift; + my %source = %{$source}; + my $file = shift; + my %file = %{$file}; + + my $date = POSIX::strftime("%a, %d %b %Y %H:%M:%S %Z", + 0, 0, 0, substr($item{added}, 6, 2), + substr($item{added}, 4, 2)-1, substr($item{added}, 0, 4)-1900); + + my $tags = join(", ", @{$item{tags}}); + foreach my $tag (@{$file{tags}}) { + $tags .= ", $tag"; } print FOUT "\n"; - print FOUT "",htmlentities("$source{name} - $item{title}"),"\n"; - print FOUT "",htmlentities($file{url}),"\n"; + print FOUT "", htmlentities("$source{name} - $item{title}"), "\n"; + print FOUT "", htmlentities($file{url}), "\n"; print FOUT "$date\n"; - print FOUT "\n"; + print FOUT "\n"; print FOUT ""; print FOUT htmlentities("$item{title}
    From: $source{name}
    "); print FOUT htmlentities("Tags: $tags
    \n"); @@ -550,11 +586,11 @@ print FOUT "
    \n"; } - $createdfiles[$#createdfiles+1]="multimedia.xml"; - open(FOUT,">multimedia.xml"); + $createdfiles[$#createdfiles+1] = "multimedia.xml"; + open(FOUT, ">multimedia.xml"); - my @s=stat("multimedia-input.xml"); - my $date=POSIX::strftime("%a, %d %b %Y %H:%M:%S %Z",localtime($s[9])); + my @s = stat("multimedia-input.xml"); + my $date = POSIX::strftime("%a, %d %b %Y %H:%M:%S %Z", localtime($s[9])); print FOUT < @@ -566,13 +602,13 @@ EOF foreach my $order (@date_order) { - my %item=%{$items[$order]}; - my %source=%{$sources{$item{source}}}; + my %item = %{$items[$order]}; + my %source = %{$sources{$item{source}}}; if (defined $item{overview}) { - printxml_multiple(\%item,\%source); + printxml_multiple(\%item, \%source); } else { - printxml_single(\%item,\%source,$item{files}{0}); + printxml_single(\%item, \%source, $item{files}{0}); } } @@ -588,7 +624,7 @@ # Created files # { - open(FOUT,">multimedia.created"); + open(FOUT, ">multimedia.created"); foreach my $f (@createdfiles) { print FOUT "$f\n"; } >Release-Note: >Audit-Trail: >Unformatted: