madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20987: LJSUP-10432: restore removed functionali...

Committer: sbelyaev
LJSUP-10432: restore removed functionality
U   trunk/cgi-bin/LJ/DelayedEntry.pm
Modified: trunk/cgi-bin/LJ/DelayedEntry.pm
===================================================================
--- trunk/cgi-bin/LJ/DelayedEntry.pm	2012-01-25 11:17:36 UTC (rev 20986)
+++ trunk/cgi-bin/LJ/DelayedEntry.pm	2012-01-25 11:18:24 UTC (rev 20987)
@@ -460,7 +460,8 @@
 sub url {
     my ($self) = @_;
     my $journal = $self->journal;
-    my $url = $journal->journal_base . "/d" . $self->delayedid . ".html";
+    my $url = "$LJ::SITEROOT/manage/scheduled_posts.bml?usejournal=" .
+              $journal->username . "#entry_" . $self->delayedid;
     return $url;
 }
 
@@ -972,7 +973,8 @@
     # XXX: should have an option of returning a url with escaped (&)
     #      or non-escaped (&) arguments.  a new link object would be best.
     my $args = @args ? "?" . join("&", @args) : "";
-    return LJ::journal_base($u) . "/d$delayedid.html$args";
+    return "$LJ::SITEROOT/manage/scheduled_posts.bml?usejournal=" . $u->username . 
+           "#entry_$delayedid";
 }
 
 sub __delayed_entry_secwhere {
@@ -1133,6 +1135,27 @@
                                                 $dt->minute );
 }
 
+sub __get_now {
+    my $dt = DateTime->now->set_time_zone('UTC');
+
+    # make the proper date format
+    return sprintf("%04d-%02d-%02d %02d:%02d",  $dt->year, 
+                                                $dt->month,
+                                                $dt->day, 
+                                                $dt->hour,
+                                                $dt->minute );
+}
+
+
+sub is_future_date {
+    my ($req) = @_;
+    my $now = __get_now();
+    my $request_time = __get_datetime($req);
+
+    return $request_time ge $now;
+}
+
+
 sub __assert {
     my ($statement, $error) = @_;
     $error ||= '';

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