Loudblog-plugin written

Today, I had to write a plugin to be able to play OGG-files online in a webcast running Loudblog. I used the supplied function for displaying a link to the audio file in the posting, which were only modified.

[php]

function oggplayer($content){

//generates the link to the audiofile (works within postings-loop)
global $settings;
global $currentid;
global $postings;

//redirect or direct link?
if ($settings[‘countweb’] == ”1”) {
$before = ”get.php?web=”;
} else {
$before = ”audio/”;
}

if (!veryempty($postings[$currentid][‘audio_file’])) {
if ($postings[$currentid][‘filelocal’] == 1) {
$audio = $before . $postings[$currentid][‘audio_file’];
} else {
$audio = $postings[$currentid][‘audio_file’];
if ($settings[‘countweb’] == ”1”) {
$audio = $before.$audio;
}
}

$return = ”<a href=”http://www.jcraft.com/jorbis/player/JOrbisPlayer.php?play=&#8221;. $settings[‘url’].”/”.$audio . ”” title=””.$postings[$currentid][‘title’].””>”;
$return .= fullparse (stripcontainer ($content));
$return .= ”</a>n”;
return trim($return);
} else {
return ””;
}
}

[/php]

Kommentera

Fyll i dina uppgifter nedan eller klicka på en ikon för att logga in:

WordPress.com Logo

Du kommenterar med ditt WordPress.com-konto. Logga ut / Ändra )

Twitter-bild

Du kommenterar med ditt Twitter-konto. Logga ut / Ändra )

Facebook-foto

Du kommenterar med ditt Facebook-konto. Logga ut / Ändra )

Google+ photo

Du kommenterar med ditt Google+-konto. Logga ut / Ändra )

Ansluter till %s