OSDN Git Service

editlogの日時がズレることがあったので1秒以内のログは同じ履歴とみなすようにしています。
authortakezoe <takezoe@users.osdn.me>
Sun, 28 Aug 2011 17:32:43 +0000 (17:32 +0000)
committertakezoe <takezoe@users.osdn.me>
Sun, 28 Aug 2011 17:32:43 +0000 (17:32 +0000)
plugin/core/Diff.pm

index 960acde..bb49de3 100644 (file)
@@ -85,6 +85,7 @@ sub show_history {
        }
        
        # editlog¥×¥é¥°¥¤¥ó¤Î¥í¥°¤«¤éÊÔ½¸¼Ô¤Î¥æ¡¼¥¶Ì¾¤ò¼èÆÀ
+       # ¡Êeditlog¤ÎÆüÉÕ¤¬¥º¥ì¤ë¤³¤È¤¬¤¢¤Ã¤¿¤Î¤Ç1ÉðÊÆâ¤Î¹¹¿·¤ÏƱ¤¸ÍúÎò¤È¤ß¤Ê¤¹¤è¤¦¤Ë¤·¤Æ¤Þ¤¹¡Ë
        my $editlog = {};
        if($wiki->config('log_dir') ne "" && -e $wiki->config('log_dir')."/useredit.log"){
                open(DATA,$wiki->config('log_dir')."/useredit.log") or die $!;
@@ -92,9 +93,9 @@ sub show_history {
                        my($date, $time, $unixtime, $action, $subject, $id) = split(" ",$_);
                        if($subject eq $page){
                                if($id eq ''){
-                                       $editlog->{$unixtime} = 'anonymous';
+                                       $editlog->{substr($unixtime, 0, length($unixtime) - 4)} = 'anonymous';
                                } else {
-                                       $editlog->{$unixtime} = $id;
+                                       $editlog->{substr($unixtime, 0, length($unixtime) - 4)} = $id;
                                }
                        }
                }
@@ -113,8 +114,8 @@ sub show_history {
                $buf .= "<a href=\"".$wiki->create_url({ action=>"DIFF",page=>$page,generation=>($#list-$count) })."\">".&Util::format_date($time).
                        "</a> <a href=\"".$wiki->create_url({ action=>"SOURCE",page=>$page,generation=>($#list-$count) })."\">¥½¡¼¥¹</a>";
                        
-               if(defined($editlog->{$time})){
-                       $buf .= " by ".$editlog->{$time};
+               if(defined($editlog->{substr($time, 0, length($time) - 4)})){
+                       $buf .= " by ".$editlog->{substr($time, 0, length($time) - 4)};
                }
                
                $buf .=  "</li>\n";