2heoh (2heoh) wrote in changelog,
2heoh
2heoh
changelog

[livejournal] r20822: LJM-1948: m.livejournal.com Polls: vote ...

Committer: slobin
LJM-1948: m.livejournal.com Polls: vote and view results

M Poll.pm
U   trunk/cgi-bin/LJ/Poll.pm
Modified: trunk/cgi-bin/LJ/Poll.pm
===================================================================
--- trunk/cgi-bin/LJ/Poll.pm	2011-12-20 14:43:47 UTC (rev 20821)
+++ trunk/cgi-bin/LJ/Poll.pm	2011-12-20 14:47:09 UTC (rev 20822)
@@ -948,6 +948,23 @@
                 warn "Unknown key in pollresultaggrepated2: '$key'" if $LJ::IS_DEV_SERVER;
             }
         }
+
+        unless(%aggr_results) {
+            my $sth;
+            #if ($self->is_clustered) {
+            $sth = $self->journal->prepare("SELECT pollqid, value, userid FROM pollresult2 WHERE pollid=? AND journalid=?");
+            $sth->execute($self->pollid, $self->journalid);
+            my %users = ();
+            while (my $row = $sth->fetchrow_arrayref) {
+                
+                $aggr_results{$row->[0]}{$row->[1]}++;
+                $users{$row->[2]} = 1;
+                
+            }
+            $aggr_users = keys %users;
+
+        }
+
     }
 
     #if (scalar keys %aggr_results) {

Tags: 2heoh, livejournal, pm, slobin
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