]> bicyclesonthemoon.info Git - ott/bsta/commitdiff
bugfix new viewer
authorb <rowerynaksiezycu@gmail.com>
Sun, 8 Oct 2023 22:49:46 +0000 (22:49 +0000)
committerb <rowerynaksiezycu@gmail.com>
Sun, 8 Oct 2023 22:49:46 +0000 (22:49 +0000)
bsta_lib.1.pm
settings.txt
viewer.1.pl

index 4d5450cb040b47c6cf3d110cc66bbc38c20161e6..42c700ed8baef8e9d5cd73b0c645122ff32b4dae 100644 (file)
@@ -57,6 +57,8 @@ use botm_common (
        'read_data_file', 'write_data_file'
 );
 
+###PERL_PATH_SEPARATOR:     PATH_SEPARATOR     = /
+
 ###PERL_CGI_PATH:           CGI_PATH           = /bsta/
 ###PERL_CGI_BBCODE_PATH:    CGI_BBCODE_PATH    = /bsta/b
 ###PERL_CGI_CSS_PATH:       CGI_CSS_PATH       = /bsta/bsta.css
@@ -222,7 +224,7 @@ sub get_remote_addr {
 sub get_frame {
        (my $cgi) = @_;
        
-       if ($cgi{'f'} =~ /^.+$/) {
+       if ($cgi->{'f'} =~ /^.+$/) {
                return int($&);
        }
        elsif ($ENV{'PATH_INFO'} =~ /^\/(.+)$/) {
@@ -237,7 +239,7 @@ sub get_frame {
 sub get_password {
        (my $cgi) = @_;
        
-       if ($cgi{'p'} =~ /^.+$/) {
+       if ($cgi->{'p'} =~ /^.+$/) {
                return $&;
        }
        else {
@@ -434,7 +436,7 @@ sub bbtree {
                                                # $new_ind = $ind.'.'.$bbtree{$ind.'.count'};
                                        }
                                        else {
-                                               $debug .= debug($printdebug, "[$new_$ind]tag: $tag\n");
+                                               $debug .= debug($printdebug, "[$new_ind]tag: $tag\n");
                                                $bbtree{$new_ind.'.type'  } = 'tag';
                                                $bbtree{$new_ind.'.name'  } = '/'.$tag_name;
                                                $bbtree{$new_ind.'.value' } = $tag_value;
@@ -476,7 +478,7 @@ sub bbtree {
                        $bb = '';
                }
        }
-       my $final_ind = '_.'.$bbtree{"_.count"}
+       my $final_ind = '_.'.$bbtree{"_.count"};
        $debug .= debug($printdebug, "[$final_ind]automatic tag: [/ht]\n -->\n");
        $bbtree{$final_ind.'.type' } = "tag";
        $bbtree{$final_ind.'.name' } = '/ht';
@@ -512,7 +514,7 @@ sub convtree {
                $debug .= debug($printdebug, "[$level:$ind:".int($bbtree->{$ind.'.count'})."]");
                #normal text
                if ($bbtree->{$ind.'.type'} eq 'text') {
-                       my $text = $bbtree->{$ind.'.value'}
+                       my $text = $bbtree->{$ind.'.value'};
                        $debug .= debug($printdebug, "text: ".$text);
                        $out .= $escape ? html_encode_line($text) : $text;
                        
@@ -541,7 +543,7 @@ sub convtree {
                                $level -= 1;
                                $debug .= debug($printdebug, "[<]");
                                if ($level >= 0) {
-                                       $goto-next = 'nd';
+                                       $goto_next = 'nd';
                                }
                                else {
                                        # time to end this
@@ -558,7 +560,7 @@ sub convtree {
                                                if (exists($tags->{$name.'='.$value})) {
                                                        $out .=
                                                                $tags->{$name.'='} .
-                                                               $tags->{$name.'='.$value'} .
+                                                               $tags->{$name.'='.$value} .
                                                                $tags->{$name.'/='};
                                                }
                                                else {
@@ -640,7 +642,7 @@ sub bb_to_html {
        my $debug;
        
        ($debug, %bbtree) = bbtree($bb, $printdebug);
-       ($debug, $ht) = convtree ($printdebug, $debug, 'html', %bbtree);
+       ($debug, $ht) = convtree ($printdebug, $debug, 'html', \%bbtree);
        
        return $ht;
 }
@@ -760,6 +762,7 @@ sub print_html_end {
 }
 
 sub print_html_head_start {
+       (my $fh) = @_;
        print $fh '<head>'."\n";
        print $fh '<meta http-equiv="Content-type" content="text/html; charset=UTF-8">'."\n";
        print $fh '<link rel="icon" type="image/png" href="'.html_entity_encode_dec(FAVICON_PATH(),1).'">'."\n";
@@ -822,7 +825,7 @@ sub print_viewer_page {
        
        my $text_mode      = int($context->{'text_mode'});
        my $timer_unlocked = int($context->{'timer_unlocked'});
-       my $timer          = int($context->{'timer'};
+       my $timer          = int($context->{'timer'});
        
        my $last_frame = int($state->{'last'});
        my $ong_state  = int($state->{'state'});
@@ -851,25 +854,25 @@ sub print_viewer_page {
                $timer_s = 'EE';
        }
        
-       my $prev_available = (($frame > 0) && $access');
-       my $next_available = ($password_ok' || ($next_frame <= $last_frame));
+       my $prev_available = (($frame > 0) && $access);
+       my $next_available = ($password_ok || ($next_frame <= $last_frame));
        my $prefetch_next  = (
                $password_ok ||
-               ($next_frame < $tast_frame) || (
+               ($next_frame < $last_frame) || (
                        ($next_frame <= $last_frame) &&
                        ($ong_state >= STATE->{'ready'})
                )
        );
        my $show_timer = (
-               ($frame == $last_frame)) && (
+               ($frame == $last_frame) && (
                        ($ong_state == STATE->{'waiting'}) ||
                        ($ong_state == STATE->{'ready'})
                )
        );
        my $show_command = (
-               $password_ok' ||
-               ($frame' < $last_frame) || (
-                       ($ong_state) >= STATE->{'ready'}) &&
+               $password_ok ||
+               ($frame < $last_frame) || (
+                       ($ong_state >= STATE->{'ready'}) &&
                        $context->{'show_command'}
                )
        );
@@ -919,7 +922,7 @@ sub print_viewer_page {
                $bbcode_url = merge_url(
                        $viewer_url,
                        {'query'=>{
-                               'b' = TEXT_MODE->{'bb'}
+                               'b' => TEXT_MODE->{'bb'}
                        }}
                );
        }
@@ -927,7 +930,7 @@ sub print_viewer_page {
                $info_url = merge_url(
                        $viewer_url,
                        {'query'=>{
-                               'b' = TEXT_MODE->{'info'}
+                               'b' => TEXT_MODE->{'info'}
                        }}
                );
        }
@@ -962,7 +965,7 @@ sub print_viewer_page {
        if ($nextframe_indirect) {
                $frame_next_url = merge_url(
                        {'path' => CGI_FRAME_PATH()},
-                       {'path' => $nextframe}
+                       {'path' => $next_frame}
                );
        }
        elsif ($next_frame_data->{'frame'} ne '') {
@@ -1099,7 +1102,7 @@ sub print_viewer_page {
        }
        print '&gt';
        if ($show_command_link) {
-               print $fh '<a href="'.($access : $_viewer_next_url : $_viewer_last_url).'">';
+               print $fh '<a href="'.($access ? $_viewer_next_url : $_viewer_last_url).'">';
        }
        if ($show_command) {
                print $fh $_command;
@@ -1114,7 +1117,7 @@ sub print_viewer_page {
        
        print $fh '<div id="underlinks">'."\n";
        
-       unless (($frame == 0) && $Static) {
+       unless (($frame == 0) && $static) {
                print $fh '<a href="'.$_base_url.'">Once again</a> | ';
        }
        if ($prev_available) {
@@ -1128,8 +1131,8 @@ sub print_viewer_page {
        if ($text_mode != TEXT_MODE->{'normal'}) {
                print $fh '<a href="'.$_viewer_url.'">Without</a> | ';
        }
-       print $fh '<a href="'.$_info_path.'">Info</a> | ';
-       print $fh '<a href="'.$_bbcode_path.'">BB</a>';
+       print $fh '<a href="'.$_info_url.'">Info</a> | ';
+       print $fh '<a href="'.$_bbcode_url.'">BB</a>';
        print $fh "\n</span>\n";
        
        print $fh "</div>\n</div>\n";
@@ -1156,7 +1159,7 @@ sub write_index {
                my $settings
        ) = @_;
        
-       if ($mode eq viewer) {
+       if ($mode eq 'viewer') {
                my %frame_data     = read_data_file(join_path(PATH_SEPARATOR(), DATA_PATH(), 0));
                my %next_frame_data= read_data_file(join_path(PATH_SEPARATOR(), DATA_PATH(), 1));
                my %default        = read_data_file(DATA_DEFAULT_PATH());
index 59fa4b7a789b21298e453ee2c81a5d3d62497d7b..a346d99f6327ae2faef78f418d3895c5bf960995 100644 (file)
@@ -140,7 +140,7 @@ PERL_SET_PATH = \$ENV{'PATH'} = @_PERL_STR($path);
 
 PERL_EXPORT_VERSION    = @_PERL_OUR_STR( VERSION, $_version)
 
-PERL_PATH_SEPARATOR = = @_PERL_CONSTANT_STR( PATH_SEPARATOR, $_PATH_SEPARATOR)
+PERL_PATH_SEPARATOR     = @_PERL_CONSTANT_STR( PATH_SEPARATOR, $_PATH_SEPARATOR)
 
 PERL_CGI_PATH           = @_PERL_CONSTANT_STR( CGI_PATH       , $_cgi_path       )
 PERL_CGI_2WORDS_PATH    = @_PERL_CONSTANT_STR( CGI_2WORDS_PATH, $_cgi_2words_path)
index 3c59102ff9acff9edbca8767dfb71c52597a285c..91d5d5c8faedf7de1568c28254a22cfb9af38475 100644 (file)
@@ -33,7 +33,7 @@ use botm_common (
        'join_path'
 );
 use bsta_lib (
-       'STATE', 'TEXT_MODE'
+       'STATE', 'TEXT_MODE',
        'fail_method', 'fail_content_type',
        'get_remote_addr', 'get_frame', 'get_password',
        'merge_settings',
@@ -122,7 +122,7 @@ if ($frame >= 0) {
        %frame_data= read_data_file($frame_data_path);
 }
 
-$password_ok = ($password eq $settings{'password'}) {
+$password_ok = ($password eq $settings{'password'});
 
 # state & activation logic
 if (open ($state_file, "+<:encoding(UTF-8)", DATA_STATE_PATH())) {
@@ -209,7 +209,7 @@ if (open ($state_file, "+<:encoding(UTF-8)", DATA_STATE_PATH())) {
                                $goto_list{'title-1'}   = $frame_data{'title'};
                                $goto_list{'ongtime-1'} = $frame_data{'ongtime'};
                                
-                               if (copy ($inpath, $outpath)) {
+                               if (copy ($in_path, $out_path)) {
                                        write_index('viewer', \%state, \%settings);
                                        write_data_file($state_file,     '','', \%state);
                                        write_data_file(DATA_LIST_PATH(),'','', \%goto_list);