diff --git a/bin/.perltidyrc b/bin/.perltidyrc index c689e069a..178f514b4 100644 --- a/bin/.perltidyrc +++ b/bin/.perltidyrc @@ -51,7 +51,7 @@ --look-for-selfloader --maximum-consecutive-blank-lines=1 --maximum-fields-per-table=0 ---maximum-line-length=80 +--maximum-line-length=132 --minimum-space-to-comment=4 --noopening-anonymous-sub-brace-on-new-line --noopening-brace-on-new-line diff --git a/bin/alpha_page b/bin/alpha_page index d6d271c58..62bd83124 100755 --- a/bin/alpha_page +++ b/bin/alpha_page @@ -27,26 +27,21 @@ my ( $Pgm_Path, $Pgm_Name, $Version ); use vars '$Pgm_Root'; # So we can see it in eval var subs in read_parms BEGIN { - ($Version) = - q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs + ($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs ( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/; ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name; $Pgm_Root = "$Pgm_Path/.."; - eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'" - ; # Use BEGIN eval to keep perl2exe happy + eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # Use BEGIN eval to keep perl2exe happy } use Getopt::Long; my %parms; -if ( - !&GetOptions( \%parms, "h", "help", "message=s", "name:s", "pin:i", - "service:s" ) +if ( !&GetOptions( \%parms, "h", "help", "message=s", "name:s", "pin:i", "service:s" ) or @ARGV or $parms{h} or $parms{help} or !$parms{message} - or !$parms{service} - ) + or !$parms{service} ) { print < $parms{size} KBytes\n", + $msg .= sprintf " - Storing %5.1f MB of data from %4d files\n", $counts{size} / 10**6, $counts{file}; + $msg .= sprintf " - Skipped %5.1f MB of data from %4d files with size > $parms{size} KBytes\n", $counts{size_size} / 10**6, $counts{count_size}; - $msg .= - sprintf - " - Skipped %5.1f MB of data from %4d files with name = $parms{skip}\n", + $msg .= sprintf " - Skipped %5.1f MB of data from %4d files with name = $parms{skip}\n", $counts{size_skip} / 10**6, $counts{count_skip}; - $msg .= - sprintf - " - Skipped %5.1f MB of data from %4d files with age > $parms{age}\n", + $msg .= sprintf " - Skipped %5.1f MB of data from %4d files with age > $parms{age}\n", $counts{size_age} / 10**6, $counts{count_age}; print $msg; $log .= $msg; @@ -156,8 +143,7 @@ sub tar_files { } } my ( $size, $date ) = ( stat $parms{file} )[ 7, 9 ]; - printf "\nFile stats: %s %s %s\n\n", $parms{file}, $size, - scalar localtime $date; + printf "\nFile stats: %s %s %s\n\n", $parms{file}, $size, scalar localtime $date; } sub read_dir { diff --git a/bin/dailystrips b/bin/dailystrips index 8b30a3d5f..050f37040 100755 --- a/bin/dailystrips +++ b/bin/dailystrips @@ -25,13 +25,11 @@ use File::Copy; # Variables my ( - %options, $version, $time_today, - @localtime_today, @localtime_yesterday, @localtime_tomorrow, - $long_date, $short_date, $short_date_yesterday, - $short_date_tomorrow, @get, @strips, - %defs, $known_strips, %groups, - $known_groups, %classes, $val, - $link_tomorrow, $no_dateparse, @base_dirparts + %options, $version, $time_today, @localtime_today, @localtime_yesterday, + @localtime_tomorrow, $long_date, $short_date, $short_date_yesterday, $short_date_tomorrow, + @get, @strips, %defs, $known_strips, %groups, + $known_groups, %classes, $val, $link_tomorrow, $no_dateparse, + @base_dirparts ); $version = "1.0.28"; @@ -40,15 +38,11 @@ $time_today = time; # Get options GetOptions( - \%options, 'quiet|q', 'verbose', 'output=s', - 'lite', 'local|l', 'noindex', 'archive|a', - 'dailydir|d', 'stripdir', 'save|s', 'nostale', - 'date=s', 'new|n', 'defs=s', 'nopersonal', - 'basedir=s', 'list', 'proxy=s', 'proxyauth=s', - 'noenvproxy', 'nospaces', 'useragent=s', 'version|v', - 'help|h', 'avantgo', 'random', 'nosystem', - 'stripnav', 'nosymlinks', 'titles=s', 'retries=s', - 'clean=s', 'updates=s', 'noupdates' + \%options, 'quiet|q', 'verbose', 'output=s', 'lite', 'local|l', 'noindex', 'archive|a', + 'dailydir|d', 'stripdir', 'save|s', 'nostale', 'date=s', 'new|n', 'defs=s', 'nopersonal', + 'basedir=s', 'list', 'proxy=s', 'proxyauth=s', 'noenvproxy', 'nospaces', 'useragent=s', 'version|v', + 'help|h', 'avantgo', 'random', 'nosystem', 'stripnav', 'nosymlinks', 'titles=s', 'retries=s', + 'clean=s', 'updates=s', 'noupdates' ) or exit 1; # Process options: @@ -266,8 +260,7 @@ if ( $options{'dailydir'} and $options{'stripdir'} ) { if ( $options{'proxy'} ) { $options{'proxy'} =~ /^(http:\/\/)?(.*?):(.+?)\/?$/i; unless ( $2 and $3 ) { - die - "Error: incorrectly formatted proxy server ('http://server:port' expected)\n"; + die "Error: incorrectly formatted proxy server ('http://server:port' expected)\n"; } $options{'proxy'} = "http://$2:$3"; @@ -276,8 +269,7 @@ if ( $options{'proxy'} ) { if ( !$options{'noenvproxy'} and !$options{'proxy'} and $ENV{'http_proxy'} ) { $ENV{'http_proxy'} =~ /(http:\/\/)?(.*?):(.+?)\/?$/i; unless ( $2 and $3 ) { - die - "Error: incorrectly formatted proxy server environment variable\n('http://server:port' expected)\n"; + die "Error: incorrectly formatted proxy server environment variable\n('http://server:port' expected)\n"; } $options{'proxy'} = "http://$2:$3"; @@ -285,8 +277,7 @@ if ( !$options{'noenvproxy'} and !$options{'proxy'} and $ENV{'http_proxy'} ) { if ( $options{'proxyauth'} ) { unless ( $options{'proxyauth'} =~ /^.+?:.+?$/ ) { - die - "Error: incorrectly formatted proxy credentials ('user:pass' expected)\n"; + die "Error: incorrectly formatted proxy credentials ('user:pass' expected)\n"; } } @@ -357,15 +348,13 @@ if ( $options{'local'} ) { # any issues with masks and Win32? unless ( mkdir( $short_date, 0755 ) ) { - die - "Error: could not create today's directory ($short_date/)\n"; + die "Error: could not create today's directory ($short_date/)\n"; } } } unless ( open( STDOUT, ">dailystrips-$short_date.html" ) ) { - die - "Error: could not open HTML file (dailystrips-$short_date.html) for writing\n"; + die "Error: could not open HTML file (dailystrips-$short_date.html) for writing\n"; } unless ( $options{'date'} ) { @@ -417,10 +406,7 @@ if ( $options{'local'} ) { unless ( grep( //, @archive ) ) { for (@archive) { - if ( - s/()/$1\n$long_date<\/a>
/ - ) - { + if ( s/()/$1\n
$long_date<\/a>
/ ) { unless ( open( ARCHIVE, ">archive.html" ) ) { die "Error: could not open archive.html for writing\n"; } @@ -443,10 +429,7 @@ if ( $options{'local'} ) { my $match_count; for (@previous_page) { - if ( - s// |
Next day<\/a>/ - ) - { + if ( s// | Next day<\/a>/ ) { $match_count++; last if ( $match_count == 2 ); } @@ -457,18 +440,15 @@ if ( $options{'local'} ) { close(PREVIOUS); } else { - warn - "Warning: could not open dailystrips-$short_date_yesterday.html for writing\n"; + warn "Warning: could not open dailystrips-$short_date_yesterday.html for writing\n"; } } else { - warn - "Warning: did not find any tag in previous day's file to make today's link\n"; + warn "Warning: did not find any tag in previous day's file to make today's link\n"; } } else { - warn - "Warning: could not open dailystrips-$short_date_yesterday.html for reading\n"; + warn "Warning: could not open dailystrips-$short_date_yesterday.html for reading\n"; } } @@ -478,8 +458,7 @@ elsif ( $options{'output'} ) { } unless ( open( STDOUT, ">$options{'output'}" ) ) { - die - "Error: Could not open output file ($options{'output'}) for writing\n"; + die "Error: Could not open output file ($options{'output'}) for writing\n"; } } @@ -506,8 +485,7 @@ unless ( $options{'quiet'} ) { } if ( -e "dailystrips-$short_date_tomorrow.html" ) { - $link_tomorrow = - " | Next day"; + $link_tomorrow = " | Next day"; } else { $link_tomorrow = ""; @@ -515,8 +493,7 @@ else { # Generate HTML page if ( $options{'lite'} ) { - print - "$options{'titles'}dailystrips for $long_date

\n"; + print "$options{'titles'}dailystrips for $long_date

\n"; } else { my $topanchor; @@ -572,17 +549,13 @@ for (@strips) { my ( $strip, $name, $homepage, $img_addr, $referer, $prefetch, $artist ) = split( /;/, $_ ); my ( - $img_line, $local_name, - $local_name_dir, $local_name_file, - $local_name_ext, $image, - $ext, $local_name_yesterday, - $local_name_yesterday_dir, $local_name_yesterday_file, - $local_name_yesterday_ext + $img_line, $local_name, $local_name_dir, $local_name_file, + $local_name_ext, $image, $ext, $local_name_yesterday, + $local_name_yesterday_dir, $local_name_yesterday_file, $local_name_yesterday_ext ); if ( $options{'verbose'} and $options{'local'} ) { - warn "Downloading strip file for " - . lc( ( split( /;/, $_ ) )[0] ) . "\n"; + warn "Downloading strip file for " . lc( ( split( /;/, $_ ) )[0] ) . "\n"; } if ( $img_addr =~ "^unavail" ) { @@ -612,8 +585,7 @@ for (@strips) { $local_name_ext = "$ext"; } elsif ( $options{'dailydir'} ) { - $local_name_yesterday = - "$short_date_yesterday/$name-$short_date_yesterday$ext"; + $local_name_yesterday = "$short_date_yesterday/$name-$short_date_yesterday$ext"; $local_name_yesterday_dir = "$short_date_yesterday/"; $local_name_yesterday_file = "$name-$short_date_yesterday"; $local_name_yesterday_ext = "$ext"; @@ -668,8 +640,7 @@ for (@strips) { $img_addr = $local_name; $img_addr =~ s/ /\%20/go; if ( $options{'stripnav'} ) { - $img_line = - "\"$name\"
Return to top"; + $img_line = "\"$name\"
Return to top"; } else { $img_line = "\"$name\""; @@ -729,8 +700,7 @@ for (@strips) { $img_addr = $local_name; $img_addr =~ s/ /\%20/go; if ( $options{'stripnav'} ) { - $img_line = - "\"$name\"
Return to top"; + $img_line = "\"$name\"
Return to top"; } else { $img_line = "\"$name\""; @@ -743,57 +713,41 @@ for (@strips) { print IMAGE $image; close(IMAGE); - if ( - -e $local_name - and system( - "diff \"$local_name\" \"$local_name.tmp\" >/dev/null 2>&1" - ) == 0 - ) + if ( -e $local_name + and system( "diff \"$local_name\" \"$local_name.tmp\" >/dev/null 2>&1" ) == 0 ) { # already downloaded the same strip earlier today unlink("$local_name.tmp"); if ( $options{'avantgo'} ) { - $img_line = - &make_avantgo_table( $local_name, $ext ); + $img_line = &make_avantgo_table( $local_name, $ext ); } else { $img_addr = $local_name; $img_addr =~ s/ /\%20/go; if ( $options{'stripnav'} ) { - $img_line = - "\"$name\"
Return to top"; + $img_line = "\"$name\"
Return to top"; } else { - $img_line = - "\"$name\""; + $img_line = "\"$name\""; } } } - elsif ( - system( - "diff \"$local_name_yesterday\" \"$local_name.tmp\" >/dev/null 2>&1" - ) == 0 - ) - { + elsif ( system( "diff \"$local_name_yesterday\" \"$local_name.tmp\" >/dev/null 2>&1" ) == 0 ) { + # same strip as yesterday if ( $options{'nosymlinks'} ) { - system( "mv", "$local_name.tmp", - "$local_name" ); + system( "mv", "$local_name.tmp", "$local_name" ); } else { unlink("$local_name.tmp"); if ( $options{'stripdir'} or $options{'dailydir'} ) { - system( - "ln -s \"../$local_name_yesterday\" \"$local_name\" >/dev/null 2>&1" - ); + system( "ln -s \"../$local_name_yesterday\" \"$local_name\" >/dev/null 2>&1" ); } else { - system( - "ln -s \"$local_name_yesterday\" \"$local_name\" >/dev/null 2>&1" - ); + system( "ln -s \"$local_name_yesterday\" \"$local_name\" >/dev/null 2>&1" ); } } @@ -805,12 +759,10 @@ for (@strips) { $img_addr = $local_name; $img_addr =~ s/ /\%20/go; if ( $options{'stripnav'} ) { - $img_line = - "\"$name\"
Return to top"; + $img_line = "\"$name\"
Return to top"; } else { - $img_line = - "\"$name\""; + $img_line = "\"$name\""; } } } @@ -823,21 +775,17 @@ for (@strips) { system( "mv", "$local_name.tmp", "$local_name" ); if ( $options{'avantgo'} ) { - &make_avantgo_files( $local_name, - $local_name_ext ); - $img_line = - &make_avantgo_table( $local_name, $ext ); + &make_avantgo_files( $local_name, $local_name_ext ); + $img_line = &make_avantgo_table( $local_name, $ext ); } else { $img_addr = $local_name; $img_addr =~ s/ /\%20/go; if ( $options{'stripnav'} ) { - $img_line = - "\"$name\"
Return to top"; + $img_line = "\"$name\"
Return to top"; } else { - $img_line = - "\"$name\""; + $img_line = "\"$name\""; } } } @@ -849,8 +797,7 @@ for (@strips) { else { # regular mode - just give addresses to strips on their webserver if ( $options{'stripnav'} ) { - $img_line = - "\"$name\"
Return to top"; + $img_line = "\"$name\"
Return to top"; } else { $img_line = "\"$name\""; @@ -863,8 +810,7 @@ for (@strips) { } if ( $options{'lite'} ) { - print - "$name$artist
+ print "$name$artist
$img_line

"; @@ -972,8 +918,7 @@ sub http_get { if ( $response->is_error() ) { if ( $options{'verbose'} ) { - warn - "Warning: could not download $url: $status (attempt $_ of $options{'retries'})\n"; + warn "Warning: could not download $url: $status (attempt $_ of $options{'retries'})\n"; } } else { @@ -1003,8 +948,7 @@ sub get_strip { if ( $page =~ /^ERROR/ ) { if ( $options{'verbose'} ) { - warn - "Error: $strip: could not download searchpage $defs{$strip}{'searchpage'}\n"; + warn "Error: $strip: could not download searchpage $defs{$strip}{'searchpage'}\n"; } $addr = "unavail-server"; @@ -1035,10 +979,7 @@ sub get_strip { $addr =~ s/\$match/$match/ge; } else { - $addr = - $defs{$strip}{'baseurl'} - . $match - . $defs{$strip}{'urlsuffix'}; + $addr = $defs{$strip}{'baseurl'} . $match . $defs{$strip}{'urlsuffix'}; } } } @@ -1052,8 +993,7 @@ sub get_strip { if ( $page =~ /^ERROR/ ) { if ( $options{'verbose'} ) { - warn - "Error: $strip: could not download searchpage $defs{$strip}{'searchpage'}\n"; + warn "Error: $strip: could not download searchpage $defs{$strip}{'searchpage'}\n"; } $addr = "unavail-server"; @@ -1109,8 +1049,7 @@ sub get_strip { if ( $page =~ /^ERROR/ ) { if ( $options{'verbose'} ) { - warn - "Error: $strip: could not download searchpage $defs{$strip}{'searchpage'}\n"; + warn "Error: $strip: could not download searchpage $defs{$strip}{'searchpage'}\n"; } $addr = "unavail-server"; @@ -1174,8 +1113,7 @@ sub get_strip { $page = &http_get( $defs{$strip}{'searchpage'} ); if ( $page =~ /^ERROR/ ) { if ( $options{'verbose'} ) { - warn - "Error: $strip: could not download searchpage $defs{$strip}{'searchpage'}\n"; + warn "Error: $strip: could not download searchpage $defs{$strip}{'searchpage'}\n"; } $addr = "unavail-server"; } @@ -1203,8 +1141,7 @@ sub get_strip { } else { # find the information in the second page - my ($searchkey) = - $page =~ /$defs{$strip}{'searchpattern2'}/; + my ($searchkey) = $page =~ /$defs{$strip}{'searchpattern2'}/; if ( $searchkey eq '' ) { warn "Error: $strip: unable to locate searchkey2\n"; } @@ -1297,8 +1234,7 @@ sub get_defs { qw(homepage searchpage searchpattern baseurl imageurl urlsuffix referer prefetch artist drmurl searchpattern2) ) { - if ( $classes{$using_class}{$_} and !$defs{$strip}{$_} ) - { + if ( $classes{$using_class}{$_} and !$defs{$strip}{$_} ) { my $classvar = $classes{$using_class}{$_}; $classvar =~ s/(\$[0-9])/$defs{$strip}{$1}/g; $classvar =~ s/\$strip/$strip/g; @@ -1307,8 +1243,7 @@ sub get_defs { } for (qw(type matchpart provides)) { - if ( $classes{$using_class}{$_} and !$defs{$strip}{$_} ) - { + if ( $classes{$using_class}{$_} and !$defs{$strip}{$_} ) { $defs{$strip}{$_} = $classes{$using_class}{$_}; } } @@ -1328,10 +1263,7 @@ sub get_defs { } #other vars in definition - for ( - qw(homepage searchpage searchpattern imageurl baseurl urlsuffix referer prefetch) - ) - { + for ( qw(homepage searchpage searchpattern imageurl baseurl urlsuffix referer prefetch) ) { if ( $defs{$strip}{$_} ) { $defs{$strip}{$_} =~ s/\$(name|homepage|searchpage|searchpattern|imageurl|baseurl|referer|prefetch)/$defs{$strip}{$1}/g; @@ -1339,24 +1271,16 @@ sub get_defs { } #dates - for ( - qw(homepage searchpage searchpattern imageurl baseurl urlsuffix referer prefetch) - ) - { + for ( qw(homepage searchpage searchpattern imageurl baseurl urlsuffix referer prefetch) ) { if ( $defs{$strip}{$_} ) { - $defs{$strip}{$_} =~ - s/(\%(-?)[a-zA-Z])/strftime("$1", @localtime_today)/ge; + $defs{$strip}{$_} =~ s/(\%(-?)[a-zA-Z])/strftime("$1", @localtime_today)/ge; } } # stuff - for ( - qw(homepage searchpage searchpattern imageurl baseurl urlsuffix referer) - ) - { + for ( qw(homepage searchpage searchpattern imageurl baseurl urlsuffix referer) ) { if ( $defs{$strip}{$_} ) { - $defs{$strip}{$_} =~ - s//&my_eval($1)/ge; + $defs{$strip}{$_} =~ s//&my_eval($1)/ge; } } @@ -1377,13 +1301,11 @@ sub get_defs { if ( $defs{$strip}{'type'} eq "search" ) { unless ( $defs{$strip}{'searchpattern'} ) { - die - "Error: strip $strip has no 'searchpattern' value in $defs_file\n"; + die "Error: strip $strip has no 'searchpattern' value in $defs_file\n"; } unless ( $defs{$strip}{'searchpattern'} =~ /\(.+\)/ ) { - die - "Error: strip $strip has no parentheses in searchpattern\n"; + die "Error: strip $strip has no parentheses in searchpattern\n"; } unless ( $defs{$strip}{'matchpart'} ) { @@ -1398,20 +1320,17 @@ sub get_defs { or $defs{$strip}{'urlsuffix'} ) ) { - die - "Error: strip $strip: cannot use both 'imageurl' at the same time as 'baseurl'\nor 'urlsuffix'\n"; + die "Error: strip $strip: cannot use both 'imageurl' at the same time as 'baseurl'\nor 'urlsuffix'\n"; } } elsif ( $defs{$strip}{'type'} eq "generate" ) { unless ( $defs{$strip}{'imageurl'} ) { - die - "Error: strip $strip has no 'imageurl' value in $defs_file\n"; + die "Error: strip $strip has no 'imageurl' value in $defs_file\n"; } } unless ( $defs{$strip}{'provides'} ) { - die - "Error: strip $strip has no 'provides' value in $defs_file\n"; + die "Error: strip $strip has no 'provides' value in $defs_file\n"; } #debugger @@ -1498,8 +1417,7 @@ sub get_defs { } elsif (/^useclass\s+(.+)$/i) { unless ( defined $classes{$1} ) { - die - "Error: strip $strip references invalid class $1 at $defs_file line $line\n"; + die "Error: strip $strip references invalid class $1 at $defs_file line $line\n"; } $defs{$strip}{'useclass'} = $1; @@ -1508,9 +1426,7 @@ sub get_defs { $defs{$strip}{'homepage'} = $1; } elsif (/^type\s+(.+)$/i) { - unless ( $1 =~ - /^(search|generate|flashdrm|search2pages|doublesearch)$/i ) - { + unless ( $1 =~ /^(search|generate|flashdrm|search2pages|doublesearch)$/i ) { die "Error: invalid 'type' at $defs_file line $line\n"; } @@ -1561,8 +1477,7 @@ sub get_defs { $defs{$strip}{'artist'} = $1; } elsif (/^(.+)\s+?/) { - die - "Error: Unknown keyword '$1' at $defs_file line $line, in strip $strip\n"; + die "Error: Unknown keyword '$1' at $defs_file line $line, in strip $strip\n"; } } elsif ( $sectype eq "group" ) { @@ -1578,8 +1493,7 @@ sub get_defs { join( ';', split( /\s+/, $1 ) ) . ";"; } elsif (/^(.+)\s+?/) { - die - "Error: Unknown keyword '$1' at $defs_file line $line, in group $group\n"; + die "Error: Unknown keyword '$1' at $defs_file line $line, in group $group\n"; } } } @@ -1655,10 +1569,7 @@ sub make_avantgo_table { foreach my $row ( 0 .. ( $rows - 1 ) ) { $table .= ""; foreach my $col ( 0 .. ( $cols - 1 ) ) { - $table .= - ""; + $table .= ""; } $table .= ""; diff --git a/bin/dailystrips-clean b/bin/dailystrips-clean index 94999b319..d0c79077a 100755 --- a/bin/dailystrips-clean +++ b/bin/dailystrips-clean @@ -27,10 +27,7 @@ $version = "1.0.1"; $time_today = time; # Get options -GetOptions( - \%options, 'quiet|q', 'verbose|v', 'test|t', - 'dir=s', 'archive|a', 'version|v', 'help|h' -) or exit 1; +GetOptions( \%options, 'quiet|q', 'verbose|v', 'test|t', 'dir=s', 'archive|a', 'version|v', 'help|h' ) or exit 1; # Help and version override anything else if ( $options{'help'} ) { @@ -133,8 +130,7 @@ for (@files) { if ( $options{'archive'} ) { if ( open( ARCHIVE, "<$options{'dir'}archive.html" ) ) { - my $oldest = strftime( "\%Y.\%m.\%d", - localtime( $time_today - ( 86400 * ( $options{'days'} - 1 ) ) ) ); + my $oldest = strftime( "\%Y.\%m.\%d", localtime( $time_today - ( 86400 * ( $options{'days'} - 1 ) ) ) ); my $out; while () { @@ -151,8 +147,7 @@ if ( $options{'archive'} ) { print ARCHIVE $out; } else { - warn - "Error: cannot update archive.html - could not write file: $!\n"; + warn "Error: cannot update archive.html - could not write file: $!\n"; } } else { diff --git a/bin/display b/bin/display index 6ba7408db..0d2b294e9 100755 --- a/bin/display +++ b/bin/display @@ -7,7 +7,7 @@ my ( $Pgm_Path, $Pgm_Name ); BEGIN { ( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/; ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name; - eval "use lib '$Pgm_Path/../lib'"; # Use BEGIN eval to keep perl2exe happy + eval "use lib '$Pgm_Path/../lib'"; # Use BEGIN eval to keep perl2exe happy } use Getopt::Long; @@ -36,8 +36,7 @@ End_of_Help # Find the path to the mh/bin directory. BEGIN { ( $Pgm_Path, $Pgm_Name ) = $0 =~ /^(.*?)[\\\/]?([^\\\/]+).bat/; - use Cwd - ; # perl2exe leaves $0=mh.bat, so assume/require current directory is mh/bin dir + use Cwd; # perl2exe leaves $0=mh.bat, so assume/require current directory is mh/bin dir $Pgm_Path = cwd() unless ($Pgm_Path); } diff --git a/bin/display_callers b/bin/display_callers index 9154790fd..5b81a751e 100755 --- a/bin/display_callers +++ b/bin/display_callers @@ -17,20 +17,18 @@ # #--------------------------------------------------------------------------- -package display_callers - ; # So we can do the faster 'do' from mh, and not mess it up. +package display_callers; # So we can do the faster 'do' from mh, and not mess it up. my ( $Pgm_Path, $Pgm_Name ); -use vars '$Pgm_Root'; # So we can see it in eval var subs in read_parms +use vars '$Pgm_Root'; # So we can see it in eval var subs in read_parms BEGIN { - ($Version) = - q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs + ($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs ( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/; ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name; $Pgm_Root = "$Pgm_Path/.."; - eval "use lib '$Pgm_Path/../lib'"; # Use BEGIN eval to keep perl2exe happy + eval "use lib '$Pgm_Path/../lib'"; # Use BEGIN eval to keep perl2exe happy } use Getopt::Long; @@ -69,10 +67,10 @@ else { &display; } -my ( $file_qual, $dir, $MW ); -my ( @members1, @members2, @members_picked1, @members_picked2, %info ); +my ( $file_qual, $dir, $MW ); +my ( @members1, @members2, @members_picked1, @members_picked2, %info ); my ( %callerid_name_by_number, %dbm_name_by_number, %calls ); -my ( @pl1, @pl2, @pl3 ); +my ( @pl1, @pl2, @pl3 ); my ($loop); my %config_parms; @@ -90,8 +88,7 @@ sub setup { # use DB_File; # neede for ocmpiled version?? if ( $parms{cgi} ) { - eval "use CGI ':all';" - ; # Use eval so we don't fail if CGI not available (e.g. mh.exe) + eval "use CGI ':all';"; # Use eval so we don't fail if CGI not available (e.g. mh.exe) print &header( -target => 'New Window' ); print &start_html("Phone Logs"); print "

Phone Logs

\n"; @@ -137,9 +134,8 @@ sub read_member_list { opendir( DIR, "$dir/logs" ) or die "Could not open directory $dir/logs: $!\n"; my @members = readdir(DIR); - @members1 = reverse sort grep( /callerid.*$file_qual.*log$/, @members ) - ; # ... should sort by -M instead of name ?? - @members2 = reverse sort grep( /phone.*$file_qual.*log$/, @members ); + @members1 = reverse sort grep( /callerid.*$file_qual.*log$/, @members ); # ... should sort by -M instead of name ?? + @members2 = reverse sort grep( /phone.*$file_qual.*log$/, @members ); # Default to just the latest member unless (@members_picked1) { @@ -156,8 +152,7 @@ sub read_member_list { sub read_callerid_list { print "Reading override phone list\n"; open( CALLERID, $config_parms{caller_id_file} ) - or print - "Error, could not open mh.ini caller_id_file=$config_parms{caller_id_file}: $!\n"; + or print "Error, could not open mh.ini caller_id_file=$config_parms{caller_id_file}: $!\n"; my $callerid_cnt = 0; while () { @@ -201,15 +196,12 @@ sub read_dbm_file { # print "1 number=$number data=$data\n" if $data =~ /SPENSER/i or $number =~ /8619/ or $number =~ /5307/; # next if $data =~ /[^\x9\xa\xd\x20-\x7e]/; # Ignore messed up records ... should filter these out of source file. next - if $data =~ /[^\x20-\x7e]/ - ; # Ignore messed up records ... should filter these out of source file. + if $data =~ /[^\x20-\x7e]/; # Ignore messed up records ... should filter these out of source file. next - if $number =~ /[^\x20-\x7e]/ - ; # Ignore messed up records ... should filter these out of source file. + if $number =~ /[^\x20-\x7e]/; # Ignore messed up records ... should filter these out of source file. #2 3:53 PM Sat, Dec 27 1997 name=WINTER BRUCE LA - my ( $calls, $time, $date, $name ) = - $data =~ /^(\d+) +(.+), (.+) name=(.+)/; + my ( $calls, $time, $date, $name ) = $data =~ /^(\d+) +(.+), (.+) name=(.+)/; next unless $name; $dbm_name_by_number{$number} = $name; @@ -218,8 +210,8 @@ sub read_dbm_file { $calls{dbm}{$count}{date} = sprintf( "last=%010d calls=%4d", parsedate($date), $calls ); - $calls{dbm}{$count}{'# calls'} = sprintf( "%04d", $calls ) - ; # Since we do not have a sortable date here, sort on number of calls. + $calls{dbm}{$count}{'# calls'} = + sprintf( "%04d", $calls ); # Since we do not have a sortable date here, sort on number of calls. $calls{dbm}{$count}{time_date} = sprintf( "last=%s calls=%4d", $date, $calls ); $calls{dbm}{$count}{number} = $number; @@ -251,16 +243,15 @@ sub read_in_call_log { while () { # next if /[^\x9\xa\xd\x20-\x7e]/; # Ignore messed up records - tr/\x20-\x7e//cd; # Translate bad characters or else TK will mess up + tr/\x20-\x7e//cd; # Translate bad characters or else TK will mess up #Tue, Nov 2 6:46 PM 507-252-8619 SPENCER DARYL #Mon 04/14/97 14:28:00 #Sat 12/15/01 17:37:51 507-281-3888 name=TACINELLI JOHN data=###DATE12151737...NMBR5072813888...NAMETACINELLI JOHN +++ line=W - my ( $time_date, $number, $name ) = - $_ =~ /(.+?)(\d\d\d\-?\d\d\d\-?\d\d\d\d) (.+)$/; - my ($line) = $_ =~ /line=(.+?)/; # Optional ... which incoming line + my ( $time_date, $number, $name ) = $_ =~ /(.+?)(\d\d\d\-?\d\d\d\-?\d\d\d\d) (.+)$/; + my ($line) = $_ =~ /line=(.+?)/; # Optional ... which incoming line $name =~ s/^name=//; # Deal with "private, 'out of area', and bad data" calls @@ -323,7 +314,7 @@ sub read_out_call_log { while () { # next if /[^\x9\xa\xd\x20-\x7e]/; # Ignore messed up records - tr/\x20-\x7e//cd; # Translate bad characters or else TK will mess up + tr/\x20-\x7e//cd; # Translate bad characters or else TK will mess up #Tue, Nov 2 9:28 AM O2537009 #Fri 11/26/99 10:14:06 O2537009 @@ -392,25 +383,18 @@ sub display { $fbr->Label( -text => 'List of log files' )->pack; my $fbr2 = $fbr->Frame->pack(qw/-expand no -fill x/); - $fbr2->Label( -text => 'Incoming files' ) - ->pack(qw/-expand yes -fill x -side left/); - $fbr2->Label( -text => 'Outgoing files' ) - ->pack(qw/-expand yes -fill x -side left/); + $fbr2->Label( -text => 'Incoming files' )->pack(qw/-expand yes -fill x -side left/); + $fbr2->Label( -text => 'Outgoing files' )->pack(qw/-expand yes -fill x -side left/); my ( $files1, $files2 ); - $files1 = $fbr->Scrolled( - qw/Listbox -selectmode extended -width -1 -height 10 -setgrid 1 -scrollbars e -bg cyan/ - ); + $files1 = $fbr->Scrolled( qw/Listbox -selectmode extended -width -1 -height 10 -setgrid 1 -scrollbars e -bg cyan/ ); $files1->pack(@pl2)->insert( 0, @members1 ); - $files2 = $fbr->Scrolled( - qw/Listbox -selectmode extended -width -1 -height 10 -setgrid 1 -scrollbars e -bg cyan/ - ); + $files2 = $fbr->Scrolled( qw/Listbox -selectmode extended -width -1 -height 10 -setgrid 1 -scrollbars e -bg cyan/ ); $files2->pack(@pl2)->insert( 0, @members2 ); # $files1->activate(0); # $files2->activate(0); - $files1->selection( 'set', 0 ) - ; # Only one listbox widget can have a row slected at a time :( + $files1->selection( 'set', 0 ); # Only one listbox widget can have a row slected at a time :( # $files2->selection('set', 0); @@ -478,19 +462,14 @@ sub phone_list { if ( $class eq 'dbm' ) { my $search_frame = $ptr->Frame->pack; - my $search_label = - $search_frame->Label( -text => "Search:" )->pack( -side => 'left' ); + my $search_label = $search_frame->Label( -text => "Search:" )->pack( -side => 'left' ); - my $search_entry = - $search_frame->Entry( -textvariable => \$search_var, -width => 10 ) - ->pack; + my $search_entry = $search_frame->Entry( -textvariable => \$search_var, -width => 10 )->pack; $search_entry->bind( '', sub { &search_data($search_var) } ); } my $frame = $ptr->Frame->pack; - my $log = $ptr->Scrolled( - qw/Text -state normal -width 60 -height 15 -scrollbars e -bg cyan/) - ->pack(@pl2); + my $log = $ptr->Scrolled(qw/Text -state normal -width 60 -height 15 -scrollbars e -bg cyan/)->pack(@pl2); $info{$class}{window} = $log; for my $button (qw/name number date calls/) { @@ -509,16 +488,13 @@ sub phone_list { $log->bind( '' => sub { - my $text = - $log->get( 'current linestart +20 chars', 'current lineend' ); + my $text = $log->get( 'current linestart +20 chars', 'current lineend' ); $text =~ s/^.*? (\d\d\d-)/$1/; # Delete up to the number my $popup = $MW->Toplevel; my $label = - $popup->Label( -text => - "Edit name to be more prounancable,\nthen hit enter (or Escape to exit)" - )->pack( -side => 'top' ); - my $entry = $popup->Entry( -width => 40, -textvariable => \$text ) - ->pack( -side => 'bottom' ); + $popup->Label( -text => "Edit name to be more prounancable,\nthen hit enter (or Escape to exit)" ) + ->pack( -side => 'top' ); + my $entry = $popup->Entry( -width => 40, -textvariable => \$text )->pack( -side => 'bottom' ); $entry->tkwait( 'visibility', $entry ); $entry->focus; @@ -551,20 +527,16 @@ sub search_data { print "Searching for $search_var\n"; # Search data logged from incoming caller id data. - my ( $count1, $count2, %results ) = - &main::search_dbm( "$config_parms{data_dir}/phone/callerid.dbm", - $search_var ); + my ( $count1, $count2, %results ) = &main::search_dbm( "$config_parms{data_dir}/phone/callerid.dbm", $search_var ); # Also search in array created from mh.ini caller_id_file data while ( my ( $key, $value ) = each %callerid_name_by_number ) { if ( $key =~ /$search_var/i or $value =~ /$search_var/i ) { - $value = - &main::read_dbm( "$config_parms{data_dir}/phone/callerid.dbm", - $key ); # Use dbm data for consistency + $value = &main::read_dbm( "$config_parms{data_dir}/phone/callerid.dbm", $key ); # Use dbm data for consistency $results{$key} = $value; } } - $count2 = keys %results; # Reset count, in case Caller_ID search found any + $count2 = keys %results; # Reset count, in case Caller_ID search found any my $list = $info{dbm}{window}; @@ -573,25 +545,21 @@ sub search_data { my $results; if ($count2) { for ( sort keys %results ) { - my ( $cid_number, $cid_date, $cid_name ) = - $results{$_} =~ /(\S+) (.+) name=(.+)/; + my ( $cid_number, $cid_date, $cid_name ) = $results{$_} =~ /(\S+) (.+) name=(.+)/; $cid_name = $callerid_name_by_number{$_} if $callerid_name_by_number{$_}; $cid_date = ( split( ',', $cid_date ) )[1]; # Drop leading time field # $results .= sprintf("%15s: %-15s calls=%3s last=%s\n %s\n", $_, $cid_name, $cid_number, $cid_date, $caller); - $results .= sprintf( "last=%12s calls=%4d %s %s\n", - $cid_date, $cid_number, $_, $cid_name ); + $results .= sprintf( "last=%12s calls=%4d %s %s\n", $cid_date, $cid_number, $_, $cid_name ); } # map {$results .= " $_: $results{$_}\n\n"} sort keys %results; - $results = - "Results: $count2 out of $count1 records matched\n\n" . $results; + $results = "Results: $count2 out of $count1 records matched\n\n" . $results; } else { - $results = - "\nResults: No match found out of $count1 records searched\n"; + $results = "\nResults: No match found out of $count1 records searched\n"; } $list->delete( '0.0', 'end' ); @@ -689,8 +657,7 @@ sub post_cgi_form { sub phone_list2 { my ($list) = @_; - print "\n
", - "$info{$list}{label} Calls ($info{$list}{count} entries)
\n"; + print "\n
", "$info{$list}{label} Calls ($info{$list}{count} entries)
\n"; print &radio_group( -name => "sort_$list", -values => [ 'name', 'number', 'date' ], diff --git a/bin/find_files b/bin/find_files index 4b6d8daa0..bf14425be 100755 --- a/bin/find_files +++ b/bin/find_files @@ -19,8 +19,7 @@ use strict; my ( $Pgm_Path, $Pgm_Name, $Version ); BEGIN { - ($Version) = - q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs + ($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs ( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/; ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name; } @@ -65,19 +64,18 @@ $search = shift; @skip = split ',', $parms{skip} if $parms{skip}; @boxes = split ',', $parms{boxes} if $parms{boxes}; @shares = split ',', $parms{dirs}; -@skip = qw(^/program ^/win) unless @skip; # Skip program and windows dirs +@skip = qw(^/program ^/win) unless @skip; # Skip program and windows dirs @boxes = &find_boxes unless @boxes; @shares = &find_shares(@boxes) unless @shares; -$| = 1; # Turn on command buffering (e.g. flush on every print) +$| = 1; # Turn on command buffering (e.g. flush on every print) print "\nSearching for $search in @shares\n\n"; for my $share (@shares) { print "Traversing share $share\n"; &read_dir($share); } -print - "\nRead $counts{dir} directories and $counts{file} files.\n - Found $counts{found} files that match $search\n"; +print "\nRead $counts{dir} directories and $counts{file} files.\n - Found $counts{found} files that match $search\n"; print "\nFound files:\n ", join "\n ", @found if @found; print "\nRun took ", scalar(time) - $time_start, " seconds\n"; @@ -115,13 +113,8 @@ sub find_shares_wmi { print "Finding shares on @boxes\n"; use Win32::OLE; for my $box (@boxes) { - if ( - my $WMI = Win32::OLE->GetObject( - "WinMgmts:{impersonationLevel=impersonate}!//$box") - ) - { - for my $share ( Win32::OLE::in( $WMI->InstancesOf('Win32_Share') ) ) - { + if ( my $WMI = Win32::OLE->GetObject("WinMgmts:{impersonationLevel=impersonate}!//$box") ) { + for my $share ( Win32::OLE::in( $WMI->InstancesOf('Win32_Share') ) ) { next unless $share->{Type} == 0; # Look at shares only next if $share->{Name} =~ /\$$/; # Ignore hidden shares push @shares, "//$box/$share->{Name}"; diff --git a/bin/find_programs b/bin/find_programs index 41cc5b013..9cfff1445 100755 --- a/bin/find_programs +++ b/bin/find_programs @@ -46,8 +46,7 @@ use strict; my ( $Pgm_Path, $Pgm_Name, $Version ); BEGIN { - ($Version) = - q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs + ($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs ( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/; ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name; } @@ -109,20 +108,13 @@ sub wmi_processes { defwatch rtvscan stisvc vptray OSA msgsys mgabg pdesk); my $count = 0; - if ( - my $WMI = Win32::OLE->GetObject( - "WinMgmts:{impersonationLevel=impersonate}!//$box") - ) - { - for my $process ( Win32::OLE::in( $WMI->InstancesOf('Win32_Process') ) ) - { + if ( my $WMI = Win32::OLE->GetObject("WinMgmts:{impersonationLevel=impersonate}!//$box") ) { + for my $process ( Win32::OLE::in( $WMI->InstancesOf('Win32_Process') ) ) { my $name = $process->{Name}; $count++; next if !$parms{all} and grep $name =~ /$_/i, @ignore_list; next if $find and $name !~ /$find/i; - $list .= - sprintf - " PID:%5d,%5d Pgm:%-15s Threads:%3s Mem:%6.2f,%6.2f Date: %s\n", + $list .= sprintf " PID:%5d,%5d Pgm:%-15s Threads:%3s Mem:%6.2f,%6.2f Date: %s\n", $process->{ProcessID}, $process->{ParentProcessID}, $process->{Name}, $process->{ThreadCount}, $process->{WorkingSetSize} / 10**6, @@ -130,8 +122,7 @@ sub wmi_processes { } } else { - print "WMI unable to connect to \\$box:" - . Win32::OLE->LastError() . "\n"; + print "WMI unable to connect to \\$box:" . Win32::OLE->LastError() . "\n"; } return ( $count, $list ); } diff --git a/bin/get_earthquakes b/bin/get_earthquakes index 501a92008..85b37499a 100755 --- a/bin/get_earthquakes +++ b/bin/get_earthquakes @@ -29,8 +29,7 @@ BEGIN { ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name; } -my ($Version) = - q$Revision: 398 $ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs +my ($Version) = q$Revision: 398 $ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs use Getopt::Long; our %parms; @@ -97,7 +96,7 @@ unless ( tie %DBM, 'DB_File', $parms{dbm}, O_RDWR | O_CREAT, 0666 ) { } if ( $parms{d} ) { - print map( {"$_ => $DBM{$_}\n"} keys(%DBM) ); + print map( { "$_ => $DBM{$_}\n" } keys(%DBM) ); untie %DBM; die "Dumpped the DBM file. Exiting!\n"; } @@ -105,8 +104,7 @@ if ( $parms{d} ) { unlink $f_cnss_merged_txt; my $getURLcmd = 'net_ftp -passive 1 -command get -server hazards.cr.usgs.gov '; $getURLcmd .= ' -user anonymous -password anonymous'; -system( $getURLcmd - . " -file $f_cnss_merged_txt -file_remote cnss/cnss_14.fing " ); +system( $getURLcmd . " -file $f_cnss_merged_txt -file_remote cnss/cnss_14.fing " ); unless ( open CNSS, $f_cnss_merged_txt ) { die "$Pgm_Name: Failed to retrieve file from USGS\n"; @@ -134,9 +132,7 @@ foreach $line (@txtFile) { if ( !exists( $DBM{$key} ) ) { #Entry is new so go ahead and calculate the distance; expensive - $event->[7] = sprintf "%d", - calc_distance( $latitude, $longitude, - $event->[1], $event->[2], $Earthquake_Units ) + .5; + $event->[7] = sprintf "%d", calc_distance( $latitude, $longitude, $event->[1], $event->[2], $Earthquake_Units ) + .5; $event->[9] = 0; } else { @@ -154,11 +150,7 @@ foreach $line (@txtFile) { if ( $event->[7] <= $distance and $event->[4] >= $Magnitude_thresholds{$distance} ) { - print( "$Pgm_Name: found magnitude " - . $event->[4] - . " quake " - . $event->[7] - . " $Earthquake_Units away\n" ) + print( "$Pgm_Name: found magnitude " . $event->[4] . " quake " . $event->[7] . " $Earthquake_Units away\n" ) if $parms{v}; print($line) if $parms{v}; $event->[8] = 1; @@ -206,13 +198,9 @@ if ( $keyNewest ne "" ) { ? ( abs( 5 * round( $dbmEvent[1] / 5 ) ) > 65 ? 20 : 10 ) : 5; my $image = - 'http://earthquake.usgs.gov/recenteqsww/Maps/10/' - . $long_reso * - round( - ( $dbmEvent[2] < 0 ? 360 + $dbmEvent[2] : $dbmEvent[2] ) / $long_reso ) - . '_' - . 5 * - round( $dbmEvent[1] / 5 ) . '.gif'; + 'http://earthquake.usgs.gov/recenteqsww/Maps/10/' + . $long_reso * round( ( $dbmEvent[2] < 0 ? 360 + $dbmEvent[2] : $dbmEvent[2] ) / $long_reso ) . '_' + . 5 * round( $dbmEvent[1] / 5 ) . '.gif'; unlink $f_earthquakes_gif; $getURLcmd = "get_url " . ( $parms{v} ? "" : "-quiet" ); system( $getURLcmd . " $image $f_earthquakes_gif" ); @@ -244,12 +232,10 @@ else { my $units = $Earthquake_Units eq 'miles' ? "miles" : "km "; print( TXT "List is filtered using the follwing:\n" ); print( TXT " Distance <= Magnitude >=\n" ); - foreach my $distThresh ( sort( { $b <=> $a } keys(%Magnitude_thresholds) ) ) - { + foreach my $distThresh ( sort( { $b <=> $a } keys(%Magnitude_thresholds) ) ) { my $magThresh = $Magnitude_thresholds{$distThresh}; - $distThresh = - $distThresh > 20038 ? " Any" : sprintf( "%5.0d", $distThresh ); - $magThresh = $magThresh == 0 ? " Any" : sprintf( "%4.1f", $magThresh ); + $distThresh = $distThresh > 20038 ? " Any" : sprintf( "%5.0d", $distThresh ); + $magThresh = $magThresh == 0 ? " Any" : sprintf( "%4.1f", $magThresh ); print( TXT " $distThresh $units $magThresh\n" ); } print( TXT "\n" ); @@ -273,10 +259,7 @@ foreach my $key ( reverse( sort(@keysSpeak) ) ) { ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday ) = gmtime( $dbmEvent[0] ); - printf( TXT "%04d/%02d/%02d %02d:%02d:%02d ", - $year + 1900, - $mon + 1, $mday, $hour, $min, $sec - ); + printf( TXT "%04d/%02d/%02d %02d:%02d:%02d ", $year + 1900, $mon + 1, $mday, $hour, $min, $sec ); $qnoso = $dbmEvent[1] < 0 ? "S" : "N"; $qeawe = $dbmEvent[2] < 0 ? "W" : "E"; @@ -303,23 +286,15 @@ sub parse_quake { # 0 1 2 3 4 5 6 7 8 9 #[gmt,lat,lon,depth,magnitude,source,location,distance,speak,spoken] - if ( - my ( - $qdate, $qtime, $qlatd, $qnoso, $qlong, - $qeawe, $qdept, $qmagn, $qsrc, $qloca - ) - = $line =~ - m!^(.{10})\s(.{8})\s(.{6})([NS])\s(.{6})([EW])\s(.{5})\s(.{3})\s(.{7}):\s(.+)! - ) + if ( my ( $qdate, $qtime, $qlatd, $qnoso, $qlong, $qeawe, $qdept, $qmagn, $qsrc, $qloca ) = + $line =~ m!^(.{10})\s(.{8})\s(.{6})([NS])\s(.{6})([EW])\s(.{5})\s(.{3})\s(.{7}):\s(.+)! ) { #convert timestamp to gmt my ( $qyear, $qmnth, $qday ) = $qdate =~ m!(\S+)/(\S+)/(\S+)!; my ( $qhour, $qminu, $qseco ) = $qtime =~ m!(\S+):(\S+):(\S+)!; my $qgmt; - eval { - $qgmt = timegm( $qseco, $qminu, $qhour, $qday, $qmnth - 1, $qyear ); - }; + eval { $qgmt = timegm( $qseco, $qminu, $qhour, $qday, $qmnth - 1, $qyear ); }; if ($@) { print("$Pgm_Name: timegm() failed to parse date and time\n") if $parms{v}; @@ -362,11 +337,7 @@ sub calc_distance { $lon2 /= $c; $d = 2 * Math::Trig::asin( - sqrt( - ( sin( ( $lat1 - $lat2 ) / 2 ) )**2 + - cos($lat1) * cos($lat2) * ( sin( ( $lon1 - $lon2 ) / 2 ) )**2 - ) - ); + sqrt( ( sin( ( $lat1 - $lat2 ) / 2 ) )**2 + cos($lat1) * cos($lat2) * ( sin( ( $lon1 - $lon2 ) / 2 ) )**2 ) ); if ( $units ne 'miles' ) { return $d * 6378; # convert to kilometers and return diff --git a/bin/get_email b/bin/get_email index 703ccdf68..8a869ac44 100755 --- a/bin/get_email +++ b/bin/get_email @@ -27,24 +27,19 @@ my ( $Pgm_Path, $Pgm_Name, $Version ); use vars '$Pgm_Root'; # So we can see it in eval var subs in read_parms BEGIN { - ($Version) = - q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs + ($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs ( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/; ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name; $Pgm_Root = "$Pgm_Path/.."; - eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'" - ; # Use BEGIN eval to keep perl2exe happy + eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # Use BEGIN eval to keep perl2exe happy } use Getopt::Long; use vars qw(%config_parms %config_parms_startup); -if ( - !&GetOptions( \%config_parms_startup, 'quiet', 'debug', 'h', 'help', - 'net_mail_scan_age=s' ) +if ( !&GetOptions( \%config_parms_startup, 'quiet', 'debug', 'h', 'help', 'net_mail_scan_age=s' ) or @ARGV or $config_parms_startup{h} - or $config_parms_startup{help} - ) + or $config_parms_startup{help} ) { print <Latest emails
]; + $summary = qq[$time    Latest emails
]; my $wday = (localtime)[6]; my $day = ( 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun' )[$wday]; @@ -219,7 +210,7 @@ sub check_accounts { my $message_s = "s"; $message_s = "" if ( $msgcnt == 1 ); $summary .= - qq[   $msgcnt message$message_s ($msg_unread unread) $msgsize in ] + qq[   $msgcnt message$message_s ($msg_unread unread) $msgsize in ] . qq[$account: $config_parms{"net_mail_${account}_address"}, $config_parms{"net_mail_${account}_user"}
\n]; if ( $$msgptr{from_name} ) { @@ -248,8 +239,7 @@ sub check_accounts { # print "dbx get_email body=$body.\n"; - $body =~ - s/Content-Disposition: attachment.+?filename=(.+?)^.+/Attachment deleted: $1/gsm; + $body =~ s/Content-Disposition: attachment.+?filename=(.+?)^.+/Attachment deleted: $1/gsm; # while ($body =~ m/Content-Disposition: attachment.+?filename=(.+?\").+?NextPart.+?\n/s) { # $body =~ s/Content-Disposition: attachment.+?filename=(.+?\").+?NextPart.+?\n/Attachment removed: $1\n\n/sm; @@ -269,13 +259,11 @@ sub check_accounts { # - .scan is deleted in code_dir/internet_mail.pl after scanning for commands # - .html will be deleted (in get_email) only after email has been read logit( "$config_parms{data_dir}/get_email.scan", - "Msg: $number From:$$msgptr{from}[$cnt] To:$to Subject:$subject Body:$body" - ); + "Msg: $number From:$$msgptr{from}[$cnt] To:$to Subject:$subject Body:$body" ); # print "dbx get_email s=$subject body=$body\n"; - use HTML::Entities - ; # So we can encode stuff like + use HTML::Entities; # So we can encode stuff like $to = encode_entities $to; $replyto = encode_entities $replyto; $from = encode_entities $from; @@ -290,11 +278,11 @@ sub check_accounts { $body = "
$body
"; } - my $href = time . $cnt; # An arbitrary index + my $href = time . $cnt; # An arbitrary index my $href_prev = $href - 1 unless $cnt == 0; my $href_next = $href + 1 unless $cnt == $#list; $href_prev = 'top' - unless $href_prev; # No easy way to track prev href + unless $href_prev; # No easy way to track prev href my $time_date = &time_date_stamp( 14, time ); my $html; @@ -303,8 +291,7 @@ sub check_accounts { # $html = 'Date: ' . &time_date_stamp(14, time) . "
\n"; # Log format same as .scan logit $html = "Previous , "; $html .= "Next\n" if $href_next; - $html .= "
Date: $time_date
\n" - ; # Log format same as .scan logit + $html .= "
Date: $time_date
\n"; # Log format same as .scan logit $html .= "To:$to
\nFrom: $name
\nReply to: $replyto
\nSubject:$subject
\n"; $html .= "
$body


\n"; @@ -314,24 +301,17 @@ sub check_accounts { $msg_latest .= $html; # Log by account and day of week - my $log = - "$config_parms{data_dir}/email/${account}_${day}.shtml"; - my $logi = - "$config_parms{data_dir}/email/${account}_${day}_index.html"; + my $log = "$config_parms{data_dir}/email/${account}_${day}.shtml"; + my $logi = "$config_parms{data_dir}/email/${account}_${day}_index.html"; unlink $log - if time - ( stat $log )[9] > - 3600 * 24; # Reset if from last week + if time - ( stat $log )[9] > 3600 * 24; # Reset if from last week unless ( -e $log ) { unlink $logi; - my $html2 = - "\n"; - $html2 .= - "\n"; + my $html2 = "
MsgReceivedFromSubject
\n"; + $html2 .= "\n"; logit( $logi, $html2, 0 ); - $html2 = - qq[\n]; - $html2 .= - qq[\n
MsgReceivedFromSubject
\n
\n]; + $html2 = qq[\n]; + $html2 .= qq[\n\n
\n]; logit( $log, $html2, 0 ); } @@ -345,14 +325,11 @@ sub check_accounts { unless ( defined $msgcnt_prev ); $msgcnt_prev = 0 unless ( defined $msgcnt_prev ); my $msgcnt2 = sprintf( "%02d", $msgcnt_prev + $cnt + 1 ); - $html = - "($msgcnt2) Back to Index , " - . $html; + $html = "($msgcnt2) Back to Index , " . $html; logit( $log, $html, 0 ); - my $index = - "$msgcnt2$time_date$name"; + my $index = "$msgcnt2$time_date$name"; $index .= "$subject\n"; logit( $logi, $index, 0 ); } @@ -373,27 +350,23 @@ sub check_accounts { # If new mail is age based, need to reset latest.html every time unlink("$config_parms{data_dir}/email/latest.html") if $config_parms{net_mail_scan_age}; - logit( "$config_parms{data_dir}/email/latest.html", $msg_latest, - 0 ); + logit( "$config_parms{data_dir}/email/latest.html", $msg_latest, 0 ); } # $msgcnt_flag .= sprintf("%3d", ($config_parms{net_mail_scan_age})?$msg_inbox_total:$msgcnt); # gmail can have thousands of messages, instead, just add a space... - $message_counts .= " " - . ( $config_parms{net_mail_scan_age} ? $msg_inbox_total : $msgcnt ); + $message_counts .= " " . ( $config_parms{net_mail_scan_age} ? $msg_inbox_total : $msgcnt ); my $temp = &make_name_list( $account, @{ $email_prev{$account} } ); $results_unread .= $temp; # Create html version with a link - $temp =~ - s|^(.+) has |   $1 has |; + $temp =~ s|^(.+) has |   $1 has |; $results_unread2 .= $temp . "
" if $temp; # Save parsed data, so we don't have to re-read next time - $email_file_data .= - ( join( $;, $account, @{ $email_prev{$account} } ) ) . "\n" + $email_file_data .= ( join( $;, $account, @{ $email_prev{$account} } ) ) . "\n" if $email_prev{$account} and @{ $email_prev{$account} }; } @@ -420,8 +393,7 @@ sub make_name_list { my $account2 = $account; $account2 =~ tr/_/ /; # Make speakable - @list = grep !/^filtered/i, - @list; # Delete blank names (filtered out from the above get_email_rule) + @list = grep !/^filtered/i, @list; # Delete blank names (filtered out from the above get_email_rule) my $cnt = @list; return unless $cnt; @@ -434,11 +406,7 @@ sub make_name_list { # $_ =~ s/\@/ At /g ; # ...change \@ to the word "At" # } - return ("$account2 has " - . plural( $cnt, 'new message' ) - . " from " - . &speakify_list(@list) - . ".\n" ); + return ( "$account2 has " . plural( $cnt, 'new message' ) . " from " . &speakify_list(@list) . ".\n" ); # return ("Email account $account2 has " . plural($cnt, 'new email message') . diff --git a/bin/get_email_rule_example.pl b/bin/get_email_rule_example.pl index f5e2045a4..f25f81cc3 100755 --- a/bin/get_email_rule_example.pl +++ b/bin/get_email_rule_example.pl @@ -8,8 +8,7 @@ sub get_email_rule { $from = 'The perl guys' if $to =~ /Perl-Win32-Users/; $from = 'The phone guys' if $to =~ /ktx/ or $subject =~ /kx-t/i; $from = 'junk mail' - if $from =~ /\S+[0-9]{3,}/ - ; # If we get a joe#### type address, assume it is junk mail. + if $from =~ /\S+[0-9]{3,}/; # If we get a joe#### type address, assume it is junk mail. return if $from =~ /X10 Newsletter/; # These are not needed if using the MS TTS engine (it pronounces fred@placed.com ok) diff --git a/bin/get_mp3_data b/bin/get_mp3_data index 8891f9f24..306505556 100755 --- a/bin/get_mp3_data +++ b/bin/get_mp3_data @@ -7,8 +7,7 @@ use IO::File; my ( $Pgm_Path, $Pgm_Name, $Version ); BEGIN { - ($Version) = - q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs + ($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs ( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/; ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name; } @@ -49,8 +48,7 @@ for my $dir (@ARGV) { print "\nTraversing dir $dir\n"; &read_mp3_dir($dir); } -print - "\nRead $counts{dir} directories and $counts{file} files.\n - Found $counts{tag} files with TAG data\n"; +print "\nRead $counts{dir} directories and $counts{file} files.\n - Found $counts{tag} files with TAG data\n"; my @tags = qw(title artist album year comment genre file); for ( 0 .. 6 ) { printf " - Found %4d files with a $tags[$_] tag\n", $counts{$_} @@ -130,8 +128,7 @@ sub GetOggInfo ($) { #Find out if the Ogg Stream uses Vorbis version 0 encoding. return - if unpack( 'H22', OggRead( $fh, \$temp, 11 ) ) ne - '01766f7262697300000000'; + if unpack( 'H22', OggRead( $fh, \$temp, 11 ) ) ne '01766f7262697300000000'; #Skip the next 18 bytes of the identification header. $buf = OggRead( $fh, \$temp, 18 ); @@ -183,80 +180,43 @@ sub read_mp3_dir { close MP3DIR; my @mp3_genres = ( - 'Blues', 'Classic Rock', - 'Country', 'Dance', - 'Disco', 'Funk', - 'Grunge', 'Hip-Hop', - 'Jazz', 'Metal', - 'New Age', 'Oldies', - 'Other', 'Pop', - 'R&B', 'Rap', - 'Reggae', 'Rock', - 'Techno', 'Industrial', - 'Alternative', 'Ska', - 'Death Metal', 'Pranks', - 'Soundtrack', 'Euro-Techno', - 'Ambient', 'Trip-Hop', - 'Vocal', 'Jazz+Funk', - 'Fusion', 'Trance', - 'Classical', 'Instrumental', - 'Acid', 'House', - 'Game', 'Sound Clip', - 'Gospel', 'Noise', - 'Alt. Rock', 'Bass', - 'Soul', 'Punk', - 'Space', 'Meditative', - 'Instrumental Pop', 'Instrumental Rock', - 'Ethnic', 'Gothic', - 'Darkwave', 'Techno-Industrial', - 'Electronic', 'Pop-Folk', - 'Eurodance', 'Dream', - 'Southern Rock', 'Comedy', - 'Cult', 'Gangsta Rap', - 'Top 40', 'Christian Rap', - 'Pop/Funk', 'Jungle', - 'Native American', 'Cabaret', - 'New Wave', 'Psychedelic', - 'Rave', 'Showtunes', - 'Trailer', 'Lo-Fi', - 'Tribal', 'Acid Punk', - 'Acid Jazz', 'Polka', - 'Retro', 'Musical', - 'Rock & Roll', 'Hard Rock', - 'Folk', 'Folk/Rock', - 'National Folk', 'Swing', - 'Fast-Fusion', 'Bebob', - 'Latin', 'Revival', - 'Celtic', 'Bluegrass', - 'Avantgarde', 'Gothic Rock', - 'Progressive Rock', 'Psychedelic Rock', - 'Symphonic Rock', 'Slow Rock', - 'Big Band', 'Chorus', - 'Easy Listening', 'Acoustic', - 'Humour', 'Speech', - 'Chanson', 'Opera', - 'Chamber Music', 'Sonata', - 'Symphony', 'Booty Bass', - 'Primus', 'Porn Groove', - 'Satire', 'Slow Jam', - 'Club', 'Tango', - 'Samba', 'Folklore', - 'Ballad', 'Power Ballad', - 'Rhythmic Soul', 'Freestyle', - 'Duet', 'Punk Rock', - 'Drum Solo', 'A Cappella', - 'Euro-House', 'Dance Hall', - 'Goa', 'Drum & Bass', - 'Club-House', 'Hardcore', - 'Terror', 'Indie', - 'BritPop', 'Negerpunk', - 'Polsk Punk', 'Beat', - 'Christian Gangsta Rap', 'Heavy Metal', - 'Black Metal', 'Crossover', - 'Contemporary Christian', 'Christian Rock', - 'Merengue', 'Salsa', - 'Thrash Metal', 'Anime', - 'JPop', 'Synthpop' + 'Blues', 'Classic Rock', 'Country', 'Dance', + 'Disco', 'Funk', 'Grunge', 'Hip-Hop', + 'Jazz', 'Metal', 'New Age', 'Oldies', + 'Other', 'Pop', 'R&B', 'Rap', + 'Reggae', 'Rock', 'Techno', 'Industrial', + 'Alternative', 'Ska', 'Death Metal', 'Pranks', + 'Soundtrack', 'Euro-Techno', 'Ambient', 'Trip-Hop', + 'Vocal', 'Jazz+Funk', 'Fusion', 'Trance', + 'Classical', 'Instrumental', 'Acid', 'House', + 'Game', 'Sound Clip', 'Gospel', 'Noise', + 'Alt. Rock', 'Bass', 'Soul', 'Punk', + 'Space', 'Meditative', 'Instrumental Pop', 'Instrumental Rock', + 'Ethnic', 'Gothic', 'Darkwave', 'Techno-Industrial', + 'Electronic', 'Pop-Folk', 'Eurodance', 'Dream', + 'Southern Rock', 'Comedy', 'Cult', 'Gangsta Rap', + 'Top 40', 'Christian Rap', 'Pop/Funk', 'Jungle', + 'Native American', 'Cabaret', 'New Wave', 'Psychedelic', + 'Rave', 'Showtunes', 'Trailer', 'Lo-Fi', + 'Tribal', 'Acid Punk', 'Acid Jazz', 'Polka', + 'Retro', 'Musical', 'Rock & Roll', 'Hard Rock', + 'Folk', 'Folk/Rock', 'National Folk', 'Swing', + 'Fast-Fusion', 'Bebob', 'Latin', 'Revival', + 'Celtic', 'Bluegrass', 'Avantgarde', 'Gothic Rock', + 'Progressive Rock', 'Psychedelic Rock', 'Symphonic Rock', 'Slow Rock', + 'Big Band', 'Chorus', 'Easy Listening', 'Acoustic', + 'Humour', 'Speech', 'Chanson', 'Opera', + 'Chamber Music', 'Sonata', 'Symphony', 'Booty Bass', + 'Primus', 'Porn Groove', 'Satire', 'Slow Jam', + 'Club', 'Tango', 'Samba', 'Folklore', + 'Ballad', 'Power Ballad', 'Rhythmic Soul', 'Freestyle', + 'Duet', 'Punk Rock', 'Drum Solo', 'A Cappella', + 'Euro-House', 'Dance Hall', 'Goa', 'Drum & Bass', + 'Club-House', 'Hardcore', 'Terror', 'Indie', + 'BritPop', 'Negerpunk', 'Polsk Punk', 'Beat', + 'Christian Gangsta Rap', 'Heavy Metal', 'Black Metal', 'Crossover', + 'Contemporary Christian', 'Christian Rock', 'Merengue', 'Salsa', + 'Thrash Metal', 'Anime', 'JPop', 'Synthpop' ); for my $file ( sort @files ) { @@ -328,7 +288,7 @@ sub read_mp3_dir { if defined $tag_data[$i]; } - $tag_data[$i] =~ tr/\x20-\x7e//cd; # Drop non-ascii characters + $tag_data[$i] =~ tr/\x20-\x7e//cd; # Drop non-ascii characters $tag_data[$i] =~ s/^\s+//; $tag_data[$i] =~ s/\s+$//; if ( $i == 1 ) { diff --git a/bin/get_tv_grid b/bin/get_tv_grid index 1d1922359..6403d4615 100755 --- a/bin/get_tv_grid +++ b/bin/get_tv_grid @@ -42,36 +42,32 @@ use strict; my ( $Pgm_Path, $Pgm_Name, $Version ); BEGIN { - ($Version) = - q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs + ($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs ( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/; ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name; - eval - "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # So perl2exe works + eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # So perl2exe works } require "RedirAgent.pm"; #require "SMSAgent.pm"; -require 'handy_utilities.pl'; # For read_mh_opts -require 'handy_net_utilities.pl' - ; # For net_mail_send <-- causes probs in perl 5.6.1 with -w flag! +require 'handy_utilities.pl'; # For read_mh_opts +require 'handy_net_utilities.pl'; # For net_mail_send <-- causes probs in perl 5.6.1 with -w flag! use Getopt::Long; use LWP::Simple; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Request::Common; -use vars '%config_parms'; # Not a my, as called from handy_net_utils +use vars '%config_parms'; # Not a my, as called from handy_net_utils #====================================================================== # Variable declarations and other init #====================================================================== # Globals # -my ( %parms, $didLogIn, $infile, $outfile, %channels_skip, %channels_keep, - $channel_data ); -my ( $url, $ua, $cookie_jar, $req_get1, $req_get2, $req_post, $logged_in ); +my ( %parms, $didLogIn, $infile, $outfile, %channels_skip, %channels_keep, $channel_data ); +my ( $url, $ua, $cookie_jar, $req_get1, $req_get2, $req_post, $logged_in ); my ( @hours, %providers, @uas ); my ( $dbm_file, $dbm_file2 ); my ( %DBM, %DBM2 ); @@ -96,23 +92,12 @@ my $dbgSubmitRequest = 1; # Set to 0 to turn off URL requests #====================================================================== if ( !&GetOptions( - \%parms, "h", - "help", "infile=s", - "outfile=s", "outdir=s", - "reget", "redo", - "db=s", "name=s", - "preserveRaw", "keep=s", - "skip=s", "channel_max=s", - "channel_min=s", "zip:s", - "debug", "label=s", - "keep_old", "mail_to=s", - "provider:s", "provider_name:s", - "get_providers", "mail_server=s", - "mail_baseref=s", "purge=s", - "mail_baseref=s", "include_footer", - "days=s", "day=s", - "hour=s", "tableChannels=s", - "timebars=s" + \%parms, "h", "help", "infile=s", "outfile=s", "outdir=s", + "reget", "redo", "db=s", "name=s", "preserveRaw", "keep=s", + "skip=s", "channel_max=s", "channel_min=s", "zip:s", "debug", "label=s", + "keep_old", "mail_to=s", "provider:s", "provider_name:s", "get_providers", "mail_server=s", + "mail_baseref=s", "purge=s", "mail_baseref=s", "include_footer", "days=s", "day=s", + "hour=s", "tableChannels=s", "timebars=s" ) or @ARGV or ( $parms{h} or $parms{help} ) @@ -213,8 +198,7 @@ sub days_from_now { my ( $day_time, $days ) = @_; my $day_time2 = $day_time + $days * 60 * 60 * 24; my ( $day, $month, $year, $down ) = ( localtime($day_time2) )[ 3, 4, 5, 6 ]; - my $dow = - (qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday))[$down]; + my $dow = (qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday))[$down]; $month++; $year += 1900; @@ -250,7 +234,7 @@ sub setup { $parms{tableChannels} = 40 unless $parms{tableChannels}; $parms{days} = 1 unless $parms{days}; $parms{db} = 'tv' unless $parms{db}; - $parms{outdir} = "$config_parms{html_dir}/$parms{db}" + $parms{outdir} = "$config_parms{html_dir}/$parms{db}" unless $parms{outdir}; $parms{zip} = $config_parms{zip_code} unless $parms{zip}; $parms{proxy} = $ENV{http_proxy} unless $parms{proxy}; @@ -261,9 +245,9 @@ sub setup { unless $parms{provider}; $parms{provider_name} = $config_parms{ $parms{db} . '_provider_name' } unless $parms{provider_name}; - $parms{get_providers} = 0 unless ( $parms{get_providers} ); - $parms{hour} = $config_parms{ $parms{db} . '_hours' } unless $parms{hour}; - $parms{skip} = $config_parms{ $parms{db} . '_channels_skip' } + $parms{get_providers} = 0 unless ( $parms{get_providers} ); + $parms{hour} = $config_parms{ $parms{db} . '_hours' } unless $parms{hour}; + $parms{skip} = $config_parms{ $parms{db} . '_channels_skip' } if ( $config_parms{ $parms{db} . '_channels_skip' } and !$parms{skip} ); $parms{keep} = $config_parms{ $parms{db} . '_channels_keep' } if ( $config_parms{ $parms{db} . '_channels_keep' } and !$parms{keep} ); @@ -307,8 +291,8 @@ sub setup { || die "Missing provider!"; $parms{channel_min} = '1' unless $parms{channel_min}; $parms{channel_max} = '99999' unless $parms{channel_max}; - $parms{label} = "VCR" unless $parms{label}; # This can also be an image link - $parms{days} = 1 unless $parms{days}; + $parms{label} = "VCR" unless $parms{label}; # This can also be an image link + $parms{days} = 1 unless $parms{days}; $parms{redo} = 1 if $parms{reget}; $parms{reget} = 1 if $parms{get_providers}; $parms{duration} = 6 unless $parms{duration}; @@ -409,9 +393,8 @@ sub submitRequest { my $res; # Reponse $request->content_type('application/x-www-form-urlencoded'); $request->header( - 'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)', - 'Referer' => - ( $referer ? $referer : 'http://tvlistings.zap2it.com/grid.asp' ), + 'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)', + 'Referer' => ( $referer ? $referer : 'http://tvlistings.zap2it.com/grid.asp' ), 'Accept' => '*/*', 'Accept-Language' => 'en', ); @@ -423,9 +406,7 @@ sub submitRequest { } # Submit request - print "Request: [" - . ( $request->as_string ) - . ( $cookie_jar->as_string ) . "]\n" + print "Request: [" . ( $request->as_string ) . ( $cookie_jar->as_string ) . "]\n" if ( $parms{debug} ); if ($outFile) { print "Submitting request with output file: $outFile \n" @@ -452,9 +433,7 @@ sub submitRequest { or die "missing location: ", $res->as_string; print "is redirect to $ur\n" if ( $parms{debug} ); $request = HTTP::Request->new( GET => $url . $ur ); - print "Request: [" - . ( $request->as_string ) - . ( $cookie_jar->as_string ) . "]\n" + print "Request: [" . ( $request->as_string ) . ( $cookie_jar->as_string ) . "]\n" if ( $parms{debug} ); $res = $ua->request( $request, $outFile ); return 1; @@ -506,17 +485,11 @@ sub login { # Second submission, to submit our zip code #------------------------------------------------------------ - my $req_zip = - HTTP::Request->new( - POST => $url . "zipcode.asp?partner_id=national&zipcode=$parms{zip}" ); - $req_zip->content( "zipcode=$parms{zip}&" - . "partner_id=national&" - . "FormName=zipcode.asp&" - . "submit1=Continue" ); + my $req_zip = HTTP::Request->new( POST => $url . "zipcode.asp?partner_id=national&zipcode=$parms{zip}" ); + $req_zip->content( "zipcode=$parms{zip}&" . "partner_id=national&" . "FormName=zipcode.asp&" . "submit1=Continue" ); $req_zip->content_type('application/x-www-form-urlencoded'); print "2 of 4\n" if $parms{debug}; - $submitResult = - submitRequest( $req_zip, "$config_parms{data_dir}/tv_providers.html" ); + $submitResult = submitRequest( $req_zip, "$config_parms{data_dir}/tv_providers.html" ); if ( 1 != $submitResult ) { return -1; } @@ -547,12 +520,9 @@ sub login { } if ( !defined $this_provider ) { - ($this_provider) = split( /,\s*/, $parms{provider} ) - ; # first time through, take the first one + ($this_provider) = split( /,\s*/, $parms{provider} ); # first time through, take the first one } - my $req_prov = - HTTP::Request->new( - POST => $url . "system.asp?partner_id=national&zipcode=$parms{zip}" ); + my $req_prov = HTTP::Request->new( POST => $url . "system.asp?partner_id=national&zipcode=$parms{zip}" ); $req_prov->content( "provider=$this_provider&" . "saveProvider=See%20Listings&" . "zipCode=$parms{zip}&" @@ -573,8 +543,7 @@ sub login { # so we have to do that with this step before asking for specific # dates/times #------------------------------------------------------------ - my $req_allChans = - HTTP::Request->new( GET => $url . 'listings_redirect.asp?spp=0' ); + my $req_allChans = HTTP::Request->new( GET => $url . 'listings_redirect.asp?spp=0' ); print "4 of 4\n" if $parms{debug}; $submitResult = submitRequest($req_allChans); if ( 1 != $submitResult ) { @@ -646,8 +615,7 @@ sub fetchDataToFile { } if ( !@uas ) { @providers = split( /,\s*/, $parms{provider} ); - $this_provider = - shift @providers; # what we just logged-into + $this_provider = shift @providers; # what we just logged-into } push( @uas, @@ -657,8 +625,7 @@ sub fetchDataToFile { 'provider' => $this_provider } ); - if ( $this_provider = shift @providers ) - { # prepare for next request + if ( $this_provider = shift @providers ) { # prepare for next request $ua = new RedirAgent(); $cookie_jar = HTTP::Cookies->new; $ua->cookie_jar($cookie_jar); @@ -669,8 +636,7 @@ sub fetchDataToFile { #------------------------------------------------------------ # Retrieve the file we need #------------------------------------------------------------ - print - "Requesting data for ${startDay} at $startHour for $parms{duration} hours\n"; + print "Requesting data for ${startDay} at $startHour for $parms{duration} hours\n"; # $startHour -= 2; my $provnum; @@ -678,8 +644,7 @@ sub fetchDataToFile { $ua = $_->{ua}; $cookie_jar = $_->{cookie_jar}; my $ofile = providerFilename( $outfile, $provnum ); - my $loopReq = - HTTP::Request->new( POST => $url . 'listings_redirect.asp' ); + my $loopReq = HTTP::Request->new( POST => $url . 'listings_redirect.asp' ); $loopReq->content( "displayType=Grid&" . "duration=$parms{duration}&" . "startDay=${startDay}&" @@ -690,8 +655,7 @@ sub fetchDataToFile { $loopReq->content_type('application/x-www-form-urlencoded'); my $submitResult = submitRequest( $loopReq, $ofile ); - my $loopReq = - HTTP::Request->new( GET => $url . 'listings_redirect.asp?spp=0' ); + my $loopReq = HTTP::Request->new( GET => $url . 'listings_redirect.asp?spp=0' ); my $submitResult = submitRequest( $loopReq, $ofile ); if ( 1 != $submitResult ) { return -1; @@ -734,9 +698,7 @@ sub prov_count { # SUB: processRawFile #====================================================================== sub processRawFile { - my ( $day_time, $hour, $down, $rawFile, $outfile, $dow, $month, $day, - $year, $tomorrow_month, $tomorrow_day ) - = @_; + my ( $day_time, $hour, $down, $rawFile, $outfile, $dow, $month, $day, $year, $tomorrow_month, $tomorrow_day ) = @_; print "Processing $rawFile to $outfile\n" if ( $parms{debug} ); #------------------------------------------------------------ @@ -766,21 +728,17 @@ eof #------------------------------------------------------------ # Create & initialize local variables for processing #------------------------------------------------------------ - my ( - $record, $record_prev, $script, $loop_phase, - $count1, $count2, $count3 - ); + my ( $record, $record_prev, $script, $loop_phase, $count1, $count2, $count3 ); my ( $pgm_desc, $min_start, $min_end, $min_pgm ) = 0; $count1 = $count2 = $count3 = 0; - my $channel_number = ''; - my $channel_name = ''; - my $pgm_name = ''; - my $channelRowsSaved = 0; - my $current_time_bar = ''; - my $rowOfLastTimeBar = 0; - my $tableStartText = - qq||; + my $channel_number = ''; + my $channel_name = ''; + my $pgm_name = ''; + my $channelRowsSaved = 0; + my $current_time_bar = ''; + my $rowOfLastTimeBar = 0; + my $tableStartText = qq|
|; my $rowsInCurrentOutTable = 0; my $script_flag = 0; @@ -920,10 +878,7 @@ eof #------------------------------------------------------------ # remove Shockwave ads #------------------------------------------------------------ - if ( $record =~ - m!\s*
! - ) - { + if ( $record =~ m!
\s*
! ) { next; } @@ -994,11 +949,9 @@ eof # (Don't do this if this is the last line of the table.) #------------------------------------------------------------ if ( $rowsInCurrentOutTable % $parms{timebars} == 0 - and $rowsInCurrentOutTable != - $parms{tableChannels} ) + and $rowsInCurrentOutTable != $parms{tableChannels} ) { - my $tempResult = - $rowsInCurrentOutTable % $parms{timebars}; + my $tempResult = $rowsInCurrentOutTable % $parms{timebars}; print OUT $current_time_bar; } @@ -1058,17 +1011,12 @@ eof # can show them on the local output webpage. Also, alter url ref # so that it points to our logos directory. #----------------------------------------------------------------- - if ( $record =~ - s!/tms_network_logos/([^/]*\.(jpg|gif))!/$parms{db}/logos/$1! - ) - { + if ( $record =~ s!/tms_network_logos/([^/]*\.(jpg|gif))!/$parms{db}/logos/$1! ) { unless ( -f "$parms{outdir}/logos/$1" ) { #print "Retrieving logo: $1\n" if ( $parms{debug} ); print "Retrieving logo: $1\n"; - my $logoRequest = - HTTP::Request->new( - GET => $url . "tms_network_logos/$1" ); + my $logoRequest = HTTP::Request->new( GET => $url . "tms_network_logos/$1" ); $ua->request( $logoRequest, "$parms{outdir}/logos/$1" ); @@ -1080,15 +1028,12 @@ eof # can show them on the local output webpage. Also, alter url ref # so that it points to our logos directory. #----------------------------------------------------------------- - if ( $record =~ - s!images/([^/]*\.(jpg|gif))!/$parms{db}/logos/$1! ) - { + if ( $record =~ s!images/([^/]*\.(jpg|gif))!/$parms{db}/logos/$1! ) { unless ( -f "$parms{outdir}/logos/$1" ) { #print "Retrieving logo: $1\n" if ( $parms{debug} ); print "Retrieving logo: $1\n"; - my $logoRequest = - HTTP::Request->new( GET => $url . "images/$1" ); + my $logoRequest = HTTP::Request->new( GET => $url . "images/$1" ); $ua->request( $logoRequest, "$parms{outdir}/logos/$1" ); } @@ -1102,8 +1047,7 @@ eof # #
"; + $html_calls .= ""; # $html_calls .= ""; $html_calls .= diff --git a/web/bin/phone_in_old.pl b/web/bin/phone_in_old.pl index ee79c3810..6e420745e 100644 --- a/web/bin/phone_in_old.pl +++ b/web/bin/phone_in_old.pl @@ -6,8 +6,7 @@ for my $r (@calls) { my ( $time, $num, $name ) = $r =~ /(.+\d+:\d+:\d+) (\S+) (.+)/; next unless $num; - $html_calls .= - ""; + $html_calls .= ""; } #my $html_calls; diff --git a/web/bin/phone_list.pl b/web/bin/phone_list.pl index fb436846c..d31ef4607 100644 --- a/web/bin/phone_list.pl +++ b/web/bin/phone_list.pl @@ -24,8 +24,7 @@ sub rejected_call_list { my $html_calls; my @calls = &read_reject_call_list(); for my $r (@calls) { - my ( $number, $name, $sound, $type ) = - $r =~ /number=(.+) name=(.+) sound=(.*) type=(.*)/; + my ( $number, $name, $sound, $type ) = $r =~ /number=(.+) name=(.+) sound=(.*) type=(.*)/; $html_calls .= ""; $pos = $pos + 1; @@ -49,9 +48,7 @@ sub rejected_call_list {
#------------------------------------------------------------ - $record =~ - s|\"([_a-z]+\.asp\??)|\"http://tvlistings2.zap2it.com/$1|g; + $record =~ s|\"([_a-z]+\.asp\??)|\"http://tvlistings2.zap2it.com/$1|g; # last if $record =~ / END GRID TABLE /; @@ -1158,8 +1102,7 @@ eof $pgm_name_html =~ s/&/and/g; $pgm_name_html =~ s/\'/'/g; $pgm_name_html =~ s/\?/?/g; - $pgm_name =~ - s/\<.+?\>//g; # Drop extra HTML directives (e.g. font) + $pgm_name =~ s/\<.+?\>//g; # Drop extra HTML directives (e.g. font) # Set program times/dates my $time_start = &min_to_hour($min_start); @@ -1172,16 +1115,14 @@ eof $time_start = &min_to_hour( $min_start - 24 * 60 ); $time_end = &min_to_hour( $min_end - 24 * 60 ); } - print - "found program start $time_start pgm_date $pgm_date\n"; + print "found program start $time_start pgm_date $pgm_date\n"; - print - "db $pgm_name, $min_pgm, $min_start, $min_end, $time_start, $time_end, $pgm_date\n" + print "db $pgm_name, $min_pgm, $min_start, $min_end, $time_start, $time_end, $pgm_date\n" if $parms{debug}; # Insert the mh VCR link my $vcr_ref = - "$parms{label}"; $pgm_data = "$vcr_ref for $pgm_data" unless lc $parms{label} eq 'none'; @@ -1194,21 +1135,17 @@ eof $pgm_data .= $record; ($pgm_desc) = $record =~ /> *(.+)/; - $record = - $pgm_data; # This will get saved to $channel_data; + $record = $pgm_data; # This will get saved to $channel_data; # Clean up the program description - $pgm_desc =~ - s/\<.+?\>//g; # Drop extra HTML directives (e.g. font) - $pgm_desc =~ s/ / /g; # Drop extra spaces + $pgm_desc =~ s/\<.+?\>//g; # Drop extra HTML directives (e.g. font) + $pgm_desc =~ s/ / /g; # Drop extra spaces #------------------------------------------------------------ # Store the data in the DBM #------------------------------------------------------------ - my $db_key = - join( $;, $channel_number, $pgm_date, $time_start ); - my $db_data = - join( $;, $time_end, $pgm_name, $pgm_desc ); + my $db_key = join( $;, $channel_number, $pgm_date, $time_start ); + my $db_data = join( $;, $time_end, $pgm_name, $pgm_desc ); $DBM{$db_key} = $db_data; $DBM2{$channel_number} = $channel_name; print "db key=$db_key\n data=$db_data.\n" @@ -1236,8 +1173,7 @@ eof } } # Main while-loop - print "$count1 records with $count2 grid records were read. " - . "$count3 programs stored for $channelRowsSaved channels.\n"; + print "$count1 records with $count2 grid records were read. " . "$count3 programs stored for $channelRowsSaved channels.\n"; close IN; $provnum++; } @@ -1252,11 +1188,9 @@ eof #====================================================================== sub make_index { my ( $hour, $down, $day, $day_time ) = @_; - print OUT "
\n\n\n @@ -215,18 +207,11 @@ sub edit { } $data .= "$_\n"; $rowcount++; @@ -289,13 +274,8 @@ sub edit_list { } $data .= "$_\n"; + $data .= map_chars( $cparms{$_} ) . '">\n"; $rowcount++; } @@ -342,8 +322,7 @@ sub make_doc { next unless defined $dparms{$_}; $data .= '

' . $_ . '

' . "\n"; $data .= 'Insert description here.

' . "\n"; - $data .= - 'Default value: ' . map_chars( $dparms{$_} ) . '

' . "\n"; + $data .= 'Default value: ' . map_chars( $dparms{$_} ) . '

' . "\n"; } return $head . $data . $tail; @@ -359,8 +338,7 @@ sub map_chars { # This is similar to handy_Utils read_opts ... maybe should merge or share code? sub my_read_opts { - my ( $ref_parms, $ref_order, $ref_cats, $ref_catorder, $config_file, - $debug ) = @_; + my ( $ref_parms, $ref_order, $ref_cats, $ref_catorder, $config_file, $debug ) = @_; my ( $key, $value, $value_continued, $help, $help_flag ); # If debug == 0 (instead of undef) this is disabled @@ -428,8 +406,7 @@ sub my_read_opts { $$ref_cats{$key} = $category; } } - print - "parm key=$key value=$$ref_parms{$key} category=$$ref_cats{$key}\n" + print "parm key=$key value=$$ref_parms{$key} category=$$ref_cats{$key}\n" if $debug; } close CONFIG; @@ -445,11 +422,9 @@ sub localize { closedir(DIR); foreach my $file ( sort @files ) { next - if $file =~ /location_specimen|example/ - ; # Ignore mh.location_specimen.ini and mh.example.ini - next if $file =~ /^\./; # Ignore ./ and ../ - $file =~ s/(mh\.|\.ini)//i - ; # problem with this line (next line should not be needed) + if $file =~ /location_specimen|example/; # Ignore mh.location_specimen.ini and mh.example.ini + next if $file =~ /^\./; # Ignore ./ and ../ + $file =~ s/(mh\.|\.ini)//i; # problem with this line (next line should not be needed) $file =~ s/\.ini//i; # $file = ucfirst($file); diff --git a/web/bin/items.pl b/web/bin/items.pl index f93a91951..214e67bed 100644 --- a/web/bin/items.pl +++ b/web/bin/items.pl @@ -16,8 +16,7 @@ return &web_items_list(); -use vars '$web_item_file_name' - ; # Avoid my, so we can keep the same name between web calls +use vars '$web_item_file_name'; # Avoid my, so we can keep the same name between web calls my (@file_data); sub web_items_list { @@ -27,8 +26,7 @@ sub web_items_list { $html = qq| Items Menu\n$html Use this page to review or update your .mht file.|; - $html .= - qq|
Read-Only: Login as admin to edit| + $html .= qq|
Read-Only: Login as admin to edit| unless $Authorized eq 'admin'; $html .= qq|A backup is made and comments and record order are preserved. To update existing items, enter/change the field and hit Enter.| @@ -63,10 +61,8 @@ sub web_items_list { if $ARGV[0] =~ /^file=(.+)$/; # User selected another mht file # Create a form to pick which file - $html .= - "

\n" - ; ### DW: remove bgcolors + print OUT "
\n\n\n\n); + print qq( \n); } else { $width = $maxwidth[$_] ? $maxwidth[$_] + 1 : 20; @@ -678,29 +673,25 @@ EOF &HTMLescape( &slashescapetextarea( $field[$_] ) ); if ( $flags[$_]{'r'} ) { $safefieldta =~ s/\n/
\n/g; - print - qq(
\n); + print qq( \n); } else { $width = $maxwidth[$_] > 20 ? $maxwidth[$_] : 20; $width = $width < 60 ? $width : 60; $height = $maxheight[$_] > 1 ? $maxheight[$_] + 1 : 2; $height = $height < 10 ? $height : 10; - print - qq( \n); + print qq( \n); } # ordinary text fields } else { if ( $flags[$_]{'r'} ) { - print - qq( \n); + print qq( \n); } else { $width = $maxwidth[$_] ? $maxwidth[$_] + 1 : 20; - print - qq( \n); + print qq( \n); } } @@ -868,7 +859,7 @@ sub getcgivars { ( $name, $value ) = split( '=', $_, 2 ); $name =~ s/%(..)/sprintf("%c",hex($1))/ge; $value =~ s/%(..)/sprintf("%c",hex($1))/ge; - $in{$name} .= "\0" if defined( $in{$name} ); # concatenate multiple vars + $in{$name} .= "\0" if defined( $in{$name} ); # concatenate multiple vars $in{$name} .= $value; } @@ -909,9 +900,10 @@ sub urlencode { # create URL-encoded QUERY_STRING for an associative array sub urlencodelist { local (%a) = @_; - return join( '&', - map { &urlencode($_) . '=' . &urlencode( $a{$_} ) } - grep( defined( $a{$_} ), keys %a ) ); + return join( + '&', map { &urlencode($_) . '=' . &urlencode( $a{$_} ) } + grep( defined( $a{$_} ), keys %a ) + ); } # returns a subset of associative array @@ -939,11 +931,7 @@ sub hiddenvars { foreach ( keys %a ) { if ( defined( $a{$_} ) ) { - $ret .= - '\n"; + $ret .= '\n"; } } return $ret; diff --git a/web/bin/display_map.pl b/web/bin/display_map.pl index d31705cd3..b59f8cd67 100644 --- a/web/bin/display_map.pl +++ b/web/bin/display_map.pl @@ -25,8 +25,7 @@ #u2 = qq|&FAM=myblast&W=600&H=350|; $u2 = qq|&FAM=myblast&W=300&H=300|; -$u1 = - qq|http://maps.aprsworld.net/mapserver/map.php?lat=$y&lon=$x&label=$text2|; +$u1 = qq|http://maps.aprsworld.net/mapserver/map.php?lat=$y&lon=$x&label=$text2|; my $html = "

$text

\n"; diff --git a/web/bin/flight_status.pl b/web/bin/flight_status.pl index 8b6f41bb7..b0f09ce45 100644 --- a/web/bin/flight_status.pl +++ b/web/bin/flight_status.pl @@ -31,8 +31,7 @@ } if ( $statusURL ne '' ) { - $html .= - qq[

Airline: $HTTP_ARGV{airline}. Flight Number: $HTTP_ARGV{flight}.

+ $html .= qq[

Airline: $HTTP_ARGV{airline}. Flight Number: $HTTP_ARGV{flight}.

Request the status of another flight

Refresh this flight status page

]; @@ -150,8 +149,7 @@
]; - $html .= &insert_keyboard( - { form => 'main', target => 'flight', numeric_keypad => 'yes' } ); + $html .= &insert_keyboard( { form => 'main', target => 'flight', numeric_keypad => 'yes' } ); } return $html; diff --git a/web/bin/floorplan.pl b/web/bin/floorplan.pl index 343d1756a..df9392215 100644 --- a/web/bin/floorplan.pl +++ b/web/bin/floorplan.pl @@ -44,8 +44,7 @@ my $object_name = shift || '$Property'; my $object = &get_object_by_name($object_name); -return &html_page( 'FloorPlan', - "No $object_name Group found to generate a floorplan from" ) +return &html_page( 'FloorPlan', "No $object_name Group found to generate a floorplan from" ) unless $object; my $html = ""; @@ -87,13 +86,9 @@ sub web_fp #render table representation of objects and their co-ordinates for my $obj (@l_objs) { ( $l_x, $l_y, $l_w, $l_h ) = $obj->get_fp_location(); if ( $l_x ne "" ) { #Only do items with co-ordinates - for ( my $h = $l_y; - $h < $l_y + $l_h; - $h++ ) # Create Virtual Frame Buffer of object blocks + for ( my $h = $l_y; $h < $l_y + $l_h; $h++ ) # Create Virtual Frame Buffer of object blocks { - for ( my $w = $l_x; - $w < $l_x + $l_w; - $w++ ) # Create Virtual Frame buffer of object blocks + for ( my $w = $l_x; $w < $l_x + $l_w; $w++ ) # Create Virtual Frame buffer of object blocks { $l_fp[$w][$h] = $obj; $l_xmax = $w if $l_xmax < $w; @@ -104,37 +99,27 @@ sub web_fp #render table representation of objects and their co-ordinates } $l_html .= web_fp_item($p_obj) . "
"; if ( @l_objs > 0 ) { - $l_html .= - "
\n"; ### DW: remove bgcolors - print OUT - " TV Listings for $parms{name} "; + print OUT " TV Listings for $parms{name} "; print OUT ""; #---------------------------------------------------------------------- @@ -1270,8 +1204,7 @@ sub make_index { # be the friendliest way to do this (in my own humble opinion.) # Feel free to change this if you like. #---------------------------------------------------------------------- - print OUT - "\n"; #my $dow_start = -$down - 7; my $dow_start = -$parms{purge}; @@ -1279,8 +1212,7 @@ sub make_index { # my $dow_stop = $parms{days} -1; for my $count ( $dow_start .. $dow_stop ) { - my ( $dow2, $dow2n, $day2, $month2, $year2 ) = - &days_from_now( $day_time, $count ); + my ( $dow2, $dow2n, $day2, $month2, $year2 ) = &days_from_now( $day_time, $count ); print OUT "
$safefieldta
$safefieldta
$safefield[$_]
$safefield[$_]
\n"; - for ( my $x = 0; - $x <= $l_xmax; - $x++ ) #initialize table with (hopefully) accurate sizing + $l_html .= "
\n"; + for ( my $x = 0; $x <= $l_xmax; $x++ ) #initialize table with (hopefully) accurate sizing { $l_html .= ""; } - for ( my $y = 0; - $y <= $l_ymax; - $y++ ) #Create HTML Table stucture of Virtual Frame buffer + for ( my $y = 0; $y <= $l_ymax; $y++ ) #Create HTML Table stucture of Virtual Frame buffer { $l_html .= "\n"; - $l_html .= - "\t\n"; for ( my $x = 0; $x <= $l_xmax; $x++ ) { $l_obj = $l_fp[$x][$y]; - if ( $l_obj ne "" ) { #Only do if object is at coordinates + if ( $l_obj ne "" ) { #Only do if object is at coordinates if ( $l_rendered{$l_obj} eq '' ) { $l_rendered{$l_obj} = 1; - ( $l_x, $l_y, $l_w, $l_h ) = - $l_obj->get_fp_location(); + ( $l_x, $l_y, $l_w, $l_h ) = $l_obj->get_fp_location(); if ( $l_x eq '' ) { $l_x = 1; } if ( $l_y eq '' ) { $l_y = 1; } if ( $l_w eq '' ) { $l_w = 1; } if ( $l_h eq '' ) { $l_h = 1; } - if ( $l_obj->isa('Group') ) { #recurse groups + if ( $l_obj->isa('Group') ) { #recurse groups $l_html .= "\t\n"; } } @@ -335,11 +316,7 @@ sub web_fp_item #render all items based on type if ( $l_state ne '' ) { my ($l_str) = $l_text =~ /\$(.*)/; - $l_html .= - ""; + $l_html .= ""; } if ( $l_image ne '' ) { $l_html .= "$l_text"; @@ -353,17 +330,15 @@ sub web_fp_item #render all items based on type return $l_html; } -sub web_fp_idle_color #Fade color from acolor to bcolor over idle_time of object +sub web_fp_idle_color #Fade color from acolor to bcolor over idle_time of object { my ( $p_object, $p_acolor, $p_bcolor, $p_maxtime ) = @_; my ( $l_ared, $l_agreen, $l_ablue ) = $p_acolor =~ /#*(..)(..)(..)/; my ( $l_bred, $l_bgreen, $l_bblue ) = $p_bcolor =~ /#*(..)(..)(..)/; - ( $l_ared, $l_agreen, $l_ablue ) = - ( hex $l_ared, hex $l_agreen, hex $l_ablue ); - ( $l_bred, $l_bgreen, $l_bblue ) = - ( hex $l_bred, hex $l_bgreen, hex $l_bblue ); + ( $l_ared, $l_agreen, $l_ablue ) = ( hex $l_ared, hex $l_agreen, hex $l_ablue ); + ( $l_bred, $l_bgreen, $l_bblue ) = ( hex $l_bred, hex $l_bgreen, hex $l_bblue ); my ( $l_red, $l_green, $l_blue ); my $l_time; @@ -401,10 +376,7 @@ sub web_fp_idle_color #Fade color from acolor to bcolor over idle_time of object $l_blue = int( $l_ablue + ( ( $l_bblue - $l_ablue ) * ($l_percent) ) ); } - return ("#" - . sprintf( "%02X", $l_red ) - . sprintf( "%02X", $l_green ) - . sprintf( "%02X", $l_blue ) ); + return ( "#" . sprintf( "%02X", $l_red ) . sprintf( "%02X", $l_green ) . sprintf( "%02X", $l_blue ) ); } sub web_fp_camera_popup { diff --git a/web/bin/floorplan_svg.pl b/web/bin/floorplan_svg.pl index a1c123ab8..f10351300 100644 --- a/web/bin/floorplan_svg.pl +++ b/web/bin/floorplan_svg.pl @@ -112,8 +112,7 @@ sub web_fp #render table representation of objects and their co-ordinates my $l_bcolor = '#CCCCCC'; my $l_acolor = '#00FF00'; - my $title_room = $svg->text( id => "title", x => 50, y => 75 ) - ->cdata( web_fp_filter_name($object_name) ); + my $title_room = $svg->text( id => "title", x => 50, y => 75 )->cdata( web_fp_filter_name($object_name) ); my $y = $svg->group( id => 'group_y', style => { stroke => 'black', fill => 'white' } @@ -128,11 +127,9 @@ sub web_fp #render table representation of objects and their co-ordinates # It was 10, I'm not sure that 12 is correct # times 10, the rooms are given in feet (I guess) $l_x *= 12; - $l_x += $xOffset - ; # Corrective offset to move it of the right edge of the display area + $l_x += $xOffset; # Corrective offset to move it of the right edge of the display area $l_y *= 12; - $l_y += $yOffset - ; # Corrective offset to move it of the top edge of the display area + $l_y += $yOffset; # Corrective offset to move it of the top edge of the display area $l_w *= 12; $l_h *= 12; @@ -153,7 +150,7 @@ sub web_fp #render table representation of objects and their co-ordinates )->cdata( web_fp_filter_name( $obj->{object_name} ) ); $i++; } - @n_objs = @{ $$obj{members} }; # This is the Devices within the Room + @n_objs = @{ $$obj{members} }; # This is the Devices within the Room for my $item (@n_objs) { my ( $width, $height ); my $ob = Ob($item); @@ -204,8 +201,7 @@ sub web_fp #render table representation of objects and their co-ordinates else { ( $l_x, $l_y, $l_w, $l_h ) = $p_obj->get_fp_location(); my ( $l_text, $l_state, $l_image ) = web_fp_item($p_obj); - $svg->text( x => $l_x + 6, y => $l_y + 6 ) - ->cdata( web_fp_filter_name($l_text) ); + $svg->text( x => $l_x + 6, y => $l_y + 6 )->cdata( web_fp_filter_name($l_text) ); $svg->image( x => $l_x, y => $l_y, diff --git a/web/bin/headercontrol.pl b/web/bin/headercontrol.pl index 3b06dd4ea..887de2ef7 100644 --- a/web/bin/headercontrol.pl +++ b/web/bin/headercontrol.pl @@ -17,8 +17,7 @@ &save_header_control_list(@parms); } -my $phone_dir = - "$config_parms{data_dir}/headerallow.tab"; # Avoid redefined sub msgs +my $phone_dir = "$config_parms{data_dir}/headerallow.tab"; # Avoid redefined sub msgs my $form_type = &html_form_select( 'type', 0, 'True', 'True', 'False', ); return &headercontrol_list(); my $GuestValueTrue; @@ -39,8 +38,7 @@ sub headercontrol_list { my $html_calls; my @calls = &read_headercontrol_list; for my $r (@calls) { - my ( $HeaderName, $family, $guest ) = - $r =~ /Name=(.*) Family=(.*) Guest=(.*)/; + my ( $HeaderName, $family, $guest ) = $r =~ /Name=(.*) Family=(.*) Guest=(.*)/; #print "$HeaderName, $family, $guest\n"; if ( $Authorized eq 'admin' ) { @@ -131,8 +129,7 @@ sub save_header_control_list { #print_log "counter is $counter:$writedata"; #now we need to write this to the file - my ( $HeaderToWrite, $FamilyValue, $junk, $GuestValue ) = - $writedata =~ /(.*)=(true|false)(.*)=(true|false)/i; + my ( $HeaderToWrite, $FamilyValue, $junk, $GuestValue ) = $writedata =~ /(.*)=(true|false)(.*)=(true|false)/i; #print_log "Header:$HeaderToWrite, $FamilyValue, $GuestValue"; my $WritingData = "$HeaderToWrite\t$FamilyValue\t$GuestValue"; @@ -194,8 +191,7 @@ sub read_headercontrol_list { #ok, we have the number and name is filled with the rest, lets break up name a little #print_log "HeaderName;$HeaderName, Family;$family, Guest;$guest\n"; - push @header, - sprintf( "Name=%s Family=%s Guest=%s", $HeaderName, $family, $guest ); + push @header, sprintf( "Name=%s Family=%s Guest=%s", $HeaderName, $family, $guest ); } close MYFILE; diff --git a/web/bin/hvac.pl b/web/bin/hvac.pl index 1c798e72c..c47b3ddc3 100644 --- a/web/bin/hvac.pl +++ b/web/bin/hvac.pl @@ -68,8 +68,7 @@ sub hvac_ask { $html .= "
"; + $l_html .= "\t"; $l_html .= ""; $l_html .= web_fp_item($l_obj); } @@ -154,11 +139,7 @@ sub web_fp #render table representation of objects and their co-ordinates } } else { #Blank space - $l_html .= - "\t"; + $l_html .= "\t"; $l_html .= "
"; if ( $state eq 'hold' ) { - $html .= - '

Click here to cancel the hold.

'; + $html .= '

Click here to cancel the hold.

'; } else { $html .= qq| diff --git a/web/bin/icon_auth.pl b/web/bin/icon_auth.pl index 4a52bb3ea..81c8fb194 100644 --- a/web/bin/icon_auth.pl +++ b/web/bin/icon_auth.pl @@ -18,7 +18,4 @@ : "/SET_PASSWORD?user=$Authorized"; #print "\ndbx a=$Authorized i=$icon a=$action\n"; -return - ""
-  . ( ($Authorized) ? "; +return "" . ( ($Authorized) ? "; diff --git a/web/bin/icon_mode.pl b/web/bin/icon_mode.pl index 1f89b83ee..d53c8fc58 100644 --- a/web/bin/icon_mode.pl +++ b/web/bin/icon_mode.pl @@ -3,6 +3,5 @@ # and cycle them when users click on it. # Is being called from modes/main.shtml. -return - "$Save{mode} Mode"; +return "$Save{mode} Mode"; diff --git a/web/bin/iniedit.pl b/web/bin/iniedit.pl index cce5a3e8b..89e1dfbde 100644 --- a/web/bin/iniedit.pl +++ b/web/bin/iniedit.pl @@ -46,8 +46,7 @@ return localize() if $testing and !@ARGV; # For testing only -my ( %dparms, %cparms, @order, %pparms, %categories, @catorder, %changed, - %help ); +my ( %dparms, %cparms, @order, %pparms, %categories, @catorder, %changed, %help ); my $private_parms = $Pgm_Path . "/mh.private.ini"; $private_parms = $ENV{mh_parms} if $ENV{mh_parms}; @@ -131,15 +130,11 @@ sub commit { # print_log "Error in backup up parms file $private_parms: $!"; open( PRIVATE, ">$private_parms" ) - or return $head - . "\nError, could not open $private_parms for writing.

\n" - . $tail; - print PRIVATE - "# Misterhouse configuration file generated by iniedit.pl\n\n"; + or return $head . "\nError, could not open $private_parms for writing.

\n" . $tail; + print PRIVATE "# Misterhouse configuration file generated by iniedit.pl\n\n"; my $data; if ( defined $args{edit_list} ) { - $data = - 'Close'; + $data = 'Close'; } else { $data = 'Back'; @@ -168,8 +163,7 @@ sub commit { sub edit { my $data = '
'; - $data .= - 'Read-Only: Login as admin to edit
' + $data .= 'Read-Only: Login as admin to edit
' unless $Authorized eq 'admin'; $data .= ' Note: Commit will resort and filter out comments.' @@ -184,15 +178,13 @@ sub edit { '; foreach ( @catorder, 'Other' ) { - $data .= - ' ' . $_ . "\n"; + $data .= ' ' . $_ . "\n"; } $data .= ' '; $data .= '  '; - $data .= - '' + $data .= '' if $Authorized eq 'admin'; $data .= '

"; - $data .= - ''; - $data .= - '" + $data .= ( defined $dparms{$_} ? map_chars( $dparms{$_} ) : '' ) . "'\">" if $Authorized eq 'admin'; $data .= "
"; $data .= '
\n"; + $html .= "
Which .mht file to edit?\n"; - $html .= &html_form_select( 'file', 1, $web_item_file_name, @file_paths ) - . "
\n"; # Create form to add an item my $form_type = &html_form_select( @@ -134,10 +130,8 @@ sub web_items_list { } # Add an index - $html .= - ""; for my $header ( '', 'Type', @headers ) { - $html .= - qq[]; + $html .= qq[]; # $html .= " "; } @@ -209,16 +201,12 @@ sub web_items_list { $html .= " "; $html .= " "; for my $field ( 1 .. $headers - 1 ) { - $html .= &html_form_input_set_func( - 'web_item_set_field', "/bin/items.pl", - "$pos,$field", $item_info[$field] - ); + $html .= &html_form_input_set_func( 'web_item_set_field', "/bin/items.pl", "$pos,$field", $item_info[$field] ); } $html .= "\n"; } @@ -324,8 +312,7 @@ sub web_item_add { $other2 =~ s/,$//; # write out new record to mht file - $file_data[@file_data] = sprintf( "%-20s%-20s%-20s%-20s%-20s%s", - $type, $address, $name, $group, $other1, $other2 ); + $file_data[@file_data] = sprintf( "%-20s%-20s%-20s%-20s%-20s%s", $type, $address, $name, $group, $other1, $other2 ); &mht_item_file_write( $web_item_file_name, \@file_data ); return 0; @@ -342,19 +329,15 @@ sub web_item_help { Groups => 'List of groups the item belongs to, seperated by |', Interface => 'The X10 Interface to use (e.g. CM17, CM11)', X10_Type => 'The type of X10 device (e.g. LM14 or preset)', - String => - 'The serial characters to match (e.g. XA1A1 to match 2 A1 button pushes)', - State => 'The state name to correlate to this items serial String', - Port => 'Which port to look for the serial data on', - ID => - 'Ibutton ID: type|serial|crc crc is optional. type=01 (1990) type=10 (1820)', - Channel => 'When using a switch, choose channel A or B', - Item => 'Item name to tie this voice command to', - Phrase => 'Voice_Cmd Text', - Mode => - '\'R\' (readable): generate read request to learn current state at initialization', - Options => - 'List the device options separated by | (e.g. preset, resume=80)', + String => 'The serial characters to match (e.g. XA1A1 to match 2 A1 button pushes)', + State => 'The state name to correlate to this items serial String', + Port => 'Which port to look for the serial data on', + ID => 'Ibutton ID: type|serial|crc crc is optional. type=01 (1990) type=10 (1820)', + Channel => 'When using a switch, choose channel A or B', + Item => 'Item name to tie this voice command to', + Phrase => 'Voice_Cmd Text', + Mode => '\'R\' (readable): generate read request to learn current state at initialization', + Options => 'List the device options separated by | (e.g. preset, resume=80)', FloorPlan => 'Floor Plan location', Other => 'Other stuff :)' ); diff --git a/web/bin/k8055.pl b/web/bin/k8055.pl index 62172e46f..49a4038ba 100644 --- a/web/bin/k8055.pl +++ b/web/bin/k8055.pl @@ -23,8 +23,7 @@ ]; if ( $param{autorefresh} > 0 ) { - $html .= - qq[\n]; + $html .= qq[\n]; } $html .= qq[ @@ -49,8 +48,7 @@ for ( $i = 1; $i <= $numCounters; $i++ ) { if ( $param{"c$i"} ne '' ) { $k8055->setDebounce( $i, $param{"c$i"} ); - push( @result, - "Setting Counter $i Debounce to " . $param{"c$i"} . " ms" ); + push( @result, "Setting Counter $i Debounce to " . $param{"c$i"} . " ms" ); } } } @@ -74,8 +72,7 @@ } elsif ( $param{action} eq 'autoupdate' ) { $k8055->setUpdatePeriod( $param{autoupdatetime} ); - push( @result, - "Setting auto-update period to $param{autoupdatetime} seconds" ); + push( @result, "Setting auto-update period to $param{autoupdatetime} seconds" ); } elsif ( $param{action} eq 'update' ) { $k8055->update(); @@ -147,8 +144,7 @@ ]; for ( $i = 1; $i <= $numAnalogueOutputPorts; $i++ ) { - $html .= - qq[

Port $i:

]; + $html .= qq[

Port $i:

]; } $html .= qq[

\n]; @@ -161,8 +157,7 @@ $html .= "

"; for ( $i = 1; $i <= $numCounters; $i++ ) { - $html .= - qq[

Counter $i:

]; + $html .= qq[

Counter $i:

]; } $html .= qq[

\n]; diff --git a/web/bin/list_buttons.pl b/web/bin/list_buttons.pl index 09a3119a6..d6dde59b9 100644 --- a/web/bin/list_buttons.pl +++ b/web/bin/list_buttons.pl @@ -110,10 +110,7 @@ #$html = "\n\n" . if ($html_refrate) { - $htm_hdr = - "<\/head>\n"; + $htm_hdr = "<\/head>\n"; } else { $htm_hdr = "\n"; diff --git a/web/bin/list_categories.pl b/web/bin/list_categories.pl index 348635bba..9dc083e72 100644 --- a/web/bin/list_categories.pl +++ b/web/bin/list_categories.pl @@ -14,29 +14,24 @@ # Use custom icons if they exist my $image = "/graphics/category-$category2.gif"; if ( &http_get_local_file($image) ) { - $h .= - qq[$category2\n]; + $h .= qq[$category2\n]; } # Create buttons with GD module if available elsif ( $Info{module_GD} ) { my $name = &pretty_object_name($category); - $h .= - qq[$name\n]; + $h .= qq[$name\n]; } # Otherwise use text else { - $h .= - &html_active_href( "list?$category", &pretty_object_name($category) ) - . "\n"; + $h .= &html_active_href( "list?$category", &pretty_object_name($category) ) . "\n"; } $html .= $h . "\n"; $html .= "\n" unless ++$count % 3; } -$html = "\n\n" - . &html_header('Browse Categories') . " +$html = "\n\n" . &html_header('Browse Categories') . "
Which .mht file to edit?\n"; + $html .= &html_form_select( 'file', 1, $web_item_file_name, @file_paths ) . "
Refresh\n"; - $html .= - "  ReLoad Code \n"; + $html .= "
Refresh\n"; + $html .= "  ReLoad Code \n"; $html .= "Item Index: \n"; for my $type ( sort keys %item_pos ) { $html .= "$type\n"; @@ -146,31 +140,30 @@ sub web_items_list { # Define fields by type my %headers = ( - ANALOG_SENSOR => - [ 'Identifier', 'Name', 'Conduit', 'Groups', 'Type', 'Tokens' ], - EIB1 => [ 'Address', 'Name', 'Groups', 'Mode' ], - EIB1G => [ 'Address', 'Name', 'Groups', 'Addresses' ], - EIB2 => [ 'Address', 'Name', 'Groups' ], - EIB5 => [qw(Address Name Groups Mode)], - EIB7 => [ 'Address', 'Name', 'Groups' ], - GENERIC => [qw(Name Groups)], - GROUP => [qw(Name FloorPlan Groups)], - IBUTTON => [qw(ID Name Port Channel)], - SERIAL => [qw(String Name Groups State Port)], - VOICE => [qw(Item Phrase)], - X10A => [qw(Address Name Groups Interface)], - X10I => [qw(Address Name Groups Interface Options)], - X10SL => [qw(Address Name Groups Interface Options)], - X10MS => [qw(Address Name Groups Type)], - X106BUTTON => [qw(Address Name)], - UPBPIM => [qw(Name NetworkID Password Address)], - UPBD => [qw(Name Interface NetworkID Address Groups)], - UPBL => [qw(Name Interface NetworkID Address Groups)], - INSTEON_PLM => [qw(Name)], - INSTEON_LAMPLINC => [qw(Address Name Groups)], - INSTEON_BULBLINC => [qw(Address Name Groups)], - INSTEON_APPLIANCELINC => [qw(Address Name Groups)], - INSTEON_SWITCHLINC => [qw(Address Name Groups)], + ANALOG_SENSOR => [ 'Identifier', 'Name', 'Conduit', 'Groups', 'Type', 'Tokens' ], + EIB1 => [ 'Address', 'Name', 'Groups', 'Mode' ], + EIB1G => [ 'Address', 'Name', 'Groups', 'Addresses' ], + EIB2 => [ 'Address', 'Name', 'Groups' ], + EIB5 => [qw(Address Name Groups Mode)], + EIB7 => [ 'Address', 'Name', 'Groups' ], + GENERIC => [qw(Name Groups)], + GROUP => [qw(Name FloorPlan Groups)], + IBUTTON => [qw(ID Name Port Channel)], + SERIAL => [qw(String Name Groups State Port)], + VOICE => [qw(Item Phrase)], + X10A => [qw(Address Name Groups Interface)], + X10I => [qw(Address Name Groups Interface Options)], + X10SL => [qw(Address Name Groups Interface Options)], + X10MS => [qw(Address Name Groups Type)], + X106BUTTON => [qw(Address Name)], + UPBPIM => [qw(Name NetworkID Password Address)], + UPBD => [qw(Name Interface NetworkID Address Groups)], + UPBL => [qw(Name Interface NetworkID Address Groups)], + INSTEON_PLM => [qw(Name)], + INSTEON_LAMPLINC => [qw(Address Name Groups)], + INSTEON_BULBLINC => [qw(Address Name Groups)], + INSTEON_APPLIANCELINC => [qw(Address Name Groups)], + INSTEON_SWITCHLINC => [qw(Address Name Groups)], INSTEON_SWITCHLINCRELAY => [qw(Address Name Groups)], INSTEON_KEYPADLINC => [qw(Address Name Groups)], INSTEON_KEYPADLINCRELAY => [qw(Address Name Groups)], @@ -194,8 +187,7 @@ sub web_items_list { $html .= "
$header$header$header"; $html .= "Copy" if $Authorized eq 'admin'; - $html .= - " Delete" + $html .= " Delete" if $Authorized eq 'admin'; $html .= "$item_info[0]
diff --git a/web/bin/list_items.pl b/web/bin/list_items.pl index 45bd63e4e..97b4aa512 100644 --- a/web/bin/list_items.pl +++ b/web/bin/list_items.pl @@ -17,24 +17,19 @@ my $name = &pretty_object_name($object_type); if ( &http_get_local_file($image) ) { - $h .= - qq[$name\n]; + $h .= qq[$name\n]; } # Create buttons with GD module if available elsif ( $Info{module_GD} ) { # $name =~ s/ /%20/g; - $h .= - qq[$name\n]; + $h .= qq[$name\n]; } # Otherwise use text else { - $h .= - &html_active_href( "list?$object_type", - &pretty_object_name($object_type) ) - . "\n"; + $h .= &html_active_href( "list?$object_type", &pretty_object_name($object_type) ) . "\n"; } $html .= $h . "\n"; $html .= "\n" unless ++$count % 3; diff --git a/web/bin/list_widgets.pl b/web/bin/list_widgets.pl index 02fc72def..262559f72 100644 --- a/web/bin/list_widgets.pl +++ b/web/bin/list_widgets.pl @@ -5,12 +5,7 @@ my ( $html, $count ); -for my $type ( - 'Widgets', 'Widgets_Label', - 'Widgets_Entry', 'Widgets_RadioButton', - 'Widgets_Checkbox', 'Vars_Global', - 'Vars_Save' - ) +for my $type ( 'Widgets', 'Widgets_Label', 'Widgets_Entry', 'Widgets_RadioButton', 'Widgets_Checkbox', 'Vars_Global', 'Vars_Save' ) { # Look for custom icon my $type2 = lc $type; @@ -27,8 +22,7 @@ # Create buttons with GD module if available elsif ( $Info{module_GD} ) { my $name = &pretty_object_name($type); - $h .= - qq[$name\n]; + $h .= qq[$name\n]; } # Otherwise use text diff --git a/web/bin/menu.pl b/web/bin/menu.pl index 139b24b7e..452b14e97 100644 --- a/web/bin/menu.pl +++ b/web/bin/menu.pl @@ -110,8 +110,7 @@ sub menu_list_top { $html .= &menu_button( $menu_group, "/bin/menu.pl?$menu_group" ); $html .= "    " unless $menu_buttons; } - $html .= - 'No menus defined. Enable menu.pl in the common code selector' + $html .= 'No menus defined. Enable menu.pl in the common code selector' unless %Menus > 1; return &html_top . $html; } @@ -137,8 +136,7 @@ sub menu_list { $menus_prev1 .= $menu_prev; # $html .= &menu_button($menu_prev, ($menu_prev eq $menus[-1]) ? '' : "/bin/menu.pl?$menu_group&$menus_prev1"); - $html .= - &menu_button( $menu_prev, "/bin/menu.pl?$menu_group&$menus_prev1" ); + $html .= &menu_button( $menu_prev, "/bin/menu.pl?$menu_group&$menus_prev1" ); } $html .= "
\n"; @@ -187,16 +185,14 @@ sub menu_list { $href = "/bin/menu.pl?$menu_group&$menus|$goto"; $text = $goto; } - my $color = - ( $target eq 'speech' or $target eq 'main' ) ? 'blue' : 'white'; + my $color = ( $target eq 'speech' or $target eq 'main' ) ? 'blue' : 'white'; # Use an active button if 2 states and tied to an object my $states = @{ $$ptr2{Dstates} } if $$ptr2{Dstates}; my $action = $$ptr2{A}; if ( $states >= 1 and $action =~ /^ *set +(\$\S+)/ and eval "ref $1" ) { - $html .= - &menu_button2( $1, $text, $menu_group, $menus, $menu, $item ); + $html .= &menu_button2( $1, $text, $menu_group, $menus, $menu, $item ); } else { $html .= &menu_button( $text, $href, $target, $color ); @@ -220,22 +216,16 @@ sub menu_states { my $border = ( $buttons and $menu_buttons ) ? 0 : 1; # my $html = "
\n"; - my $html = - "
"; + my $html = "
$$ptr2{Dprefix}
"; my $state = 0; for my $state_name ( @{ $$ptr2{Dstates} } ) { my $href = "sub?menu_run($menu_group,$menu,$item,$state,h)"; $href =~ s/ /%20/g; if ($buttons) { - $html .= "\n"; + $html .= "\n"; } else { - $html .= - "\n"; + $html .= "\n"; } $state++; } @@ -314,8 +304,7 @@ sub menu_button2 { # my $href = "sub?menu_run($menu_group,$menu,$item,$state_next,hr,/bin/menu.pl?$menu_group&$menus)"; # &button_action is in mh/code/common/html_functions.pl # Need the function form, not the .pl form, since the argument has ? and & in it - my $href = - "sub?button_action($object_name,$state_next,/bin/menu.pl?$menu_group&$menus)"; + my $href = "sub?button_action($object_name,$state_next,/bin/menu.pl?$menu_group&$menus)"; $href =~ s/ /%20/g; return "$link\n"; } @@ -323,8 +312,7 @@ sub menu_button2 { sub key_pointer { $menu_key_index++; return unless $menu_keys; - return - ""; + return ""; } sub html_top { @@ -336,28 +324,19 @@ sub html_top { # $html =~ s||\n|; if ($menu_keys) { - my $script = "\n" - . "\n"; + my $script = "\n" . "\n"; $html =~ s//$script/; $html =~ s/body /body onload='load(); self.focus()' /; } $html .= "
$$ptr2{Dprefix}" - . &menu_button( $state_name, $href, 'speech', 'blue' ) - . "" . &menu_button( $state_name, $href, 'speech', 'blue' ) . "$state_name " - . &key_pointer - . "$state_name " . &key_pointer . "
\n"; - $html .= "\n" + $html .= + "\n" if $menu_keys_allowed; - $html .= "\n"; - $html .= "\n"; + $html .= "\n"; $html .= - "\n"; + "\n"; + $html .= "\n"; $html .= "
" - . &html_file( undef, '../web/bin/set_cookie.pl', - 'menu_keys&&Keyboard Control', 1 ) - . "" . &html_file( undef, '../web/bin/set_cookie.pl', 'menu_keys&&Keyboard Control', 1 ) . "" - . &html_file( undef, '../web/bin/set_cookie.pl', - 'menu_buttons&&Buttons', 1 ) - . "" - . &html_file( undef, '../web/bin/set_cookie.pl', - 'webmute&&Webmute&&&&/bin/menu.pl', 1 ) - . "" . &html_file( undef, '../web/bin/set_cookie.pl', 'menu_buttons&&Buttons', 1 ) . "Help" . &html_file( undef, '../web/bin/set_cookie.pl', 'webmute&&Webmute&&&&/bin/menu.pl', 1 ) . "Help
\n"; return $html; } diff --git a/web/bin/menu_old.pl b/web/bin/menu_old.pl index a632a9a13..ead5fdcc0 100644 --- a/web/bin/menu_old.pl +++ b/web/bin/menu_old.pl @@ -35,8 +35,7 @@ sub menu_list { $target++; $target = 'speech' if $target eq 'menu4'; my $html = "\n"; - $html .= - "\n"; + $html .= "\n"; my $item = 0; my $ptr = $Menus{$menu_group}; for my $ptr2 ( @{ $$ptr{$menu}{items} } ) { @@ -96,11 +95,9 @@ sub menu_states { my $ptr2 = $Menus{$menu_group}{$menu}{items}[$item]; my $state = 0; - my $html = - "
$menu
$menu
"; + my $html = "
$$ptr2{Dprefix}
"; for my $state_name ( @{ $$ptr2{Dstates} } ) { - $html .= - "\n"; + $html .= "\n"; $state++; } $html .= "
$$ptr2{Dprefix}$state_name$state_name
"; diff --git a/web/bin/mh_usage.pl b/web/bin/mh_usage.pl index bc41488a9..bffe3bac2 100644 --- a/web/bin/mh_usage.pl +++ b/web/bin/mh_usage.pl @@ -13,12 +13,10 @@ $msg = "City and State/Country not filled in, so no data was sent."; } else { - $msg = - "Usage data logged:\n\n city=$city state/country=$state name=$name\n"; + $msg = "Usage data logged:\n\n city=$city state/country=$state name=$name\n"; $msg .= "\nThanks!\n"; display $msg, 0, "$Time_Date: Usage survey"; - logit "$config_parms{data_dir}/mh_usage.txt", - "city=$city state=$state name=$name"; + logit "$config_parms{data_dir}/mh_usage.txt", "city=$city state=$state name=$name"; } return html_page '', $msg; diff --git a/web/bin/mp3_applet_playlist.pl b/web/bin/mp3_applet_playlist.pl index ec35de755..a7e5e8e29 100644 --- a/web/bin/mp3_applet_playlist.pl +++ b/web/bin/mp3_applet_playlist.pl @@ -18,8 +18,7 @@ "MisterHouse Jukebox Playlist"; $Mp3List = "$Mp3List "; $Mp3List = "$Mp3List "; - $Mp3List = - "$Mp3List "; + $Mp3List = "$Mp3List "; $Mp3List = "$Mp3List "; - $Mp3List = - "$Mp3List "; + $Mp3List = "$Mp3List
"; $Mp3List = "$Mp3List"; @@ -49,8 +47,7 @@ my $pos = 1; foreach my $item (@$titles) { my $Time = &mp3_get_playlist_timestr( $pos - 1 ); - my $Str = - " "; + my $Str = " "; $Str = substr( "$pos. $item", 1 ); my $my_pos = $pos - 1; @@ -58,16 +55,15 @@ # Only highlight the current song otherwise just add to the list # v 1.10 and Add a Track Jump URL if ( $pos - 1 == $currPos ) { - $Mp3List = $Mp3List - . ""; + $Mp3List = + $Mp3List . ""; } # if ( $pos - 1 == $currPos ) { $Mp3List = $Mp3List ."" ; } # if ( $pos - 1 != $currPos ) { $Mp3List = $Mp3List ."" ; } if ( $pos - 1 != $currPos ) { - $Mp3List = $Mp3List - . ""; } diff --git a/web/bin/mp3_search.pl b/web/bin/mp3_search.pl index ed9b2defa..828a0de01 100644 --- a/web/bin/mp3_search.pl +++ b/web/bin/mp3_search.pl @@ -38,18 +38,15 @@ my $href = encode_url( '"' . $playfiles{$playlist} . '"' ); $href = ""; my $icon = $href; - $icon .= - "playlist"; + $icon .= "playlist"; $html .= ""; - $html .= - ""; + $html .= ""; $html .= "\n" unless ++$i % 3; } } elsif ( $string eq 'stations' ) { my @stations = &mp3_radio_stations; - $html .= - ""; + $html .= ""; $html .= ""; $html .= ""; $html .= ""; @@ -60,8 +57,7 @@ my ( $station, $url, $bandwidth, $style ) = split $;, $station; my $href = ""; my $icon = $href; - $icon .= - "playlist"; + $icon .= "playlist"; $html .= ""; $html .= ""; $html .= ""; @@ -70,8 +66,7 @@ $html .= "\n"; } $html .= "\n"; + $html .= "Get internet radio station list\n"; } elsif ( $string eq 'artists' ) { my %artists = &mp3_find_all('artist'); @@ -90,14 +85,11 @@ my $href = encode_url( quotemeta($artist) ); my $n = $artists{$artist}; $artist = 'none' if $artist eq ''; - $href = - ""; + $href = ""; my $icon = $href; - $icon .= - "playlist"; + $icon .= "playlist"; $html .= ""; - $html .= - ""; + $html .= ""; $html .= "\n" unless ++$i % 3; } } @@ -119,14 +111,11 @@ next if $album eq '' or $albums{$artistalbum} < 3; my $href = encode_url( quotemeta($album) ); my $n = $albums{$artistalbum}; - $href = - ""; + $href = ""; my $icon = $href; - $icon .= - "playlist"; + $icon .= "playlist"; $html .= ""; - $html .= - ""; + $html .= ""; $html .= "\n" unless ++$i % 3; } } @@ -138,14 +127,11 @@ my $href = encode_url( quotemeta($year) ); my $n = $years{$year}; $year = 'none' if $year eq ''; - $href = - ""; + $href = ""; my $icon = $href; - $icon .= - "playlist"; + $icon .= "playlist"; $html .= ""; - $html .= - ""; + $html .= ""; $html .= "\n" unless ++$i % 3; } } @@ -157,14 +143,11 @@ my $href = encode_url( quotemeta($genre) ); my $n = $genres{$genre}; $genre = 'none' if $genre eq ''; - $href = - ""; + $href = ""; my $icon = $href; - $icon .= - "playlist"; + $icon .= "playlist"; $html .= ""; - $html .= - ""; + $html .= ""; $html .= "\n" unless ++$i % 3; } } @@ -177,28 +160,21 @@ $string =~ s/album=.+//; my $year = $1 if $string =~ /year=(.+)/; $string =~ s/year=.+//; - my ( $results1, $results2, $count1, $count2 ) = - &mp3_search( $string, $genre, $artist, $album, $year ); + my ( $results1, $results2, $count1, $count2 ) = &mp3_search( $string, $genre, $artist, $album, $year ); # print "db r=$results1\n"; if ($count2) { # $html .= "\n"; - $html .= - "Play All\n"; + $html .= "Play All\n"; $html .= " Add All

\n"; if ($show_details) { - $html .= - "

"; - $html .= - ""; - $html .= - ""; - $html .= - ""; - $html .= - ""; + $html .= ""; + $html .= ""; + $html .= ""; + $html .= ""; + $html .= ""; $html .= "\n"; } } @@ -207,11 +183,9 @@ } while ( $results1 =~ - /Title: (.+?) *Album: (.+?) *Year: (.+?) *Genre: *(.+?) *- Artist: (.+?) *Comments: *(.+?) *- File: (.+?)$/smg - ) + /Title: (.+?) *Album: (.+?) *Year: (.+?) *Genre: *(.+?) *- Artist: (.+?) *Comments: *(.+?) *- File: (.+?)$/smg ) { - my ( $title, $album, $year, $genre, $artist, $comments, $file ) = - ( $1, $2, $3, $4, $5, $6, $7 ); + my ( $title, $album, $year, $genre, $artist, $comments, $file ) = ( $1, $2, $3, $4, $5, $6, $7 ); # print "db t=$title a=$album y=$year g=$genre art=$artist c=$comments f=$file \n"; last unless $title; @@ -220,12 +194,9 @@ my ( $href, $arg ); if ($show_details) { $href = encode_url( '"' . $file . '"' ); - $href =~ - s/\\/\//g; # Forward slashes work ok in windows, and are easier - $html .= - ""; + $href =~ s/\\/\//g; # Forward slashes work ok in windows, and are easier + $html .= ""; $href = encode_url( quotemeta($artist) ); $html .= ""; @@ -241,8 +212,7 @@ $html .= "\n"; } else { - $html .= - ""; + $html .= ""; $html .= "\n" unless ++$i % 3; } } diff --git a/web/bin/mrwiki.pl b/web/bin/mrwiki.pl index 722c30534..68d94531d 100644 --- a/web/bin/mrwiki.pl +++ b/web/bin/mrwiki.pl @@ -36,71 +36,71 @@ package UseModWiki; $q $Now $UserID $TimeZoneOffset $ScriptName $BrowseCode $OtherCode); # == Configuration ===================================================== -$DataDir = $main::config_parms{wiki_data}; -$UseConfig = 0; # 1 = use config file, 0 = do not look for config +$DataDir = $main::config_parms{wiki_data}; +$UseConfig = 0; # 1 = use config file, 0 = do not look for config # Default configuration (used if UseConfig is 0) -$CookieName = "MrWiki"; # Name for this wiki (for multi-wiki sites) -$SiteName = "MrWiki"; # Name of site (used for titles) -$HomePage = "HomePage"; # Home page (change space to _) -$RCName = "RecentChanges"; # Name of changes page (change space to _) -$LogoUrl = "/graphics/mrwiki.gif"; # URL for site logo ("" for no logo) +$CookieName = "MrWiki"; # Name for this wiki (for multi-wiki sites) +$SiteName = "MrWiki"; # Name of site (used for titles) +$HomePage = "HomePage"; # Home page (change space to _) +$RCName = "RecentChanges"; # Name of changes page (change space to _) +$LogoUrl = "/graphics/mrwiki.gif"; # URL for site logo ("" for no logo) #$ENV{PATH} = $main::config_parms{wiki_diff}; #Path to find "diff" -$ScriptTZ = ""; # Local time zone ("" means do not print) -$RcDefault = 30; # Default number of RecentChanges days -@RcDays = qw(1 3 7 30 90); # Days for links on RecentChanges -$KeepDays = 14; # Days to keep old revisions -$SiteBase = ""; # Full URL for header -$FullUrl = ""; # Set if the auto-detected URL is wrong -$RedirType = 1; # 1 = CGI.pm, 2 = script, 3 = no redirect -$AdminPass = ""; # Set to non-blank to enable password(s) -$EditPass = ""; # Like AdminPass, but for editing only -$StyleSheet = "/ia5/default.css"; # URL for CSS stylesheet (like "/wiki.css") -$NotFoundPg = ""; # Page for not-found links ("" for blank pg) -$EmailFrom = "MrWiki"; # Text for "From: " field of email notes. -$SendMail = "/usr/sbin/sendmail"; # Full path to sendmail executable -$FooterNote = ""; # HTML for bottom of every page -$EditNote = ""; # HTML notice above buttons on edit page -$MaxPost = 1024 * 210; # Maximum 210K posts (about 200K for pages) -$NewText = ""; # New page text ("" for default message) -$HttpCharset = ""; # Charset for pages, like "iso-8859-2" -$UserGotoBar = ""; # HTML added to end of goto bar +$ScriptTZ = ""; # Local time zone ("" means do not print) +$RcDefault = 30; # Default number of RecentChanges days +@RcDays = qw(1 3 7 30 90); # Days for links on RecentChanges +$KeepDays = 14; # Days to keep old revisions +$SiteBase = ""; # Full URL for header +$FullUrl = ""; # Set if the auto-detected URL is wrong +$RedirType = 1; # 1 = CGI.pm, 2 = script, 3 = no redirect +$AdminPass = ""; # Set to non-blank to enable password(s) +$EditPass = ""; # Like AdminPass, but for editing only +$StyleSheet = "/ia5/default.css"; # URL for CSS stylesheet (like "/wiki.css") +$NotFoundPg = ""; # Page for not-found links ("" for blank pg) +$EmailFrom = "MrWiki"; # Text for "From: " field of email notes. +$SendMail = "/usr/sbin/sendmail"; # Full path to sendmail executable +$FooterNote = ""; # HTML for bottom of every page +$EditNote = ""; # HTML notice above buttons on edit page +$MaxPost = 1024 * 210; # Maximum 210K posts (about 200K for pages) +$NewText = ""; # New page text ("" for default message) +$HttpCharset = ""; # Charset for pages, like "iso-8859-2" +$UserGotoBar = ""; # HTML added to end of goto bar # Major options: -$UseSubpage = 1; # 1 = use subpages, 0 = do not use subpages -$UseCache = 0; # 1 = cache HTML pages, 0 = generate every page -$EditAllowed = 1; # 1 = editing allowed, 0 = read-only -$RawHtml = 0; # 1 = allow tag, 0 = no raw HTML in pages -$HtmlTags = 0; # 1 = "unsafe" HTML tags, 0 = only minimal tags -$UseDiff = 1; # 1 = use diff features, 0 = do not use diff -$FreeLinks = 1; # 1 = use [[word]] links, 0 = LinkPattern only -$WikiLinks = 1; # 1 = use LinkPattern, 0 = use [[word]] only -$AdminDelete = 1; # 1 = Admin only page, 0 = Editor can delete pages -$RunCGI = 1; # 1 = Run script as CGI, 0 = Load but do not run -$EmailNotify = 0; # 1 = use email notices, 0 = no email on changes -$EmbedWiki = 0; # 1 = no headers/footers, 0 = normal wiki pages +$UseSubpage = 1; # 1 = use subpages, 0 = do not use subpages +$UseCache = 0; # 1 = cache HTML pages, 0 = generate every page +$EditAllowed = 1; # 1 = editing allowed, 0 = read-only +$RawHtml = 0; # 1 = allow tag, 0 = no raw HTML in pages +$HtmlTags = 0; # 1 = "unsafe" HTML tags, 0 = only minimal tags +$UseDiff = 1; # 1 = use diff features, 0 = do not use diff +$FreeLinks = 1; # 1 = use [[word]] links, 0 = LinkPattern only +$WikiLinks = 1; # 1 = use LinkPattern, 0 = use [[word]] only +$AdminDelete = 1; # 1 = Admin only page, 0 = Editor can delete pages +$RunCGI = 1; # 1 = Run script as CGI, 0 = Load but do not run +$EmailNotify = 0; # 1 = use email notices, 0 = no email on changes +$EmbedWiki = 0; # 1 = no headers/footers, 0 = normal wiki pages # Minor options: -$LogoLeft = 0; # 1 = logo on left, 0 = logo on right -$RecentTop = 1; # 1 = recent on top, 0 = recent on bottom -$UseDiffLog = 1; # 1 = save diffs to log, 0 = do not save diffs -$KeepMajor = 1; # 1 = keep major rev, 0 = expire all revisions -$KeepAuthor = 1; # 1 = keep author rev, 0 = expire all revisions -$ShowEdits = 0; # 1 = show minor edits, 0 = hide edits by default -$HtmlLinks = 0; # 1 = allow A HREF links, 0 = no raw HTML links -$SimpleLinks = 0; # 1 = only letters, 0 = allow _ and numbers -$NonEnglish = 0; # 1 = extra link chars, 0 = only A-Za-z chars -$ThinLine = 0; # 1 = fancy
tags, 0 = classic wiki
-$BracketText = 1; # 1 = allow [URL text], 0 = no link descriptions -$UseAmPm = 1; # 1 = use am/pm in times, 0 = use 24-hour times -$UseIndex = 0; # 1 = use index file, 0 = slow/reliable method -$UseHeadings = 1; # 1 = allow = h1 text =, 0 = no header formatting -$NetworkFile = 1; # 1 = allow remote file:, 0 = no file:// links -$BracketWiki = 0; # 1 = [WikiLnk txt] link, 0 = no local descriptions -$UseLookup = 1; # 1 = lookup host names, 0 = skip lookup (IP only) -$FreeUpper = 1; # 1 = force upper case, 0 = do not force case -$FastGlob = 1; # 1 = new faster code, 0 = old compatible code +$LogoLeft = 0; # 1 = logo on left, 0 = logo on right +$RecentTop = 1; # 1 = recent on top, 0 = recent on bottom +$UseDiffLog = 1; # 1 = save diffs to log, 0 = do not save diffs +$KeepMajor = 1; # 1 = keep major rev, 0 = expire all revisions +$KeepAuthor = 1; # 1 = keep author rev, 0 = expire all revisions +$ShowEdits = 0; # 1 = show minor edits, 0 = hide edits by default +$HtmlLinks = 0; # 1 = allow A HREF links, 0 = no raw HTML links +$SimpleLinks = 0; # 1 = only letters, 0 = allow _ and numbers +$NonEnglish = 0; # 1 = extra link chars, 0 = only A-Za-z chars +$ThinLine = 0; # 1 = fancy
tags, 0 = classic wiki
+$BracketText = 1; # 1 = allow [URL text], 0 = no link descriptions +$UseAmPm = 1; # 1 = use am/pm in times, 0 = use 24-hour times +$UseIndex = 0; # 1 = use index file, 0 = slow/reliable method +$UseHeadings = 1; # 1 = allow = h1 text =, 0 = no header formatting +$NetworkFile = 1; # 1 = allow remote file:, 0 = no file:// links +$BracketWiki = 0; # 1 = [WikiLnk txt] link, 0 = no local descriptions +$UseLookup = 1; # 1 = lookup host names, 0 = skip lookup (IP only) +$FreeUpper = 1; # 1 = force upper case, 0 = do not force case +$FastGlob = 1; # 1 = new faster code, 0 = old compatible code # HTML tag lists, enabled if $HtmlTags is set. # Scripting is currently possible with these tags, @@ -176,8 +176,7 @@ sub InitLinkPatterns { $AnyLetter .= "]"; # Main link pattern: lowercase between uppercase, then anything - $LpA = - $UpperLetter . "+" . $LowerLetter . "+" . $UpperLetter . $AnyLetter . "*"; + $LpA = $UpperLetter . "+" . $LowerLetter . "+" . $UpperLetter . $AnyLetter . "*"; # Optional subpage link pattern: uppercase, lowercase, then anything $LpB = $UpperLetter . "+" . $LowerLetter . "+" . $AnyLetter . "*"; @@ -225,8 +224,7 @@ sub InitLinkPatterns { # 5. A $FS (field separator) character (kept in output) # 6. A double double-quote ("") (removed from output) - $UrlProtocols = "http|https|ftp|afs|news|nntp|mid|cid|mailto|wais|" - . "prospero|telnet|gopher"; + $UrlProtocols = "http|https|ftp|afs|news|nntp|mid|cid|mailto|wais|" . "prospero|telnet|gopher"; $UrlProtocols .= '|file' if $NetworkFile; $UrlPattern = "((?:(?:$UrlProtocols):[^\\]\\s\"<>$FS]+)$QDelim)"; $ImageExtensions = "(gif|jpg|png|bmp|jpeg)"; @@ -313,24 +311,24 @@ sub InitRequest { $IndexInit = 0; # Must be reset for each request $InterSiteInit = 0; %InterSite = (); - $MainPage = "."; # For subpages only, the name of the top-level page - $OpenPageName = ""; # Currently open page - &CreateDir($DataDir); # Create directory if it doesn't exist + $MainPage = "."; # For subpages only, the name of the top-level page + $OpenPageName = ""; # Currently open page + &CreateDir($DataDir); # Create directory if it doesn't exist if ( !-d $DataDir ) { &ReportError( Ts( 'Could not create %s', $DataDir ) . ": $!" ); return 0; } - &InitCookie(); # Reads in user data + &InitCookie(); # Reads in user data return 1; } sub InitCookie { %SetCookie = (); $TimeZoneOffset = 0; - undef $q->{'.cookies'}; # Clear cache if it exists (for SpeedyCGI) + undef $q->{'.cookies'}; # Clear cache if it exists (for SpeedyCGI) %UserCookie = $q->cookie($CookieName); $UserID = $UserCookie{'id'}; - $UserID =~ s/\D//g; # Numeric only + $UserID =~ s/\D//g; # Numeric only if ( $UserID < 200 ) { $UserID = 111; } @@ -342,7 +340,7 @@ sub InitCookie { || ( $UserData{'randkey'} != $UserCookie{'randkey'} ) ) { $UserID = 113; - %UserData = (); # Invalid. Later consider warning message. + %UserData = (); # Invalid. Later consider warning message. } } if ( $UserData{'tzoffset'} != 0 ) { @@ -353,12 +351,12 @@ sub InitCookie { sub DoBrowseRequest { my ( $id, $action, $text ); - if ( !$q->param ) { # No parameter + if ( !$q->param ) { # No parameter &BrowsePage($HomePage); return 1; } $id = &GetParam( 'keywords', '' ); - if ($id) { # Just script?PageName + if ($id) { # Just script?PageName if ( $FreeLinks && ( !-f &GetPageFile($id) ) ) { $id = &FreeToNormal($id); } @@ -450,26 +448,19 @@ sub BrowsePage { # Later maybe add edit time? if ( $goodRevision ne '' ) { - $fullHtml .= - '' . Ts( 'Showing revision %s', $revision ) . "
"; + $fullHtml .= '' . Ts( 'Showing revision %s', $revision ) . "
"; } else { - $fullHtml .= '' - . Ts( 'Revision %s not available', $revision ) . ' (' - . T('showing current revision instead') - . ')
'; + $fullHtml .= + '' . Ts( 'Revision %s not available', $revision ) . ' (' . T('showing current revision instead') . ')
'; } } $allDiff = &GetParam( 'alldiff', 0 ); if ( $allDiff != 0 ) { $allDiff = &GetParam( 'defaultdiff', 1 ); } - if ( - ( - ( $id eq $RCName ) || ( T($RCName) eq $id ) || ( T($id) eq $RCName ) - ) - && &GetParam( 'norcdiff', 1 ) - ) + if ( ( ( $id eq $RCName ) || ( T($RCName) eq $id ) || ( T($id) eq $RCName ) ) + && &GetParam( 'norcdiff', 1 ) ) { $allDiff = 0; # Only show if specifically requested } @@ -484,8 +475,7 @@ sub BrowsePage { } $fullHtml .= &WikiToHTML( $Text{'text'} ); $fullHtml .= "
\n" if ( !&GetParam( 'embed', $EmbedWiki ) ); - if ( ( $id eq $RCName ) || ( T($RCName) eq $id ) || ( T($id) eq $RCName ) ) - { + if ( ( $id eq $RCName ) || ( T($RCName) eq $id ) || ( T($id) eq $RCName ) ) { print $fullHtml; &DoRc(); print "
\n" if ( !&GetParam( 'embed', $EmbedWiki ) ); @@ -502,9 +492,8 @@ sub BrowsePage { sub ReBrowsePage { my ( $id, $oldId, $isEdit ) = @_; - if ( $oldId ne "" ) { # Target of #REDIRECT (loop breaking) - print &GetRedirectPage( "action=browse&id=$id&oldid=$oldId", - $id, $isEdit ); + if ( $oldId ne "" ) { # Target of #REDIRECT (loop breaking) + print &GetRedirectPage( "action=browse&id=$id&oldid=$oldId", $id, $isEdit ); } else { print &GetRedirectPage( $id, $id, $isEdit ); @@ -519,19 +508,14 @@ sub DoRc { if ( &GetParam( "from", 0 ) ) { $starttime = &GetParam( "from", 0 ); - print "

" . Ts( 'Updates since %s', &TimeToText($starttime) ) - . "

\n"; + print "

" . Ts( 'Updates since %s', &TimeToText($starttime) ) . "

\n"; } else { $daysago = &GetParam( "days", 0 ); $daysago = &GetParam( "rcdays", 0 ) if ( $daysago == 0 ); if ($daysago) { $starttime = $Now - ( ( 24 * 60 * 60 ) * $daysago ); - print "

" - . Ts( - 'Updates in the last %s day' . ( ( $daysago != 1 ) ? "s" : "" ), - $daysago - ) . "

\n"; + print "

" . Ts( 'Updates in the last %s day' . ( ( $daysago != 1 ) ? "s" : "" ), $daysago ) . "

\n"; # Note: must have two translations (for "day" and "days") # Following comment line is for translation helper script @@ -540,11 +524,7 @@ sub DoRc { } if ( $starttime == 0 ) { $starttime = $Now - ( ( 24 * 60 * 60 ) * $RcDefault ); - print "

" - . Ts( - 'Updates in the last %s day' . ( ( $RcDefault != 1 ) ? "s" : "" ), - $RcDefault ) - . "

\n"; + print "

" . Ts( 'Updates in the last %s day' . ( ( $RcDefault != 1 ) ? "s" : "" ), $RcDefault ) . "

\n"; # Translation of above line is identical to previous version } @@ -561,8 +541,7 @@ sub DoRc { . ": $RcFile

" . T('Error was') . ":\n

$!
\n" . '

' - . T('Note: This error is normal if no changes have been made.') - . "\n"; + . T('Note: This error is normal if no changes have been made.') . "\n"; } @fullrc = split( /\n/, $fileData ); $firstTs = 0; @@ -594,22 +573,18 @@ sub DoRc { $idOnly = &GetParam( "rcidonly", "" ); if ( $idOnly ne "" ) { - print '(' . Ts( 'for %s only', &ScriptLink( $idOnly, $idOnly ) ) - . ')
'; + print '(' . Ts( 'for %s only', &ScriptLink( $idOnly, $idOnly ) ) . ')
'; } foreach $i (@RcDays) { print " | " if $showbar; $showbar = 1; - print &ScriptLink( "action=rc&days=$i", - Ts( '%s day' . ( ( $i != 1 ) ? 's' : '' ), $i ) ); + print &ScriptLink( "action=rc&days=$i", Ts( '%s day' . ( ( $i != 1 ) ? 's' : '' ), $i ) ); # Note: must have two translations (for "day" and "days") # Following comment line is for translation helper script # Ts('%s days', ''); } - print "
" - . &ScriptLink( "action=rc&from=$lastTs", - T('List new changes starting from') ); + print "
" . &ScriptLink( "action=rc&from=$lastTs", T('List new changes starting from') ); print " " . &TimeToText($lastTs) . "
\n"; # Later consider a binary search? @@ -628,13 +603,11 @@ sub DoRc { last if ( $ts >= $starttime ); } if ( $i == @fullrc ) { - print '
' - . Ts( 'No updates since %s', &TimeToText($starttime) ) - . "
\n"; + print '
' . Ts( 'No updates since %s', &TimeToText($starttime) ) . "
\n"; } else { splice( @fullrc, 0, $i ); # Remove items before index $i - # Later consider an end-time limit (items older than X) + # Later consider an end-time limit (items older than X) print &GetRcHtml(@fullrc); } print '

' . Ts( 'Page generated %s', &TimeToText($Now) ), "
\n"; @@ -650,7 +623,7 @@ sub GetRcHtml { my %changetime = (); my %pagecount = (); - $tEdit = T('(edit)'); # Optimize translations out of main loop + $tEdit = T('(edit)'); # Optimize translations out of main loop $tDiff = T('(diff)'); $tChanges = T('changes'); $showedit = &GetParam( "rcshowedit", $ShowEdits ); @@ -660,10 +633,10 @@ sub GetRcHtml { foreach $rcline (@outrc) { ( $ts, $pagename, $summary, $isEdit, $host ) = split( /$FS3/, $rcline ); - if ( $showedit == 0 ) { # 0 = No edits + if ( $showedit == 0 ) { # 0 = No edits push( @temprc, $rcline ) if ( !$isEdit ); } - else { # 2 = Only edits + else { # 2 = Only edits push( @temprc, $rcline ) if ($isEdit); } } @@ -741,7 +714,7 @@ sub GetRcHtml { # Later do new-RC looping here. $html .= &CalcTime($ts) . " $count$edit" . " $sum"; - $html .= ". . . . . $author\n"; # Make dots optional? + $html .= ". . . . . $author\n"; # Make dots optional? } $html .= "\n" if ($inlist); return $html; @@ -759,17 +732,16 @@ sub DoHistory { my ($id) = @_; my ( $html, $canEdit ); - print &GetHeader( "", &QuoteHtml( Ts( 'History of %s', $id ) ), "" ) - . "
"; + print &GetHeader( "", &QuoteHtml( Ts( 'History of %s', $id ) ), "" ) . "
"; &OpenPage($id); &OpenDefaultText(); $canEdit = &UserCanEdit($id); - $canEdit = 0; # Turn off direct "Edit" links - $html = &GetHistoryLine( $id, $Page{'text_default'}, $canEdit, 1 ); + $canEdit = 0; # Turn off direct "Edit" links + $html = &GetHistoryLine( $id, $Page{'text_default'}, $canEdit, 1 ); &OpenKeptRevisions('text_default'); foreach ( reverse sort { $a <=> $b } keys %KeptRevisions ) { - next if ( $_ eq "" ); # (needed?) + next if ( $_ eq "" ); # (needed?) $html .= &GetHistoryLine( $id, $KeptRevisions{$_}, $canEdit, 0 ); } print $html; @@ -917,10 +889,10 @@ sub GetSearchLink { my ($id) = @_; my $name = $id; - $id =~ s|.+/|/|; # Subpage match: search for just /SubName + $id =~ s|.+/|/|; # Subpage match: search for just /SubName if ($FreeLinks) { - $name =~ s/_/ /g; # Display with spaces - $id =~ s/_/+/g; # Search for url-escaped spaces + $name =~ s/_/ /g; # Display with spaces + $id =~ s/_/+/g; # Search for url-escaped spaces } return &ScriptLink( "search=$id", $name ); } @@ -973,8 +945,7 @@ sub GetAuthorLink { # Later have user preference for link titles and/or host text? if ( ( $uid > 0 ) && ( $userName ne "" ) ) { - $html = &ScriptLinkTitle( $userName, $userNameShow, - Ts( 'ID %s', $uid ) . ' ' . Ts( 'from %s', $host ) ); + $html = &ScriptLinkTitle( $userName, $userNameShow, Ts( 'ID %s', $uid ) . ' ' . Ts( 'from %s', $host ) ); } else { $html = $host; @@ -1007,10 +978,7 @@ sub GetHeader { return $result if ($embed); if ( $oldId ne '' ) { - $result .= - $q->h3( '(' - . Ts( 'redirected from %s', &GetEditLink( $oldId, $oldId ) ) - . ')' ); + $result .= $q->h3( '(' . Ts( 'redirected from %s', &GetEditLink( $oldId, $oldId ) ) . ')' ); } if ( ( !$embed ) && ( $LogoUrl ne "" ) ) { $logoImage = "img src=\"$LogoUrl\" alt=\"$altText\" border=0"; @@ -1036,12 +1004,7 @@ sub GetHeader { sub GetHttpHeader { my $cookie; if ( defined( $SetCookie{'id'} ) ) { - $cookie = - "$CookieName=" . "rev&" - . $SetCookie{'rev'} . "&id&" - . $SetCookie{'id'} - . "&randkey&" - . $SetCookie{'randkey'}; + $cookie = "$CookieName=" . "rev&" . $SetCookie{'rev'} . "&id&" . $SetCookie{'id'} . "&randkey&" . $SetCookie{'randkey'}; $cookie .= ";expires=Fri, 08-Sep-2010 19:48:23 GMT"; if ( $HttpCharset ne '' ) { return $q->header( @@ -1097,8 +1060,7 @@ sub GetFooterText { $result .= &GetGotoBar($id); if ( &UserCanEdit( $id, 0 ) ) { if ( $rev ne '' ) { - $result .= &GetOldPageLink( 'edit', $id, $rev, - Ts( 'Edit revision %s of this page', $rev ) ); + $result .= &GetOldPageLink( 'edit', $id, $rev, Ts( 'Edit revision %s of this page', $rev ) ); } else { $result .= &GetEditLink( $id, T('Edit text of this page') ); @@ -1128,12 +1090,7 @@ sub GetFooterText { } $result .= '
' . &GetSearchForm(); if ( $DataDir =~ m|/tmp/| ) { - $result .= - '
' - . T('Warning') - . ': ' - . Ts( 'Database is stored in temporary directory %s', $DataDir ) - . '
'; + $result .= '
' . T('Warning') . ': ' . Ts( 'Database is stored in temporary directory %s', $DataDir ) . '
'; } $result .= $q->endform; $result .= &GetMinimumFooter(); @@ -1141,13 +1098,7 @@ sub GetFooterText { } sub GetCommonFooter { - return - "


" - . &GetFormStart() - . &GetGotoBar("") - . &GetSearchForm() - . $q->endform - . &GetMinimumFooter(); + return "
" . &GetFormStart() . &GetGotoBar("") . &GetSearchForm() . $q->endform . &GetMinimumFooter(); } sub GetMinimumFooter { @@ -1158,8 +1109,7 @@ sub GetMinimumFooter { } sub GetFormStart { - return $q->startform( "POST", "$ScriptName", - "application/x-www-form-urlencoded" ); + return $q->startform( "POST", "$ScriptName", "application/x-www-form-urlencoded" ); } sub GetGotoBar { @@ -1187,10 +1137,7 @@ sub GetGotoBar { sub GetSearchForm { my ($result); - $result = - T('Search:') . ' ' - . $q->textfield( -name => 'search', -size => 20 ) - . &GetHiddenValue( "dosearch", 1 ); + $result = T('Search:') . ' ' . $q->textfield( -name => 'search', -size => 20 ) . &GetHiddenValue( "dosearch", 1 ); return $result; } @@ -1205,14 +1152,14 @@ sub GetRedirectPage { $nameLink = "$name"; if ( $RedirType < 3 ) { if ( $RedirType == 1 ) { # Use CGI.pm - # NOTE: do NOT use -method (does not work with old CGI.pm versions) - # Thanks to Daniel Neri for fixing this problem. + # NOTE: do NOT use -method (does not work with old CGI.pm versions) + # Thanks to Daniel Neri for fixing this problem. $html = $q->redirect( -uri => $url ); } - else { # Minimal header + else { # Minimal header $html = "Status: 302 Moved\n"; $html .= "Location: $url\n"; - $html .= "Content-Type: text/html\n"; # Needed for browser failure + $html .= "Content-Type: text/html\n"; # Needed for browser failure $html .= "\n"; } $html .= "\n" . Ts( 'Your browser should go to the %s page.', $newid ); @@ -1259,7 +1206,7 @@ sub CommonMarkup { local $_ = $text; if ( $doLines < 2 ) { # 2 = do line-oriented only - # The tag stores text with no markup (except quoting HTML) + # The tag stores text with no markup (except quoting HTML) s/\<nowiki\>((.|\n)*?)\<\/nowiki\>/&StoreRaw($1)/ige; # The
 tag wraps the stored text with the HTML 
 tag
@@ -1317,8 +1264,8 @@ sub CommonMarkup {
         }
     }
     if ($doLines) {    # 0 = no line-oriented, 1 or 2 = do line-oriented
-            # The quote markup patterns avoid overlapping tags (with 5 quotes)
-            # by matching the inner quotes for the strong pattern.
+                       # The quote markup patterns avoid overlapping tags (with 5 quotes)
+                       # by matching the inner quotes for the strong pattern.
         s/('*)'''(.*?)'''/$1$2<\/strong>/g;
         s/''(.*?)''/$1<\/em>/g;
         if ($UseHeadings) {
@@ -1514,8 +1461,7 @@ sub UrlLink {
     }
 
     # Restricted image URLs so that mailto:foo@bar.gif is not an image
-    if ( $useImage && ( $name =~ /^(http:|https:|ftp:).+\.$ImageExtensions$/ ) )
-    {
+    if ( $useImage && ( $name =~ /^(http:|https:|ftp:).+\.$ImageExtensions$/ ) ) {
         return ( "", $punct );
     }
     return ( "$name", $punct );
@@ -1578,17 +1524,10 @@ sub ISBNLink {
     if ( length($num) != 10 ) {
         return "ISBN $rawnum";
     }
-    $first = "";
-    $second =
-        ""
-      . T('alternate') . "";
-    $third =
-        ""
-      . T('search') . "";
-    $html = $first . "ISBN " . $rawprint . " ";
+    $first  = "";
+    $second = "" . T('alternate') . "";
+    $third  = "" . T('search') . "";
+    $html   = $first . "ISBN " . $rawprint . " ";
     $html .= "($second, $third)";
     $html .= " " if ( $rawnum =~ / $/ );    # Add space if old ISBN had space.
     return $html;
@@ -1627,8 +1566,7 @@ sub WikiHeading {
 sub GetDiffHTML {
     my ( $diffType, $id, $rev, $newText ) = @_;
     my ( $html, $diffText, $diffTextTwo, $priorName, $links, $usecomma );
-    my ( $major, $minor, $author, $useMajor, $useMinor, $useAuthor,
-        $cacheName );
+    my ( $major, $minor, $author, $useMajor, $useMinor, $useAuthor, $cacheName );
 
     $links     = "(";
     $usecomma  = 0;
@@ -1711,10 +1649,7 @@ sub GetDiffHTML {
                 || ( &GetPageCache("old$cacheName") < 1 ) )
           )
         {
-            $html = ''
-              . Ts( 'No diff available--this is the first %s revision.',
-                $priorName )
-              . "\n$links
"; + $html = '' . Ts( 'No diff available--this is the first %s revision.', $priorName ) . "\n$links
"; } else { $html = '' @@ -1770,7 +1705,7 @@ sub GetDiff { print STDERR "
diff=$diff_out\n"; &ReleaseDiffLock() if ($lock); $diff_out =~ s/\\ No newline.*\n//g; # Get rid of common complaint. - # No need to unlink temp files--next diff will just overwrite. + # No need to unlink temp files--next diff will just overwrite. return $diff_out; } @@ -1808,8 +1743,7 @@ sub ColorDiff { $diff =~ s/$FS(\d+)$FS/$SaveUrl{$1}/ge; # Restore saved text $diff =~ s/$FS(\d+)$FS/$SaveUrl{$1}/ge; # Restore nested saved text $diff =~ s/\r?\n/
/g; - return "
Track
(del)
Song Title
(jump)
Play
Time
$pos$item$Time
$pos$item$Time
$pos$item$Time
$pos\ # $item$Time
$pos \ + $Mp3List = $Mp3List . "
$pos \ $item $Time
$icon$href$playlist
$href$playlist
Station
Station
URL
Bandwidth
Style
$icon$station$href$url
"; - $html .= - "Get internet radio station list
$icon$href$artist ($n)
$href$artist ($n)
$icon$href$artist - $album ($n)
$href$artist - $album ($n)
$icon$href$year ($n)
$href$year ($n)
$icon$href$genre ($n)
$href$genre ($n)
Play All
Title
Artist
Album
Year
Genre
Title
Artist
Album
Year
Genre
[add]"; - $html .= - " $title
[add]"; + $html .= " $title
$artist
$href$title
$href$title
\n" . $diff - . "
\n"; + return "
\n" . $diff . "
\n"; } # ==== Database (Page, Section, Text, Kept, User) functions ==== @@ -1833,15 +1767,15 @@ sub OpenNewSection { $Section{'tscreate'} = $Now; # Set once at creation $Section{'ts'} = $Now; # Updated every edit $Section{'ip'} = $ENV{REMOTE_ADDR}; - $Section{'host'} = ''; # Updated only for real edits (can be slow) - $Section{'id'} = $UserID; + $Section{'host'} = ''; # Updated only for real edits (can be slow) + $Section{'id'} = $UserID; $Section{'username'} = &GetParam( "username", "" ); - $Section{'data'} = $data; - $Page{$name} = join( $FS2, %Section ); # Replace with save? + $Section{'data'} = $data; + $Page{$name} = join( $FS2, %Section ); # Replace with save? } sub OpenNewText { - my ($name) = @_; # Name of text (usually "default") + my ($name) = @_; # Name of text (usually "default") %Text = (); # Later consider translation of new-page message? (per-user difference?) @@ -1852,8 +1786,8 @@ sub OpenNewText { $Text{'text'} = T('Describe the new page here.') . "\n"; } $Text{'text'} .= "\n" if ( substr( $Text{'text'}, -1, 1 ) ne "\n" ); - $Text{'minor'} = 0; # Default as major edit - $Text{'newauthor'} = 1; # Default as new author + $Text{'minor'} = 0; # Default as major edit + $Text{'newauthor'} = 1; # Default as new author $Text{'summary'} = ''; &OpenNewSection( "text_$name", join( $FS3, %Text ) ); } @@ -1971,8 +1905,7 @@ sub UpdatePageVersion { } sub KeepFileName { - return $KeepDir . "/" . &GetPageDirectory($OpenPageName) - . "/$OpenPageName.kp"; + return $KeepDir . "/" . &GetPageDirectory($OpenPageName) . "/$OpenPageName.kp"; } sub SaveKeepSection { @@ -2172,7 +2105,7 @@ sub UserCanEdit { # Optimized for the "everyone can edit" case (don't check passwords) if ( ( $id ne "" ) && ( -f &GetLockedPageFile($id) ) ) { return 1 if ( &UserIsAdmin() ); # Requires more privledges - # Later option for editor-level to edit these pages? + # Later option for editor-level to edit these pages? return 0; } if ( !$EditAllowed ) { @@ -2183,7 +2116,7 @@ sub UserCanEdit { return 1 if ( &UserIsEditor() ); return 0; } - if ($deepCheck) { # Deeper but slower checks (not every page) + if ($deepCheck) { # Deeper but slower checks (not every page) return 1 if ( &UserIsEditor() ); return 0 if ( &UserIsBanned() ); } @@ -2194,7 +2127,7 @@ sub UserIsBanned { my ( $host, $ip, $data, $status ); ( $status, $data ) = &ReadFile("$DataDir/banlist"); - return 0 if ( !$status ); # No file exists, so no ban + return 0 if ( !$status ); # No file exists, so no ban $ip = $ENV{'REMOTE_ADDR'}; $host = &GetRemoteHost(0); foreach ( split( /\n/, $data ) ) { @@ -2480,11 +2413,8 @@ sub CalcDay { $ts += $TimeZoneOffset; my ( $sec, $min, $hour, $mday, $mon, $year ) = localtime($ts); - return ( - "January", "February", "March", "April", - "May", "June", "July", "August", - "September", "October", "November", "December" - )[$mon] + return ( "January", "February", "March", "April", "May", "June", "July", "August", + "September", "October", "November", "December" )[$mon] . " " . $mday . ", " . ( $year + 1900 ); @@ -2555,8 +2485,7 @@ sub GetRemoteHost { if ( $UseLookup && ( $rhost eq "" ) ) { # Catch errors (including bad input) without aborting the script - eval 'use Socket; $iaddr = inet_aton($ENV{REMOTE_ADDR});' - . '$rhost = gethostbyaddr($iaddr, AF_INET)'; + eval 'use Socket; $iaddr = inet_aton($ENV{REMOTE_ADDR});' . '$rhost = gethostbyaddr($iaddr, AF_INET)'; } if ( $rhost eq "" ) { $rhost = $ENV{REMOTE_ADDR}; @@ -2570,7 +2499,7 @@ sub FreeToNormal { $id =~ s/ /_/g; $id = ucfirst($id); - if ( index( $id, '_' ) > -1 ) { # Quick check for any space/underscores + if ( index( $id, '_' ) > -1 ) { # Quick check for any space/underscores $id =~ s/__+/_/g; $id =~ s/^_//; $id =~ s/_$//; @@ -2582,7 +2511,7 @@ sub FreeToNormal { if ($FreeUpper) { # Note that letters after ' are *not* capitalized - if ( $id =~ m|[-_.,\(\)/][a-z]| ) { # Quick check for non-canonical case + if ( $id =~ m|[-_.,\(\)/][a-z]| ) { # Quick check for non-canonical case $id =~ s|([-_.,\(\)/])([a-z])|$1 . uc($2)|ge; } } @@ -2735,8 +2664,7 @@ sub DoEdit { if ( $revision ne '' ) { print "\n" . Ts( 'Editing old revision %s.', $revision ) . " " - . T( - 'Saving this page will replace the latest revision with this text.') + . T('Saving this page will replace the latest revision with this text.') . '
'; } if ($isConflict) { @@ -2750,12 +2678,10 @@ sub DoEdit { } print "

", T('Someone saved this page after you started editing.'), " ", - T('The top textbox contains the saved text.'), " ", - T('Only the text in the top textbox will be saved.'), + T('The top textbox contains the saved text.'), " ", T('Only the text in the top textbox will be saved.'), "
\n", T('Scroll down to see your edited text.'), "
\n"; - print T('Last save time:'), ' ', &TimeToText($oldTime), - " (", T('Current time is:'), ' ', &TimeToText($Now), ")
\n"; + print T('Last save time:'), ' ', &TimeToText($oldTime), " (", T('Current time is:'), ' ', &TimeToText($Now), ")
\n"; } print &GetFormStart(); print &GetHiddenValue( "title", $id ), "\n", @@ -2792,9 +2718,8 @@ sub DoEdit { if ($EmailNotify) { print "   " . $q->checkbox( - -name => 'do_email_notify', - -label => - Ts( 'Send email notification that %s has been changed.', $id ) + -name => 'do_email_notify', + -label => Ts( 'Send email notification that %s has been changed.', $id ) ); } print "
"; @@ -2807,8 +2732,7 @@ sub DoEdit { print ' (', T('Your user name is'), ' ', &GetPageLink($userName) . ') '; } else { - print ' (', Ts( 'Visit %s to set your user name.', &GetPrefsLink() ), - ') '; + print ' (', Ts( 'Visit %s to set your user name.', &GetPrefsLink() ), ') '; } print $q->submit( -name => 'Preview', -value => T('Preview') ), "\n"; @@ -2822,9 +2746,7 @@ sub DoEdit { if ($preview) { print "

", T('Preview:'), "

\n"; if ($isConflict) { - print "", - T('NOTE: This preview shows the revision of the other author.'), - "
\n"; + print "", T('NOTE: This preview shows the revision of the other author.'), "
\n"; } $MainPage = $id; $MainPage =~ s|/.*||; # Only the main page name (remove subpage) @@ -2881,8 +2803,7 @@ sub DoEditPrefs { -size => 15, -maxlength => 50 ), - ' ', T('(blank to remove password)'), '
(', - T('Passwords allow sharing preferences between multiple systems.'), + ' ', T('(blank to remove password)'), '
(', T('Passwords allow sharing preferences between multiple systems.'), ' ', T('Passwords are completely optional.'), ')'; if ( $AdminPass ne '' ) { @@ -2898,20 +2819,15 @@ sub DoEditPrefs { } if ($EmailNotify) { print "
"; - print &GetFormCheck( 'notify', 1, - T('Include this address in the site email list.') ), + print &GetFormCheck( 'notify', 1, T('Include this address in the site email list.') ), ' ', T('(Uncheck the box to remove the address.)'); - print '
', T('Email Address:'), ' ', - &GetFormText( 'email', "", 30, 60 ); + print '
', T('Email Address:'), ' ', &GetFormText( 'email', "", 30, 60 ); } print "
$recentName:\n"; - print '
', T('Default days to display:'), ' ', - &GetFormText( 'rcdays', $RcDefault, 4, 9 ); - print "
", - &GetFormCheck( 'rcnewtop', $RecentTop, T('Most recent changes on top') ); - print "
", - &GetFormCheck( 'rcall', 0, T('Show all changes (not just most recent)') ); + print '
', T('Default days to display:'), ' ', &GetFormText( 'rcdays', $RcDefault, 4, 9 ); + print "
", &GetFormCheck( 'rcnewtop', $RecentTop, T('Most recent changes on top') ); + print "
", &GetFormCheck( 'rcall', 0, T('Show all changes (not just most recent)') ); %labels = ( 0 => T('Hide minor edits'), 1 => T('Show minor edits'), @@ -2924,20 +2840,13 @@ sub DoEditPrefs { -labels => \%labels, -default => &GetParam( "rcshowedit", $ShowEdits ) ); - print "
", - &GetFormCheck( 'rcchangehist', 1, T('Use "changes" as link to history') ); + print "
", &GetFormCheck( 'rcchangehist', 1, T('Use "changes" as link to history') ); if ($UseDiff) { print '
', T('Differences:'), "\n"; - print "
", - &GetFormCheck( 'diffrclink', 1, - Ts( 'Show (diff) links on %s', $recentName ) ); - print "
", - &GetFormCheck( 'alldiff', 0, T('Show differences on all pages') ); - print " (", - &GetFormCheck( 'norcdiff', 1, - Ts( 'No differences on %s', $recentName ) ), - ")"; + print "
", &GetFormCheck( 'diffrclink', 1, Ts( 'Show (diff) links on %s', $recentName ) ); + print "
", &GetFormCheck( 'alldiff', 0, T('Show differences on all pages') ); + print " (", &GetFormCheck( 'norcdiff', 1, Ts( 'No differences on %s', $recentName ) ), ")"; %labels = ( 1 => T('Major'), 2 => T('Minor'), 3 => T('Author') ); print '
', T('Default difference type:'), ' '; print $q->popup_menu( @@ -2951,18 +2860,13 @@ sub DoEditPrefs { # Note: TZ offset is added by TimeToText, so pre-subtract to cancel. print '
', T('Server time:'), ' ', &TimeToText( $Now - $TimeZoneOffset ); - print '
', T('Time Zone offset (hours):'), ' ', - &GetFormText( 'tzoffset', 0, 4, 9 ); - print '
', - &GetFormCheck( 'editwide', 1, - T('Use 100% wide edit area (if supported)') ); - print '
', - T('Edit area rows:'), ' ', &GetFormText( 'editrows', 20, 4, 4 ), + print '
', T('Time Zone offset (hours):'), ' ', &GetFormText( 'tzoffset', 0, 4, 9 ); + print '
', &GetFormCheck( 'editwide', 1, T('Use 100% wide edit area (if supported)') ); + print '
', T('Edit area rows:'), ' ', &GetFormText( 'editrows', 20, 4, 4 ), ' ', T('columns:'), ' ', &GetFormText( 'editcols', 65, 4, 4 ); print '
', &GetFormCheck( 'toplinkbar', 1, T('Show link bar on top') ); - print '
', - &GetFormCheck( 'linkrandom', 0, T('Add "Random Page" link to link bar') ); + print '
', &GetFormCheck( 'linkrandom', 0, T('Add "Random Page" link to link bar') ); print '
', $q->submit( -name => 'Save', -value => T('Save') ), "\n"; print "
\n"; print &GetGotoBar(''); @@ -3004,11 +2908,9 @@ sub DoUpdatePrefs { print &GetHeader( '', T('Saving Preferences'), '' ); print '
'; if ( $UserID < 1001 ) { - print '', - Ts( 'Invalid UserID %s, preferences not saved.', $UserID ), ''; + print '', Ts( 'Invalid UserID %s, preferences not saved.', $UserID ), ''; if ( $UserID == 111 ) { - print '
', - T('(Preferences require cookies, but no cookie was sent.)'); + print '
', T('(Preferences require cookies, but no cookie was sent.)'); } print &GetCommonFooter(); return; @@ -3030,8 +2932,7 @@ sub DoUpdatePrefs { print Ts( 'Invalid UserName %s: not saved.', $username ), "
\n"; } elsif ( length($username) > 50 ) { # Too long - print T('UserName must be 50 characters or less. (not saved)'), - "
\n"; + print T('UserName must be 50 characters or less. (not saved)'), "
\n"; } else { print Ts( 'UserName %s saved.', $username ), '
'; @@ -3105,8 +3006,7 @@ sub UpdateEmailList { my $notify = $UserData{'notify'}; if ( -f "$DataDir/emails" ) { open( NOTIFY, "$DataDir/emails" ) - or die( - Ts( 'Could not read from %s:', "$DataDir/emails" ) . " $!\n" ); + or die( Ts( 'Could not read from %s:', "$DataDir/emails" ) . " $!\n" ); @old_emails = ; close(NOTIFY); } @@ -3117,8 +3017,7 @@ sub UpdateEmailList { if ( $notify and ( not $already_in_list ) ) { &RequestLock() or die( T('Could not get mail lock') ); open( NOTIFY, ">>$DataDir/emails" ) - or die( - Ts( 'Could not append to %s:', "$DataDir/emails" ) . " $!\n" ); + or die( Ts( 'Could not append to %s:', "$DataDir/emails" ) . " $!\n" ); print NOTIFY $new_email, "\n"; close(NOTIFY); &ReleaseLock(); @@ -3126,8 +3025,7 @@ sub UpdateEmailList { elsif ( ( not $notify ) and $already_in_list ) { &RequestLock() or die( T('Could not get mail lock') ); open( NOTIFY, ">$DataDir/emails" ) - or die( - Ts( 'Could not overwrite %s:', "$DataDir/emails" ) . " $!\n" ); + or die( Ts( 'Could not overwrite %s:', "$DataDir/emails" ) . " $!\n" ); foreach (@old_emails) { print NOTIFY "$_" unless /$new_email/; } @@ -3452,8 +3350,7 @@ sub GetPageLinks { if ($pagelink) { if ($FreeLinks) { my $fl = $FreeLinkPattern; - $text =~ - s/\[\[$fl\|[^\]]+\]\]/push(@links, &FreeToNormal($1)), ' '/ge; + $text =~ s/\[\[$fl\|[^\]]+\]\]/push(@links, &FreeToNormal($1)), ' '/ge; $text =~ s/\[\[$fl\]\]/push(@links, &FreeToNormal($1)), ' '/ge; } if ($WikiLinks) { @@ -3526,12 +3423,12 @@ sub DoPost { else { $newAuthor = ( $Section{'ip'} ne $authorAddr ); # hostname fallback } - $newAuthor = 1 if ( $oldrev == 0 ); # New page - $newAuthor = 0 if ( !$newAuthor ); # Standard flag form, not empty - # Detect editing conflicts and resubmit edit + $newAuthor = 1 if ( $oldrev == 0 ); # New page + $newAuthor = 0 if ( !$newAuthor ); # Standard flag form, not empty + # Detect editing conflicts and resubmit edit if ( ( $oldrev > 0 ) && ( $newAuthor && ( $oldtime != $pgtime ) ) ) { &ReleaseLock(); - if ( $oldconflict > 0 ) { # Conflict again... + if ( $oldconflict > 0 ) { # Conflict again... print STDERR "db1b\n"; &DoEdit( $id, 2, $pgtime, $string, $preview ); @@ -3609,8 +3506,7 @@ sub UpdateDiffs { &SetPageCache( 'diff_default_major', "1" ); } else { - &SetPageCache( 'diff_default_major', - &GetKeptDiff( $new, $oldMajor, 0 ) ); + &SetPageCache( 'diff_default_major', &GetKeptDiff( $new, $oldMajor, 0 ) ); } if ($newAuthor) { &SetPageCache( 'diff_default_author', "1" ); @@ -3619,8 +3515,7 @@ sub UpdateDiffs { &SetPageCache( 'diff_default_author', "2" ); } else { - &SetPageCache( 'diff_default_author', - &GetKeptDiff( $new, $oldAuthor, 0 ) ); + &SetPageCache( 'diff_default_author', &GetKeptDiff( $new, $oldAuthor, 0 ) ); } } @@ -3779,8 +3674,7 @@ sub WriteRcLog { $extraTemp = join( $FS2, %extra ); # The two fields at the end of a line are kind and extension-hash - my $rc_line = - join( $FS3, $editTime, $id, $summary, $isEdit, $rhost, "0", $extraTemp ); + my $rc_line = join( $FS3, $editTime, $id, $summary, $isEdit, $rhost, "0", $extraTemp ); if ( !open( OUT, ">>$RcFile" ) ) { die( Ts( '%s log error:', $RCName ) . " $!" ); } @@ -3846,8 +3740,7 @@ sub UserIsEditorOrError { sub UserIsAdminOrError { if ( !&UserIsAdmin() ) { - print '

', - T('This operation is restricted to administrators only...'); + print '

', T('This operation is restricted to administrators only...'); print &GetCommonFooter(); return 0; } @@ -4089,8 +3982,7 @@ sub EditRecentChangesFile { if ( !$status ) { # Save error text if needed. - $errorText = "

Could not open $RCName log file:" - . " $fname

Error was:\n

$!
\n"; + $errorText = "

Could not open $RCName log file:" . " $fname

Error was:\n

$!
\n"; print $errorText; # Maybe handle differently later? return; } @@ -4136,7 +4028,7 @@ sub DeletePage { unlink($fname) if ( -f $fname ); unlink($IndexFile) if ($UseIndex); &EditRecentChanges( 1, $page, "" ) if ($doRC); # Delete page - # Currently don't do anything with page text + # Currently don't do anything with page text } # Given text, returns substituted text @@ -4146,7 +4038,7 @@ sub SubstituteTextLinks { # Much of this is taken from the common markup %SaveUrl = (); $SaveUrlIndex = 0; - $text =~ s/$FS//g; # Remove separators (paranoia) + $text =~ s/$FS//g; # Remove separators (paranoia) if ($RawHtml) { $text =~ s/(((.|\n)*?)<\/html>)/&StoreRaw($1)/ige; } @@ -4155,11 +4047,10 @@ sub SubstituteTextLinks { $text =~ s/(((.|\n)*?)<\/nowiki>)/&StoreRaw($1)/ige; if ($FreeLinks) { - $text =~ - s/\[\[$FreeLinkPattern\|([^\]]+)\]\]/&SubFreeLink($1,$2,$old,$new)/geo; + $text =~ s/\[\[$FreeLinkPattern\|([^\]]+)\]\]/&SubFreeLink($1,$2,$old,$new)/geo; $text =~ s/\[\[$FreeLinkPattern\]\]/&SubFreeLink($1,"",$old,$new)/geo; } - if ($BracketText) { # Links like [URL text of link] + if ($BracketText) { # Links like [URL text of link] $text =~ s/(\[$UrlPattern\s+([^\]]+?)\])/&StoreRaw($1)/geo; $text =~ s/(\[$InterLinkPattern\s+([^\]]+?)\])/&StoreRaw($1)/geo; } @@ -4169,7 +4060,7 @@ sub SubstituteTextLinks { $text =~ s/$LinkPattern/&SubWikiLink($1, $old, $new)/geo; } - $text =~ s/$FS(\d+)$FS/$SaveUrl{$1}/ge; # Restore saved text + $text =~ s/$FS(\d+)$FS/$SaveUrl{$1}/ge; # Restore saved text return $text; } @@ -4180,8 +4071,7 @@ sub SubFreeLink { $oldlink = $link; $link =~ s/^\s+//; $link =~ s/\s+$//; - if ( ( $link eq $old ) || ( &FreeToNormal($old) eq &FreeToNormal($link) ) ) - { + if ( ( $link eq $old ) || ( &FreeToNormal($old) eq &FreeToNormal($link) ) ) { $link = $new; } else { @@ -4374,6 +4264,6 @@ sub DoShowVersion { #END_OF_OTHER_CODE &DoWikiRequest() if ( $RunCGI && ( $_ ne 'nocgi' ) ); # Do everything. -1; # In case we are loaded from elsewhere +1; # In case we are loaded from elsewhere # == End of UseModWiki script. =========================================== diff --git a/web/bin/phone_in.pl b/web/bin/phone_in.pl index 45626f4e9..47251fd93 100644 --- a/web/bin/phone_in.pl +++ b/web/bin/phone_in.pl @@ -5,8 +5,7 @@ my @logs = &read_phone_logs1('callerid'); my @calls = &read_phone_logs2( 100, @logs ); for my $r (@calls) { - my ( $time, $num, $name, $line, $type ) = - $r =~ /date=(.+) number=(.+) name=(.+) line=(.*) type=(.*)/; + my ( $time, $num, $name, $line, $type ) = $r =~ /date=(.+) number=(.+) name=(.+) line=(.*) type=(.*)/; ( $time, $num, $name ) = $r =~ /(.+\d+:\d+:\d+) (\S+) (.+)/ unless $name; $display_name = $name; $display_name =~ s/_/ /g; # remove underscores to make it print pretty @@ -14,8 +13,7 @@ # next unless $line; - $html_calls .= - "
Show last call from $num Show last call from $num
$time$num$name
$time$num$name
Delete $number$name$sound$type
"; print "dbx2\n"; - my $form_type = - &html_form_select( 'type', 0, 'Friend', 'Friend', 'Business', 'reject', - 'Family' ); + my $form_type = &html_form_select( 'type', 0, 'Friend', 'Friend', 'Business', 'reject', 'Family' ); #form action='/bin/items.pl?add' method=post> @@ -116,8 +113,7 @@ sub rej_call_item_delete { my @ReadRejFile = &read_reject_call_list(); unlink $phone_dir; for $line (@ReadRejFile) { - ( $number, $name, $sound, $type ) = - $line =~ /number=(.+) name=(.+) sound=(.*) type=(.*)/; + ( $number, $name, $sound, $type ) = $line =~ /number=(.+) name=(.+) sound=(.*) type=(.*)/; $number =~ s/\s*$//; #trim the fat off the end $name =~ s/\s*$//; #trim the fat off the end @@ -179,9 +175,7 @@ sub read_reject_call_list { $type = 'general' unless $type; # print_log "Number;$number, Name;$name, Sound;$sound, Type;$type\n"; - push @calls, - sprintf( "number=%-12s name=%s sound=%s type=%s", - $number, $name, $sound, $type ); + push @calls, sprintf( "number=%-12s name=%s sound=%s type=%s", $number, $name, $sound, $type ); } close MYFILE; diff --git a/web/bin/phone_out.pl b/web/bin/phone_out.pl index ef1b1d882..a5b9e2922 100644 --- a/web/bin/phone_out.pl +++ b/web/bin/phone_out.pl @@ -11,8 +11,7 @@ my ( $time, $num, $name, $line, $type, $dur, $ext, $color, $coloroff ); $coloroff = ""; - ( $time, $num, $name, $line, $type ) = $r =~ - /date=(.+\d+:\d+:\d+) number=(\S+) +name=(.*?) line=(\S*) type=(\S*)/; + ( $time, $num, $name, $line, $type ) = $r =~ /date=(.+\d+:\d+:\d+) number=(\S+) +name=(.*?) line=(\S*) type=(\S*)/; ( $dur, $ext ) = $r =~ / dur=(\S*) ext=(\S*)/; $name = '' unless $name; @@ -35,8 +34,7 @@ # $color = "" if ( $name ne 'NA' ) ; - $html_calls .= - " + $html_calls .= " $color$time$coloroff $color$num$coloroff $color$name$coloroff diff --git a/web/bin/phone_out2.pl b/web/bin/phone_out2.pl index dec378154..6d0c3e813 100644 --- a/web/bin/phone_out2.pl +++ b/web/bin/phone_out2.pl @@ -10,8 +10,7 @@ for my $r (@calls) { my ( $time, $num, $name, $line, $type, $dur, $ext, $color, $coloroff ); $coloroff = ""; - ( $time, $num, $name, $line, $type ) = $r =~ - /date=(.+\d+:\d+:\d+) number=(\S+) +name=(.*?) line=(\S*) type=(\S*)/; + ( $time, $num, $name, $line, $type ) = $r =~ /date=(.+\d+:\d+:\d+) number=(\S+) +name=(.*?) line=(\S*) type=(\S*)/; ( $dur, $ext ) = $r =~ / dur=(\S*) ext=(\S*)/; $name = '' unless $name; next unless $num; @@ -33,8 +32,7 @@ # $color = "" if ( $name ne 'NA' ) ; - $html_calls .= - " + $html_calls .= " $color$time$coloroff $color$num$coloroff $color$name$coloroff diff --git a/web/bin/photo_search.pl b/web/bin/photo_search.pl index cee28fc22..79a98389c 100644 --- a/web/bin/photo_search.pl +++ b/web/bin/photo_search.pl @@ -21,7 +21,7 @@ $string =~ s/search=//; # Allow for ?string or ?search=string -use vars '@photos'; # This will be persistent across passes and code reloads +use vars '@photos'; # This will be persistent across passes and code reloads @photos = file_read $config_parms{photo_index} unless @photos; my @match = sort grep /$string/i, @photos; @@ -33,8 +33,7 @@ print_log $results; my $html .= "$results"; $html .= " (only first $limit are shown)" if $count1 > $limit; -$html .= - ". Search Again. Back to photo slideshow\n
\n"; +$html .= ". Search Again. Back to photo slideshow\n
\n"; my $i; my ( $index, $photos ); @@ -49,8 +48,7 @@ if ( $i < $limit ) { $index .= "
$name\n"; $href++; - $photos .= - "

Back to top. $name
\n"; + $photos .= "

Back to top. $name
\n"; } else { $index .= "
$name\n"; diff --git a/web/bin/photos.pl b/web/bin/photos.pl index 8fa326597..9492be789 100644 --- a/web/bin/photos.pl +++ b/web/bin/photos.pl @@ -29,8 +29,7 @@ my $time = $config_parms{photo_time}; $time = 60 unless defined $time; $config_parms{photo_url} = '/ia5' unless $config_parms{photo_url}; -my $background = - ( $config_parms{photo_background} =~ /$Http{'User-Agent'}/ ) ? 1 : 0; +my $background = ( $config_parms{photo_background} =~ /$Http{'User-Agent'}/ ) ? 1 : 0; #$background = 1; my $browser_size = &http_agent_size; @@ -44,13 +43,8 @@ # If sync, and requested photo does not match up with the last # photo served, then change the refresh time to sync up the 2 browsers -elsif ( - $parm eq 'sync' - and !( - $i == $Save{photo_index} + 1 - or ( $i == 0 and $Save{photo_index} == $#photos ) - ) - ) +elsif ( $parm eq 'sync' + and !( $i == $Save{photo_index} + 1 or ( $i == 0 and $Save{photo_index} == $#photos ) ) ) { $i = $Save{photo_index}; my $time_diff = $Time - $Save{photo_index_time}; @@ -131,8 +125,7 @@ my $time2 = $time * 1000; # This is simplier. -my $refresh = - ""; +my $refresh = ""; # This can cause problems. When the java timer expires # to triggers a refresh on the Audrey, it will interrupt any other voyager browser activity @@ -150,8 +143,7 @@ # Create header html with optional search my $header = ''; -$header = - "$i : +$header = "$i : $photo_name" unless $config_parms{photo_no_title}; $header = "
diff --git a/web/bin/photos_slideshow.pl b/web/bin/photos_slideshow.pl index 44d04e4ee..4e691d9ac 100644 --- a/web/bin/photos_slideshow.pl +++ b/web/bin/photos_slideshow.pl @@ -76,8 +76,7 @@ if ( $captions ne '0' ) { $sseffect .= "captions: true, "; } -$sseffect .= - "controller: true, delay: ${time}000, duration: 1000, height: $height, hu: '$config_parms{photo_dirs}', "; +$sseffect .= "controller: true, delay: ${time}000, duration: 1000, height: $height, hu: '$config_parms{photo_dirs}', "; if ( $thumbs ne '0' ) { $sseffect .= "thumbnails: true, "; } diff --git a/web/bin/rejectcall.pl b/web/bin/rejectcall.pl index 00530414a..92b3b2698 100644 --- a/web/bin/rejectcall.pl +++ b/web/bin/rejectcall.pl @@ -20,8 +20,7 @@ sub rejected_call_list { my $html_calls; my @calls = read_reject_call_list; for my $r (@calls) { - my ( $number, $name, $sound, $type ) = - $r =~ /number=(.+) name=(.+) sound=(.*) type=(.*)/; + my ( $number, $name, $sound, $type ) = $r =~ /number=(.+) name=(.+) sound=(.*) type=(.*)/; $html_calls .= "Delete $number$name$sound$type"; $pos = $pos + 1; @@ -45,9 +44,7 @@ sub rejected_call_list { "; - my $form_type = - &html_form_select( 'type', 0, 'Friend', 'Friend', 'Business', 'reject', - 'Family' ); + my $form_type = &html_form_select( 'type', 0, 'Friend', 'Friend', 'Business', 'reject', 'Family' ); #form action='/bin/items.pl?add' method=post> @@ -106,8 +103,7 @@ sub rej_call_item_delete { my @ReadRejFile = read_reject_call_list; unlink "$phone_dir/phone.caller_id.list"; for $line (@ReadRejFile) { - ( $number, $name, $sound, $type ) = - $line =~ /number=(.+) name=(.+) sound=(.*) type=(.*)/; + ( $number, $name, $sound, $type ) = $line =~ /number=(.+) name=(.+) sound=(.*) type=(.*)/; $number =~ s/\s*$//; #trim the fat off the end $name =~ s/\s*$//; #trim the fat off the end @@ -115,8 +111,7 @@ sub rej_call_item_delete { $type =~ s/\s*$//; #trim the fat off the end $writeparms = "$number\t\t$name\t\t$sound\t\t$type"; if ( $filePos ne $deletepos ) { - &rej_call_file_write( "$phone_dir/phone.caller_id.list", - $writeparms ); + &rej_call_file_write( "$phone_dir/phone.caller_id.list", $writeparms ); } diff --git a/web/bin/rss_logs.pl b/web/bin/rss_logs.pl index c28ff87f9..76a0a5f8e 100644 --- a/web/bin/rss_logs.pl +++ b/web/bin/rss_logs.pl @@ -53,8 +53,7 @@ use vars '%rss_logs_data'; if ($article) { - return &html_page( "RSS $log article $article", - "Log: $log
Article: $article
$rss_logs_data{$log}{$article}" ); + return &html_page( "RSS $log article $article", "Log: $log
Article: $article
$rss_logs_data{$log}{$article}" ); } else { return &rss_log($log); @@ -70,9 +69,7 @@ sub rss_log { $config_parms{rss_maxitems} = 100 unless $config_parms{rss_maxitems}; $config_parms{rss_image} = "http://misterhouse.sourceforge.net/mh_logo.gif" unless $config_parms{rss_image}; - $config_parms{rss_image} = - "http://$config_parms{http_server}" - . ":$config_parms{http_port}/ia5/images/mhlogo.gif" + $config_parms{rss_image} = "http://$config_parms{http_server}" . ":$config_parms{http_port}/ia5/images/mhlogo.gif" if $config_parms{http_server} and $config_parms{http_port} and not $config_parms{rss_image}; @@ -100,8 +97,7 @@ sub rss_log { # still working on the link for each item. can we follow this particular item for more detail? # maybe hook up phone number entry -> address book lookup, etc. obviously TODO - my $rss_link = - "http://$config_parms{http_server}:$config_parms{http_port}/bin/rss_logs.pl?$log&"; + my $rss_link = "http://$config_parms{http_server}:$config_parms{http_port}/bin/rss_logs.pl?$log&"; print "\tparsing $log log\n" if $Debug{rss}; my $article = 0; @@ -114,8 +110,7 @@ sub rss_log { # Create rss item from each line in log for my $r (@calls) { $article++; - my ( $time_date, $num, $name, $line, $type ) = - $r =~ /date=(.+) number=(.+) name=(.+) line=(.*) type=(.*)/; + my ( $time_date, $num, $name, $line, $type ) = $r =~ /date=(.+) number=(.+) name=(.+) line=(.*) type=(.*)/; ( $time_date, $num, $name ) = $r =~ /(.+\d+:\d+:\d+) (\S+) (.+)/ unless $name; next unless $num; @@ -124,11 +119,10 @@ sub rss_log { # print "db t=$time_date t2=$time_date2 t3=$time_date3\n"; $rss->add_item( - title => $time_date, - link => $rss_link . $article, - pubDate => $time_date3, - description => - "Incoming call from $num ($name). line=$line type=$type." + title => $time_date, + link => $rss_link . $article, + pubDate => $time_date3, + description => "Incoming call from $num ($name). line=$line type=$type." ); $rss_logs_data{$log}{$article} = $r; last if $article >= $config_parms{rss_maxitems}; @@ -136,9 +130,7 @@ sub rss_log { } else { # Reverse logdata to show newest items first - for - my $line ( reverse file_read "$config_parms{data_dir}/logs/$log.log" ) - { + for my $line ( reverse file_read "$config_parms{data_dir}/logs/$log.log" ) { next unless $line; $article++; my ( $time_date, $data ) = $line =~ /(.+ [AP]M) (.+)$/; diff --git a/web/bin/set_cookie.pl b/web/bin/set_cookie.pl index 9df2b5639..1257ebe6e 100644 --- a/web/bin/set_cookie.pl +++ b/web/bin/set_cookie.pl @@ -60,10 +60,8 @@ my $html = "Off\n"; - $html .= - " On\n"; + $html .= " Off\n"; + $html .= " On\n"; $html .= "
\n"; # Checkboxes do not return values when not checked :( diff --git a/web/bin/set_cookie2.pl b/web/bin/set_cookie2.pl index e26611dfa..c2f0add8a 100644 --- a/web/bin/set_cookie2.pl +++ b/web/bin/set_cookie2.pl @@ -60,7 +60,6 @@ $state2 = '' if defined $Cookies{$string} and $Cookies{$string} eq '0'; my $image = "/graphics/${string}_${state1}.gif"; - return - "$string $state1\n"; + return "$string $state1\n"; } diff --git a/web/bin/set_parm_tv_provider.pl b/web/bin/set_parm_tv_provider.pl index b165f68ab..fd187c074 100644 --- a/web/bin/set_parm_tv_provider.pl +++ b/web/bin/set_parm_tv_provider.pl @@ -66,13 +66,9 @@ sub edit { # Update tv_provider_name if changed if ( $args{provider} and $providers{ $args{provider} } - and $providers{ $args{provider} } ne - $config_parms{tv_provider_name} ) + and $providers{ $args{provider} } ne $config_parms{tv_provider_name} ) { - my %parms = ( - 'tv_provider', '', 'tv_provider_name', - $providers{ $args{provider} } - ); + my %parms = ( 'tv_provider', '', 'tv_provider_name', $providers{ $args{provider} } ); print "db writing out new parm: $config_parms{tv_provider_name}\n"; &write_mh_opts( \%parms ); &read_parms; # Re-read parms @@ -91,9 +87,7 @@ sub edit { $html .= ' selected' if $id eq $config_parms{tv_provider} or $name eq $config_parms{tv_provider_name}; - $html .= '>' - . $name - . '          ' . "\n"; + $html .= '>' . $name . '          ' . "\n"; } $html .= ''; diff --git a/web/bin/set_parm_weather_local.pl b/web/bin/set_parm_weather_local.pl index 8d67f9c89..87d92be3c 100644 --- a/web/bin/set_parm_weather_local.pl +++ b/web/bin/set_parm_weather_local.pl @@ -14,8 +14,7 @@ if ( &get_parm_file( \%config_parms, 'web_href_weather_local_image' ) ) { $html = '
Our local weather.'; } - $html .= - '
Reset the mh.ini parm for this page according to your zip code'; + $html .= '
Reset the mh.ini parm for this page according to your zip code'; return html_page '', $html; } else { @@ -27,24 +26,18 @@ return &html_page( '', "Connect to the internet and try again" ) unless net_ping 'www.google.com'; - $html = get - "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=$config_parms{zip_code}"; - my ($id) = - $html =~ m|Local Radar|i; + $html = get "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=$config_parms{zip_code}"; + my ($id) = $html =~ m|Local Radar|i; speak "Weather i d is $id"; # Update the mh.ini parm if changed - my $parm1 = - "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=$config_parms{zip_code}"; + my $parm1 = "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=$config_parms{zip_code}"; my $parm2 = "http://radar.wunderground.com/data/nids/${id}_0.gif"; if ( $parm1 ne $config_parms{web_href_weather_local} or $parm2 ne $config_parms{web_href_weather_local_image} ) { - my %parms = ( - 'web_href_weather_local', $parm1, - 'web_href_weather_local_image', $parm2 - ); + my %parms = ( 'web_href_weather_local', $parm1, 'web_href_weather_local_image', $parm2 ); main::write_mh_opts( \%parms ); # my $parmfile = $Pgm_Path . "/mh.private.ini"; @@ -53,7 +46,7 @@ } $html = - "Weather page result:
  • Zipcode used: $config_parms{zip_code}" + "Weather page result:
    • Zipcode used: $config_parms{zip_code}" . "
    • ID: $id
    • web_href_weather_local: $parm1
    • web_href_weather_local_image: $parm2
    "; return html_page '', $html; diff --git a/web/bin/shopping_list.pl b/web/bin/shopping_list.pl index 3bb574daf..66ec12eb5 100644 --- a/web/bin/shopping_list.pl +++ b/web/bin/shopping_list.pl @@ -191,20 +191,14 @@ sub shoppingListError { $param{'action'} = 'list' unless defined( $param{'action'} ); $param{'action'} = 'list' if $param{'action'} eq 'cancel'; -my $printing = ( - ( $param{'action'} eq 'print' ) - or ( $param{'action'} eq 'print preview' ) - or ( $param{'action'} eq 'e-mail' ) -); -my $atShop = ( - ( $param{'action'} eq 'at shop' ) - or ( $param{'action'} eq 'remove items' ) -); +my $printing = + ( ( $param{'action'} eq 'print' ) or ( $param{'action'} eq 'print preview' ) or ( $param{'action'} eq 'e-mail' ) ); +my $atShop = + ( ( $param{'action'} eq 'at shop' ) or ( $param{'action'} eq 'remove items' ) ); if ( $param{'action'} eq 'add item' ) { if ( ( $param{'category'} eq 'select' ) or ( $param{'item'} eq '' ) ) { - $html .= - qq[

    Category: \n\n]; open( SHOPLIST, $file ) || return shoppingListError("$file: $!"); while () { chomp; @@ -213,24 +207,20 @@ sub shoppingListError { } close(SHOPLIST); $html .= qq[

     

    \n]; - $html .= - qq[

    Item:


    ]; - $html .= - qq[

    Add to $prettyName Now:


    ]; + $html .= qq[

    Item:


    ]; + $html .= qq[

    Add to $prettyName Now:


    ]; $html .= qq[

    \n]; $html .= qq[

    \n]; $html .= qq[\n]; $html .= ''; - $html .= &insert_keyboard( - { form => 'main', target => 'item', autocap => 'yes' } ); + $html .= &insert_keyboard( { form => 'main', target => 'item', autocap => 'yes' } ); $html .= qq[\n]; return html_page( undef, $html ); } open( OLDLIST, $file ) || return shoppingListError("$file: $!"); my $duplicate = 0; my $newvalue = $param{'onlistnow'} eq 'on' ? '1' : '0'; - $html .= - "

    Param onlistnow is $param{'onlistnow'} so newvalue is $newvalue

    \n" + $html .= "

    Param onlistnow is $param{'onlistnow'} so newvalue is $newvalue

    \n" if $shoppinglistdebug; while () { @@ -369,30 +359,19 @@ sub shoppingListError { } else { if ($atShop) { - $sectionHeader .= - qq[\n

    $1

    ]; - $sectionHeader .= - qq[

    \n]; + $sectionHeader .= qq[\n

    $1

    ]; + $sectionHeader .= qq[

    \n]; } else { - $sectionHeader .= - qq[

    \n]; - $sectionHeader .= - qq[\n]; - $sectionHeader .= - qq[\n]; - $sectionHeader .= - qq[\n]; - $sectionHeader .= - qq[\n]; - $sectionHeader .= - qq[\n]; - $sectionHeader .= - qq[\n]; - $sectionHeader .= - qq[

    \n]; - $sectionHeader .= - qq[

    $1

    \n]; + $sectionHeader .= qq[

    \n]; + $sectionHeader .= qq[\n]; + $sectionHeader .= qq[\n]; + $sectionHeader .= qq[\n]; + $sectionHeader .= qq[\n]; + $sectionHeader .= qq[\n]; + $sectionHeader .= qq[\n]; + $sectionHeader .= qq[

    \n]; + $sectionHeader .= qq[

    $1

    \n]; } } next; @@ -427,8 +406,7 @@ sub shoppingListError { $html .= qq[\n]; } else { - $html .= qq[\n]; } diff --git a/web/bin/soapcgi.pl b/web/bin/soapcgi.pl index dfd0aec41..8c24ed3c5 100644 --- a/web/bin/soapcgi.pl +++ b/web/bin/soapcgi.pl @@ -24,8 +24,7 @@ my ( $key, $header ); while ( ( $key, $header ) = each %Http ) { logit "$config_parms{data_dir}/logs/soapdebug.log", "$key $header"; - logit "$config_parms{data_dir}/logs/soapdebug.log", - "$ENV{HTTP_QUERY_STRING}"; + logit "$config_parms{data_dir}/logs/soapdebug.log", "$ENV{HTTP_QUERY_STRING}"; } } diff --git a/web/bin/status_line.pl b/web/bin/status_line.pl index 27aa9819a..8880ab180 100644 --- a/web/bin/status_line.pl +++ b/web/bin/status_line.pl @@ -71,8 +71,7 @@ $html .= qq[\n]; -$html .= - qq[
    $item'; + $html .= qq['; $html .= qq[$item
    \n]; +$html .= qq[
    \n]; $html .= qq[\n"; if ( $parms{date} ) { - $html .= - qq[\n]; + $html .= qq[\n]; } if ( $parms{clock} ) { $html .= qq[\n]; } if ( $parms{jclock1} ) { - $html .= - qq[\n]; + $html .= qq[\n]; } if ( $parms{jclock2} ) { - $html .= - qq[\n]; + $html .= qq[\n]; } $html .= qq[
    $fontstart\n]; # Do parms in specified order @@ -86,18 +85,14 @@ # Allow for sun (auto-pick), sunrise, or sunset elsif ( $parm =~ /sun/ ) { if ( $parm eq 'sun' ) { - $parm = ( - time_less_than "$Time_Sunrise + 2:00" - or time_greater_than "$Time_Sunset + 2:00" - ) ? 'sunrise' : 'sunset'; + $parm = + ( time_less_than "$Time_Sunrise + 2:00" or time_greater_than "$Time_Sunset + 2:00" ) ? 'sunrise' : 'sunset'; } if ( $parm eq 'sunrise' ) { - $html .= - qq[  Rise $Time_Sunrise\n]; + $html .= qq[  Rise $Time_Sunrise\n]; } else { - $html .= - qq[  Set $Time_Sunset\n]; + $html .= qq[  Set $Time_Sunset\n]; } } @@ -124,27 +119,23 @@ elsif ( $parm eq 'email' ) { $Save{email_flag} = '' unless $Save{email_flag}; - $html .= - qq[ $Save{email_flag}\n]; + $html .= qq[ $Save{email_flag}\n]; } elsif ( $parm eq 'weather' ) { $Weather{Summary_Short} = '' unless $Weather{Summary_Short}; - $html .= - qq[  $Weather{Summary_Short}\n]; + $html .= qq[  $Weather{Summary_Short}\n]; } elsif ( $parm eq 'weather_long' ) { $Weather{Summary} = '' unless $Weather{Summary}; - $html .= - qq[  $Weather{Summary}\n]; + $html .= qq[  $Weather{Summary}\n]; } elsif ( $parm eq 'wind' ) { my $html_wind = $Weather{Wind}; $html_wind = '' unless $html_wind; $html_wind =~ s/from the/ /; - $html .= - qq[  $html_wind\n]; + $html .= qq[  $html_wind\n]; } # Allow for user defined html (e.g. code/bruce/web_sub.pl) @@ -157,19 +148,16 @@ $html .= "$fontstart$Date_Now$fontstart$Date_Now${fontstart} $Time_Now
    ${fontstart} $Time_Now
    ${fontstart} $Time_Now
    \n]; diff --git a/web/bin/status_panel.pl b/web/bin/status_panel.pl index 3370f3836..f288e04cc 100644 --- a/web/bin/status_panel.pl +++ b/web/bin/status_panel.pl @@ -22,10 +22,8 @@ # Allow for sun (auto-pick), sunrise, or sunset elsif ( $parm =~ /sun/ ) { if ( $parm eq 'sun' ) { - $parm = ( - time_less_than "$Time_Sunrise + 2:00" - or time_greater_than "$Time_Sunset + 2:00" - ) ? 'sunrise' : 'sunset'; + $parm = + ( time_less_than "$Time_Sunrise + 2:00" or time_greater_than "$Time_Sunset + 2:00" ) ? 'sunrise' : 'sunset'; } if ( $parm eq 'sunrise' ) { $html .= qq[

    Sunrise: $Time_Sunrise

    \n]; diff --git a/web/bin/triggers.pl b/web/bin/triggers.pl index 78d022c61..9da9a6411 100644 --- a/web/bin/triggers.pl +++ b/web/bin/triggers.pl @@ -30,12 +30,10 @@ sub web_trigger_list { my $html = &html_header('Triggers Menu'); my $form_trigger = &html_form_select( 'trigger1', 0, 'time_now', '', - qw(time_now time_cron time_random new_second new_minute new_hour $New_Hour $New_Day $New_Week $New_Month $New_Year) - ); + qw(time_now time_cron time_random new_second new_minute new_hour $New_Hour $New_Day $New_Week $New_Month $New_Year) ); my $form_code = &html_form_select( 'code1', 0, 'speak', '', - qw(speak play display print_log set run run_voice_cmd net_im_send net_mail_send get) - ); + qw(speak play display print_log set run run_voice_cmd net_im_send net_mail_send get) ); $html = qq| @@ -101,17 +99,14 @@ sub web_trigger_list { ) { - my ( $trigger, $code, $type, $triggered, $trigger_error, $code_error ) - = trigger_get($name); + my ( $trigger, $code, $type, $triggered, $trigger_error, $code_error ) = trigger_get($name); if ( $type_prev ne $type ) { $html .= "\n" if $type_prev; $type_prev = $type; - $html .= - "

    $type: (back to top)\n"; + $html .= "

    $type: (back to top)\n"; $html .= qq|\n|; - $html .= - "\n"; + $html .= "\n"; } my $name2 = $name; @@ -121,25 +116,16 @@ sub web_trigger_list { $code =~ s/"/"/g; $html .= "\n"; + $html .= "Copy\n"; + $html .= " Delete\n"; + $html .= " Run\n"; - $html .= - &html_form_input_set_func( 'trigger_rename', '/bin/triggers.pl', - $name, $name ); + $html .= &html_form_input_set_func( 'trigger_rename', '/bin/triggers.pl', $name, $name ); $html .= qq|\n| if $trigger_error; - $html .= - &html_form_input_set_func( 'trigger_set_trigger', '/bin/triggers.pl', - $name, $trigger ); + $html .= &html_form_input_set_func( 'trigger_set_trigger', '/bin/triggers.pl', $name, $trigger ); $html .= "\n" if $trigger_error; $html .= qq|\n| if $code_error; - $html .= - &html_form_input_set_func( 'trigger_set_code', '/bin/triggers.pl', - $name, $code ); + $html .= &html_form_input_set_func( 'trigger_set_code', '/bin/triggers.pl', $name, $code ); $html .= "\n" if $code_error; $html .= &html_form_select_set_func( 'trigger_set_type', '/bin/triggers.pl', @@ -153,11 +139,9 @@ sub web_trigger_list { $html .= "\n\n"; - $html .= - qq|\n\n\n| + $html .= qq|\n\n\n| if $trigger_error; - $html .= - qq|\n\n\n| + $html .= qq|\n\n\n| if $code_error; } $html .= "
    NameTrigger EventAction CodeTypeLast Run
    NameTrigger EventAction CodeTypeLast Run
    "; - $html .= - "Copy\n"; - $html .= - " Delete\n"; - $html .= - " Run
    Trigger Event Error: $trigger_error
    Trigger Event Error: $trigger_error
    Action Code Error: $code_error
    Action Code Error: $code_error
    \n"; @@ -199,13 +183,10 @@ sub web_trigger_add { # Create form else { - my $html = - "Add a trigger:

    \n"; + my $html = "Add a trigger:\n"; $html .= qq|
    Name \n|; - $html .= - qq|
    Trigger\n|; - $html .= - qq|
    Event \n|; + $html .= qq|
    Trigger\n|; + $html .= qq|
    Event \n|; $html .= qq|
    Type @@ -20,7 +19,7 @@ elsif ( 'asterisk' eq lc $config_parms{phone_voicemail_type} ) { my $mailbox = ($Authorized) ? $config_parms{phone_voicemail_number} : '25'; - my $pin = ($Authorized) ? $config_parms{phone_voicemail_pin} : '9999'; + my $pin = ($Authorized) ? $config_parms{phone_voicemail_pin} : '9999'; return qq[ @@ -32,12 +31,10 @@
    ]; } elsif ( 'vocp' eq lc $config_parms{phone_voicemail_type} ) { - return - qq[Voice Mail]; + return qq[Voice Mail]; } else { - return - qq[Voice mail
    ]; + return qq[Voice mail
    ]; } diff --git a/web/bin/wc_settings.pl b/web/bin/wc_settings.pl index 43f4dc97c..9a50cdebd 100644 --- a/web/bin/wc_settings.pl +++ b/web/bin/wc_settings.pl @@ -41,8 +41,8 @@ # We use the wc_address_x from 0 to wc_max - 1 # if we pass anything in output changes to html snippet -my $outmode = @ARGV[0]; # arg is number of columns to format to -my $arg2 = @ARGV[1]; # if we have a second arg it is the url for full frame +my $outmode = @ARGV[0]; # arg is number of columns to format to +my $arg2 = @ARGV[1]; # if we have a second arg it is the url for full frame my ( $outimage, $rest ) = split / /, $arg2; # because we may have extra stuff my $html = " \n "; @@ -72,8 +72,7 @@ #Add this cameras settings into the string my $wcURL = $config_parms{$wcThis}; my ( $wcURL, $wcDescr ) = split( /\,/, $wcURL ); - $scriptlet .= - "webCamRegisterCam(\"" . $wcx . ": $wcDescr\", \"$wcURL\", $wcx); \n"; + $scriptlet .= "webCamRegisterCam(\"" . $wcx . ": $wcDescr\", \"$wcURL\", $wcx); \n"; $html .= "[0] . ".png?" . int(100000*rand) . "'>\n"; $html .= - "\'/rrd/weather_" - . $typegraph . "_" - . $periodgraph->[0] - . ".$rrd_format?" - . time() - . '\' border=0>

    '; + "\'/rrd/weather_" . $typegraph . "_" . $periodgraph->[0] . ".$rrd_format?" . time() . '\' border=0>

    '; } } } diff --git a/web/bin/weather_graph_zoom.pl b/web/bin/weather_graph_zoom.pl index 74b43060c..c8d887511 100755 --- a/web/bin/weather_graph_zoom.pl +++ b/web/bin/weather_graph_zoom.pl @@ -100,33 +100,25 @@ # my $day = $cgi->param('debday'); # my $month = $cgi->param('debmonth'); # my $year = $cgi->param('debyear'); - my $debepochtime = timelocal( - 0, 0, 0, - $cgi->param('debday'), - $cgi->param('debmonth') - 1, - $cgi->param('debyear') - 1900 - ); + my $debepochtime = timelocal( 0, 0, 0, $cgi->param('debday'), $cgi->param('debmonth') - 1, $cgi->param('debyear') - 1900 ); # Convert end date in Epoch date - my $endepochtime = timelocal( - 59, 59, 23, - $cgi->param('endday'), - $cgi->param('endmonth') - 1, - $cgi->param('endyear') - 1900 - ); + my $endepochtime = timelocal( 59, 59, 23, $cgi->param('endday'), $cgi->param('endmonth') - 1, $cgi->param('endyear') - 1900 ); if ( $endepochtime > time() ) { $endepochtime = time(); } if ( $debepochtime <= $endepochtime ) { my %sensor_names; - &main::read_parm_hash( \%sensor_names, - $main::config_parms{weather_graph_sensor_names} ); + &main::read_parm_hash( \%sensor_names, $main::config_parms{weather_graph_sensor_names} ); &create_rrdgraph_zoom( - $debepochtime, $endepochtime, - $cgi->param('width'), $cgi->param('height'), - $cgi->param('sensor1'), $sensor_names{ $cgi->param('sensor1') }, - $cgi->param('sensor2'), $sensor_names{ $cgi->param('sensor2') } + $debepochtime, $endepochtime, + $cgi->param('width'), + $cgi->param('height'), + $cgi->param('sensor1'), + $sensor_names{ $cgi->param('sensor1') }, + $cgi->param('sensor2'), + $sensor_names{ $cgi->param('sensor2') } ); } else { @@ -176,9 +168,7 @@ sub print_graph { ); print $cgi->start_Tr; print $cgi->start_td( { -align => 'center' } ); - print $cgi->img( - { src => "/rrd/weather_zoom.$rrd_format?" . time(), align => 'center' } - ); + print $cgi->img( { src => "/rrd/weather_zoom.$rrd_format?" . time(), align => 'center' } ); print $cgi->end_td; print $cgi->end_Tr; print $cgi->end_table(); @@ -232,13 +222,11 @@ sub print_prompts { -cellspacing => "0" } ); - print $cgi->start_form( - { -method => 'GET', -action => '/bin/weather_graph_zoom.pl' } ); + print $cgi->start_form( { -method => 'GET', -action => '/bin/weather_graph_zoom.pl' } ); # Choose RRD database print $cgi->start_Tr; - print $cgi->start_td( - { -align => 'right', valign => "center", width => "90" } ); + print $cgi->start_td( { -align => 'right', valign => "center", width => "90" } ); print 'Round Robin Database'; print $cgi->end_td; $RRDDIR = "$config_parms{rrd_dir}"; @@ -260,10 +248,8 @@ sub print_prompts { print 'Sensor 2'; print $cgi->end_td; - print $cgi->start_td( - { -align => 'left', -colspan => 1, valign => "center" } ); - &main::read_parm_hash( \%sensor_names, - $main::config_parms{weather_graph_sensor_names} ); + print $cgi->start_td( { -align => 'left', -colspan => 1, valign => "center" } ); + &main::read_parm_hash( \%sensor_names, $main::config_parms{weather_graph_sensor_names} ); for my $sensor_name ( sort keys %sensor_names ) { push @list_sensors, $sensor_name; } @@ -292,15 +278,13 @@ sub print_prompts { ); print $cgi->end_td; - print $cgi->start_td( - { -align => 'right', -colspan => 1, valign => "center" } ); + print $cgi->start_td( { -align => 'right', -colspan => 1, valign => "center" } ); print $cgi->start_b; print "Width "; print $cgi->br; print "Height "; print $cgi->end_td; - print $cgi->start_td( - { -align => 'left', -colspan => 1, valign => "center" } ); + print $cgi->start_td( { -align => 'left', -colspan => 1, valign => "center" } ); print $cgi->popup_menu( -name => 'width', -size => 1, @@ -485,10 +469,7 @@ sub get_footer1 { else { $colon = ':'; } - $footer = - "Step size$colon " - . convertstepz($step) - . " Data points$colon $datapoint"; + $footer = "Step size$colon " . convertstepz($step) . " Data points$colon $datapoint"; return $footer; } @@ -511,10 +492,9 @@ sub get_footer2 { sub create_rrdgraph_zoom { my $celgtime; my $create_graph; - my $colordatamoy = 'ff0000'; # color of primary variable average line (red) - my $colordatamoy2 = '330099'; # color of primary variable average line (red) - my $colorna = - 'C0C0C0'; # color for unknown area or 0 for gaps (barre noire verticale) + my $colordatamoy = 'ff0000'; # color of primary variable average line (red) + my $colordatamoy2 = '330099'; # color of primary variable average line (red) + my $colorna = 'C0C0C0'; # color for unknown area or 0 for gaps (barre noire verticale) my $colordatamax = '330099'; # color of min and max my $colordatamax2 = 'FFFF00'; # color of min and max my $colorwhite = 'ffffff'; # color white @@ -529,10 +509,7 @@ sub create_rrdgraph_zoom { my $secs; my $titrerrd; - my ( - $time1, $time2, $gwidth, $gheight, - $sensor1, $libsensor1, $sensor2, $libsensor2 - ) = @_; + my ( $time1, $time2, $gwidth, $gheight, $sensor1, $libsensor1, $sensor2, $libsensor2 ) = @_; print "SENSOR1=$sensor1 LIBSENSOR1=$libsensor1" if $debug; print "SENSOR2=$sensor2 LIBSENSOR2=$libsensor2" if $debug; @@ -554,12 +531,9 @@ sub create_rrdgraph_zoom { $time1 = int( $time1 / $secs ) * $secs; $time2 = int( $time2 / $secs ) * $secs; - $titrerrd = - ( $sensor2 ne "nosensor" ) ? "$libsensor1, $libsensor2" : "$libsensor1"; + $titrerrd = ( $sensor2 ne "nosensor" ) ? "$libsensor1, $libsensor2" : "$libsensor1"; - ( $start, $step, $names, $array ) = - RRDs::fetch "$config_parms{weather_data_rrd}", "AVERAGE", "-s", "$time1", - "-e", "$time2"; + ( $start, $step, $names, $array ) = RRDs::fetch "$config_parms{weather_data_rrd}", "AVERAGE", "-s", "$time1", "-e", "$time2"; $err = RRDs::error; die "ERROR : function RRDs::fetch : $err" if $err; $datapoint = $#$array + 1; @@ -736,8 +710,7 @@ sub create_rrdgraph_zoom { ( $strminvar2 = $strminvar ) =~ s/mindata/mindata2/g; ( $strmaxvar2 = $strmaxvar ) =~ s/maxdata/maxdata2/g; - $str_graph = - qq^RRDs::graph("$rrd_graph_dir/weather_zoom.$native_rrd_format", + $str_graph = qq^RRDs::graph("$rrd_graph_dir/weather_zoom.$native_rrd_format", "--title", "Environmental data : $titrerrd", "--height","$gheight", "--width", "$gwidth", @@ -749,12 +722,7 @@ sub create_rrdgraph_zoom { "--color","SHADEA#0000CC", "--color","SHADEB#0000CC", ^ - . "\"--vertical-label\"," - . "$libuom" - . "\"--start\"," - . "\"$time1\"," - . "\"--end\"," - . "\"$time2\"," + . "\"--vertical-label\"," . "$libuom" . "\"--start\"," . "\"$time1\"," . "\"--end\"," . "\"$time2\"," . "\"DEF:var=$rrd_dir:" . $sensor1 @@ -770,20 +738,17 @@ sub create_rrdgraph_zoom { . "$strmaxvar" . ( - $sensor2 ne "nosensor" - ? "\"DEF:var2=$rrd_dir:" . $sensor2 . ":AVERAGE\"," + $sensor2 ne "nosensor" ? "\"DEF:var2=$rrd_dir:" . $sensor2 . ":AVERAGE\"," : '' ) . ( $sensor2 ne "nosensor" ? "$strvar2" : '' ) . ( - $sensor2 ne "nosensor" - ? "\"DEF:mindata2=$rrd_dir:" . $sensor2 . ":MIN\"," + $sensor2 ne "nosensor" ? "\"DEF:mindata2=$rrd_dir:" . $sensor2 . ":MIN\"," : '' ) . ( $sensor2 ne "nosensor" ? "$strminvar2" : '' ) . ( - $sensor2 ne "nosensor" - ? "\"DEF:maxdata2=$rrd_dir:" . $sensor2 . ":MAX\"," + $sensor2 ne "nosensor" ? "\"DEF:maxdata2=$rrd_dir:" . $sensor2 . ":MAX\"," : '' ) . ( $sensor2 ne "nosensor" ? "$strmaxvar2" : '' ) @@ -798,10 +763,7 @@ sub create_rrdgraph_zoom { "GPRINT:fvar:LAST:Last \\\\: %5.1lf\\\\n", ^ . ( - $sensor2 ne "nosensor" - ? "\"LINE2:fvar2#$colordatamoy2:" - . sprintf( "%-${max}s", $libsensor2 ) - . " (Average)\"," + $sensor2 ne "nosensor" ? "\"LINE2:fvar2#$colordatamoy2:" . sprintf( "%-${max}s", $libsensor2 ) . " (Average)\"," : '' ) . ( @@ -817,8 +779,7 @@ sub create_rrdgraph_zoom { : '' ) . ( - $sensor2 ne "nosensor" - ? "\"GPRINT:fvar2:LAST:Last \\\\: %5.1lf\\\\n\"," + $sensor2 ne "nosensor" ? "\"GPRINT:fvar2:LAST:Last \\\\: %5.1lf\\\\n\"," : '' ) . qq^ @@ -833,18 +794,13 @@ sub create_rrdgraph_zoom { die "ERROR : function RRDs::graph : $err\n" if $err; if ( $rrd_format ne $native_rrd_format ) { if ( $rrd_format eq 'gif' and $native_rrd_format eq 'png' ) { - my $pngFilename = - File::Spec->catfile( $rrd_graph_dir, "weather_zoom.png" ); - my $gifFilename = - File::Spec->catfile( $rrd_graph_dir, "weather_zoom.gif" ); + my $pngFilename = File::Spec->catfile( $rrd_graph_dir, "weather_zoom.png" ); + my $gifFilename = File::Spec->catfile( $rrd_graph_dir, "weather_zoom.gif" ); - system( $config_parms{weather_convert_png_to_gif}, - $pngFilename, $gifFilename ); + system( $config_parms{weather_convert_png_to_gif}, $pngFilename, $gifFilename ); } else { - &print_log( - "weather_graph_zoom: sorry, don't know how to convert from $native_rrd_format to $rrd_format" - ); + &print_log( "weather_graph_zoom: sorry, don't know how to convert from $native_rrd_format to $rrd_format" ); } } } diff --git a/web/bin/webcam_dirs.pl b/web/bin/webcam_dirs.pl index b8ab92759..366be1244 100644 --- a/web/bin/webcam_dirs.pl +++ b/web/bin/webcam_dirs.pl @@ -29,19 +29,18 @@ my $html = " -"; # basic html page to the target - # setup our starting point -my @dirs = $search_from; # Start with a simple array of One entry -my @endDirs = ""; # We fill this as we find the ending dirs +"; # basic html page to the target + # setup our starting point +my @dirs = $search_from; # Start with a simple array of One entry +my @endDirs = ""; # We fill this as we find the ending dirs -&recurse_dirs(); # Here we go off and find all the dirs ! +&recurse_dirs(); # Here we go off and find all the dirs ! -@endDirs = sort @endDirs; # Sort our entries because its easier to read +@endDirs = sort @endDirs; # Sort our entries because its easier to read -$html .= - ""; +$html .= "
    "; -my $mycol = 1; # table column counter +my $mycol = 1; # table column counter #my $columns =3; # and limits (width) my $columns = $wcMax - 1; @@ -119,16 +118,16 @@ sub get_dirs { next if ( $files =~ /^\./ ); # no dot dirs $thisDir = $search_this . "/" . $files; # usable path - # here we need to strip off everything up to and incl ./web/ + # here we need to strip off everything up to and incl ./web/ ( $base, $here ) = split( /\/web/, $thisDir ); if ( -d $thisDir ) { # we need to see if we're at the end of the line - my $Status = &test_for_dirs(); # use the quick check - if ( $Status eq "end" ) { # to see if were done on this one - push @endDirs, "$thisDir"; # yep save it to the display list + my $Status = &test_for_dirs(); # use the quick check + if ( $Status eq "end" ) { # to see if were done on this one + push @endDirs, "$thisDir"; # yep save it to the display list } - push @dirs, "$thisDir"; #and put on recurson stack + push @dirs, "$thisDir"; #and put on recurson stack } } return; diff --git a/web/bin/webcam_shows.pl b/web/bin/webcam_shows.pl index aab25a01c..45b38c8c1 100644 --- a/web/bin/webcam_shows.pl +++ b/web/bin/webcam_shows.pl @@ -16,8 +16,7 @@ my $wcx = "" unless $config_parms{wc_address_1}; # 1 ? # Get the list of directories in the camera directory -my $abs_dir = - $config_parms{html_dir} . "/" . $config_parms{wc_slide_dir} . "/cams"; +my $abs_dir = $config_parms{html_dir} . "/" . $config_parms{wc_slide_dir} . "/cams"; opendir( DIR, $abs_dir ); my @files = grep { !/\.$/ && -d "$abs_dir/$_" } readdir(DIR); #readdir(DIR); closedir(DIR); @@ -27,10 +26,8 @@ my $bgcolor = "#333366"; -my $webdir = - $config_parms{wc_slide_dir} . $config_parms{wc_slide_dir} . "/cams/"; -my $html = - "\n"; +my $webdir = $config_parms{wc_slide_dir} . $config_parms{wc_slide_dir} . "/cams/"; +my $html = "\n"; $html .= "
    \n"; # make the links to the movie files ... @@ -56,15 +53,11 @@ #Add this cameras settings into the string my $wcURL = $config_parms{$wcThis}; my ( $wcURL, $wcDescr ) = split( /\,/, $wcURL ); - my $currDir = - "/bin/webcam_movie.pl?" . $config_parms{wc_slide_dir} . "/cams/" . $file; - my $href = ""; + my $currDir = "/bin/webcam_movie.pl?" . $config_parms{wc_slide_dir} . "/cams/" . $file; + my $href = ""; $html .= "\n"; - $html .= - ""; $html .= @@ -91,17 +84,9 @@ #$last_image = sprintf ('%04s/2%02s%02d%02d%02d%02d%02d',$last_image, $last_image); } else { $jnk = "None"; } - $html .= - ""; + $html .= ""; - $html .= - ""; $html .= "\n"; diff --git a/web/comics/dailystrips/dailystrips-update b/web/comics/dailystrips/dailystrips-update index 8ea5ad1bb..8f19a6cbe 100644 --- a/web/comics/dailystrips/dailystrips-update +++ b/web/comics/dailystrips/dailystrips-update @@ -29,9 +29,8 @@ $dailystrips_version = "1.0.28"; # Get options GetOptions( - \%options, 'quiet|q', 'verbose', 'proxy=s', - 'proxyauth=s', 'noenvproxy', 'version|v', 'help|h', - 'retries=s', 'updates=s', 'minage=s' + \%options, 'quiet|q', 'verbose', 'proxy=s', 'proxyauth=s', 'noenvproxy', + 'version|v', 'help|h', 'retries=s', 'updates=s', 'minage=s' ) or exit 1; # Process options: @@ -83,8 +82,7 @@ unless ( $options{'retries'} ) { if ( $options{'proxy'} ) { $options{'proxy'} =~ /^(http:\/\/)?(.*?):(.+?)\/?$/i; unless ( $2 and $3 ) { - die - "Error: incorrectly formatted proxy server ('http://server:port' expected)\n"; + die "Error: incorrectly formatted proxy server ('http://server:port' expected)\n"; } $options{'proxy'} = "http://$2:$3"; @@ -93,8 +91,7 @@ if ( $options{'proxy'} ) { if ( !$options{'noenvproxy'} and !$options{'proxy'} and $ENV{'http_proxy'} ) { $ENV{'http_proxy'} =~ /(http:\/\/)?(.*?):(.+?)\/?$/i; unless ( $2 and $3 ) { - die - "Error: incorrectly formatted proxy server environment variable\n('http://server:port' expected)\n"; + die "Error: incorrectly formatted proxy server environment variable\n('http://server:port' expected)\n"; } $options{'proxy'} = "http://$2:$3"; @@ -102,8 +99,7 @@ if ( !$options{'noenvproxy'} and !$options{'proxy'} and $ENV{'http_proxy'} ) { if ( $options{'proxyauth'} ) { unless ( $options{'proxyauth'} =~ /^.+?:.+?$/ ) { - die - "Error: incorrectly formatted proxy credentials ('user:pass' expected)\n"; + die "Error: incorrectly formatted proxy credentials ('user:pass' expected)\n"; } } @@ -163,8 +159,7 @@ sub http_get { if ( $response->is_error() ) { if ( $options{'verbose'} ) { - warn - "Warning: could not download $url: $status (attempt $_ of $options{'retries'})\n"; + warn "Warning: could not download $url: $status (attempt $_ of $options{'retries'})\n"; } } else { @@ -180,12 +175,9 @@ sub http_get { sub get_updated_defs { # set parameters - my $updates_file = shift; - my $updates_rev_url = - "http://dailystrips.sourceforge.net/UPDATES/ds-update-" - . $dailystrips_version . ".rev"; - my $updates_url = "http://dailystrips.sourceforge.net/UPDATES/ds-update-" - . $dailystrips_version; + my $updates_file = shift; + my $updates_rev_url = "http://dailystrips.sourceforge.net/UPDATES/ds-update-" . $dailystrips_version . ".rev"; + my $updates_url = "http://dailystrips.sourceforge.net/UPDATES/ds-update-" . $dailystrips_version; my $local_revision = 0; my $remote_revision = 0; @@ -198,9 +190,7 @@ sub get_updated_defs { } # check revision of local file - if ( - open( UPDATES, "<$updates_file" ) - ) # or die "Error: cannot read updates file: $!\n"; + if ( open( UPDATES, "<$updates_file" ) ) # or die "Error: cannot read updates file: $!\n"; { while () { if (/^#REVISION:\s*(\-?\d+)/i) { diff --git a/web/comics/dailystrips/install.pl b/web/comics/dailystrips/install.pl index 996b9b6d4..faa7be11e 100644 --- a/web/comics/dailystrips/install.pl +++ b/web/comics/dailystrips/install.pl @@ -20,8 +20,7 @@ # Not for Win32 if ( $^O =~ /Win32/ ) { - die - "install.pl is not for use on Win32 systems. Please see INSTALL file.\n"; + die "install.pl is not for use on Win32 systems. Please see INSTALL file.\n"; } # Editable paths @@ -100,12 +99,7 @@ die "Error creating documentation directory. See above for reason.\n"; } -if ( - system( - "install BUGS CHANGELOG CONTRIBUTORS COPYING INSTALL README README.DEFS README.LOCAL TODO $options{'docdir'}" - ) - ) -{ +if ( system( "install BUGS CHANGELOG CONTRIBUTORS COPYING INSTALL README README.DEFS README.LOCAL TODO $options{'docdir'}" ) ) { die "Error installing documentation files. See above for reason.\n"; } @@ -118,12 +112,7 @@ die "Error creating scripts directory. See above for reason.\n"; } -if ( - system( - "install dailystrips dailystrips-clean dailystrips-update $options{'scriptdir'}" - ) - ) -{ +if ( system( "install dailystrips dailystrips-clean dailystrips-update $options{'scriptdir'}" ) ) { die "Error installing script. See above for reason.\n"; } diff --git a/web/ia4/web_sub.pl b/web/ia4/web_sub.pl index e5bc2d63c..8a0a7f022 100644 --- a/web/ia4/web_sub.pl +++ b/web/ia4/web_sub.pl @@ -11,18 +11,13 @@ sub X10Lamp { $o = &get_object_by_name($arg1); return 'not found' unless $o; $objState = $o->state; - $icon = - "" - . $objState - . ""; + $icon = "" . $objState . ""; if ( $objState eq 'on' ) { - $icon = - ""; + $icon = ""; } if ( $objState eq 'off' ) { - $icon = - ""; + $icon = ""; } return $icon; } @@ -54,12 +49,10 @@ sub housemode { $icon = "/graphics/$arg3.gif"; if ( $objState eq 'on' ) { - $icon = - ""; + $icon = ""; } if ( $objState eq 'off' ) { - $icon = - ""; + $icon = ""; } return $icon; } @@ -101,14 +94,12 @@ sub web_phonelog { print_log "Announced Recent Callers."; $NumofCalls = 0; - $log_out = - "
    " - . $href - . " + $html .= "" . $href . " " - . $href - . " Last Image
    " . " " - . $jnk - . "
    " . $href . " Last Image
    " . " " . $jnk . "
    " - . $href - . " + $html .= "" . $href . "
    "; + $log_out = "
    "; foreach $CallLogTempLine (@callloglines) { $NumofCalls = $NumofCalls + 1; ( $PhoneDateLog, $PhoneTimeLog, $PhoneNameLog, $PhoneNumberLog ) = ( split( '`', $CallLogTempLine ) )[ 0, 1, 2, 3 ]; - $log_out .= - ""; + $log_out .= ""; $log_out .= ""; } @@ -116,8 +107,7 @@ sub web_phonelog { $log_out .= "); + $html .= qq(); } $html .= "\n"; } @@ -365,12 +352,12 @@ sub patchurl { eval { if ( !defined( $uri->scheme ) or !$uri->scheme ) { - $uri = new URI $url, ( $base->scheme || 'http' ); # what the hell? + $uri = new URI $url, ( $base->scheme || 'http' ); # what the hell? } # Gack! relative URL! if ( $uri->path !~ m|^/| ) { - local $URI::ABS_ALLOW_RELATIVE_SCHEME = 1; # gack gack + local $URI::ABS_ALLOW_RELATIVE_SCHEME = 1; # gack gack $uri = URI->new($url)->abs($base); } @@ -380,9 +367,9 @@ sub patchurl { } }; - $uri->scheme('http') unless $uri->scheme; # thanks, slashdot + $uri->scheme('http') unless $uri->scheme; # thanks, slashdot - return $url if $@; # bail out if there's an error. + return $url if $@; # bail out if there's an error. $uri->as_string; } diff --git a/web/ia6/date.pl b/web/ia6/date.pl index 7dd47916f..af2b47e24 100644 --- a/web/ia6/date.pl +++ b/web/ia6/date.pl @@ -1,13 +1,8 @@ my $html; -my @months = ( - 'January', 'February', 'March', 'April', 'May', 'June', - 'July', 'August', 'September', 'October', 'November', 'December' -); -my @days = ( - 'Sunday', 'Monday', 'Tuesday', 'Wednesday', - 'Thursday', 'Friday', 'Saturday' -); +my @months = + ( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ); +my @days = ( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ); my ( $sec, $min, $hour, $day, $month, $year, $day2 ) = ( localtime(time) )[ 0, 1, 2, 3, 4, 5, 6 ]; diff --git a/web/ia6/weatherpoint.pl b/web/ia6/weatherpoint.pl index ec4b2fff8..c22d138b1 100644 --- a/web/ia6/weatherpoint.pl +++ b/web/ia6/weatherpoint.pl @@ -9,9 +9,8 @@ my $f_weatherpoint_page = "$config_parms{data_dir}/web/weatherpoint.txt"; my $f_weatherpoint_html = "$config_parms{data_dir}/web/weatherpoint.html"; -$p_weatherpoint_page = new Process_Item( - "get_url \"$config_parms{weatherpointURL}\" \"$f_weatherpoint_html\""); -$v_get_weatherpoint = new Voice_Cmd('Get weather point'); +$p_weatherpoint_page = new Process_Item("get_url \"$config_parms{weatherpointURL}\" \"$f_weatherpoint_html\""); +$v_get_weatherpoint = new Voice_Cmd('Get weather point'); if ( $Startup or $Reload ) { # Used for testing @@ -28,8 +27,7 @@ $text = file_read $f_weatherpoint_html; # Find beginning of table and replace table tag - $text =~ - s/.+5-Day Forecast.+?width=468>(.+)/
    $PhoneDateLog $PhoneTimeLog $PhoneNameLog $PhoneNumberLog$PhoneDateLog $PhoneTimeLog $PhoneNameLog $PhoneNumberLog
    "; $log_out .= ""; - $log_out .= - ""; + $log_out .= ""; $log_out .= ""; $log_out .= "
    NUMBER OF CALLS: $NumofCallsNUMBER OF CALLS: $NumofCalls
    "; diff --git a/web/ia5/phone/voicemail.pl b/web/ia5/phone/voicemail.pl index 9188db484..6107c0b84 100644 --- a/web/ia5/phone/voicemail.pl +++ b/web/ia5/phone/voicemail.pl @@ -5,9 +5,8 @@ # Authority: anyone if ( 'mci' eq lc $config_parms{phone_voicemail_type} ) { - my $phone = - ($Authorized) ? $config_parms{phone_voicemail_number} : '0001112222'; - my $pin = ($Authorized) ? $config_parms{phone_voicemail_pin} : '9999'; + my $phone = ($Authorized) ? $config_parms{phone_voicemail_number} : '0001112222'; + my $pin = ($Authorized) ? $config_parms{phone_voicemail_pin} : '9999'; return qq[
    @@ -20,7 +19,7 @@ elsif ( 'asterisk' eq lc $config_parms{phone_voicemail_type} ) { my $mailbox = ($Authorized) ? $config_parms{phone_voicemail_number} : '25'; - my $pin = ($Authorized) ? $config_parms{phone_voicemail_pin} : '9999'; + my $pin = ($Authorized) ? $config_parms{phone_voicemail_pin} : '9999'; return qq[ @@ -32,12 +31,10 @@
    ]; } elsif ( 'vocp' eq lc $config_parms{phone_voicemail_type} ) { - return - qq[Voice Mail]; + return qq[Voice Mail]; } else { - return - qq[Voice mail
    ]; + return qq[Voice mail
    ]; } diff --git a/web/ia5/pictures/getcomics.pl b/web/ia5/pictures/getcomics.pl index 78454994b..54a327252 100644 --- a/web/ia5/pictures/getcomics.pl +++ b/web/ia5/pictures/getcomics.pl @@ -15,10 +15,8 @@ BEGIN my $base; my %pages; -$pages{'dilbert'} = [ - 'http://www.dilbert.com/comics/dilbert/archive/', - 'img.*?src="(/comics/dilbert/archive/images/dilbert\d+.gif)"' -]; +$pages{'dilbert'} = + [ 'http://www.dilbert.com/comics/dilbert/archive/', 'img.*?src="(/comics/dilbert/archive/images/dilbert\d+.gif)"' ]; #$pages{'bobbins'} = # [ @@ -157,10 +155,8 @@ BEGIN $filename =~ s|/|.|g; if ( -f $filename ) { - ( - undef, undef, undef, undef, undef, undef, undef, - undef, undef, $mtime, undef, undef, undef - ) = stat($filename); + ( undef, undef, undef, undef, undef, undef, undef, undef, undef, $mtime, undef, undef, undef ) = + stat($filename); if ( $mtime > $utime ) { $cached = 1; } @@ -206,8 +202,7 @@ BEGIN next if !defined($content); next if $n < $numrules; - print - " Item $page, content type $contenttype successfully fetched.\n"; + print " Item $page, content type $contenttype successfully fetched.\n"; # Now, filter the page. if ( defined( $filters{$page} ) ) { @@ -276,15 +271,8 @@ BEGIN my $srcurl = ""; $srcurl = " (from $url)
    "; $srcurl .= " ($date)" if $date; - if ( - !( - $compilation =~ - s|()|$page$srcurl\n| - ) - ) - { - $compilation =~ - s|()|$page$srcurl\n$1|; + if ( !( $compilation =~ s|()|$page$srcurl\n| ) ) { + $compilation =~ s|()|$page$srcurl\n$1|; } } } @@ -344,8 +332,7 @@ sub carve_image { } `pnmcut $x $y $w $h $name/$filename 2>/dev/null | ppmtogif 2>/dev/null > $name/$ {name}_$ {x}_$ {y}.gif`; - $html .= - qq(
    $1/s; + $text =~ s/.+5-Day Forecast.+?width=468>(.+)/
    $1/s; # Find last TH tag and add all needed closing tags $text =~ s/(.+)<\/th>.+/$1<\/th><\/tr><\/table>/s; diff --git a/web/misc/mp3Rip.pl b/web/misc/mp3Rip.pl index 5480ea0be..100b9549a 100644 --- a/web/misc/mp3Rip.pl +++ b/web/misc/mp3Rip.pl @@ -42,8 +42,7 @@ sub abort { my $dir = &mp3Rip_abort($cddbid); my $html = &html_header("Misterhouse mp3Rip: Aborted Rip $cddbid"); $html .= "

    The MP3 Rip process has been aborted.\n"; - $html .= - "

    The data will be stored as an incomplete process and you can delete it or try to resume.\n"; + $html .= "

    The data will be stored as an incomplete process and you can delete it or try to resume.\n"; if ( -d $dir ) { $html .= "

    The directory '$dir' exists and may contain a partially ripped CD. You may want to examine this directory manually to see if any manual actions are necessary.\n"; @@ -102,8 +101,7 @@ sub resume_rip { } $html .= "

    The MP3 Rip is in progress.

    Since this disc was somehow lost by the system before, you should monitor the progress closely to verify it is completing sucessfully. \n"; - $html .= - "

    Return to the mp3Rip Homepage to check the status.\n"; + $html .= "

    Return to the mp3Rip Homepage to check the status.\n"; $html .= "


    Questions, bugs, comments, suggestions related to the Misterhouse mp3Rip system? Contact Kirk Bauer\n"; return &html_page( "Misterhouse mp3Rip: Rip Resumed", $html ); @@ -121,20 +119,13 @@ sub view_log { $html

     |;
    -        foreach (
    -            reverse &main::file_read(
    -                "$config_parms{mp3Rip_work_dir}/$cddbid.log") )
    -        {
    +        foreach ( reverse &main::file_read("$config_parms{mp3Rip_work_dir}/$cddbid.log") ) {
                 $html .= "$_\n";
             }
         }
         elsif ( -f "$config_parms{mp3Rip_archive_dir}/$cddbid.log" ) {
    -        $html .=
    -          "

    NOTE: This is an archived log file as the ripping process is complete.

    \n";
    -        foreach (
    -            reverse &main::file_read(
    -                "$config_parms{mp3Rip_archive_dir}/$cddbid.log") )
    -        {
    +        $html .= "

    NOTE: This is an archived log file as the ripping process is complete.

    \n";
    +        foreach ( reverse &main::file_read("$config_parms{mp3Rip_archive_dir}/$cddbid.log") ) {
                 $html .= "$_\n";
             }
         }
    @@ -146,8 +137,7 @@ sub view_log {
     
     sub get_cdinfo {
         &mp3Rip_get_cdinfo();
    -    my $html =
    -      &html_header("Misterhouse mp3Rip Step 1/$numsteps: Retrieving CD Info");
    +    my $html = &html_header("Misterhouse mp3Rip Step 1/$numsteps: Retrieving CD Info");
         $html = qq|
     
     $html
    @@ -156,8 +146,7 @@ sub get_cdinfo {
     |;
         $html .=
           "

    Questions, bugs, comments, suggestions related to the Misterhouse mp3Rip system? Contact Kirk Bauer\n"; - return &html_page( - "Misterhouse mp3Rip Step 1/$numsteps: Retrieving CD Info", $html ); + return &html_page( "Misterhouse mp3Rip Step 1/$numsteps: Retrieving CD Info", $html ); } sub verify_cdinfo { @@ -166,18 +155,15 @@ sub verify_cdinfo { $html .= "

    Still processing... please wait.\n"; return $html; } - my ( $cddbid, $track_numbers, $track_lengths, $total_seconds ) = - &mp3Rip_parse_cdinfo(); + my ( $cddbid, $track_numbers, $track_lengths, $total_seconds ) = &mp3Rip_parse_cdinfo(); unless ($track_numbers) { - my $html .= - "

    ERROR READING CD INFORMATION!\n"; - $html .= "

    Things to check:

    \n
      \n"; - $html .= "
    • Is there a CD in the drive?\n"; + my $html .= "

      ERROR READING CD INFORMATION!\n"; + $html .= "

      Things to check:

      \n
        \n"; + $html .= "
      • Is there a CD in the drive?\n"; $html .= "
      • Try running '$config_parms{mp3Rip_cdinfo}' as the Misterhouse user ('$ENV{USER}') to see if it is working okay. \n"; $html .= "
      \n"; - $html .= - "

      Click here when you are ready to try again\n"; + $html .= "

      Click here when you are ready to try again\n"; return $html; } return ( undef, $cddbid, $track_numbers, $track_lengths, $total_seconds ); @@ -198,22 +184,15 @@ sub confirm_files { } my $html = &html_header("Misterhouse mp3Rip Step 4/$numsteps: Filenames"); unless (@tracks) { - $html .= - "

      NO TRACKS SELECTED!\n"; - $html .= - "

      Hit the Back button on your browser and select one or more tracks to rip.\n"; - return &html_page( "Misterhouse mp3Rip Step 4/$numsteps: Filenames", - $html ); + $html .= "

      NO TRACKS SELECTED!\n"; + $html .= "

      Hit the Back button on your browser and select one or more tracks to rip.\n"; + return &html_page( "Misterhouse mp3Rip Step 4/$numsteps: Filenames", $html ); } $html .= "

      IMPORTANT: The following directory should not exist or at least be empty since existing files might be deleted or overwritten!

    \n"; - my $dir = - &mp3Rip_get_dir_name( $names{'genre'}, $names{'artist'}, - $names{'album'} ); + my $dir = &mp3Rip_get_dir_name( $names{'genre'}, $names{'artist'}, $names{'album'} ); $html .= - "\n"; + "\n"; foreach my $track ( sort @tracks ) { my $trackname = &mp3Rip_get_filename( $track, @@ -222,12 +201,11 @@ sub confirm_files { $names{'album'}, $names{'genre'} ); $html .= - "\n"; } - $html .= - "\n"; + $html .= "\n"; $html .= "
    Directory
    Directory
    Track $trackTrack $track
    \n"; $html .= "\n"; $html .= "\n"; @@ -237,20 +215,15 @@ sub confirm_files { $html .= "\n"; foreach my $track (@tracks) { - $html .= "\n"; - $html .= "\n"; - $html .= "\n"; - $html .= "\n"; + $html .= "\n"; + $html .= "\n"; + $html .= "\n"; + $html .= "\n"; } $html .= "\n"; $html .= "

    Questions, bugs, comments, suggestions related to the Misterhouse mp3Rip system? Contact Kirk Bauer\n"; - return &html_page( "Misterhouse mp3Rip Step 4/$numsteps: Filenames", - $html ); + return &html_page( "Misterhouse mp3Rip Step 4/$numsteps: Filenames", $html ); } sub start_rip { @@ -258,15 +231,12 @@ sub start_rip { my $html = &html_header("Misterhouse mp3Rip Step 5/$numsteps: Ripping CD"); if ($error) { $html .= "

    ERROR: $error!\n"; - return &html_page( "Misterhouse mp3Rip Step 5/$numsteps: Ripping CD", - $html ); + return &html_page( "Misterhouse mp3Rip Step 5/$numsteps: Ripping CD", $html ); } - $html .= - "

    The MP3 Rip is in progress.

    Return to the mp3Rip Homepage to check the status.\n"; + $html .= "

    The MP3 Rip is in progress.

    Return to the mp3Rip Homepage to check the status.\n"; $html .= "


    Questions, bugs, comments, suggestions related to the Misterhouse mp3Rip system? Contact Kirk Bauer\n"; - return &html_page( "Misterhouse mp3Rip Step 5/$numsteps: Ripping CD", - $html ); + return &html_page( "Misterhouse mp3Rip Step 5/$numsteps: Ripping CD", $html ); } my $default_artist = ''; @@ -290,8 +260,7 @@ sub do_select_row { if ( $special eq 'track' ) { my $shortname = $name; $shortname =~ s/title$//; - $html .= - "\n"; + $html .= "\n"; $html .= "$label"; } else { @@ -324,14 +293,11 @@ sub do_select_row { $shortname =~ s/title$//; my $id = $label; $id =~ s/^\s*(\d+)\s+.*$/$1/; - $html .= - "\n"; - $html .= - "\n"; + $html .= "\n"; + $html .= "\n"; } if ( $special eq 'artist' ) { - $html .= - "(Changes are also applied to tracks below)\n"; + $html .= "(Changes are also applied to tracks below)\n"; } $html .= "\n"; return $html; @@ -371,21 +337,17 @@ sub track_edit { $selected{$_}++; } } - my $html = - &html_header("Misterhouse mp3Rip Step 3/$numsteps: Finalize Naming"); - my ( $error, $cddbid, $track_numbers, $track_lengths, $total_seconds ) = - &verify_cdinfo( 'track_edit', $html ); + my $html = &html_header("Misterhouse mp3Rip Step 3/$numsteps: Finalize Naming"); + my ( $error, $cddbid, $track_numbers, $track_lengths, $total_seconds ) = &verify_cdinfo( 'track_edit', $html ); if ($error) { - return &html_page( - "Misterhouse mp3Rip Step 3/$numsteps: Finalize Naming", $error ); + return &html_page( "Misterhouse mp3Rip Step 3/$numsteps: Finalize Naming", $error ); } my %combined; my $entrycount = -1; $max_track_count = $#{@$track_numbers} + 1; foreach my $disc ( &mp3Rip_get_cddb_discs() ) { if ( $selected{ $disc->[1] } ) { - my ( $genre, $artist, $album, @tracks ) = - &mp3Rip_get_disc_details($disc); + my ( $genre, $artist, $album, @tracks ) = &mp3Rip_get_disc_details($disc); my $trackcount = 0; $entrycount++; $combined{'genre'}->[$entrycount] = $genre; @@ -397,8 +359,7 @@ sub track_edit { } } } - $html .= - "

    For each row, type in or modify the value in the text box or make a selection from the list, if applicable.\n"; + $html .= "

    For each row, type in or modify the value in the text box or make a selection from the list, if applicable.\n"; $html .= "

    Disc Info\n"; $html .= "\n"; - $html .= - "

    \n"; - $html .= - &do_select_row( '', 'Genre', 'genre', - &remove_dups( @{ $combined{'genre'} } ), + $html .= "
    \n"; + $html .= &do_select_row( '', 'Genre', 'genre', &remove_dups( @{ $combined{'genre'} } ), '------------', sort( &mp3Rip_get_id3_genres() ) ); - $html .= - &do_select_row( 'artist', 'Artist', 'artist', - &remove_dups( &fix_caps( @{ $combined{'artist'} } ) ) ); - $html .= - &do_select_row( '', 'Album', 'album', - &remove_dups( &fix_caps( @{ $combined{'album'} } ) ) ); - $html .= &do_select_row( '', 'Year', 'year' ); + $html .= &do_select_row( 'artist', 'Artist', 'artist', &remove_dups( &fix_caps( @{ $combined{'artist'} } ) ) ); + $html .= &do_select_row( '', 'Album', 'album', &remove_dups( &fix_caps( @{ $combined{'album'} } ) ) ); + $html .= &do_select_row( '', 'Year', 'year' ); $html .= "
    \n"; $html .= "

    Track Info\n"; $html .= "\n"; @@ -428,43 +382,33 @@ sub track_edit { foreach ( my $i = 1; $i <= ( $#{@$track_numbers} + 1 ); $i++ ) { $html .= &do_select_row( 'track', "$i ($track_lengths->[$i-1])", - "track${i}title", - &remove_dups( &fix_caps( @{ $combined{'tracks'}->[$i] } ) ) ); + "track${i}title", &remove_dups( &fix_caps( @{ $combined{'tracks'}->[$i] } ) ) ); } - $html .= - "

    \n"; + $html .= "

    \n"; foreach ( my $i = 1; $i <= ( $#{@$track_numbers} + 1 ); $i++ ) { - $html .= "[ $i - 1 ] . "\">\n"; + $html .= "[ $i - 1 ] . "\">\n"; } $html .= "

    \n"; $html .= "

    Go back to Step 2\n"; $html .= "


    Questions, bugs, comments, suggestions related to the Misterhouse mp3Rip system? Contact Kirk Bauer\n"; - return &html_page( "Misterhouse mp3Rip Step 3/$numsteps: Finalize Naming", - $html ); + return &html_page( "Misterhouse mp3Rip Step 3/$numsteps: Finalize Naming", $html ); } sub do_cddb_list { my $html = &html_header("Misterhouse mp3Rip Step 2/$numsteps: CDDB List"); - my ( $error, $cddbid, $track_numbers, $track_lengths, $total_seconds ) = - &verify_cdinfo( 'cddb_list', $html ); + my ( $error, $cddbid, $track_numbers, $track_lengths, $total_seconds ) = &verify_cdinfo( 'cddb_list', $html ); if ($error) { - return &html_page( "Misterhouse mp3Rip Step 2/$numsteps: CDDB List", - $error ); + return &html_page( "Misterhouse mp3Rip Step 2/$numsteps: CDDB List", $error ); } $html .= "Audio CD Found

      \n"; - $html .= - "
    • Total Length: " . &mp3Rip_format_time($total_seconds) . "\n"; - $html .= - "
    • Number of Tracks: " . ( $#{@$track_numbers} + 1 ) . "\n"; + $html .= "
    • Total Length: " . &mp3Rip_format_time($total_seconds) . "\n"; + $html .= "
    • Number of Tracks: " . ( $#{@$track_numbers} + 1 ) . "\n"; $html .= "

    Select at least one CDDB entry to pre-populate your CD info. If you select more than one you will be presented with a list box for each item on the next page. You will still be able to make manual changes as well.\n"; - $html .= - "

    If you don't select any discs below, you will have to manually enter information about this CD.\n"; + $html .= "

    If you don't select any discs below, you will have to manually enter information about this CD.\n"; $html .= "

    \n"; - $html .= - "\n"; + $html .= "\n"; foreach my $disc ( &mp3Rip_get_cddb_discs() ) { my ( $genre, $cddbid, $album ) = @$disc; @@ -473,15 +417,13 @@ sub do_cddb_list { $html .= "\n"; } - $html .= - "\n"; + $html .= "\n"; $html .= "
    Select?GenreArtist / AlbumCDDB DiscID
    Select?GenreArtist / AlbumCDDB DiscID
    $genre$album$cddbid
    \n"; $html .= "

    TIP: Select all discs that appear to match your CD so you will have a wider variety of choices on the next page.\n"; $html .= "


    Questions, bugs, comments, suggestions related to the Misterhouse mp3Rip system? Contact Kirk Bauer\n"; - return &html_page( "Misterhouse mp3Rip Step 2/$numsteps: CDDB List", - $html ); + return &html_page( "Misterhouse mp3Rip Step 2/$numsteps: CDDB List", $html ); } sub main_page { @@ -508,35 +450,26 @@ sub main_page { my @pending = &mp3Rip_get_pending(); if (@pending) { $html .= "\n"; - $html .= - "\n"; + $html .= "\n"; $html .= "\n"; foreach (@pending) { my ( - $cddbid, $artist, - $album, $current, - $rip_status, $rip_percent, - $compress_status, $compress_percent, - $rip_time, $rip_predicted_remaining, - $compress_time, $compress_predicted_remaining + $cddbid, $artist, $album, $current, + $rip_status, $rip_percent, $compress_status, $compress_percent, + $rip_time, $rip_predicted_remaining, $compress_time, $compress_predicted_remaining ) = @$_; - $html .= - "\n"; - $html .= - "\n"; + $html .= "\n"; - $html .= - "\n"; + $html .= "\n"; } $html .= "
    Ripping in Progress
    Ripping in Progress
    CDDBIDArtistAlbum TitleCurrent ActivityRip StatusCompress StatusActions
    $cddbid$artist$album$current$rip_status\n"; + $html .= "
    $cddbid$artist$album$current$rip_status\n"; $html .= "
    Elapsed: " . &mp3Rip_format_time($rip_time); - $html .= "
    Remaining: " - . &mp3Rip_format_time($rip_predicted_remaining); + $html .= "
    Remaining: " . &mp3Rip_format_time($rip_predicted_remaining); $html .= &show_percent_bar($rip_percent); $html .= "
    $compress_status\n"; $html .= "
    Elapsed: " . &mp3Rip_format_time($compress_time); - $html .= "
    Remaining: " - . &mp3Rip_format_time($compress_predicted_remaining); + $html .= "
    Remaining: " . &mp3Rip_format_time($compress_predicted_remaining); $html .= &show_percent_bar($compress_percent); $html .= "
    View Log
    Abort
    View Log
    Abort
    \n"; } @@ -544,14 +477,11 @@ sub main_page { my @incomplete = &mp3Rip_get_incomplete(); if (@incomplete) { $html .= "

    \n"; - $html .= - "\n"; - $html .= - "\n"; + $html .= "\n"; + $html .= "\n"; foreach (@incomplete) { my ( $cddbid, $artist, $album, $status ) = @$_; - $html .= - "
    Incomplete CDs
    CDDBIDArtistAlbum TitleStatusActions
    Incomplete CDs
    CDDBIDArtistAlbum TitleStatusActions
    $cddbid$artist$album$status\n"; + $html .= "
    $cddbid$artist$album$status\n"; $html .= "View Log \n"; $html .= "Resume \n"; $html .= "Delete\n"; @@ -563,8 +493,7 @@ sub main_page { my @completed = &mp3Rip_get_recently_completed(); if (@completed) { $html .= "

    \n"; - $html .= - "\n"; + $html .= "\n"; foreach (@completed) { $html .= "\n"; } diff --git a/web/music/MP3_WebCtrl.pl b/web/music/MP3_WebCtrl.pl index 16730cae7..4a07a0e37 100644 --- a/web/music/MP3_WebCtrl.pl +++ b/web/music/MP3_WebCtrl.pl @@ -32,8 +32,7 @@ my $Song = &mp3_get_playlist_title(); $Song =~ tr/_/ /; # replace _ by " " to make it clear my $Volume = &mp3_get_volume(); -$Volume = ( int( ( $Volume + 2 ) / 5 ) * 5 ) - ; # volume by slice of 5, xmms doesn't change exactly +$Volume = ( int( ( $Volume + 2 ) / 5 ) * 5 ); # volume by slice of 5, xmms doesn't change exactly my $Pos = &mp3_get_playlist_pos(); my $SongTime = &mp3_get_output_timestr(); @@ -63,11 +62,7 @@ sub mp3_top { "; my $Value; - for $Value ( - 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, - 60, 65, 70, 75, 80, 85, 90, 95, 100 - ) - { + for $Value ( 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100 ) { if ( $Volume == $Value ) { $HTTP = $HTTP . "
    Recently Completed CDs
    Recently Completed CDs
    $_
    \n"; - $HTTP = $HTTP - . "\n"; + $HTTP = + $HTTP . "\n"; $HTTP = $HTTP . "\n"; - $HTTP = $HTTP - . "\n"; - $HTTP = $HTTP - . "\n"; + $HTTP = + $HTTP . "\n"; + $HTTP = $HTTP . "\n"; my ( $playlists, %playfiles ) = &mp3_playlists; for my $playlist ( sort keys %playfiles ) { @@ -145,8 +139,7 @@ sub PlaylistCtrl { my $HTTP = "\n"; $HTTP = $HTTP . "\n"; $HTTP = $HTTP . "\n"; - $HTTP = $HTTP - . "\n"; + $HTTP = $HTTP . "\n"; $HTTP = $HTTP . "\n"; return $HTTP; } diff --git a/web/music/MP3_WebPlaylist.pl b/web/music/MP3_WebPlaylist.pl index dbb3bddcf..b39b91c99 100644 --- a/web/music/MP3_WebPlaylist.pl +++ b/web/music/MP3_WebPlaylist.pl @@ -44,8 +44,8 @@ $DisplayName =~ tr/_/ /; $DisplayName =~ s/-/ - /g; $DisplayName =~ s/.m3u$//; - $HTTP = $HTTP - . "\n"; + $HTTP = + $HTTP . "\n"; } $HTTP = $HTTP . "
    Refresh
    Refresh
    Clear
    Shuffle
    Sort
    Shuffle
    Sort
    $DisplayName
    $DisplayName
    \n"; } @@ -63,8 +63,7 @@ sub DisplayPlaylist { my $titles = &mp3_get_playlist(); if ( @$titles == 0 ) { - $HTTP = $HTTP - . "

    There is no track in the playlist

    \n"; + $HTTP = $HTTP . "

    There is no track in the playlist

    \n"; } else { $HTTP = $HTTP . "\n"; @@ -72,8 +71,7 @@ sub DisplayPlaylist { foreach my $item (@$titles) { my $Time = &mp3_get_playlist_timestr( $pos - 1 ); - my $Str = - " "; + my $Str = " "; $Str = substr( "$pos. $item", 1 ); $HTTP = $HTTP . "\n"; @@ -88,8 +86,7 @@ sub Header { my $HTTP = "\n"; $HTTP = $HTTP . "\n"; $HTTP = $HTTP . "\n"; - $HTTP = $HTTP - . "\n"; + $HTTP = $HTTP . "\n"; $HTTP = $HTTP . "\n"; return $HTTP; } diff --git a/web/music/xmms/MP3_WebXmmsCtrl.pl b/web/music/xmms/MP3_WebXmmsCtrl.pl index beea793a0..d472046a4 100644 --- a/web/music/xmms/MP3_WebXmmsCtrl.pl +++ b/web/music/xmms/MP3_WebXmmsCtrl.pl @@ -36,8 +36,7 @@ my $Song = Xmms_Control("get_playlist_title"); $Song =~ tr/_/ /; # replace _ by " " to make it clear my $Volume = Xmms_Control("get_volume"); -$Volume = ( int( ( $Volume + 2 ) / 5 ) * 5 ) - ; # volume by slice of 5, xmms doesn't change exactly +$Volume = ( int( ( $Volume + 2 ) / 5 ) * 5 ); # volume by slice of 5, xmms doesn't change exactly my $Pos = Xmms_Control("get_playlist_pos"); my $SongTime = Xmms_Control("get_output_timestr"); @@ -67,11 +66,7 @@ sub mp3_top { "; my $Value; - for $Value ( - 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, - 60, 65, 70, 75, 80, 85, 90, 95, 100 - ) - { + for $Value ( 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100 ) { if ( $Volume == $Value ) { $HTTP = $HTTP . "\n"; $HTTP = $HTTP . "\n"; - $HTTP = $HTTP - . "\n"; + $HTTP = + $HTTP . "\n"; my $file; @@ -170,8 +165,7 @@ sub PlaylistCtrl { my $HTTP = Header(); $HTTP = $HTTP . "

    "; $HTTP = $HTTP . "I can't open $$PlaylistDir to fetch playlist."; - $HTTP = $HTTP - . "Please verify mh.ini for the correct directory namer, under mp3_playlist_dir."; + $HTTP = $HTTP . "Please verify mh.ini for the correct directory namer, under mp3_playlist_dir."; $HTTP = $HTTP . "

    "; $HTTP = $HTTP . Footer(); return $HTTP; @@ -181,8 +175,7 @@ sub PlaylistCtrl { my $HTTP = "\n"; $HTTP = $HTTP . "\n"; $HTTP = $HTTP . "\n"; - $HTTP = $HTTP - . "\n"; + $HTTP = $HTTP . "\n"; $HTTP = $HTTP . "\n"; return $HTTP; } diff --git a/web/music/xmms/MP3_WebXmmsPlaylist.pl b/web/music/xmms/MP3_WebXmmsPlaylist.pl index 568083917..5eb24ceca 100644 --- a/web/music/xmms/MP3_WebXmmsPlaylist.pl +++ b/web/music/xmms/MP3_WebXmmsPlaylist.pl @@ -62,8 +62,8 @@ $DisplayName =~ tr/_/ /; $DisplayName =~ s/-/ - /g; $DisplayName =~ s/.m3u$//; - $HTTP = $HTTP - . "\n"; + $HTTP = + $HTTP . "\n"; } } $HTTP = $HTTP . "
    $pos. $item .... $Time
    Clear
    Shuffle
    Sort
    Sort
    $DisplayName
    $DisplayName
    \n"; @@ -100,8 +100,7 @@ sub DisplayPlaylist { my $LIST = Xmms_Control("get_playlist_titles"); if ( @$LIST == 0 ) { - $HTTP = $HTTP - . "

    There is no track in the playlist

    \n"; + $HTTP = $HTTP . "

    There is no track in the playlist

    \n"; } else { $HTTP = $HTTP . "\n"; @@ -109,8 +108,7 @@ sub DisplayPlaylist { foreach $item (@$LIST) { my $Time = Xmms_Control( "get_playlist_timestr", $pos - 1 ); - my $Str = - " "; + my $Str = " "; $Str = substr( "$pos. $item", 1 ); $HTTP = $HTTP . "\n"; @@ -125,8 +123,7 @@ sub Header { my $HTTP = "\n"; $HTTP = $HTTP . "\n"; $HTTP = $HTTP . "\n"; - $HTTP = $HTTP - . "\n"; + $HTTP = $HTTP . "\n"; $HTTP = $HTTP . "\n"; return $HTTP; } diff --git a/web/organizer/calendar.pl b/web/organizer/calendar.pl index aed23a37d..49e605ae5 100644 --- a/web/organizer/calendar.pl +++ b/web/organizer/calendar.pl @@ -98,8 +98,7 @@ BEGIN # i give up! user is going to have to set it manually print "Content-type: text/html\n\n"; print "Installation path could not be determined.\n"; - print - "

    Please edit the script and set \$ENV{\"CWD\"} to the full path in which the script is installed."; + print "

    Please edit the script and set \$ENV{\"CWD\"} to the full path in which the script is installed."; exit 1; } } # / BEGIN @@ -279,8 +278,7 @@ BEGIN # _____________________________________________________________________________ sub PrintDefault { - print - "

    $pos. $item .... $Time
    \n"; + print "
    \n"; print "
    \n"; print "\n"; @@ -307,41 +305,27 @@ sub PrintDefault { # # display the navigation - print - "
    \n"; + print "
    \n"; print "\n"; print "<<\n"; - print - " <\n"; + print " <\n"; print "\n"; - print - " >\n"; - print - " >\n"; + print " >>\n"; @@ -392,32 +376,24 @@ sub PrintDay { my $thisDate = "$year.$month.$day"; # my @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); - 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' ); $objMyDb->RemoveFilter; $objMyDb->Filter( "DATE", "eq", $thisDate ); print "\n"; - print - "Details For $months[$month-1] $day, $year
    \n"; + print "Details For $months[$month-1] $day, $year
    \n"; print "\n"; - print - "\n"; - print - "\n"; + print "\n"; + print "\n"; if ( $objMyDb->EOF ) { - print - "\n"; + print "\n"; } while ( !$objMyDb->EOF ) { - unless ( $objMyDb->FieldValue("CONTROL") eq "on" ) - { #Don't display CONTROL calendars + unless ( $objMyDb->FieldValue("CONTROL") eq "on" ) { #Don't display CONTROL calendars my $custcolor = ""; $custcolor = " bgcolor='$dataHolidayColor' " if ( $objMyDb->FieldValue("HOLIDAY") eq "on" ); @@ -425,8 +401,7 @@ sub PrintDay { if ( $objMyDb->FieldValue("VACATION") eq "on" ); $custcolor = " bgcolor='$dataMultipleColor' " if ( ( $objMyDb->FieldValue("VACATION") eq "on" ) - and ( $objMyDb->FieldValue("HOLIDAY") eq "on" ) ) - ; # if a day is both vacation and holiday + and ( $objMyDb->FieldValue("HOLIDAY") eq "on" ) ); # if a day is both vacation and holiday my $icon = $detailIcon; my $source = $objMyDb->FieldValue("SOURCE"); $icon = "images/ical_1.jpg" if ( $source =~ /^ical=/ ); @@ -435,11 +410,8 @@ sub PrintDay { ""; - print ""; - print ""; + print ""; + print ""; print "\n"; foreach $temp (@days) { - print - ""; + print ""; } print "\n"; for ( my $cellCount = 1; $cellCount <= $numWeeks; $cellCount++ ) { print "\n"; foreach $temp (@days) { - if ( ( $dayCount > $firstDay - 1 ) && ( $weekDayCount < $numDays ) ) - { + if ( ( $dayCount > $firstDay - 1 ) && ( $weekDayCount < $numDays ) ) { $weekDayCount++; $thisDate = $year . "." . $month . "." . $weekDayCount; @@ -546,12 +510,10 @@ sub PrintMonth { } if ( defined $bgcolor ) { - print - "\n"; } else { - print - "\n"; + print "\n"; } $dayCount++; @@ -634,12 +594,7 @@ sub GetMonthInfo { ( localtime( Time::Local::timelocal( 0, 0, 0, 1, $month, $year ) ) )[6]; # numDays is one day prior to 1st of month after - $numDays = ( - localtime( - Time::Local::timelocal( 0, 0, 0, 1, $nmonth, $nyear ) - - 60 * 60 * 24 - ) - )[3]; + $numDays = ( localtime( Time::Local::timelocal( 0, 0, 0, 1, $nmonth, $nyear ) - 60 * 60 * 24 ) )[3]; # figure out the number of weeks the month spans across my $numWeeks = ( $numDays + $firstDow ) / 7; @@ -663,21 +618,17 @@ sub PrintCurrentRecord { foreach $fieldName ( $objMyDB->FieldNames ) { if ( $fieldName eq "ID" ) { - print "\n"; + print "\n"; } elsif ( $fieldName eq "DATE" ) { if ( $objMyDB->FieldValue("ID") ) { - print "\n"; + print "\n"; $date_entry = $objMyDB->FieldValue($fieldName); } } elsif ( $fieldName eq "DETAILS" ) { print "\n"; - print "\n"; + print "\n"; print "\n"; + print "\n"; print "\n"; } else { print "\n"; print "\n"; - print - "\n"; + print "\n"; print "\n"; } } @@ -427,8 +411,7 @@ sub PrintCurrentRecord { print "\n"; } print "\n"; - print - "\n"; + print "\n"; print "

    \n"; } @@ -459,19 +442,15 @@ sub FatalError { my ($strMessage) = shift || "Unknown Error"; print "Content-type: text/html\n\n" unless defined($HEADER_PRINTED); print "

    \n"; - print - "A fatal error occured. The script cannot continue. Details are below:"; + print "A fatal error occured. The script cannot continue. Details are below:"; print "

    " . $strMessage . ""; print "

    The most common causes of fatal errors are:\n"; print "

      \n"; - print - "
    1. One of the script files was uploaded via FTP in Binary mode instead of ASCII\n"; - print - "
    2. The file permissions for the data directory and all .tab and .cfg files is not readable/writable\n"; + print "
    3. One of the script files was uploaded via FTP in Binary mode instead of ASCII\n"; + print "
    4. The file permissions for the data directory and all .tab and .cfg files is not readable/writable\n"; print "
    \n"; print "

    If you have already tried these, you may want to visit the "; - print - "VerySimple Support Forum \n"; + print "VerySimple Support Forum \n"; print "to see if there is a solution available.\n"; print "\n"; exit 1; diff --git a/web/organizer/tasks.pl b/web/organizer/tasks.pl index de8a8344d..84b3483d3 100644 --- a/web/organizer/tasks.pl +++ b/web/organizer/tasks.pl @@ -90,8 +90,7 @@ BEGIN # i give up! user is going to have to set it manually print "Content-type: text/html\n\n"; print "Installation path could not be determined.\n"; - print - "

    Please edit the script and set \$ENV{\"CWD\"} to the full path in which the script is installed."; + print "

    Please edit the script and set \$ENV{\"CWD\"} to the full path in which the script is installed."; exit 1; } } # / BEGIN @@ -260,12 +259,10 @@ sub PrintAllRecords { #$activePage = $objMyDB->ActivePage; # (in case we specified one out of range) my ($pageCount) = $objMyDB->PageCount; - print - "

     TimeEvent
    TimeEvent
    No Events
    No Events
    " . $link - . "" - . $objMyDb->FieldValue("TIME") - . " 
    " . $link . "" . $objMyDb->FieldValue("TIME") . " " . $link . "" @@ -464,11 +436,8 @@ sub PrintMonth { my ( $firstDay, $numDays, $numWeeks ) = &GetMonthInfo( $month, $year ); my @days = ( 'Su', 'M', 'Tu', 'W', 'Th', 'F', 'Sa' ); - 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 $temp; my $dayCount = 0; my $weekDayCount = 0; @@ -483,17 +452,14 @@ sub PrintMonth { my $highlightDate = shift || $today; print "

    \n"; - print - "$months[$month-1] $year\n"; + print "$months[$month-1] $year\n"; if ($showDayDetails) { - print - " [[Hide Details]\n"; } else { - print - " [[Show Details]\n"; } @@ -502,16 +468,14 @@ sub PrintMonth { # print the days of the week print "

    $temp$temp
    "; + print ""; } else { - print - ""; + print ""; } if ( $thisDate eq $today ) { @@ -584,8 +546,7 @@ sub PrintMonth { . $ia7_suffix . "'>" . $objMyDb->FieldValue("EVENT") . "
    " - unless ( $objMyDb->FieldValue("CONTROL") eq "on" ) - ; #Don't display CONTROL calendars; + unless ( $objMyDb->FieldValue("CONTROL") eq "on" ); #Don't display CONTROL calendars; $objMyDb->MoveNext; } print "
    "; @@ -596,8 +557,7 @@ sub PrintMonth { print "
      
    " - . $fieldName - . "" . $fieldName . "
    $fieldName
    \n"; if ( $fieldName eq "Complete" ) { - print "\n"; + print "\n"; print ""; } elsif ( $fieldName eq "Notes" ) { - print "\n"; - print - "\n"; + print "\n"; + print "\n"; } elsif ( $fieldName eq "SPEAK" ) { - print "\n"; - print - "\n"; + print "\n"; } elsif ( $fieldName eq "SOURCE" ) { #do nothing } else { - print "\n"; - print "\n"; + print "\n"; + print "\n"; } print "\n"; } @@ -541,8 +490,7 @@ sub PrintBlankRecord { print "\n"; print "\n"; - print - "\n"; + print "\n"; print "

    \n"; } @@ -589,19 +537,15 @@ sub FatalError { my ($strMessage) = shift || "Unknown Error"; print "Content-type: text/html\n\n" unless defined($HEADER_PRINTED); print "

    \n"; - print - "A fatal error occured. The script cannot continue. Details are below:"; + print "A fatal error occured. The script cannot continue. Details are below:"; print "

    " . $strMessage . ""; print "

    The most common causes of fatal errors are:\n"; print "

      \n"; - print - "
    1. One of the script files was uploaded via FTP in Binary mode instead of ASCII\n"; - print - "
    2. The file permissions for the data directory and all .tab and .cfg files is not readable/writable\n"; + print "
    3. One of the script files was uploaded via FTP in Binary mode instead of ASCII\n"; + print "
    4. The file permissions for the data directory and all .tab and .cfg files is not readable/writable\n"; print "
    \n"; print "

    If you have already tried these, you may want to visit the "; - print - "VerySimple Support Forum \n"; + print "VerySimple Support Forum \n"; print "to see if there is a solution available.\n"; print "\n"; exit 1; diff --git a/web/test/test1.pl b/web/test/test1.pl index 0dc99dc4d..4a36e17b4 100644 --- a/web/test/test1.pl +++ b/web/test/test1.pl @@ -12,13 +12,9 @@ print "Returning Time: $Time_Now\n"; $data .= "Time: $Time_Now\n"; -$data .= - "Current Temperature: Indoor $weather{TempIndoor} degrees Outdoor$weather{TempOutdoor} degrees"; -$data .= - "

    "; -$data .= - "

    "; -$data .= - "

    "; +$data .= "Current Temperature: Indoor $weather{TempIndoor} degrees Outdoor$weather{TempOutdoor} degrees"; +$data .= "

    "; +$data .= "

    "; +$data .= "

    "; return $data;

    \n"; + print "\n"; print "\n"; foreach $fieldName (@showFields) { - print - "\n"; @@ -315,11 +310,7 @@ sub PrintAllRecords { . $objMyDB->FieldValue("ID") . "&" . $ia7_suffix . "'>"; $link_close = ""; - print "\n"; + print "\n"; foreach $fieldName (@showFields) { $fieldValue = $objMyDB->FieldValue($fieldName); @@ -327,22 +318,10 @@ sub PrintAllRecords { if ( $fieldName eq "SpecialField" ) { # not used at the moment, but maybe later... - print "\n"; + print "\n"; } elsif ( lc $fieldName eq "SPEAK" ) { - print "\n"; + print "\n"; } elsif ( $fieldName eq "SOURCE" ) { } @@ -353,13 +332,7 @@ sub PrintAllRecords { $link_open = ""; $link_close = ""; } - print "\n"; + print "\n"; } } print "\n"; @@ -397,14 +370,11 @@ sub PrintCurrentRecord { print "
    \n"; #if ($m_blnIsSysAdmin) { - print - "\n"; @@ -276,8 +273,7 @@ sub PrintAllRecords { #} if ($showCompleted) { - print - " \n"; } @@ -293,8 +289,7 @@ sub PrintAllRecords { print "
     " . $fieldName . "" - . $link_open - . "Details" - . $link_close - . "" . $link_open . "Details" . $link_close . "" - . $link_open - . "" - . $fieldValue - . "" - . $link_close - . "" . $link_open . "" . $fieldValue . "" . $link_close . "" - . $link_open - . "" - . $fieldValue - . "" - . $link_close - . "" . $link_open . "" . $fieldValue . "" . $link_close . "" - . $link_open - . "" - . $fieldValue - . "" - . $link_close - . "" . $link_open . "" . $fieldValue . "" . $link_close . "
    \n"; foreach $fieldName ( $objMyDB->FieldNames ) { if ( $fieldName eq "ID" ) { - print "\n"; + print "\n"; } else { print "\n"; - print "\n" + print "\n" if ( $fieldName ne "SOURCE" ); if ( $fieldName eq "Complete" ) { my ($yes) = ""; @@ -413,10 +383,8 @@ sub PrintCurrentRecord { if ( $objMyDB->FieldValue("Complete") eq "Yes" ); $no = "checked" if ( $objMyDB->FieldValue("Complete") eq "No" ); print ""; } elsif ( $fieldName eq "Notes" ) { @@ -427,8 +395,7 @@ sub PrintCurrentRecord { } elsif ( $fieldName eq "SPEAK" ) { $fieldValue = $objMyDB->FieldValue($fieldName); - print - "\n"; @@ -469,16 +434,14 @@ sub PrintCurrentRecord { "\n"; - print - "\n"; + print "\n"; print "

    \n"; } else { $source =~ /^ical=(\S*)\ssync=(.*)/; my $icalname = $1; my $icalsync = $2; - print - "

    " - . $fieldName - . "" . $fieldName . ""; - print - "Yes\n"; - print - "No\n"; + print "Yes\n"; + print "No\n"; print " "; } @@ -444,9 +411,7 @@ sub PrintCurrentRecord { } else { - print "FieldValue($fieldName); $fieldValue =~ s/\"/"/g; print $fieldValue . "\">
    iCal2vsdb (ical $icalname) $icalsync\n"; + print "
    iCal2vsdb (ical $icalname) $icalsync\n"; print "
    \n"; } } @@ -492,40 +455,26 @@ sub PrintBlankRecord { if ( $fieldName ne "ID" ) { print "
    " - . $fieldName - . "" . $fieldName . ""; - print - "Yes\n"; - print - "No\n"; + print "Yes\n"; + print "No\n"; print "" - . $fieldName - . "" . $fieldName . "" - . $fieldName - . ""; + print "" . $fieldName . ""; print "
    " - . $fieldName - . "" . $fieldName . "