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

[livejournal] r17357: LJSUP-6573 (Add ability to select pictur...

Committer: ailyin
LJSUP-6573 (Add ability to select pictures for Facebook publishing)
U   trunk/cgi-bin/LJ/Talk.pm
U   trunk/cgi-bin/weblib.pl
U   trunk/templates/CommentForm/Form.tmpl
Modified: trunk/cgi-bin/LJ/Talk.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk.pm	2010-09-13 06:52:23 UTC (rev 17356)
+++ trunk/cgi-bin/LJ/Talk.pm	2010-09-13 07:03:34 UTC (rev 17357)
@@ -1576,7 +1576,7 @@
         );
     }
 
-    my ( $show_userpics, @pics_display, %userpicmap );
+    my ( $show_userpics, @pics_display, %userpicmap, $defaultpicurl );
     if ( $res{'pickw_count'} ) {
         $show_userpics = 1;
 
@@ -1603,6 +1603,10 @@
         foreach my $i (1 .. $res{'pickw_count'}) {
             $userpicmap{$res{"pickw_$i"}} = $res{"pickwurl_$i"};
         }
+
+        if (my $upi = $remote->userpic) {
+            $defaultpicurl = $upi->url;
+        }
     }
 
     # only show on initial compostion
@@ -1771,6 +1775,7 @@
         'show_userpics'             => $show_userpics,
         'userpics'                  => \@pics_display,
         'userpicmap'                => LJ::JSON->to_json(\%userpicmap),
+        'defaultpicurl'             => $defaultpicurl,
         'subjicon_types'            => \@subjicon_types,
         'text_hint'                 => $opts->{'text_hint'},
         'create_link'               => $create_link,

Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2010-09-13 06:52:23 UTC (rev 17356)
+++ trunk/cgi-bin/weblib.pl	2010-09-13 07:03:34 UTC (rev 17357)
@@ -704,7 +704,7 @@
     $qrhtml .= LJ::ljuser($remote->{'user'});
     $qrhtml .= "</td><td align='center'>";
 
-    my %userpicmap;
+    my (%userpicmap, $defaultpicurl);
 
     # Userpic selector
     {
@@ -740,6 +740,10 @@
             foreach my $i (1 .. $res{'pickw_count'}) {
                 $userpicmap{$res{"pickw_$i"}} = $res{"pickwurl_$i"};
             }
+
+            if (my $upi = $remote->userpic) {
+                $defaultpicurl = $upi->url;
+            }
         }
     }
 
@@ -814,6 +818,7 @@
     my $userpicmap = LJ::JSON->to_json(\%userpicmap);
     $ret .= qq{
                var userpicmap = $userpicmap;
+               var defaultpicurl = "$defaultpicurl";
                document.write("$qrsaveform");
                var de = document.createElement('div');
                de.id = 'qrdiv';

Modified: trunk/templates/CommentForm/Form.tmpl
===================================================================
--- trunk/templates/CommentForm/Form.tmpl	2010-09-13 06:52:23 UTC (rev 17356)
+++ trunk/templates/CommentForm/Form.tmpl	2010-09-13 07:03:34 UTC (rev 17357)
@@ -102,6 +102,7 @@
             <TMPL_IF show_userpics>
                 <script type="text/javascript">
                     var userpicmap=<TMPL_VAR userpicmap>;
+                    var defaultpicurl="<TMPL_VAR defaultpicurl>";
                 </script>
                 <TMPL_VAR ml_picturetouse>
                 <select name="prop_picture_keyword">

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