From 912a06e7c2122b81a9a46a7fe8e019d5b5d7acd6 Mon Sep 17 00:00:00 2001 From: takezoe Date: Sun, 3 Jul 2011 09:18:40 +0000 Subject: [PATCH] =?utf8?q?editlog=E3=83=97=E3=83=A9=E3=82=B0=E3=82=A4?= =?utf8?q?=E3=83=B3=E3=81=8C=E6=9C=89=E5=8A=B9=E3=81=AA=E5=A0=B4=E5=90=88?= =?utf8?q?=E3=81=AF=E5=B1=A5=E6=AD=B4=E3=81=AB=E7=B7=A8=E9=9B=86=E3=81=97?= =?utf8?q?=E3=81=9F=E3=83=A6=E3=83=BC=E3=82=B6=E5=90=8D=E3=82=92=E8=A1=A8?= =?utf8?q?=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?utf8?q?=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- plugin/core/Diff.pm | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/plugin/core/Diff.pm b/plugin/core/Diff.pm index b9aadfc..1f1577e 100644 --- a/plugin/core/Diff.pm +++ b/plugin/core/Diff.pm @@ -82,6 +82,23 @@ sub show_history { return "ÍúÎò¤Ï¤¢¤ê¤Þ¤»¤ó¡£"; } + # editlog¥×¥é¥°¥¤¥ó¤Î¥í¥°¤«¤éÊÔ½¸¼Ô¤Î¥æ¡¼¥¶Ì¾¤ò¼èÆÀ + 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 $!; + while(){ + my($date, $time, $unixtime, $action, $subject, $id) = split(" ",$_); + if($subject eq $pagename){ + if($id eq ''){ + $editlog->{$unixtime} = 'anonymous'; + } else { + $editlog->{$unixtime} = $id; + } + } + } + close(DATA); + } + foreach my $time (@list){ $buf .= "
  • "; if($count == 0){ @@ -91,9 +108,14 @@ sub show_history { $buf .= "". ""; } - $buf .= "create_url({ action=>"DIFF",page=>$pagename,generation=>($#list-$count) })."\">".&Util::escapeHTML($time). - "¡¡create_url({ action=>"SOURCE",page=>$pagename,generation=>($#list-$count) })."\">¥½¡¼¥¹". - "
  • \n"; + $buf .= "create_url({ action=>"DIFF",page=>$pagename,generation=>($#list-$count) })."\">".&Util::format_date($time). + " create_url({ action=>"SOURCE",page=>$pagename,generation=>($#list-$count) })."\">¥½¡¼¥¹"; + + if(defined($editlog->{$time})){ + $buf .= " by ".$editlog->{$time}; + } + + $buf .= "\n"; $count++; } return $buf."". -- 2.11.0