[ 新規 ] [ 検索 | 一覧 | FrontPage ] [ 履歴 (RSS) | 差分履歴 (RSS) ] [ ログイン ]
【PR】Amazon | SL-C3000 | SL-C1000(3/18発売!) | SL-C860 | SL-6000W | SL-6000L | SL-6000N

WalWiki/カスタマイズ/保存時に変更がなければ更新しない

差分表示


編集前の状態に戻します。
保存時に変更がなければ更新しない

*do_write()内の変更

-2003-07-02 (Wed) 18:29:40 更新有無の判定方法を変更
-2003-07-09 (Wed) 22:42:13 実装がまずかったので修正

     $form{mymsg} =~ s/\x0D\x0A|\x0D|\x0A/\n/g;                             # Walrus add [unify new-line]
     my $isChanged;                                                         # yakty add [noupdate if nochange]
     # Making diff
     {
 #        &open_diff;                                                       # yakty del [noupdate if nochange]
         my @msg1 = split(/\x0D\x0A|\x0D|\x0A/, $database{$form{mypage}});  # Walrus add [unify new-line]
         my @msg2 = split(/\n/, $form{mymsg});
 #        $diffbase{$form{mypage}} = &difftext(\@msg1, \@msg2);             # yakty del [noupdate if nochange]
 #        &close_diff;                                                      # yakty del [noupdate if nochange]     
         # yakty add [noupdate if nochange] start
         my $diffmsg = &difftext(\@msg1, \@msg2);
         $isChanged = $diffmsg =~ /^[^=]/m;
         if($isChanged){
             &open_diff;
             $diffbase{$form{mypage}} = $diffmsg;
             &close_diff;
         }
         # yakty add [noupdate if nochange] end         
     }

         # Walrus add [write softly] end
         # &send_mail_to_admin($form{mypage}, "Modify");                  # yakty del [noupdate if nochange]
         &send_mail_to_admin($form{mypage}, "Modify") if($isChanged);     # yakty add [noupdate if nochange]
         #if ($form{mytouch}) {                     # yakty del [noupdate if nochange]
         if ($form{mytouch} and $isChanged) {       # yakty add [noupdate if nochange]
 #           &set_info($form{mypage}, $info_LastModified, '' . localtime);                                # Walrus del [gmtime offset]
             &set_info($form{mypage}, $info_LastModified, '' . gmtime(time + $modifier_time_offset));     # Walrus add [gmtime offset]
             &update_recent_changes;
         }

     } else {
         #&send_mail_to_admin($form{mypage}, "Delete");                 # yakty del [noupdate if nochange]
         &send_mail_to_admin($form{mypage}, "Delete") if($isChanged);   # yakty add [noupdate if nochange]
         delete $database{$form{mypage}};
         delete $infobase{$form{mypage}};
         #if ($form{mytouch}) {                        # yakty del [noupdate if nochange]
         if ($form{mytouch} and $isChanged) {         # yakty add [noupdate if nochange]
             &update_recent_changes;
         }
         &print_header($form{mypage});
         &print_message($resource{deleted});
         &print_footer($form{mypage});
     }


02151