body<= " unless $u; # POST keys that are not actually questions from the feedback form my @known_qkeys = ( 'general-temporary', 'general-notinterested', 'general-differentaccount', 'general-mistake', 'general-switchedservice', 'general-switchedservice-more', 'features-notright', 'features-notright-more', 'features-difficult', 'features-difficult-more', 'features-wrongequipment', 'service-support', 'service-user', 'service-buggy', 'service-journalbroken', 'other-nofriends', 'other-unwantedfriend', 'other-parents', 'other-policy', 'other-death', 'other-other', 'other-other-more', 'comments', ); # We need to make sure to use the same $now for all rows in this insertion my $now = time(); my @vals = (); my @bind = (); foreach my $qkey (@known_qkeys) { next unless $POST{$qkey}; push @vals, ($now, $u->id, $qkey, $POST{$qkey}); push @bind, "(?,?,?,?)"; } my $bind = join(",", @bind); my $dbh = LJ::get_db_writer(); $dbh->do("INSERT INTO deletion_feedback VALUES $bind", undef, @vals); # Given a category, returns 1 if any qkey of that category was selected my $checkcategory = sub { my $cat = shift; foreach my $qkey (@known_qkeys) { return 1 if $POST{$qkey} && $qkey =~ /^$cat-/; } return 0; }; my $ret; $ret .= ""; $ret .= ""; # Suggest that user contact support if they selected a feature or service problem # ...but not if they just complained about support if (($checkcategory->('features') || $checkcategory->('service')) && !$POST{'service-support'}) { $ret .= " "href='$LJ::SITEROOT/support/'"}) . " p?>"; } return $ret; } _code?> <=body page?>