#!/usr/bin/perl ###################################################### # Note ver2.0 >> Style-Note TypeA # ###################################################### require './notelib.pl'; # $old_log = 'note.log'; $new_log = 'notea.log'; $log_dir = 'log/'; $img_path = '../upload/'; if(!open(IN,"$log_dir$old_log")){&err_out("$old_logが読み込めません.\n");} @buffer = ; close(IN) ; if(!open(OUT,">$log_dir$new_log")){&err_out ("テンポラリーファイルが作成できません.");} foreach $line (@buffer) { ($no,$back,$next,$file,$year,$mon,$day,$wday,$subj,$com,$h_pos) = split(/<>/, $line); @dummy = split(/\|/,$file); $fname = ""; if($dummy[0] ne ""){ ($width, $height) = &ImageSize("$img_path$dummy[0]"); if($width ne '-1'){ $fname = "[[img:$dummy[0]:left:$width:$height]]"; } } if($dummy[3] ne ""){ ($width, $height) = &ImageSize("$img_path$dummy[3]"); if($width ne '-1'){ $fname .= "[[img:$dummy[3]:left:$width:$height]]"; } } if($fname ne ""){ $com = "$fname$com"; } $h_pos =~ s/\n//g; $line2 = "$no<>$back<>$next<>$year<>$mon<>$day<>$wday<>$subj<>$com<>$h_pos<>0<>0"; print OUT "$line2\n"; } close(OUT) ; &err_out("変換は終了しました。"); exit; sub err_out{ &head; print "

$_[0]

"; &botm; exit; } sub botm{ print <<_HTML_; _HTML_ } sub head{ print "Content-type: text/html\n\n"; print <<_HTML_; $ver _HTML_ }