#!/usr/bin/perl -w #require 'getopts.pl'; #require 'getcwd.pl'; $usage = $usage = "do_pics list_file WHAT it SHOULD DO: list_file has Main and Sub topics, and is in the format: ,, Note there is no extention because it uses the name for .jpg and .html output Our file looks like: m,Argus Home,in_index.html,index m,Philosophy,in_philosophy.html,philosophy m,Specifications,in_specs.html,specs m,Pictures,in_images.html,images m,Current Events,in_cwork.html,cwork m,People,in_people.html,people m,Links,in_links.html,links First it will convert in_index.html into index.html with the title and menu stuff in there. In in_index.html, you need to have and tags ON LINES OF THEIR OWN and do_html.pl will insert the title picture. Same goes for and tags for the menu. Whatever is in between these tags gets replaced by the real menu, so you can put some template title and menu in there when you're designing the pages. Right now it's very hard coded to the menus and buttons that we're using for Argus, but that can change in time. "; if($#ARGV < 0) { print $usage; exit; } $file = $ARGV[0]; $all = 0; if ($#ARGV > 0 && $ARGV[1] =~ m/all/) { $all = 1; } print "Converting $file to unix format\n"; system("dos2unix $file"); print "Processing file $file\n"; open(MENU_FILE, $file) or die "Cannot open $file"; @menu_lines = ; foreach $menu_line (@menu_lines) { ($level, $name, $type, $directory, $file) = split(/\t/, $menu_line); chomp($file); if ($directory eq "" or $type =~ m/ALONE/ or $type =~ m/EMAIL/) { $directory = "."; } $out_file = $directory . "/button_" . $file . ".gif"; if ($all || !(-r $out_file)) { #print "Type = $type Name = $name In = $in_html Out = $out\n"; #$command = "gimp -c -s -i -b \'(script_fu_jason_web_button \"1\" \"5\" \"$name\" \"button_template.xcf\" \"" . $out_file . "\")\' \'(gimp-quit 1)\'"; #$command = "convert -font \"-*-helvetica narrow-bold-r-condensed--55-55-*-*-*-*-iso8859-1\" -fill white -draw \'text 4, 16 \"$name\"\' -geometry 25% button_template.png $out_file"; #$name =~ s/\'/\\\'/; # This still doesn't work. :-( $command = "convert -font \"-urw-helvetica-bold-r-condensed-*-55-55-*-*-p-*-iso8859-2\" -fill white -draw \'text 4, 52 \"$name\"\' -geometry 25% button_template.png $out_file"; print "About to execute $command\n"; print `$command`; system("chmod a+r $out_file"); } }