]> bicyclesonthemoon.info Git - ott/bsta/commitdiff
add source & license & author information; fix fake index html bug
authorb <rowerynaksiezycu@gmail.com>
Tue, 2 Jan 2024 18:44:08 +0000 (18:44 +0000)
committerb <rowerynaksiezycu@gmail.com>
Tue, 2 Jan 2024 18:44:08 +0000 (18:44 +0000)
2words.1.pl
bsta_lib.1.pm
chat.1.pl
settings-again.txt
settings-bsta.txt
settings-debug.txt
settings-tbst.txt
settings.txt

index e679c62adad649deb78295ff68629b04720cd731..24d41e50da2015e3493fcb698a17126b4085ff56 100644 (file)
@@ -624,5 +624,5 @@ print '    </div>'."\n";
 
 print '   </div>'."\n";
 
-print_html_body_end(\*STDOUT);
+print_html_body_end(\*STDOUT, $ong_state == STATE->{'inactive'});
 print_html_end(\*STDOUT);
index 76d2a6bd18d5309e3e63fe973dc0122c674e98cc..eb6d61e65405c73cd44f8a67b00082c9bbd8a997 100644 (file)
@@ -106,6 +106,10 @@ use File::Copy;
 ###PERL_COIN_DATE:          COIN_DATE          = 13-Nov-2016 22:15
 ###PERL_INTF_DATE:          INTF_DATE          = 28-Sep-2016 20:34
 
+###PERL_STORY_CREDITS:      STORY_CREDITS      = "BSTA" by Balthasar Szczepański
+###PERL_INTF_CREDITS:       INTF_CREDITS       = Online interface © Balthasar Szczepański; AGPL 3 license
+###PERL_SOURCE_URL:         SOURCE_URL         = http://bicyclesonthemoon.info/git-projects/?p=ott/bsta
+
 use constant STATE => {
        'inactive' => 0,
        'waiting'  => 1,
@@ -945,8 +949,15 @@ sub print_html_body_start {
 }
 
 sub print_html_body_end {
-       (my $fh) = @_;
+       (my $fh, my $hide_credits) = @_;
        print $fh '  </div>'."\n";
+       unless ($hide_credits) {
+               print $fh '  <p>'."\n";
+               print $fh '   '.html_entity_encode_dec(STORY_CREDITS(),1).'<br>'."\n";
+               print $fh '   '.html_entity_encode_dec(INTF_CREDITS(),1).'<br>'."\n";
+               print $fh '   <a href="'.html_entity_encode_dec(SOURCE_URL(),1).'" class="cz">source code</a>'."\n";
+               print $fh '  </p>'."\n";
+       }
        print $fh '  <a href="/" class="cz">'.html_entity_encode_dec(WEBSITE(),1).'</a>'."\n";
        print $fh ' </body>'."\n";
 }
@@ -1331,7 +1342,7 @@ sub print_viewer_page {
        print $fh "    </div>\n";
        print $fh "   </div>\n";
        
-       print_html_body_end($fh);
+       print_html_body_end($fh, $ong_state == STATE->{'inactive'});
        print_html_end($fh);
        
        
@@ -1435,7 +1446,7 @@ sub write_index {
                print $fh '   </tr>'."\n";
                print $fh '  </table>'."\n";
                print $fh '  <address>Apache/2.2.22 (Debian) Server at '.$_website.' Port 80</address>'."\n";
-               print $fh '  /body>'."\n";
+               print $fh '  </body>'."\n";
                print_html_end ($fh);
        }
        # the launch index
@@ -1578,7 +1589,7 @@ sub write_index {
                
                print $fh "   </div>\n";
                
-               print_html_body_end($fh);
+               print_html_body_end($fh, $ong_state == STATE->{'inactive'});
                print_html_end($fh);
        }
        close ($fh);
index f7297f9675b9fb32236e4a447c787049bfe178f8..a7f4921450a6d0fbb1b22b4c9e2443ad6a49a38e 100644 (file)
--- a/chat.1.pl
+++ b/chat.1.pl
@@ -5,7 +5,7 @@
 #
 # The coincidence interface
 #
-# Copyright (C) 2016, 2017, 2023  Balthasar Szczepański
+# Copyright (C) 2016, 2017, 2023, 2024  Balthasar Szczepański
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as
@@ -35,7 +35,7 @@ use botm_common (
        'html_entity_encode_dec',
 );
 use bsta_lib (
-       'CHAT_STATE', 'CHAT_ACTION',
+       'STATE', 'CHAT_STATE', 'CHAT_ACTION',
        'fail_method', 'fail_content_type',
        'get_remote_addr', 'get_id', 'get_password',
        'print_html_start', 'print_html_end',
@@ -51,6 +51,7 @@ use  File::Copy;
 ###PERL_DATA_CHAT_PATH:     DATA_CHAT_PATH     = /botm/data/bsta/chat
 ###PERL_DATA_COIN_PATH:     DATA_COIN_PATH     = /botm/data/bsta/coincidence
 ###PERL_DATA_SETTINGS_PATH: DATA_SETTINGS_PATH = /botm/data/bsta/settings
+###PERL_DATA_STATE_PATH:    DATA_STATE_PATH    = /botm/data/bsta/state
 
 ###PERL_WEBSITE_NAME:       WEBSITE_NAME       = Bicycles on the Moon
 
@@ -64,6 +65,7 @@ my %cgi;
 my %coin;
 my %chat;
 my %settings;
+my %state;
 
 my $time = time();
 srand ($time-$$);
@@ -114,6 +116,7 @@ $password = get_password(\%cgi);
 
 %coin      = read_data_file(DATA_COIN_PATH());
 %settings  = read_data_file(DATA_SETTINGS_PATH());
+%state     = read_data_file(DATA_STATE_PATH());
 
 $password_ok = ($password eq $settings{'password'});
 
@@ -413,7 +416,7 @@ print '    </div>'."\n";
 
 print '   </div>'."\n";
 
-print_html_body_end(\*STDOUT);
+print_html_body_end(\*STDOUT, int($state{'state'}) == STATE->{'inactive'});
 print_html_end(\*STDOUT);
 
 
index 0e5c207b26580e03716ef4db1c700b845303731f..733bd9c0863424460a0a331d975cb0bda47d2c9f 100644 (file)
@@ -84,3 +84,7 @@ coin_date   : 13-Nov-2016 22:15
 story_length    : 16
 firstpage_length: 4
 page_length     : 16
+
+story_credits: "BSTA" by Balthasar Szczepański
+intf_credits: Online interface © Balthasar Szczepański; AGPL 3 license
+source_url: http://bicyclesonthemoon.info/git-projects/?p=ott/bsta
index 6e2fbb391340db3883ef5c37782332486884b5d7..6e49feea6ae0fc6c0f485e9a85b4db3a835f4f63 100644 (file)
@@ -84,3 +84,7 @@ coin_date   : 13-Nov-2016 22:15
 story_length    : 16
 firstpage_length: 4
 page_length     : 16
+
+story_credits: "BSTA" by Balthasar Szczepański
+intf_credits: Online interface © Balthasar Szczepański; AGPL 3 license
+source_url: http://bicyclesonthemoon.info/git-projects/?p=ott/bsta
index c53dfd301a49953cc8f839fa59f32fe675522c82..afd592aefc65127ecf53036c7987b686ad5f80ae 100644 (file)
@@ -84,3 +84,7 @@ coin_date   : 13-Nov-2016 22:15
 story_length    : 16
 firstpage_length: 4
 page_length     : 16
+
+story_credits: "BSTA" by Balthasar Szczepański
+intf_credits: Online interface © Balthasar Szczepański; AGPL 3 license
+source_url: http://bicyclesonthemoon.info/git-projects/?p=ott/bsta
index bc183cef57c85b9122dec02f46686e6d82f5244a..c2b5ded6511210834028dc718101682a3fa71469 100644 (file)
@@ -84,3 +84,7 @@ coin_date   : 13-Nov-2016 22:15
 story_length    : 16
 firstpage_length: 4
 page_length     : 16
+
+story_credits: "BSTA" by Balthasar Szczepański
+intf_credits: Online interface © Balthasar Szczepański; AGPL 3 license
+source_url: http://bicyclesonthemoon.info/git-projects/?p=ott/bsta
index 68d5a25d5007d06b354f05b3143b408eff4cc709..14643788e372be53dd7a68371387ac46cfe49374 100644 (file)
@@ -181,6 +181,10 @@ PERL_FAVICON_PATH       = @_PERL_CONSTANT_STR( FAVICON_PATH, $favicon_path)
 PERL_COIN_DATE          = @_PERL_CONSTANT_STR( COIN_DATE, $coin_date)
 PERL_INTF_DATE          = @_PERL_CONSTANT_STR( INTF_DATE, $intf_date)
 
+PERL_STORY_CREDITS      = @_PERL_CONSTANT_STR( STORY_CREDITS, $story_credits)
+PERL_INTF_CREDITS       = @_PERL_CONSTANT_STR( INTF_CREDITS , $intf_credits)
+PERL_SOURCE_URL         = @_PERL_CONSTANT_STR( SOURCE_URL   , $source_url)
+
 PERL_GZIP               = @_PERL_CONSTANT_STR( GZIP, $gzip)
 
 PERL_RESET_PASSWORD     = @_PERL_CONSTANT_STR( RESET_PASSWORD, $reset_password)