]> bicyclesonthemoon.info Git - botm/oldlogs/commitdiff
more viewer bugfix after further test
authorb <rowerynaksiezycu@gmail.com>
Sat, 14 Oct 2023 17:29:34 +0000 (17:29 +0000)
committerb <rowerynaksiezycu@gmail.com>
Sat, 14 Oct 2023 17:29:34 +0000 (17:29 +0000)
bsta_lib.1.pm

index aebd62aa44426e78ee48e52c96edd4d0fe59b40c..95f54a6253ae7a9ef6e39ef58f5ba9fcb0de3ed5 100644 (file)
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# TODO: FQ NBSP ?
+
 package bsta_lib;
 
 use strict;
 #use warnings
 
 use utf8;
+use Encode ('encode', 'decode');
 use Exporter;
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
@@ -54,7 +57,8 @@ use botm_common (
        'html_entity_encode_dec',
        'merge_url',
        'read_header_env',
-       'read_data_file', 'write_data_file'
+       'read_data_file', 'write_data_file',
+       'join_path'
 );
 
 ###PERL_PATH_SEPARATOR:     PATH_SEPARATOR     = /
@@ -69,6 +73,11 @@ use botm_common (
 ###PERL_CGI_TIMER_PATH:     CGI_TIMER_PATH     = /bsta/timer.js
 ###PERL_CGI_VIEWER_PATH:    CGI_VIEWER_PATH    = /bsta/v
 
+###PERL_DATA_PATH:          DATA_PATH          = /botm/data/bsta/
+###PERL_DATA_DEFAULT_PATH:  DATA_DEFAULT_PATH  = /botm/data/bsta/default
+
+###PERL_WWW_INDEX_PATH:     WWW_INDEX_PATH     = /botm/www/1190/bsta/index.htm
+
 ###PERL_SCHEME:             SCHEME             = http
 ###PERL_WEBSITE:            WEBSITE            = 1190.bicyclesonthemoon.info
 ###PERL_FAVICON_PATH:       FAVICON_PATH       = /img/favicon.png
@@ -816,8 +825,10 @@ sub print_viewer_page {
        # my $prev_frame = $frame - 1;
        my $next_frame = $frame + 1;
        
-       my $title   =      $frame_data->{'title'};
-       my $command = $next_frame_data->{'title'};
+       my $title = $frame_data->{'title'};
+       my $command = ($frame_data->{'command'} ne '') ?
+               $frame_data->{'command'} :
+               $next_frame_data->{'title'};
        
        my $access      = $context->{'access'};
        my $password_ok = $context->{'password_ok'};
@@ -871,6 +882,7 @@ sub print_viewer_page {
        );
        my $show_command = (
                $password_ok ||
+               (!$access) ||
                ($frame < $last_frame) || (
                        ($ong_state >= STATE->{'ready'}) &&
                        $context->{'show_command'}
@@ -991,10 +1003,10 @@ sub print_viewer_page {
                $viewer_next_url = merge_url($viewer_next_url, {'query' => $password_query, 'append_query' => 1});
                $viewer_last_url = merge_url($viewer_last_url, {'query' => $password_query, 'append_query' => 1});
                if ($frame_indirect) {
-                       $frame_url = merge_url($frame_url     , {'query' => $password_query, 'append_query' => 1});
+                       $frame_url     = merge_url($frame_url      , {'query' => $password_query, 'append_query' => 1});
                }
                if ($nextframe_indirect) {
-                       $frame_url = merge_url($frame_next_url, {'query' => $password_query, 'append_query' => 1});
+                       $frame_next_url= merge_url($frame_next_url , {'query' => $password_query, 'append_query' => 1});
                }
        }
        my $_base_url        = html_entity_encode_dec($base_url       , 1);
@@ -1102,7 +1114,7 @@ sub print_viewer_page {
                print $fh ':<span id="ongm" class="'.$timer_color_m.'">'.$timer_m.'</span>';
                print $fh ':<span id="ongs" class="'.$timer_color_s.'">'.$timer_s.'</span>]<br>'."\n";
        }
-       print '&gt;';
+       print $fh '&gt;';
        if ($show_command_link) {
                print $fh '<a href="'.($access ? $_viewer_next_url : $_viewer_last_url).'">';
        }