#!/usr/bin/perl =pod uri_add.cgi Chuubu-no-uri `whatsnew' maintenor Copyright the Watermeron Project 2000-2001. Change: 2001-05-12 wakaba - Rename template: .uri-template -> uri.ja.htt 2001-05-06 wakaba - Rewrite for Suika-server spec. =cut require Suika::CGI; if (($Suika::CGI::param{mode} eq 'add' && $Suika::CGI::param{comment})) { Suika::CGI::Error::die('id') if ($Suika::CGI::param{uid} ne 'MatsumotoTakeshi'); open D, '>> whatnew.dat' or Suika::CGI::Error::die('write', file => 'whatnew.dat'); print D $Suika::CGI::param{comment}."\n"; close D; open D, 'whatnew.dat' or Suika::CGI::Error::die('open', file => 'whatnew.dat'); @D = ; close D; my ($s, $n); for (0...9) { $n = $#D - $_; next if $n < 0; $s .= '
  • '.$D[$n]; } $s = '' if $s; open H, 'uri.ja.htt' or Suika::CGI::Error::die('open', file => 'uri.ja.htt'); @H = ; close H; $" = ''; my $h = "@H"; $h =~ s//$s/g; &jcode::convert(\$h,'jis','euc'); open D, '> uri.ja.html' or Suika::CGI::Error::die('write', file => 'uri.ja.html'); print D $h; close D; Suika::CGI::Log::updated($Suika::CGI::rooturi.'chuubu/uri','ちゅーぶの瓜','和'); print "Location: uri-add?mode=relong\n\n"; } elsif ($Suika::CGI::param{mode} eq 're') { open D, 'whatnew.dat' or Suika::CGI::Error::die('open', file => 'whatnew.dat'); @D = ; close D; my $s; for (0...9) { next if $#D-$_ < 0; $s .= '
  • '.$D[$#D-$_] if $D[$#D-$_] =~ /./; } $s = "" if $s; open H, 'uri.ja.htt' or Suika::CGI::Error::die('open', file => 'uri.ja.htt'); @H = ; close H; $" = ''; my $h = "@H"; $h =~ s//$s/g; &jcode::convert(\$h,'jis','euc'); open D, '> uri.ja.html' or Suika::CGI::Error::die('write', file => 'uri.ja.html'); print D $h; close D; Suika::CGI::Log::updated($Suika::CGI::rooturi.'chuubu/uri','ちゅーぶの瓜','和'); print "Location: uri-add?mode=relong\n\n"; } elsif ($Suika::CGI::param{mode} eq 'relong') { open D, 'whatnew.dat' or Suika::CGI::Error::die('open', file => 'whatnew.dat'); @D = ; close D; my $s; for (0...$#D) { next if $#D-$_ < 0; $s .= '
  • '.$D[$#D-$_] if $D[$#D-$_] =~ /./; } $s = "" if $s; open H, 'uri.ja.htt' or Suika::CGI::Error::die('open', file => 'uri.ja.htt'); @H = ; close H; $" = ''; my $h = "@H"; $h =~ s//$s/g; &jcode::convert(\$h,'jis','euc'); open D, '> uri-all.ja.html' or Suika::CGI::Error::die('write', file => 'uri-all.ja.html'); print D $h; close D; Suika::CGI::Log::updated($Suika::CGI::rooturi.'chuubu/uri-all','ちゅーぶの瓜','和'); } print "Location: uri\n\n";