arteman (arteman) wrote in changelog,
arteman
arteman
changelog

[livejournal] r21516: LJSUP-11566 Log information about modera...

Committer: azateev
LJSUP-11566 Log information about moderator to entry properties
U   trunk/bin/upgrading/proplists.dat
U   trunk/htdocs/admin/entryprops.bml
U   trunk/htdocs/community/moderate.bml
Modified: trunk/bin/upgrading/proplists.dat
===================================================================
--- trunk/bin/upgrading/proplists.dat	2012-03-22 13:29:21 UTC (rev 21515)
+++ trunk/bin/upgrading/proplists.dat	2012-03-22 14:13:01 UTC (rev 21516)
@@ -1798,3 +1798,9 @@
   des: user id in trava.ru
   prettyname: user id in trava.ru
   indexed: 0
+
+logproplist.moderator_id:
+  datatype: num
+  des: userid of moderator, who approved this entry
+  prettyname: Moderator's userid
+  sortorder: 10

Modified: trunk/htdocs/admin/entryprops.bml
===================================================================
--- trunk/htdocs/admin/entryprops.bml	2012-03-22 13:29:21 UTC (rev 21515)
+++ trunk/htdocs/admin/entryprops.bml	2012-03-22 14:13:01 UTC (rev 21516)
@@ -84,7 +84,14 @@
             # an ugly hack, i know
             $props{$prop} = LJ::TimeUtil->mysql_time($props{$prop}) if $p->{des} =~ /unix/i;
         }
-
+        if ($prop eq 'moderator_id') {
+            my $moderator = LJ::load_userid($props{$prop});
+            if ($moderator) {
+                $extra = " (".
+                         $moderator->ljuser_display.
+                         ")$extra";
+            }
+        }
         $ret .= "<li><strong>$prop</strong>: $props{$prop}$extra</li><br />";
     }
     if ($entry->is_sticky) {

Modified: trunk/htdocs/community/moderate.bml
===================================================================
--- trunk/htdocs/community/moderate.bml	2012-03-22 13:29:21 UTC (rev 21515)
+++ trunk/htdocs/community/moderate.bml	2012-03-22 14:13:01 UTC (rev 21516)
@@ -92,6 +92,8 @@
                                                                                 'use_custom_time'=> 0, });
             if ($res) { # succeeded
                 $success = 1;
+                my $approved_entry = LJ::Entry->new($c, jitemid => $res->{itemid});
+                $approved_entry->set_prop( moderator_id => $remote->userid );
                 my $err = sub { return "<?h1 $ML{'Error'} h1?><?p $_[0] p?>"; };
                 $ret .= "<?h1 $ML{'.posted.header'} h1?><?p $ML{'.posted.text'} p?>";
                 $ret .= "<br />" .$err->($prot_err). "<br />" unless $res;

Tags: arteman, azateev, bml, dat, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments