| $link | "; $ret .= "";
$ret .= $ppe->{location} eq 'none' ? "VoicePost" : "VoicePost";
$ret .= LJ::help_icon_html("voicepost", " ");
$ret .= " $K $duration "; # include flash mp3 player. if ($datatypes->{ $ppe->{filetype} }->{ext} eq 'mp3' && $ppe->{posttime} > ( $LJ::PHONEPOST_FLASH_MP3_SUPPORT || $LJ::EndOfTime) ) { $ret .= qq{ }; } $ret .= " | ";
unless ($mode eq 'notrans') {
my $trans_url = "$LJ::SITEROOT/voicepost/transcribe.bml?user=$u->{user}&ppid=$dppid";
my $trans = LJ::PhonePost::get_latest_trans($u, $phonepostid);
if ($trans) {
my $by;
if ($trans->{revid} == 0) {
$by = 'spinvox';
} elsif ($trans->{revid} == 1) {
$by = LJ::ljuser(LJ::get_username($trans->{posterid}));
} else {
# multiple users transcribing, or just multiple transcriptions of one user?
my $memkey = [$u->{userid},"ppetu:$u->{userid}:$phonepostid"];
my $tu = LJ::MemCache::get($memkey);
unless (defined $tu) {
my $dbr = LJ::get_cluster_reader($u);
$tu = $dbr->selectrow_array("SELECT COUNT(DISTINCT(posterid)) " .
"FROM phoneposttrans " .
"WHERE journalid=? AND blobid=?",
undef, $u->{'userid'}, $phonepostid + 0);
LJ::MemCache::set($memkey, $tu);
}
$by = ($tu == 1) ? LJ::ljuser(LJ::get_username($trans->{posterid})) : "multiple users";
}
my $text = LJ::ehtml($trans->{body});
$text =~ s/\n/“$text” "; # auto-transcribed by SpinVox? if ($by eq 'spinvox') { $ret .= "Auto-Transcribed Voice Post"; # don't show if journal is paid/perm OR if logged-in user is paid/perm unless ($u->in_any_class('paid', 'perm') || ($remote && $remote->in_any_class('paid', 'perm'))) { $ret .= " - spoken through " . LJ::PhonePost::spinvox_username(); } } else { $ret .= "Transcribed by: $by | ";
}
} elsif (LJ::PhonePost::may_transcribe($u, $remote)) {
$ret .= "(transcribe) | "; } else { $ret .= "(no transcription available) | "; } } $ret .= "