From: b Date: Sat, 27 Jan 2024 10:24:25 +0000 (+0000) Subject: hyperlinks to static previous/next page X-Git-Tag: v1.2.4~2 X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=8df1918a8559ccd90adba7a345a39b580ced5ea1;p=ott%2Fbsta hyperlinks to static previous/next page --- 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()},