From 8df1918a8559ccd90adba7a345a39b580ced5ea1 Mon Sep 17 00:00:00 2001 From: b Date: Sat, 27 Jan 2024 10:24:25 +0000 Subject: [PATCH] hyperlinks to static previous/next page --- bsta_lib.1.pm | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/bsta_lib.1.pm b/bsta_lib.1.pm index a6d4b39..5629795 100644 --- a/bsta_lib.1.pm +++ b/bsta_lib.1.pm @@ -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()}, -- 2.30.2