--- suikawiki/script/wiki.cgi 2002/09/28 10:54:27 1.26 +++ suikawiki/script/wiki.cgi 2002/10/07 12:50:51 1.27 @@ -70,9 +70,9 @@ # my $modifier_sendmail = '/usr/sbin/sendmail -t -n'; # Your sendmail. my $modifier_sendmail = ''; # If you don't need mail notification. my $modifier_dir_data = './wikidata'; # Your data directory. -my $modifier_rss_title = "WalWiki $walversion"; +my $modifier_rss_title = "SuikaWiki $walversion"; my $modifier_rss_link = 'http://suika.fam.cx/~wakaba/-temp/wiki2/wiki'; # Blank is not allowed. -my $modifier_rss_description = 'This is WalWiki, yet another Wiki clone based on YukiWiki'; +my $modifier_rss_description = 'This is SuikaWiki'; ############################## # # You MAY modify following variables. @@ -205,12 +205,18 @@ } sub do_read { - &print_header($form{mypage}); my $content = $database{$form{mypage}}; + my $lm = &get_info($form{mypage}, $info_LastModified); + &print_header($form{mypage}, -last_modified => $lm); + wiki::referer::add ($form{mypage}, $ENV{HTTP_REFERER}); my $cf = 'SuikaWiki/0.9'; - $cf = $1 if $content =~ s#^(?:/\*\s*|\#\?)?([A-Z][A-Za-z0-9-]+/[0-9.]+(?:\s[^\x0D\x0A]+)?)[\x0D\x0A]+##s; + ## Should be support at least: + ## - 'SuikaWiki/0.9' CRLF + ## - 'H2H/' ("0.9" / "1.0" / "1.1") CRLF + ## - "/*" WSP* 'W3C-CSS/' ("1.0" / "2.0") "*/" CRLF + $cf = $1 if $content =~ s#^(?:/\*\s*|\#\?)?([A-Z][A-Za-z0-9-]+/[0-9.]+(?:[^0-9.][^\x0D\x0A]*)?)[\x0D\x0A]+##s; if ($cf =~ m#^SuikaWiki/0.9(?:$|\s)#) { - &print_content($content, $cf); + &print_content($content, content_format => $cf, last_modified => $lm); print &text_to_html (q([[#comment]])); } else { print "
@{[&escape($content)]}
"; @@ -220,7 +226,11 @@ print q{

See also

}; print $r; } - &print_footer($form{mypage}); + my $r = wiki::referer::list_html ($form{mypage}); + if ($r) { + print qq(

»²ΎΘΈ΅

\n$r
\n); + } + &print_footer($form{mypage}, $lm); } sub do_output_css { @@ -342,7 +352,7 @@ &update_recent_changes; } &set_info($form{mypage}, $info_IsFrozen, 0 + $form{myfrozen}); - &print_header($CompletedSuccessfully, -goto => $url_cgi.'?'.&encode($form{mypage})); + &print_header($CompletedSuccessfully, -goto => $url_cgi.'?'.&encode($form{mypage}).($form{comment_index}?"#x-comment-$form{comment_index}":'')); &print_message($resource{saved}); &print_content("$resource{continuereading} @{[&armor_name($form{mypage})]}"); &print_footer($CompletedSuccessfully); @@ -384,7 +394,7 @@ || index ($page, $word) > 0 || index ($word, $page) > 0 ) { - $r .= qq(
  • @{[&escape($page)]}@{[&escape(&get_subjectline($page))]}
  • ); + $r .= qq(
  • @{[&escape($page)]} @{[&escape(&get_subjectline($page))]}
  • ); $counter++; } } @@ -425,15 +435,14 @@ exit(0); } -sub print_header { - my ($page,%option) = @_; +sub print_header ($;%) { + my ($page, %option) = @_; my $bodyclass = "normal"; if (&is_frozen($page) and $form{mycmd} =~ /^(read|write)$/) { $bodyclass = "frozen"; } - if ($option{-goto}) { - print qq{Refresh: 0; url="$option{-goto}"\n}; - } + print qq{Refresh: 0; url="$option{-goto}"\n} if $option{-goto}; + print qq{Last-Modified: $option{-last_modified}\n} if $option{-last_modified}; my $cookedpage = &encode($page); my $escapedpage = &escape($page); print <<"EOD"; @@ -456,9 +465,8 @@ EOD &print_navigate_links ($page); print <@{[&escape($page)]}@{[&escape(&get_subjectline($page))]} +

    @{[&escape($page)]} + @{[&escape(&get_subjectline($page))]}

    EOD } @@ -501,12 +509,13 @@ } sub print_footer { - my ($page) = @_; + my ($page, $lm) = @_; $walrus_log = ($walrus_debugging) ? &text_to_html("----\n$walrus_log") : ''; # Walrus add (debug) # Walrus mod (1) start - my $cvslog = '$Revision: 1.26 $ $Date: 2002/09/28 10:54:27 $'; + my $cvslog = '$Revision: 1.27 $ $Date: 2002/10/07 12:50:51 $'; print_navigate_links ($page); print <<"EOD"; +@{[ $lm ? qq(
    Last modified: $lm
    ) : '' ]}