Add a link, "View all entries from the same date" to the success page 
shown after posting a backdated entry.

        Patch by kareila. 

diffs (35 lines):

diff -r 7ecfb426864e -r 59641e57d208 htdocs/update.bml
--- a/htdocs/update.bml Thu Jun 10 07:24:36 2010 -0500
+++ b/htdocs/update.bml Thu Jun 10 07:45:01 2010 -0500
@@ -518,8 +518,18 @@ _c?>
                     my @after_entry_post_extra_options = 
LJ::Hooks::run_hooks('after_entry_post_extra_options', user => $ju, itemlink => 
$itemlink);
                     my $after_entry_post_extra_options = join('', map 
{$_->[0]} @after_entry_post_extra_options) || '';
 
+                    my $backdatedlink = '';
+                    if ( $POST{prop_opt_backdated} or $GET{prop_opt_backdated} 
) {
+                        # we have to do some gymnastics to figure out the 
entry date
+                        my $e = LJ::Entry->new_from_url( $itemlink );
+                        my ( $y, $m, $d ) = ( $e->{eventtime} =~ 
/^(\d+)-(\d+)-(\d+)/ );
+                        my $url = $ju->journal_base . "/$y/$m/$d/";
+                        $backdatedlink = "<li><a href=\"$url\">"
+                                       . 
"$ML{'.success.links.backdated'}</a></li>";
+                    }
+
                     $$body .= " p?><?p $ML{'.success.links'} p?><ul>" . 
$writersblocklink .
-                        "<li><a 
href=\"$itemlink\">$ML{'.success.links.view'}</a></li>" .
+                        "<li><a 
href=\"$itemlink\">$ML{'.success.links.view'}</a></li>" . $backdatedlink .
                         "<li><a 
href=\"$edititemlink\">$ML{'.success.links.edit'}</a></li>" .
                         "<li><a 
href=\"/tools/memadd?journal=$juser&itemid=$itemid\">$ML{'.success.links.memories'}</a></li>"
 .
                         "<li><a 
href=\"/edittags?journal=$juser&itemid=$itemid\">$ML{'.success.links.tags'}</a></li>"
 .
diff -r 7ecfb426864e -r 59641e57d208 htdocs/update.bml.text
--- a/htdocs/update.bml.text    Thu Jun 10 07:24:36 2010 -0500
+++ b/htdocs/update.bml.text    Thu Jun 10 07:45:01 2010 -0500
@@ -109,6 +109,8 @@
 
 .success.links=Now that you've posted, you can:
 
+.success.links.backdated=View all entries from the same date
+
 .success.links.edit=Edit the entry
 
 .success.links.memories=Add the entry to your memories
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to