"; return BML::redirect("/feedback/"); } $body .= "\n"; $body .= '
"; return unless $GET{'mode'}; if ($GET{'mode'} eq "list") { my @where; my $dbr = LJ::get_db_reader(); $body .= ""; if ($GET{'viewall'} ne "") { # Do nothing extra } if ($GET{'username'} ne "") { my $userid = LJ::get_userid($GET{'username'}); unless ($userid) { $body .= " "; return; } push @where, "userid=$userid"; } if ($GET{'url'} ne "") { my $qvalue = $dbr->quote($GET{'url'}); push @where, "url=$qvalue"; } if ($GET{'state'} ne "") { my $qvalue = $dbr->quote($GET{'state'}); push @where, " state=$qvalue"; } my $where; my $i; if (@where > 0) { $where = "WHERE "; foreach (@where) { $i++; $where .= $i == 1 ? $_ : " && " . $_; } } my $sth = $dbr->prepare("SELECT * FROM fotobilder_feedback $where"); $sth->execute; my $show_total = 50; my $row_ct = 0; my $row_show = 0; my $row_skip = 0; my $row_html; my @rows; while (my $row = $sth->fetchrow_hashref) { push @rows, $row; } foreach my $row ( reverse @rows ) { next if LJ::trim($row->{'body'}) eq ""; $row_ct++; next if $GET{'skip'} && ++$row_skip <= $GET{'skip'}; if ($row_show < $show_total) { $row_show++; my $username = LJ::get_username($row->{'userid'}); $row_html .= "Links | Feedback |
---|