#!/usr/bin/perl ###################################################### # NoteJr >> Style-Note TypeB # ###################################################### require './notelib.pl'; # $old_log = 'jr.log'; $new_log = 'noteb.log'; $log_dir = 'log/'; $img_path = '../upload/'; $url_str = 'こちら'; 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,$no2,$file,$year,$mon,$day,$wday,$subj,$com,$h_pos,$i_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]]"; } } $com =~ s/(http\:[\w\.\~\-\/\?\&\+\=\:\@\%\;\#]+)/$url_str<\/a>/g ; if($fname ne ""){ $com = "$fname$com"; } $i_pos =~ s/\n//g; $line2 = "$no<>$year<>$mon<>$day<>$wday<>$subj<>$com<>$h_pos<>$i_pos<>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_ }