|
|
#!/usr/local/bin/perl
#use "../KCatch" qw( execdata );__DATA__
my($homedir,$ban,@ban,$text,$sanko,$folder);
$folder="shokyoso";
require '../server.ini';
$homedir=$server::homedir;
open(BAN,"$homedir/$folder/top_number.txt") or die $!;
@ban=;
close(BAN);
$ban=$ban[0];
open(IN,"$homedir/$folder/messages/$ban.shtml") or die $!;
while(){
$text.=$_;
}
close(IN);
$text=~/(.+)<\/title>/;
my $title=$1;
$text=~/([\s\S]+)/;
my $body=$1;
if($text=~/\n([\s\S]+)\n/){
$sanko=$1;
}
$body =~s/src="(.+?)"/src="\/$folder\/messages\/$1"/g;
print "content-type: text/html\n\n";
print "$title\n";
print "$body\n";
if($sanko){
print "\n";
print "$sanko\n";
print " \n";
}
|
|
■新着情報
|
#!/usr/local/bin/perl
use Time::Local;
$newmark = ' ';
$newdates=2;
$time=time;
open IN,"message.idx";
print "content-type: text/html\n\n";
while(){
if ($line++==5){
last;
}
@fields=split(/:=:/);
($year,$mon,$day)=split(/\//,$fields[3]);
$updatetime=timelocal(0,0,0,$day,$mon-1,$year);
if (($time-$updatetime) > $newdates*24*60*60*2) { $newsign = ""; }
else { $newsign = "$newmark"; }
if(not($fields[0]=~/^\*/)){
print " | $fields[1]$newsign | $fields[2] | \n" ;
}
}
print " | | →続き | " ;
close IN;
|
|
■交流新着情報
|
#!/usr/local/bin/perl
use KCatch;
$logfile = './wf_log.cgi';
$new_color = "#FF3300";
$newmark = ' ';
$new_time = 48;
$script = '/shokyoso/koryu/wforum.cgi';
# 時間取得
$times = time;
open(IN,"$logfile") || &error("Open Error : $logfile");
$top = ;
while () {
local($no,$reno,$xl,$sub,$email,$url,$name,$date,
$msg,$time,$h,$pw,$wrap,$oya,$smail,$res) = split(/<>/);
$count{$no} = $time;
$re{$no} = $reno;
$d{$no} = $date;
$na{$no} = $name;
$no{$no} = $no;
$ttl{$no} = $sub;
$oya{$no} = $oya;
$time{$no} = $time;
}
close(IN);
print "content-type: text/html\n\n";
print "";
# ソート処理
$i=0;
foreach (sort { ($count{$b} <=> $count{$a}) || ($a cmp $b)} keys(%count)) {
$i++;
if ($i > 10) { next; }
# 所定時間以内の投稿は[NEWマーク]表示
if (($times - $time{$_}) > $new_time*3600) { $newsign = ""; }
else { $newsign = "$newmark"; }
if ($ttl{$_} eq '投稿者削除') {
print " | $ttl{$_} - $d{$_} No\.$_ $newsign | \n";
} else {
print " | $ttl{$_} - $na{$_} $d{$_} No\.$_ $newsign | \n";
}
}
print" ";
|
→続き
|
|
|