madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20214: LJSUP-9832: added support of delayed ent...

Committer: sbelyaev
LJSUP-9832: added support of delayed entries
U   trunk/cgi-bin/LJ/DelayedEntry.pm
U   trunk/htdocs/admin/entryprops.bml
Modified: trunk/cgi-bin/LJ/DelayedEntry.pm
===================================================================
--- trunk/cgi-bin/LJ/DelayedEntry.pm	2011-10-04 06:29:11 UTC (rev 20213)
+++ trunk/cgi-bin/LJ/DelayedEntry.pm	2011-10-04 06:55:54 UTC (rev 20214)
@@ -5,7 +5,18 @@
 require 'ljprotocol.pl';
 use LJ::User;
 use Storable;
-                
+
+sub create_from_url {
+    my ($class, $url) = @_;
+
+    if ($url =~ m!(.+)/d(\d+)\.html!) {
+        my $u = LJ::User->new_from_url($1) or return undef;
+        return LJ::DelayedEntry->get_entry_by_id($u, $2);
+    }
+
+    return undef;
+}
+              
 sub create {
     my ( $class, $req, $opts ) = @_;
 
@@ -75,6 +86,10 @@
     return $self;
 }
 
+sub valid {
+    return 1;
+}
+
 sub delayedid {
     my ($self) = @_;
     return $self->{delayed_id};
@@ -239,6 +254,10 @@
     return 1;
 }
 
+sub get_suspended_mark {
+    return 0;
+} 
+
 sub should_show_suspend_msg_to {
     my ( $self, $u ) = @_;
     return $self->is_suspended && !$self->is_suspended_for($u) ? 1 : 0;

Modified: trunk/htdocs/admin/entryprops.bml
===================================================================
--- trunk/htdocs/admin/entryprops.bml	2011-10-04 06:29:11 UTC (rev 20213)
+++ trunk/htdocs/admin/entryprops.bml	2011-10-04 06:55:54 UTC (rev 20214)
@@ -24,6 +24,9 @@
     $ret .= "<?hr?>";
 
     my $entry = LJ::Entry->new_from_url($GET{url});
+    if (!$entry) {
+        $entry = LJ::DelayedEntry->create_from_url($GET{url});
+    }
 
     unless ($entry && $entry->valid) {
         $ret .= LJ::error_list("$POST{url} is not a valid entry URL.") if LJ::did_post();

Tags: bml, livejournal, madeon, pm
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