"; return BML::redirect("/feedback/"); } $body .= "\n"; $body .= '
'; $body .= ""; $body .= ""; $body .= ""; $body .= ""; $body .= ""; $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 .= "" . LJ::ljuser($username) . "

"; if ($row->{'datetime'} ne "0000-00-00 00:00:00") { $row_html .= "Filed at: $row->{'datetime'}
"; } $row_html .= ""; $row_html .= ""; my $abstract = LJ::ehtml($row->{'body'}); $abstract =~ s/\n/
/g; $row_html .= "$abstract"; } } if ($row_ct eq 0) { $body .= ""; return; } $body .= ""; $body .= ""; $body .= $row_html; my $slinks; if ($GET{'skip'}) { $slinks .= " $GET{'skip'} - $show_total}) . "\"><< Back "; } if ($row_show != $row_ct) { my $from = $GET{'skip'}+1; my $to = $row_show + $GET{'skip'}; $slinks .= "(Records $from-$to of $row_ct) "; } if ($GET{'skip'} + $row_show < $row_ct) { $slinks .= " $GET{'skip'} + $show_total}) . "\">Forward >> "; } $body .= "
LinksFeedback
"; if ($slinks ne "") { $body .= " "; } } else { $body .= ""; } return; } _code?> body=> head<= <=head page?>