'read_data_file', 'write_data_file'
);
+###PERL_PATH_SEPARATOR: PATH_SEPARATOR = /
+
###PERL_CGI_PATH: CGI_PATH = /bsta/
###PERL_CGI_BBCODE_PATH: CGI_BBCODE_PATH = /bsta/b
###PERL_CGI_CSS_PATH: CGI_CSS_PATH = /bsta/bsta.css
sub get_frame {
(my $cgi) = @_;
- if ($cgi{'f'} =~ /^.+$/) {
+ if ($cgi->{'f'} =~ /^.+$/) {
return int($&);
}
elsif ($ENV{'PATH_INFO'} =~ /^\/(.+)$/) {
sub get_password {
(my $cgi) = @_;
- if ($cgi{'p'} =~ /^.+$/) {
+ if ($cgi->{'p'} =~ /^.+$/) {
return $&;
}
else {
# $new_ind = $ind.'.'.$bbtree{$ind.'.count'};
}
else {
- $debug .= debug($printdebug, "[$new_$ind]tag: $tag\n");
+ $debug .= debug($printdebug, "[$new_ind]tag: $tag\n");
$bbtree{$new_ind.'.type' } = 'tag';
$bbtree{$new_ind.'.name' } = '/'.$tag_name;
$bbtree{$new_ind.'.value' } = $tag_value;
$bb = '';
}
}
- my $final_ind = '_.'.$bbtree{"_.count"}
+ my $final_ind = '_.'.$bbtree{"_.count"};
$debug .= debug($printdebug, "[$final_ind]automatic tag: [/ht]\n -->\n");
$bbtree{$final_ind.'.type' } = "tag";
$bbtree{$final_ind.'.name' } = '/ht';
$debug .= debug($printdebug, "[$level:$ind:".int($bbtree->{$ind.'.count'})."]");
#normal text
if ($bbtree->{$ind.'.type'} eq 'text') {
- my $text = $bbtree->{$ind.'.value'}
+ my $text = $bbtree->{$ind.'.value'};
$debug .= debug($printdebug, "text: ".$text);
$out .= $escape ? html_encode_line($text) : $text;
$level -= 1;
$debug .= debug($printdebug, "[<]");
if ($level >= 0) {
- $goto-next = 'nd';
+ $goto_next = 'nd';
}
else {
# time to end this
if (exists($tags->{$name.'='.$value})) {
$out .=
$tags->{$name.'='} .
- $tags->{$name.'='.$value'} .
+ $tags->{$name.'='.$value} .
$tags->{$name.'/='};
}
else {
my $debug;
($debug, %bbtree) = bbtree($bb, $printdebug);
- ($debug, $ht) = convtree ($printdebug, $debug, 'html', %bbtree);
+ ($debug, $ht) = convtree ($printdebug, $debug, 'html', \%bbtree);
return $ht;
}
}
sub print_html_head_start {
+ (my $fh) = @_;
print $fh '<head>'."\n";
print $fh '<meta http-equiv="Content-type" content="text/html; charset=UTF-8">'."\n";
print $fh '<link rel="icon" type="image/png" href="'.html_entity_encode_dec(FAVICON_PATH(),1).'">'."\n";
my $text_mode = int($context->{'text_mode'});
my $timer_unlocked = int($context->{'timer_unlocked'});
- my $timer = int($context->{'timer'};
+ my $timer = int($context->{'timer'});
my $last_frame = int($state->{'last'});
my $ong_state = int($state->{'state'});
$timer_s = 'EE';
}
- my $prev_available = (($frame > 0) && $access');
- my $next_available = ($password_ok' || ($next_frame <= $last_frame));
+ my $prev_available = (($frame > 0) && $access);
+ my $next_available = ($password_ok || ($next_frame <= $last_frame));
my $prefetch_next = (
$password_ok ||
- ($next_frame < $tast_frame) || (
+ ($next_frame < $last_frame) || (
($next_frame <= $last_frame) &&
($ong_state >= STATE->{'ready'})
)
);
my $show_timer = (
- ($frame == $last_frame)) && (
+ ($frame == $last_frame) && (
($ong_state == STATE->{'waiting'}) ||
($ong_state == STATE->{'ready'})
)
);
my $show_command = (
- $password_ok' ||
- ($frame' < $last_frame) || (
- ($ong_state) >= STATE->{'ready'}) &&
+ $password_ok ||
+ ($frame < $last_frame) || (
+ ($ong_state >= STATE->{'ready'}) &&
$context->{'show_command'}
)
);
$bbcode_url = merge_url(
$viewer_url,
{'query'=>{
- 'b' = TEXT_MODE->{'bb'}
+ 'b' => TEXT_MODE->{'bb'}
}}
);
}
$info_url = merge_url(
$viewer_url,
{'query'=>{
- 'b' = TEXT_MODE->{'info'}
+ 'b' => TEXT_MODE->{'info'}
}}
);
}
if ($nextframe_indirect) {
$frame_next_url = merge_url(
{'path' => CGI_FRAME_PATH()},
- {'path' => $nextframe}
+ {'path' => $next_frame}
);
}
elsif ($next_frame_data->{'frame'} ne '') {
}
print '>';
if ($show_command_link) {
- print $fh '<a href="'.($access : $_viewer_next_url : $_viewer_last_url).'">';
+ print $fh '<a href="'.($access ? $_viewer_next_url : $_viewer_last_url).'">';
}
if ($show_command) {
print $fh $_command;
print $fh '<div id="underlinks">'."\n";
- unless (($frame == 0) && $Static) {
+ unless (($frame == 0) && $static) {
print $fh '<a href="'.$_base_url.'">Once again</a> | ';
}
if ($prev_available) {
if ($text_mode != TEXT_MODE->{'normal'}) {
print $fh '<a href="'.$_viewer_url.'">Without</a> | ';
}
- print $fh '<a href="'.$_info_path.'">Info</a> | ';
- print $fh '<a href="'.$_bbcode_path.'">BB</a>';
+ print $fh '<a href="'.$_info_url.'">Info</a> | ';
+ print $fh '<a href="'.$_bbcode_url.'">BB</a>';
print $fh "\n</span>\n";
print $fh "</div>\n</div>\n";
my $settings
) = @_;
- if ($mode eq viewer) {
+ if ($mode eq 'viewer') {
my %frame_data = read_data_file(join_path(PATH_SEPARATOR(), DATA_PATH(), 0));
my %next_frame_data= read_data_file(join_path(PATH_SEPARATOR(), DATA_PATH(), 1));
my %default = read_data_file(DATA_DEFAULT_PATH());
'join_path'
);
use bsta_lib (
- 'STATE', 'TEXT_MODE'
+ 'STATE', 'TEXT_MODE',
'fail_method', 'fail_content_type',
'get_remote_addr', 'get_frame', 'get_password',
'merge_settings',
%frame_data= read_data_file($frame_data_path);
}
-$password_ok = ($password eq $settings{'password'}) {
+$password_ok = ($password eq $settings{'password'});
# state & activation logic
if (open ($state_file, "+<:encoding(UTF-8)", DATA_STATE_PATH())) {
$goto_list{'title-1'} = $frame_data{'title'};
$goto_list{'ongtime-1'} = $frame_data{'ongtime'};
- if (copy ($inpath, $outpath)) {
+ if (copy ($in_path, $out_path)) {
write_index('viewer', \%state, \%settings);
write_data_file($state_file, '','', \%state);
write_data_file(DATA_LIST_PATH(),'','', \%goto_list);