]> bicyclesonthemoon.info Git - ott/bsta/commitdiff
Continue viewer rework.
authorb <rowerynaksiezycu@gmail.com>
Tue, 26 Sep 2023 22:17:31 +0000 (22:17 +0000)
committerb <rowerynaksiezycu@gmail.com>
Tue, 26 Sep 2023 22:17:31 +0000 (22:17 +0000)
bsta_lib.1.pm
makefile
makefile.1.mak
viewer.1.pl

index a6b53bc4d6ab5ce11476575fe40a33dde5706066..aed142b2d4872e638df8320591bc87c0eab328f0 100644 (file)
@@ -26,6 +26,33 @@ use utf8;
 use Exporter;
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
+###PERL_EXPORT_VERSION: our $VERSION = 'x.x.x';
+our @ISA         = qw(Exporter);
+our @EXPORT      = ();
+our @EXPORT_OK   = (
+       'STATE',
+       'entityencode', # TO REMOVE
+       'failpage', 'fail_method', 'fail_content_type',
+       'gethttpheader', 'getcgi', # TO REMOVE
+       'urldecode', # TO REMOVE
+       'readdatafile', 'writedatafile', 'printdatafile',
+       'printdatafileht', # TO REMOVE ???
+       'urlencode', # TO REMOVE
+       'linehtml',
+       'bb2ht', 'bb2bb'
+);
+
+###PERL_LIB: use lib /botm/lib/bsta
+use botm_common (
+       'html_entity_encode_dec'
+);
+
+###PERL_CGI_GOTO_PATH:      CGI_GOTO_PATH      = /bsta/g
+###PERL_CGI_LOGO_PATH:      CGI_LOGO_PATH      = /bsta/botmlogo.png
+
+###PERL_WEBSITE:            WEBSITE            = 1190.bicyclesonthemoon.info
+
+
 # TO REMOVE
 use constant entitycode => {
        'amp' => '&',
@@ -351,26 +378,24 @@ use constant tagsht => {
        '/?'     => '[/unknown!]',
 };
 
-###PERL_EXPORT_VERSION: our $VERSION = 'x.x.x';
-our @ISA         = qw(Exporter);
-our @EXPORT      = ();
-our @EXPORT_OK   = (
-       'STATE',
-       'entityencode' # TO REMOVE
-       'failpage', 'fail_method', 'fail_content_type',
-       'gethttpheader', 'getcgi', # TO REMOVE
-       'urldecode', # TO REMOVE
-       'readdatafile', 'writedatafile', 'printdatafile',
-       'printdatafileht', # TO REMOVE ???
-       'urlencode', # TO REMOVE
-       'linehtml',
-       'bb2ht', 'bb2bb'
-);
-
-###PERL_LIB: use lib /botm/lib/bsta
-use botm_common (
-       'html_entity_encode_dec'
-);
+use constant HTML_START =>
+       '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">'."\n".
+       '<html lang="en">'."\n";
+use constant HTML_END =>
+       '</html>'."\n";
+use constant HTML_HEAD_START =>
+       '<head>'."\n".
+       '<meta http-equiv="Content-type" content="text/html; charset=UTF-8">'."\n";
+use constant HTML_HEAD_END =>
+       '</head>'."\n";
+use constant HTML_BODY_START =>
+       '<body>'."\n".
+       '<a href="/"><img id="botmlogo" src="'.html_entity_encode_dec(CGI_LOGO_PATH).'" alt="'.html_entity_encode_dec(WEBSITE).'"></a>'."\n".
+       '<div id="all">'."\n";
+use constant HTML_BODY_END =>
+       '</div>'."\n".
+       '<a href="/" class="cz">'.html_entity_encode_dec(WEBSITE).'</a>'."\n".
+       '</body></html>'."\n";
 
 
 # Function to return an error page
@@ -419,7 +444,7 @@ sub fail_method {
 
 sub fail_content_type
 {
-       (my $content_type, $method) = @_
+       (my $content_type, my $method) = @_;
        
        return failpage(
                "Status: 415 Unsupported Media Type\n",
index 5a25a9e8fd42200f9d7cd97d60f5e7afcc188c62..d34a91e2c327cb8b30dd40fc36aa4ce304e1dea4 100644 (file)
--- a/makefile
+++ b/makefile
@@ -135,6 +135,7 @@ $(EXEC)\
 $(PERL_WRAP_EXEC)
 
 LIB=\
+botm-common/botm_common.pm\
 bsta_lib.pm
 
 WWW=\
index 5884acc5c3c9fa87549704aaad475a36ce0b8e11..ead7f8447b3908b3a251fe899ced0dfabde4137e 100644 (file)
@@ -135,7 +135,7 @@ $(EXEC)\
 $(PERL_WRAP_EXEC)
 
 LIB=\
-botm_common/botm_common.pm
+botm-common/botm_common.pm\
 bsta_lib.pm
 
 WWW=\
index 527bab87e2213068f1b3d002c5890da5dcf795ae..f0ad73bb2fedb11fea301ef970704ba19923fd46 100644 (file)
@@ -27,16 +27,20 @@ use Encode ('encode', 'decode');
 
 ###PERL_LIB: use lib /botm/lib/bsta
 use botm_common (
-       'read-header_env',
-       'read_data_file', 'write_data_file'
+       'read_header_env',
+       'read_data_file', 'write_data_file',
+       'url_query_decode',
+       'join_path'
 );
 use bsta_lib (
        'STATE',
        'fail_method', 'fail_content_type',
        'entityencode',
-       'printdatafileht'
+       'printdatafileht',
        'urlencode',
-       'bb2ht', 'bb2bb', 'linehtml'
+       'bb2ht', 'bb2bb', 'linehtml',
+       
+       'readdatafile', 'writedatafile'
 );
 use File::Copy;
 
@@ -144,7 +148,7 @@ elsif ($ENV{'PATH_INFO'} =~ /^\/(.+)$/) {
 else {
        $frame = 0;
 }
-$frame_data_path = join_path('/', DATA_PATH, $frame);
+$framedata_path = join_path('/', DATA_PATH, $frame);
 
 if ($cgi{'p'} =~ /^(.+)$/) {
        $password = $1;
@@ -156,7 +160,7 @@ else {
 
 %settings = read_data_file(DATA_SETTINGS_PATH);
 %default  = read_data_file(DATA_DEFAULT_PATH);
-%framedata= read_data_file($frame_data_path);
+%framedata= read_data_file($framedata_path);
 if ($password eq $settings{'password'}) {
        $passwordOK = 1;
 }
@@ -171,8 +175,8 @@ if (open ($statefile, "+<:encoding(UTF-8)", DATA_STATE_PATH)) {
                
                if ($frame < 0) {
                        $frame = int($state{'last'}) + $frame +1;
-                       $frame_data_path = join_path('/', DATA_PATH, $frame);
-                       %framedata = read_data_file($frame_data_path);
+                       $framedata_path = join_path('/', DATA_PATH, $frame);
+                       %framedata = read_data_file($framedata_path);
                }
                
                if (