Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r18849: LJSUP-8547 (Add ability to post an entry...

Committer: ailyin
LJSUP-8547 (Add ability to post an entry to community for identity accounts): QOTD
U   trunk/cgi-bin/LJ/Widget/QotD.pm
U   trunk/cgi-bin/LJ/Widget/QotDResponses.pm
U   trunk/cgi-bin/taglib.pl
U   trunk/htdocs/community/join.bml
Modified: trunk/cgi-bin/LJ/Widget/QotD.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/QotD.pm	2011-04-12 07:07:07 UTC (rev 18848)
+++ trunk/cgi-bin/LJ/Widget/QotD.pm	2011-04-12 07:07:43 UTC (rev 18849)
@@ -151,6 +151,12 @@
                                 ? "<p>$q->{extra_text}</p>"
                                 : "";
     
+            my $usejournal_field = '';
+            if ( $remote->is_identity ) {
+                $usejournal_field
+                    = LJ::html_hidden( 'usejournal' => $LJ::QOTD_COMMUNITY );
+            }
+
             $ret .=
                 ($q->{img_url}
                     ? qq[<img src="$q->{img_url}" alt="$subject" title="$subject" class="qotd-pic" />]
@@ -161,7 +167,7 @@
                     <p>$d->{text}<em class="i-qotd-by">$d->{from_text}</em></p>
                     $extra_text
                     <ul class="canyon">
-                        <li class="canyon-section"><form action="$LJ::SITEROOT/update.bml" method="get" target="_top"><button type="submit">$d->{answer_text}</button><input type="hidden" name="qotd" value="$q->{qid}" /></form></li>
+                        <li class="canyon-section"><form action="$LJ::SITEROOT/update.bml" method="get" target="_top"><button type="submit">$d->{answer_text}</button><input type="hidden" name="qotd" value="$q->{qid}" />$usejournal_field</form></li>
                         <li class="canyon-side">$d->{view_answers_link}</li>
                     </ul>
                 </div>];

Modified: trunk/cgi-bin/LJ/Widget/QotDResponses.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/QotDResponses.pm	2011-04-12 07:07:07 UTC (rev 18848)
+++ trunk/cgi-bin/LJ/Widget/QotDResponses.pm	2011-04-12 07:07:43 UTC (rev 18849)
@@ -115,7 +115,7 @@
         }
 
         my $entry_html = LJ::trim($entry->event_html_summary($class->entry_show_length, { noexpandembedded => 1 }));
-        my $entry_author = $journal->ljuser_display();
+        my $entry_author = $entry->poster->ljuser_display();
         my $entry_subject = $entry->subject_html;
         my $entry_url = $entry->url;
         my $entry_cmt_link = $entry->reply_url;

Modified: trunk/cgi-bin/taglib.pl
===================================================================
--- trunk/cgi-bin/taglib.pl	2011-04-12 07:07:07 UTC (rev 18848)
+++ trunk/cgi-bin/taglib.pl	2011-04-12 07:07:43 UTC (rev 18849)
@@ -462,7 +462,7 @@
     my $u = LJ::want_user(shift);
     my $remote = LJ::want_user(shift);
     return undef unless $u && $remote;
-    return undef unless $remote->{journaltype} eq 'P';
+    return undef unless $remote->is_personal || $remote->is_identity;
     return undef if LJ::is_banned($remote, $u);
 
     # get permission hashref and check it; note that we fall back to the control

Modified: trunk/htdocs/community/join.bml
===================================================================
--- trunk/htdocs/community/join.bml	2011-04-12 07:07:07 UTC (rev 18848)
+++ trunk/htdocs/community/join.bml	2011-04-12 07:07:43 UTC (rev 18849)
@@ -3,6 +3,7 @@
 body<=
 <?_code
 {
+#line 6
     use strict;
 
     LJ::set_active_crumb('joincomm');

Tags: andy, bml, livejournal, pl, 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