###PERL_CGI_PATH: CGI_PATH = /bsta/
###PERL_CGI_2WORDS_PATH: CGI_2WORDS_PATH = /bsta/2words
-###PERL_CGI_CSS_PATH: CGI_CSS_PATH = /bsta/bsta.css
-###PERL_CGI_LOGO_PATH: CGI_LOGO_PATH = /bsta/botmlogo.png
-###PERL_CGI_VIEWER_PATH: CGI_VIEWER_PATH = /bsta/v
###PERL_DATA_PATH: DATA_PATH = /botm/data/bsta/
-###PERL_DATA_COIN_PATH: DATA_COIN_PATH = /botm/data/bsta/coincidence
###PERL_DATA_DEFAULT_PATH: DATA_DEFAULT_PATH = /botm/data/bsta/default
###PERL_DATA_LIST_PATH: DATA_LIST_PATH = /botm/data/bsta/list
###PERL_DATA_SETTINGS_PATH: DATA_SETTINGS_PATH = /botm/data/bsta/settings
###PERL_DATA_STORY_PATH: DATA_STORY_PATH = /botm/data/bsta/story
###PERL_WWW_PATH: WWW_PATH = /botm/www/1190/bsta/
-###PERL_WWW_INDEX_PATH: WWW_INDEX_PATH = /botm/www/1190/bsta/index.htm
-###PERL_WEBSITE: WEBSITE = 1190.bicyclesonthemoon.info
###PERL_WEBSITE_NAME: WEBSITE_NAME = Bicycles on the Moon
-###PERL_FAVICON_PATH: FAVICON_PATH = /img/favicon.png
-
-###PERL_COIN_DATE: COIN_DATE = 13-Nov-2016 22:15
-###PERL_INTF_DATE: INTF_DATE = 28-Sep-2016 20:34
###PERL_STORY_LENGTH: STORY_LENGTH = 16
###PERL_PAGE_LENGTH: PAGE_LENGTH = 16
my $frame_file;
my $in_path;
my $out_path;
+ my $ext;
# prepare to ONG frame 0!
$frame_data_path = join_path(PATH_SEPARATOR(), DATA_PATH(), 0);
%frame_data = read_data_file($frame_data_path);
%default = read_data_file(DATA_DEFAULT_PATH());
- %frame_data = merge_settings(\%default, \%frame_data);
- $frame_file = sprintf($settings{'frame'}, 0, $frame_data{'ext'});
+ $ext = (defined($frame_data{'ext'})) ?
+ $frame_data{'ext'} :
+ $default{'ext'};
+
+ $frame_file = sprintf($settings{'frame'}, 0, $ext);
$in_path = join_path(PATH_SEPARATOR(), DATA_PATH(), $frame_file);;
$out_path = join_path(PATH_SEPARATOR(), WWW_PATH(), $frame_file);
# set ONG time of frame 0
# NOTE: might get overwritten later if ONG not launched
$frame_data{'ongtime'} = $time;
+ $frame_data{'timer'} = 0;
write_data_file($frame_data_path, '', '', \%frame_data);
# update the GOTO list with frame 0
my $max_page = int(($story_id - FIRSTPAGE_LENGTH - 1) / PAGE_LENGTH) + 1;
my $newer_available = ($page > 0);
my $older_available = ($page < $max_page);
-my $show_intf = ($intf_pass == 1) && ($ong_state == STATE=>{'inactive'});
+my $show_intf = ($intf_pass == 1) && ($ong_state == STATE->{'inactive'});
my $id_start =
$story_id-1 -(
($page == 0) ? 0 : (
print_html_body_end(\*STDOUT);
print_html_end(\*STDOUT);
-
-# sub writeindex {
- # (my $indexpath, my $pass, my $mode, my $pause) = @_;
- # my $indexfile;
- # my $indexof;
-
- # if(ref($indexpath)) {
- # $indexfile=$indexpath;
- # unless (seek($indexfile, 0, 0)) {
- # return 0;
- # }
- # }
- # else {
- # unless (open ($indexfile, ">", $indexpath)) {
- # return 0;
- # }
- # }
-
- # $indexof = CGI_PATH;
- # $indexof =~ s/\/$//g;
-
- # my %coin = readdatafile(DATA_COIN_PATH);
-
- # if ($pass != 1) {
- # print $indexfile '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'."\n";
- # print $indexfile '<html>'."\n";
- # print $indexfile ' <head>'."\n";
- # print $indexfile ' <title>Index of '.$indexof.'</title>'."\n";
- # print $indexfile ' </head>'."\n";
- # print $indexfile ' <body>'."\n";
- # print $indexfile '<h1>Index of '.$indexof.'</h1>'."\n";
- # print $indexfile '<table><tr><th><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr><tr><th colspan="5"><hr></th></tr>'."\n";
- # print $indexfile '<tr><td valign="top"><img src="/icons/back.gif" alt="[DIR]"></td><td><a href="/">Parent Directory</a></td><td> </td><td align="right"> - </td><td> </td></tr>'."\n";
- # print $indexfile '<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="2words/">2words/</a></td><td align="right">'.INTF_DATE.' </td><td align="right"> - </td><td> </td></tr>'."\n";
- # print $indexfile '<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="coin/">coin/</a></td><td align="right">'.COIN_DATE.' </td><td align="right"> - </td><td> Coincidence </td></tr>'."\n";
- # print $indexfile '<tr><th colspan="5"><hr></th></tr>'."\n";
- # print $indexfile '</table>'."\n";
- # print $indexfile '<address>Apache/2.2.22 (Debian) Server at '.WEBSITE.' Port 80</address>'."\n";
- # print $indexfile '</body></html>'."\n";
- # }
- # else {
- # my %framedata;
- # my %nextframedata;
- # my %default;
-
- # %framedata = readdatafile(DATA_PATH.0);
- # %nextframedata = readdatafile(DATA_PATH.1);
- # %default=readdatafile(DATA_DEFAULT_PATH);
-
- # # if($mode == 16 && $pause) {
- # # $framedata{'ongtime'} = $time;
- # # writedatafile(DATA_PATH.0,%framedata);
- # # }
-
- # foreach my $ind (keys %default) {
- # unless(defined($framedata{$ind})){
- # $framedata{$ind}=$default{$ind};
- # }
- # unless(defined($nextframedata{$ind})){
- # $nextframedata{$ind}=$default{$ind};
- # }
- # }
-
-
- # print $indexfile '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">'."\n";
- # print $indexfile '<html lang="en"><head>'."\n";
- # print $indexfile '<title>';
- # if($mode == 8 || $mode == 4) {
- # print $indexfile 'Index of';
- # }
- # elsif($mode == 16) {
- # print $indexfile entityencode($settings{'story'});
- # if($pause) {
- # print $indexfile ' • '.WEBSITE_NAME;
- # }
- # }
- # else {
- # print $indexfile 'Index of '.$indexof;
- # }
- # print $indexfile '</title>'."\n";
- # print $indexfile '<meta http-equiv="Content-type" content="text/html; charset=UTF-8">'."\n";
- # print $indexfile '<link rel="icon" type="image/png" href="'.FAVICON_PATH.'">'."\n";
- # print $indexfile '<link rel="stylesheet" href="'.CGI_CSS_PATH.'">'."\n";
- # print $indexfile '</head><body>'."\n";
- # print $indexfile '<a href="/"><img id="botmlogo" src="'.CGI_LOGO_PATH.'" alt="'.WEBSITE.'"></a>'."\n";
- # print $indexfile '<div id="all">'."\n";
-
- # print $indexfile '<div id="inst" class="ins">'."\n";
-
- # print $indexfile '<div id="title">'."\n";
- # print $indexfile '<H1 id="titletext">';
- # if($mode == 8 || $mode == 4) {
- # print $indexfile 'Index of';
- # }
- # elsif($mode == 16) {
- # print $indexfile entityencode($settings{'story'});
- # }
- # else {
- # print $indexfile 'Index of '.$indexof;
- # }
- # print $indexfile '</H1>'."\n";
- # print $indexfile '</div>'."\n";
-
- # print $indexfile '</div><div id="framespace">'."\n";
- # print $indexfile '<img src="'.CGI_PATH;
- # if($mode == 8) {
- # print $indexfile 'intf-ll.gif'
- # }
- # elsif($mode == 4) {
- # print $indexfile 'intf-pp.gif'
- # }
- # elsif($mode == 16) {
- # if($pause) {
- # print $indexfile sprintf($settings{'frame'},0,$framedata{'ext'}).'" title="'.entityencode($framedata{'title'});
- # }
- # else {
- # print $indexfile 'intf-tr.gif'
- # }
- # }
- # else {
- # print $indexfile 'intf-kw.gif'
- # }
- # print $indexfile '" alt="0" id="frame">'."\n";
-
- # print $indexfile '</div><div id="insb" class="ins">'."\n";
- # print $indexfile '<div id="undertext">'."\n";
- # if($mode == 8 || $mode == 4) {
- # print $indexfile '<img src="/icons/back.gif" alt="[DIR]"> <a href="/">Parent Directory</a><br><img src="/icons/folder.gif" alt="[DIR]"> <a href="#">yyyyb/</a>'."\n";
- # }
- # elsif ($mode == 16) {
- # if($pause) {
- # print $indexfile bb2ht($framedata{'content'})."\n";
- # }
- # else {
- # print $indexfile "...\n";
- # }
- # }
- # else {
- # print $indexfile '<img src="/icons/back.gif" alt="[DIR]"> <a href="/">Parent Directory</a><br>'."\n";
- # print $indexfile '<img src="/icons/folder.gif" alt="[DIR]"> <a href="2words/">2words/</a> '.INTF_DATE.' - <br>'."\n";
- # print $indexfile '<img src="/icons/folder.gif" alt="[DIR]"> <a href="coin/">coin/</a> '.COIN_DATE.' - '.entityencode($coin{'server'})."\n";
- # }
- # print $indexfile '</div>'."\n";
-
- # print $indexfile '<div id="command">'."\n";
- # if ($mode == 8) {
- # print $indexfile '[<span class="br">EE</span>:<span class="br">EE</span>:<span class="br">EE</span>]'."\n";
- # }
- # elsif ($mode == 4) {
- # print $indexfile '[<span class="ni">EE</span>:<span class="ni">EE</span>:<span class="ni">EE</span>]'."\n";
- # }
- # elsif ($mode == 16) {
- # if($pause) {
- # print $indexfile '[<span class="br">00</span>:<span class="br">00</span>:<span class="br">00</span>]<br>'."\n";
- # print $indexfile '><a href="'.CGI_VIEWER_PATH.'/1">'.entityencode($nextframedata{'title'}).'</a>'."\n";
- # }
- # else {
- # print $indexfile '[<span class="ni">--</span>:<span class="ni">--</span>:<span class="ni">--</span>]<br>'."\n";
- # print $indexfile '>...<span class="inp">_</span>'."\n";
- # }
- # }
- # else {
- # }
- # print $indexfile '</div>'."\n";
-
- # print $indexfile '</div>'."\n";
-
- # print $indexfile '</div>'."\n";
- # print $indexfile '<a href="/" class="cz">'.WEBSITE.'</a>'."\n";
-
- # print $indexfile '</body></html>'."\n";
- # }
-
- # unless (ref($indexpath)) {
- # close ($indexfile);
- # }
- # else {
- # truncate ($indexfile , tell($indexfile));
- # }
-
- # return 1;
-# }