--- m/menu.pl 2001/10/10 12:00:18 1.6 +++ m/menu.pl 2001/11/07 15:02:56 1.9 @@ -14,6 +14,10 @@ my $h_base=13; my $h; +my $dir="/data/pliva-si/m"; +#my $font="arialbd.ttf"; +my $font="trebucbd.ttf"; + my %iso2utf_tab = ( '¹' => 0x0161, 'ð' => 0x0111, 'è' => 0x010d, 'æ' => 0x0107, '¾' => 0x017e, '©' => 0x0160, 'Ð' => 0x0110, 'È' => 0x010c, 'Æ' => 0x0106, '®' => 0x017d @@ -35,7 +39,7 @@ sub dump_gif { my ($text, $type, $file) = @_; $type ||= TYPE_NONE; - $file ||= $text; + $file ||= "$text-$type"; $file =~ s/[^a-zA-Z0-9\-]/_/g; $file = lc($file); print "$text" unless ($file eq "-"); @@ -50,10 +54,10 @@ $text=iso2utf($text); if ($type == TYPE_BULLET) { $image->Annotate('text' => $text, 'geometry' => '+17+10', - 'font' => "\@arialbd.ttf", 'pointsize' => 11, + 'font' => "\@$dir/$font", 'pointsize' => 11, 'fill' => '#ffffff', 'align' => 'left'); # $image->Annotate('text' => $text, 'geometry' => '+17+1', -# 'font' => "\@arialbd.ttf", 'pointsize' => 11, +# 'font' => "\@$dir/$font", 'pointsize' => 11, # 'pen' => '#FFFFFF', 'align' => 'left'); # $image->Blur('radius' => 0.1); $image->Draw('primitive' => 'rectangle', 'stroke' => '#00D000', @@ -61,7 +65,7 @@ '7,4 10,7'); } elsif ($type == TYPE_BLUEDOT) { $image->Annotate('text' => $text, 'geometry' => '+17+10', - 'font' => "\@arialbd.ttf", 'pointsize' => 11, + 'font' => "\@$dir/$font", 'pointsize' => 11, 'fill' => '#ffffff', 'align' => 'left'); $image->Draw('primitive' => 'rectangle', 'stroke' => '#00b2dc', 'fill' => '#00b2dc', 'antialias' => 1, 'points' => @@ -89,13 +93,13 @@ } } $image->Annotate('text' => $text, 'geometry' => '+3+10', - 'font' => "\@arialbd.ttf", 'pointsize' => 11, + 'font' => "\@$dir/$font", 'pointsize' => 11, 'fill' => '#FFFFFF', 'align' => 'left'); # $image->Blur('radius' => 1); } print " -> " unless ($file eq "-"); $file .= ".gif" unless ($file eq "-"); - $image->Write('filename' => "gif:$file", 'colors' => 256, + $image->Write('filename' => "gif:$dir/$file", 'colors' => 256, 'interlace' => "none", 'compress' => 'lzw'); print "$file\n" unless ($file eq "-"); return "$file"; @@ -105,7 +109,8 @@ #dump_gif("NOVOSTI", TYPE_LINE, "-"); #exit $?; -my $dbh = DBI->connect("DBI:Pg:dbname=plivasi", "", "") || +# +my $dbh = DBI->connect("DBI:Pg:dbname=plivasi", "dpavlin", "") || die $DBI::errstr; my $sth = $dbh->prepare("SELECT section,item,url,level,num FROM menu") || die $dbh->errstr();