83 |
my $file_conflict = "$modifier_dir_data/conflict.txt"; |
my $file_conflict = "$modifier_dir_data/conflict.txt"; |
84 |
my $file_format = "$modifier_dir_data/format.txt"; |
my $file_format = "$modifier_dir_data/format.txt"; |
85 |
my $url_cgi = 'wiki'; |
my $url_cgi = 'wiki'; |
86 |
my $url_stylesheet = './WalWiki/Theme/wiki.css'; |
my $url_stylesheet = 'wiki-style.css'; |
87 |
my $icontag = '<img src="/icons/folder" alt="*" width="40" height="40" />'; |
my $icontag = '<img src="/icons/folder" alt="*" width="40" height="40" />'; |
88 |
my $maxrecent = 50; |
my $maxrecent = 50; |
89 |
my $cols = 80; |
my $cols = 80; |
104 |
my $RecentChanges = 'RecentChanges'; |
my $RecentChanges = 'RecentChanges'; |
105 |
my $AdminChangePassword = 'AdminChangePassword'; |
my $AdminChangePassword = 'AdminChangePassword'; |
106 |
my $CompletedSuccessfully = 'CompletedSuccessfully'; |
my $CompletedSuccessfully = 'CompletedSuccessfully'; |
107 |
my $FrontPage = 'FrontPage'; |
my $FrontPage = 'HomePage'; |
108 |
my $IndexPage = 'IndexPage'; |
my $IndexPage = 'IndexPage'; |
109 |
my $SearchPage = 'SearchPage'; |
my $SearchPage = 'SearchPage'; |
110 |
my $CreatePage = 'CreatePage'; |
my $CreatePage = 'CreatePage'; |
139 |
$SearchPage => 1, |
$SearchPage => 1, |
140 |
$AdminChangePassword => 1, |
$AdminChangePassword => 1, |
141 |
$CompletedSuccessfully => 1, |
$CompletedSuccessfully => 1, |
142 |
$FrontPage => 1, |
#$FrontPage => 1, |
143 |
); |
); |
144 |
my %form; |
my %form; |
145 |
my %database; |
my %database; |
154 |
$CreatePage => 'create', |
$CreatePage => 'create', |
155 |
$RssPage => 'rss', |
$RssPage => 'rss', |
156 |
$AdminChangePassword => 'adminchangepasswordform', |
$AdminChangePassword => 'adminchangepasswordform', |
157 |
$FrontPage => 'FrontPage', |
#$FrontPage => 'FrontPage', |
158 |
); |
); |
159 |
my %command_do = ( |
my %command_do = ( |
160 |
read => \&do_read, |
read => \&do_read, |
403 |
my $cookedpage = &encode($page); |
my $cookedpage = &encode($page); |
404 |
print <<"EOD"; |
print <<"EOD"; |
405 |
Content-type: text/html; charset=$charset |
Content-type: text/html; charset=$charset |
406 |
|
Content-Language: $lang |
407 |
|
Content-Style-Type: text/css |
408 |
|
|
409 |
<!DOCTYPE html |
<!DOCTYPE html |
410 |
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
411 |
"http://www.w3.org/TR/html4/loose.dtd"> |
"http://www.w3.org/TR/html4/loose.dtd"> |
412 |
<html lang="$lang"> |
<html lang="$lang"> |
413 |
<head> |
<head> |
|
<meta http-equiv="Content-Language" content="$lang"> |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=$charset"> |
|
414 |
<title>$page @{[&escape(&get_subjectline($page))]}</title> |
<title>$page @{[&escape(&get_subjectline($page))]}</title> |
415 |
<link rel="index" href="$url_cgi?$IndexPage"> |
<link rel="index" href="$url_cgi?$IndexPage"> |
416 |
<link rev="made" href="mailto:$modifier_mail"> |
<link rev="made" href="mailto:$modifier_mail"> |
447 |
my ($page) = @_; |
my ($page) = @_; |
448 |
$walrus_log = ($walrus_debugging) ? &text_to_html("----\n$walrus_log") : ''; # Walrus add (debug) |
$walrus_log = ($walrus_debugging) ? &text_to_html("----\n$walrus_log") : ''; # Walrus add (debug) |
449 |
# Walrus mod (1) start |
# Walrus mod (1) start |
|
my $mod_info = $modifier_name ? qq(Modified by <a href="$modifier_url">$modifier_name</a>.) : ''; |
|
450 |
print <<"EOD"; |
print <<"EOD"; |
451 |
<div class="footer"> |
<div class="footer"> |
|
<hr /> |
|
452 |
<p> |
<p> |
453 |
<a href="http://digit.que.ne.jp/work/">WalWiki</a> $walversion © 2000-2002 by <a href="http://digit.que.ne.jp/">Makio Tsukamoto</a>.<br /> |
<a href="http://digit.que.ne.jp/work/">WalWiki</a> $walversion © 2000-2002 by <a href="http://digit.que.ne.jp/">Makio Tsukamoto</a>.<br /> |
454 |
based on <a href="http://www.hyuki.com/yukiwiki/">YukiWiki</a> $version © 2000-2002 by <a href="http://www.hyuki.com/">Hiroshi Yuki</a>.<br /> |
based on <a href="http://www.hyuki.com/yukiwiki/">YukiWiki</a> $version © 2000-2002 by <a href="http://www.hyuki.com/">Hiroshi Yuki</a>.<br /> |
455 |
$mod_info |
<a href="/gate/cvs/wakaba/wiki/" title="CVS Repository"> |
456 |
|
$Revision$ $Date$ |
457 |
|
</a> |
458 |
</p> |
</p> |
459 |
|
<div class="navigation"> |
460 |
|
[<a href="/" title="このサーバーの首頁">/</a> |
461 |
|
<a href="/map" title="このサーバーの案内">地図</a> |
462 |
|
<a href="/search/" title="このサーバーの検索">検索</a>] |
463 |
|
</div> |
464 |
</div> |
</div> |
465 |
$walrus_log <!-- Walrus add (debug) --> |
$walrus_log <!-- Walrus add (debug) --> |
466 |
</body> |
</body> |
524 |
} elsif (/^<html>/i and &is_ignore_html($form{mypage})) { |
} elsif (/^<html>/i and &is_ignore_html($form{mypage})) { |
525 |
push(@result, splice(@saved)); |
push(@result, splice(@saved)); |
526 |
push(@saved, '</html>'); |
push(@saved, '</html>'); |
527 |
|
if (/^\*\*\*\*\*(.*)/) { |
528 |
|
push(@toc, qq(-- <a href="#i$tocnum">@{[&escape($1)]}</a>\n)); |
529 |
|
push(@result, splice(@saved), qq(<h6 id="i$tocnum">) . &inline($1) . '</h6>'); |
530 |
|
$tocnum++; |
531 |
|
} elsif (/^\*\*\*\*(.*)/) { |
532 |
|
push(@toc, qq(-- <a href="#i$tocnum">@{[&escape($1)]}</a>\n)); |
533 |
|
push(@result, splice(@saved), qq(<h5 id="i$tocnum">) . &inline($1) . '</h5>'); |
534 |
|
$tocnum++; |
535 |
|
} elsif (/^\*\*\*(.*)/) { |
536 |
|
push(@toc, qq(-- <a href="#i$tocnum">@{[&escape($1)]}</a>\n)); |
537 |
|
push(@result, splice(@saved), qq(<h4 id="i$tocnum">) . &inline($1) . '</h4>'); |
538 |
|
$tocnum++; |
539 |
} elsif (/^\*\*(.*)/) { |
} elsif (/^\*\*(.*)/) { |
540 |
# if (/^\*\*(.*)/) { |
# if (/^\*\*(.*)/) { |
541 |
# Walrus mod (6) end |
# Walrus mod (6) end |
546 |
push(@toc, qq(- <a href="#i$tocnum">@{[&escape($1)]}</a>\n)); |
push(@toc, qq(- <a href="#i$tocnum">@{[&escape($1)]}</a>\n)); |
547 |
push(@result, splice(@saved), qq(<h2><a name="i$tocnum"> </a>) . &inline($1) . '</h2>'); |
push(@result, splice(@saved), qq(<h2><a name="i$tocnum"> </a>) . &inline($1) . '</h2>'); |
548 |
$tocnum++; |
$tocnum++; |
549 |
} elsif (/^----/) { |
#} elsif (/^----/) { |
550 |
push(@result, splice(@saved), '<hr>'); |
# push(@result, splice(@saved), '<hr>'); |
551 |
} elsif (/^(-{1,3})(.*)/) { |
} elsif (/^(={1,5})(.*)/) { |
552 |
|
&back_push('ol', length($1), \@saved, \@result); |
553 |
|
push(@result, '<li>' . &inline($2) . '</li>'); |
554 |
|
} elsif (/^(-{1,5})(.*)/) { |
555 |
&back_push('ul', length($1), \@saved, \@result); |
&back_push('ul', length($1), \@saved, \@result); |
556 |
push(@result, '<li>' . &inline($2) . '</li>'); |
push(@result, '<li>' . &inline($2) . '</li>'); |
557 |
} elsif (/^:([^:]+):(.*)/) { |
} elsif (/^:([^:]+):(.*)/) { |
558 |
&back_push('dl', 1, \@saved, \@result); |
&back_push('dl', 1, \@saved, \@result); |
559 |
push(@result, '<dt>' . &inline($1) . '</dt>', '<dd>' . &inline($2) . '</dd>'); |
push(@result, '<dt>' . &inline($1) . '</dt>', '<dd>' . &inline($2) . '</dd>'); |
560 |
} elsif (/^(>{1,3})(.*)/) { |
} elsif (/^(>{1,5})(.*)/) { |
561 |
&back_push('blockquote', length($1), \@saved, \@result); |
&back_push('blockquote', length($1), \@saved, \@result); |
562 |
push(@result, &inline($2)); |
push(@result, &inline($2)); |
563 |
} elsif (/^\s*$/) { |
} elsif (/^\s*$/) { |
566 |
push(@result, "<p>"); |
push(@result, "<p>"); |
567 |
} elsif (/^(\s+.*)$/) { |
} elsif (/^(\s+.*)$/) { |
568 |
&back_push('pre', 1, \@saved, \@result); |
&back_push('pre', 1, \@saved, \@result); |
569 |
push(@result, &escape($1)); # Not &inline, but &escape |
#push(@result, &escape($1)); # Not &inline, but &escape |
570 |
|
push(@result, &inline($1)); # Not &inline, but &escape |
571 |
# } elsif (/^\,(.*)$/) { # Walrus del (BF) |
# } elsif (/^\,(.*)$/) { # Walrus del (BF) |
572 |
} elsif (/^\,(.*?)[\x0D\x0A]*$/) { # Walrus add (BF) |
} elsif (/^\,(.*?)[\x0D\x0A]*$/) { # Walrus add (BF) |
573 |
&back_push('table', 1, \@saved, \@result, ' border="1"'); |
&back_push('table', 1, \@saved, \@result, ' border="1"'); |
632 |
sub inline { |
sub inline { |
633 |
my ($line) = @_; |
my ($line) = @_; |
634 |
$line = &escape($line); |
$line = &escape($line); |
635 |
$line =~ s|'''([^']+?)'''|<i>$1</i>|g; # Italic |
$line =~ s|'''([^']+?)'''|<strong>$1</strong>|g; |
636 |
$line =~ s|''([^']+?)''|<b>$1</b>|g; # Bold |
$line =~ s|''([^']+?)''|<em>$1</em>|g; |
637 |
$line =~ s|(\d\d\d\d-\d\d-\d\d \(\w\w\w\) \d\d:\d\d:\d\d)|<span class="date">$1</span>|g; # Date |
$line =~ s|(\d\d\d\d-\d\d-\d\d \(\w\w\w\) \d\d:\d\d:\d\d)|<span class="date">$1</span>|g; # Date |
638 |
$line =~ s! |
$line =~ s! |
639 |
( |
( |
640 |
((mailto|http|https|ftp):([^\x00-\x20()<>\x7F-\xFF])*) # Direct http://... |
(?:<(?:mailto|http|https|ftp|urn):[\x21-\x7E]*)> |
641 |
| |
| |
642 |
($bracket_name) # [[likethis]], [[#comment]], [[Friend:remotelink]] |
($bracket_name) # [[likethis]], [[#comment]], [[Friend:remotelink]] |
643 |
| |
| |
644 |
($interwiki_definition) # [[Friend http://somewhere/?q=sjis($1)]] |
($interwiki_definition) # [[Friend http://somewhere/?q=sjis($1)]] |
645 |
| |
#| |
646 |
($wiki_name) # LocalLinkLikeThis |
# ($wiki_name) |
647 |
) |
) |
648 |
! |
! |
649 |
&make_link($1) |
&make_link($1) |
650 |
!gex; |
!gex; |
655 |
my $chunk = shift; |
my $chunk = shift; |
656 |
# Walrus add (3) start |
# Walrus add (3) start |
657 |
my $name = $chunk; |
my $name = $chunk; |
658 |
|
$name =~ s/^<(.*)>$/$1/; |
659 |
if ($chunk =~ /^\[\[([^ ]+?) ([^ ]+?)\]\]$/ and $form{mypage} ne $InterWikiName) { |
if ($chunk =~ /^\[\[([^ ]+?) ([^ ]+?)\]\]$/ and $form{mypage} ne $InterWikiName) { |
660 |
($name, $chunk) = ($1, $2); |
($name, $chunk) = ($1, $2); |
661 |
} elsif ($chunk =~ /^mailto:(.*)$/) { |
} elsif ($chunk =~ /^mailto:(.*)$/) { |
675 |
# } |
# } |
676 |
return qq(<a href="$chunk">$name</a>); |
return qq(<a href="$chunk">$name</a>); |
677 |
# Walrus mod (3) end |
# Walrus mod (3) end |
678 |
} elsif ($chunk =~ /^(mailto):(.*)/) { |
} elsif ($chunk =~ m#^urn:[0-9A-Za-z_:;/.-]+#) { |
679 |
|
return qq|<<a href="/uri-res/N2L?${name}">$name</a>>|; |
680 |
|
} elsif ($chunk =~ /^mailto:(.*)/) { |
681 |
# return qq(<a href="$chunk">$2</a>); # Walrus del (3) |
# return qq(<a href="$chunk">$2</a>); # Walrus del (3) |
682 |
return qq(<a href="$chunk">$name</a>); # Walrus add (3) |
return qq(<<a href="$chunk">$name</a>>); # Walrus add (3) |
683 |
} elsif ($chunk =~ /^$interwiki_definition$/) { |
} elsif ($chunk =~ /^$interwiki_definition$/) { |
684 |
# return qq(<span class="InterWiki">$chunk</span>); # Walrus del (3) |
# return qq(<span class="InterWiki">$chunk</span>); # Walrus del (3) |
685 |
return qq(<span class="InterWiki">$name</span>); # Walrus add (3) |
return qq(<span class="InterWiki">$name</span>); # Walrus add (3) |