madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20087: LJSUP-9787: Option to appears/not appear...

Committer: sbelyaev
LJSUP-9787: Option to appears/not appears post in friends page and RSS (with Scheduled and sticky entries)
U   branches/delayed_entries/bin/upgrading/en.dat
U   branches/delayed_entries/cgi-bin/LJ/DelayedEntry.pm
U   branches/delayed_entries/cgi-bin/LJ/Widget/EntryForm.pm
U   branches/delayed_entries/htdocs/editjournal.bml
U   branches/delayed_entries/htdocs/update.bml
Modified: branches/delayed_entries/bin/upgrading/en.dat
===================================================================
--- branches/delayed_entries/bin/upgrading/en.dat	2011-09-20 08:41:07 UTC (rev 20086)
+++ branches/delayed_entries/bin/upgrading/en.dat	2011-09-21 01:12:26 UTC (rev 20087)
@@ -1415,6 +1415,8 @@
 
 entryform.userpics=User Picture Icon:
 
+entryform.do_not_add_rss_friends=Do not add to friends lists and RSS
+
 Error|notes=typically used inside an H1 tag to announce an error.
 Error=Error
 

Modified: branches/delayed_entries/cgi-bin/LJ/DelayedEntry.pm
===================================================================
--- branches/delayed_entries/cgi-bin/LJ/DelayedEntry.pm	2011-09-20 08:41:07 UTC (rev 20086)
+++ branches/delayed_entries/cgi-bin/LJ/DelayedEntry.pm	2011-09-21 01:12:26 UTC (rev 20087)
@@ -543,7 +543,11 @@
     my $qposttime   = $dbh->quote($posttime);
     my $utime       = $dbh->selectrow_array("SELECT UNIX_TIMESTAMP($qposttime)");
 
-    my $rlogtime    = $LJ::EndOfTime - $now;
+    my $rlogtime    = $LJ::EndOfTime;
+    unless ( $req->{'props'}->{'do_not_add_rss_friends'} ) {
+        $rlogtime -= $now;
+    }
+
     my $rposttime   = $LJ::EndOfTime - $utime;
     $self->{taglist} = __extract_tag_list(\$req->{props}->{taglist});
 
@@ -560,7 +564,7 @@
 
     $self->journal->do( "UPDATE delayedblob2 SET request_stor=$data_ser" . 
                         "WHERE journalid=$journalid AND delayedid=$delayedid");
-}
+}   
 
 sub update_tags {
     my ($self, $tags) = @_;
@@ -615,6 +619,7 @@
 sub get_entry_by_id {
     my ($class, $journal, $delayedid, $options) = @_;
     __assert($journal);
+    
     return undef unless $delayedid;
 
     my $journalid = $journal->userid;
@@ -646,9 +651,9 @@
                                          "WHERE journalid=$journalid AND ".
                                          "delayedid = $delayedid");
 
-    warn "oops!" unless $opts;
+
     return undef unless $opts;
-    warn "all ok!";
+
     my $data_ser = $dbcr->selectrow_array("SELECT request_stor " .
                                           "FROM delayedblob2 ".
                                           "WHERE journalid=$journalid AND ".
@@ -897,9 +902,8 @@
         $date_limit .= "AND day = " . $req->{day} . " ";
     }
 
-    my $u = LJ::want_user($userid);
     return undef unless __delayed_entry_can_see( $uowner,
-                                                  $u );
+                                                 $u );
 
     my $secwhere = __delayed_entry_secwhere( $uowner,
                                              $ownerid,
@@ -1419,6 +1423,16 @@
     return 0;
 }
 
+ 
+
+sub item_link {
+    my ($u, $delayedid, @args) = @_;
+    # 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";
+}
+
 sub __delayed_entry_secwhere {
     my ( $uowner, $ownerid, $posterid ) = @_;
     my $secwhere = " AND (posterid = $posterid OR journalid = $posterid

Modified: branches/delayed_entries/cgi-bin/LJ/Widget/EntryForm.pm
===================================================================
--- branches/delayed_entries/cgi-bin/LJ/Widget/EntryForm.pm	2011-09-20 08:41:07 UTC (rev 20086)
+++ branches/delayed_entries/cgi-bin/LJ/Widget/EntryForm.pm	2011-09-21 01:12:26 UTC (rev 20087)
@@ -775,6 +775,24 @@
                    $sticky_text
                 </label>};
         },
+         'do_not_add' => sub {
+            my $selected = $opts->{'opt_backdated'} || 0;
+            my $dot_add_check = LJ::html_check({
+                'type' => "check",
+                'class' => 'do_not_add_type',
+                'value' => '1',
+                'name' => 'prop_opt_backdated',
+                'id' => 'do_not_add_type',
+                'selected' => $selected,
+                $opts->{'prop_opt_preformatted'} || $opts->{'event_format'},
+                'label' => "",
+            });
+
+            my $added_to_rss_text = $BML::ML{'entryform.do_not_add_rss_friends.edit'};
+            return qq{$dot_add_check <label for='do_not_add_type' class='right options'>
+                   $added_to_rss_text
+                </label>};
+        },
         'tags' => sub {
             return if $LJ::DISABLED{'tags'};
 
@@ -1117,6 +1135,7 @@
                 $BML::ML{'entryform.spellcheck'}
                 </label> $out};
         },
+        'none' => sub {return qq{};},
     );
 
     my @schema = (
@@ -1124,7 +1143,8 @@
         [ 'mood', 'comment_settings' ],
         [ 'location', 'comment_screening' ],
         [ 'music', 'content_flag' ],
-        [ 'spellcheck', 'sticky' ], 
+        [ 'spellcheck', 'do_not_add' ],
+        [ 'none','sticky'],
         'extra',
         [ 'lastfm_logo'  ],
     );

Modified: branches/delayed_entries/htdocs/editjournal.bml
===================================================================
--- branches/delayed_entries/htdocs/editjournal.bml	2011-09-20 08:41:07 UTC (rev 20086)
+++ branches/delayed_entries/htdocs/editjournal.bml	2011-09-21 01:12:26 UTC (rev 20087)
@@ -267,7 +267,8 @@
                             'ver'        => $LJ::PROTOCOL_VER,
                             'username'   => $u->{'user'},
                             'usejournal' => $usejournal,
-                            'timezone'   => $POST{'timezone'} || $POST{'timezone'},
+                            'timezone'   => $POST{'delayed_timezone'} ||
+                                                $POST{'delayed_timezone'},
                             'itemid'     => $itemid,
                             'delayedid'  => $delayedid,
                             'type'       => $POST{'type'} || $POST{'type'},
@@ -466,6 +467,7 @@
                 'jitemid' => $itemid,
                 'delayedid' => $delayedid,
                 'sticky' => $entry_obj->is_sticky,
+                'opt_backdated' => $entry_obj->prop('opt_backdated'),
             };
 
             for (my $i = 1; $i <= $res{'prop_count'}; $i++) {
@@ -487,7 +489,7 @@
             if ($ad) {
                 $ret .= "<td valign='top' style='width: 300px;'>$ad</td>";
             }
-                
+
             $ret .= "</tr></table>";
 
             my $qotd = LJ::QotD->get_single_question($entry->{prop_qotdid});

Modified: branches/delayed_entries/htdocs/update.bml
===================================================================
--- branches/delayed_entries/htdocs/update.bml	2011-09-20 08:41:07 UTC (rev 20086)
+++ branches/delayed_entries/htdocs/update.bml	2011-09-21 01:12:26 UTC (rev 20087)
@@ -213,9 +213,9 @@
     my $altlogin_display = 'none';
     my $remotelogin_display = 'none';
     if ($auth_as_remote) {
-        $remotelogin_display = '';
+        $remotelogin_display = 'block';
     } else {
-        $altlogin_display = '';
+        $altlogin_display = 'block';
     }
 
     # Check for errors, store in hash to render later
@@ -252,23 +252,19 @@
             $auth .= "</li>\n\n";
         }
         # table with username/password fields
-        $auth .= "<li id='altlogin_wrapper_login' class='pkg' style='display: $altlogin_display;'>\n";
-        $auth .= "<label for='altlogin_username' class='title'>$ML{'.username'}</label>\n";
-        $auth .= "<span class='wrap'>\n";
+        $auth .= "<li id='altlogin_wrapper' class='pkg' style='display: $altlogin_display;'>\n";
+        $auth .= "<label for='altlogin_username' class='left'>$ML{'.username'}</label>\n";
         $auth .=  LJ::html_text({ 'name' => 'user', 'id' => 'altlogin_username', 'class' => 'text', 'size' => '15', 
                 'maxlength' => '15', 'tabindex' => '5', 'value' => $POST{'user'} || $GET{'user'} }) . "\n";
-        $auth .= "</span>\n";
         $auth .= "</li>\n";
-        $auth .= "<li id='altlogin_wrapper_password' class='pkg' style='display: $altlogin_display;'>\n";
-        $auth .= "<label for='altlogin_password' class='title'>$ML{'.password'}</label>\n";
-        $auth .= "<span class='wrap'>\n";
+        $auth .= "<li id='altlogin_wrapper' class='pkg' style='display: $altlogin_display;'>\n";
+        $auth .= "<label for='altlogin_password' class='left'>$ML{'.password'}</label>\n";
         $auth .= LJ::html_text({ 'type' => 'password', 'id' => 'altlogin_password', 'class' => 'text',  
                 'name' => 'password', 'tabindex' => '6', 'size' => '15', 'maxlength' => '30' }) . "\n";
         # posted with a user, but no password
         if ($did_post && $auth_missing) {
             $auth .= "<br /><?inerr $ML{'.error.nopass'} inerr?>";
         }
-        $auth .= "</span>\n";
         $auth .= "</li>\n\n";
 
         # if they submit the form and are spellchecking, remember
@@ -464,6 +460,9 @@
                     'tz'          => 'guess',
                     'timezone'    => $POST{'delayed_timezone'} || $GET{'delayed_timezone'},
                     'type'        => $POST{'type'} || $GET{'type'},
+                    'ver'         => 3,
+                    'do_not_add_rss_friends' => $POST{'do_not_add_rss_friends'} ||
+                                                    $GET{'do_not_add_rss_friends'}
                     );
 
         LJ::entry_form_decode(\%req, \%POST);

Tags: bml, dat, 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