diff --git a/trunk/tools/tagcloud.pl b/trunk/tools/tagcloud.pl index bb56aca..9fdafdb 100755 --- a/trunk/tools/tagcloud.pl +++ b/trunk/tools/tagcloud.pl @@ -22,20 +22,7 @@ while(($subject) = $sth->fetchrow_array()) $val =~ s/^\s*(.*?)\s*$/$1/; if(length($val) >= 4) { - #check if some clever guy has written a tag multiple times - $found = 0; - foreach my $tmpval (@subject) - { - if($val eq $tmpval) - { - $found = 1; - } - } - #only add tag if it is not been entered twice or more - if(!$found) - { - %hash->{$val}++; - } + %hash->{$val}++; } } } diff --git a/trunk/upload.pl b/trunk/upload.pl index 043ee5a..85cf0be 100644 --- a/trunk/upload.pl +++ b/trunk/upload.pl @@ -25,6 +25,15 @@ if($userinfo->{'username'}) { if($query->param('DC.Title')&&$query->param('DC.Subject')&&$query->param('DC.Description')) { + #remove duplicates from tags + @subject = split(' ', $query->param('DC.Subject')); + @unique{ @subject } = (); + foreach $tag (keys %unique) + { + $subject.=$tag." "; + } + $page->{'uploadform'}->{'DC.Subject'} = $ubject; + $page->{'innerresults'} = ['']; my @args = ();