]> bicyclesonthemoon.info Git - ott/bsta/commitdiff
hyperlinks to static previous/next page
authorb <rowerynaksiezycu@gmail.com>
Sat, 27 Jan 2024 10:24:25 +0000 (10:24 +0000)
committerb <rowerynaksiezycu@gmail.com>
Sat, 27 Jan 2024 10:24:25 +0000 (10:24 +0000)
bsta_lib.1.pm

index a6d4b39c13def32b593e8c8c09f4ff801fa6c081..5629795940285ae6dbbd9d6241e7d1a935a04b96 100644 (file)
@@ -61,7 +61,7 @@ use botm_common (
        'read_header_env',
        'read_data_file', 'write_data_file',
        'join_path',
-       'copy_encoded', 'open_encoded',
+       'copy_encoded', 'open_encoded', '_x_encoded',
        'http_header_line', 'http_status',
        'http_header_status', 'http_header_allow', 'http_header_location'
 );
@@ -1020,6 +1020,51 @@ sub print_viewer_page {
                {'path' => CGI_VIEWER_PATH()},
                {'path' => ($static ? -1 : $last_frame)}
        );
+       unless ($password_ok) {
+               my $page_file;
+               $viewer_0_url = $base_url;
+               if ($prev_frame == 0) {
+                       $viewer_prev_url = $viewer_0_url;
+               }
+               else {
+                       if ($prev_frame_data->{'page'} ne '') {
+                               $page_file = $prev_frame_data->{'page'};
+                       }
+                       else {
+                               $page_file = sprintf(
+                                       $settings->{'frame'},
+                                       $prev_frame, 'htm'
+                               );
+                       }
+                       if (_x_encoded('-f',
+                               join_path(PATH_SEPARATOR(), WWW_PATH() , $page_file)
+                       )) {
+                               $viewer_prev_url = merge_url(
+                                       {'path' => $base_url},
+                                       {'path' => $page_file}
+                               );
+                       }
+               }
+               if ($next_frame < $last_frame) {
+                       if ($next_frame_data->{'page'} ne '') {
+                               $page_file = $next_frame_data->{'page'};
+                       }
+                       else {
+                               $page_file = sprintf(
+                                       $settings->{'frame'},
+                                       $next_frame, 'htm'
+                               );
+                       }
+                       if (_x_encoded('-f',
+                               join_path(PATH_SEPARATOR(), WWW_PATH() , $page_file)
+                       )) {
+                               $viewer_next_url = merge_url(
+                                       {'path' => $base_url},
+                                       {'path' => $page_file}
+                               );
+                       }
+               }
+       }
        my $bbcode_url = ($text_mode == TEXT_MODE->{'bb'}) ?
                merge_url(
                        {'path' => CGI_BBCODE_PATH()},