// Main config file
include "./includes/conf/rp.php";
// Database functions
include "./includes/database/db.php";
?>
if ($_REQUEST['id']=="") {
Header ("Location: $indexpage");
}
else {
$id = $_REQUEST['id'];
connect_to_db($db_host,$db_user,$db_pwd,$db_name);
$result = db_query("select * from programs where ProgramID = '$id'");
$i = 0;
while ($i != 1) {
$programtitle = stripslashes(db_result($result,$i,"ProgramTitle"));
$subtitle = stripslashes(db_result($result,$i,"Subtitle"));
$series = stripslashes(db_result($result,$i,"Series"));
$length = db_result($result,$i,"Length");
$summary = stripslashes(db_result($result,$i,"Summary"));
$speaker = db_result($result,$i,"Speaker");
$type = db_result($result,$i,"Type");
$author = db_result($result,$i,"Author");
$authoremail = db_result($result,$i,"AuthorEmail");
$contact = db_result($result,$i,"contact");
$contactemail = db_result($result,$i,"ContactEmail");
$notes = stripslashes(db_result($result,$i,"notes"));
$keywords = stripslashes(db_result($result,$i,"Keywords"));
$nomod = db_result($result,$i,"RestrictMod");
$nosel = db_result($result,$i,"RestrictSell");
$fee = db_result($result,$i,"RestrictFee");
$noother = db_result($result,$i,"RestrictOther");
if (db_result($result,$i,"DateRec")!=0) {
$daterec = db_result($result,$i,"DateRec");
$drfx = substr($daterec,0,10);
if ( ereg( "([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $drfx, $regss ) ) {
$drfix = "$regss[2]/$regss[3]/$regss[1]";
}
}
if (db_result($result,$i,"DateRec")==0) {
$daterec = db_result($result,$i,"DateRecd");
$drfix = $daterec;
}
$location = db_result($result,$i,"Location");
$uploaded = db_result($result,$i,"DateCreated");
$ulfx = substr($uploaded,0,10);
if ( ereg( "([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $ulfx, $regs ) ) {
$ulfix = "$regs[2]/$regs[3]/$regs[1]";
}
else {
$ulfix = $ulfx;
}
$i++;
}
}
?>
if ($type=="0") { $ntype = "Unspecified"; }
elseif ($type=="7") { $ntype = "Regular Show"; }
elseif ($type==6) { $ntype = "Speech"; }
elseif ($type==9) { $ntype = "Interview"; }
elseif ($type==2) { $ntype = "Documentary"; }
elseif ($type==8) { $ntype = "Commentary"; }
elseif ($type==1) { $ntype = "News Report"; }
elseif ($type==10) { $ntype = "Action/Event"; }
elseif ($type==11) { $ntype = "Announcement"; }
elseif ($type==5) { $ntype = "Music"; }
else { $ntype = $type; }
?>
echo $pagetitle; ?>: Program Details: echo $programtitle; ?>
include "includes/navbar/navbarx.php"; ?>
echo $serieslabel; ?> echo $programtitle; ?>
Length:
echo $length; ?>
if ($subtitle!="") {
echo "\n";
echo "Subtitle: \n";
echo "$subtitle \n";
}
if ($summary!="") {
echo "\n";
echo "Summary: \n";
echo "";
echo nl2br($summary);
echo " \n";
}
if ($speaker!="") {
echo "\n";
echo "Featuring: \n";
echo "$speaker \n";
}
if ($type==0 | $type == 1 | $type==2 | $type==5 | $type==6 | $type == 7 | $type==8 | $type==9 | $type==10 | $type==11) {
echo "\n";
echo "Type: \n";
echo "$ntype ";
}
if ($daterec!=0) {
echo "\n";
echo "Recorded: \n";
echo "$drfix \n";
}
if ($location!="") {
echo "\n";
echo "Recorded At: \n";
echo "$location \n";
}
if ($author!="") {
echo "\n";
echo "Producer: \n";
echo "$author \n";
}
if ($contact!="") {
echo "\n";
echo "Uploaded By: \n";
echo "$contact \n";
}
if ($uploaded!="") {
echo "\n";
echo "Uploaded On: \n";
echo "$ulfix \n";
}
if ($keywords!="") {
echo "\n";
echo "Keywords: \n";
echo "$keywords \n";
}
if ($nomod== 1 | $nosel== 1 | $fee== 1 | $noother== 1) {
echo "\n";
echo "Restrictions: \n";
echo "\n";
if ($nomod== 1) { echo "No excerpting/modifying without permission. \n"; }
if ($nosel== 1) { echo "For non-profit use only. \n"; }
if ($fee== 1) { echo "Contact producer for permission to broadcast. \n"; }
if ($noother== 1) { echo "See notes. \n"; }
echo " \n";
}
$nolen = strlen($notes);
if ($nolen>1) {
echo "\n";
echo "Notes: \n";
echo "\n";
echo nl2br($notes);
echo "
\n";
}
echo "
 \;
";
?>
$vresult = db_query("select * from versions where ProgramID = $id order by Version");
$nvresult = db_num_rows($vresult);
if ($nvresult==1) {
$fresult = db_query("select * from files where ProgramID = $id order by Segment");
$nfresult = db_num_rows($fresult);
$v = 0;
while ($v!=$nvresult) {
$vtitle = stripslashes(db_result($vresult,$v,"VersionTitle"));
$lang = db_result($vresult,$v,"Language");
$script = db_result($vresult,$v,"Script");
$v++;
}
if ($script!="") {
$show_script = ">>
";
}
if ($script == "") {
$show_script = " ";
}
if ($vtitle!="") {
echo "$vtitle \n";
}
if ($vtitle=="") {
echo "$programtitle \n";
}
echo "Language: $lang \n";
echo "$show_script
\n";
echo "Seg \n";
echo "Title \n";
echo "Length File Info \n";
echo "Download ";
// \n";
// echo "Play
echo " \n";
$f = 0;
while ($f!=$nfresult) {
$fileid = db_result($fresult,$f,"FileID");
$seg = db_result($fresult,$f,"Segment");
$segtitle = stripslashes(db_result($fresult,$f,"Title"));
$flen = db_result($fresult,$f,"Length");
$finfo = db_result($fresult,$f,"Format");
$ster = db_result($fresult,$f,"Stereo");
if ($ster == 1) { $isstereo = " Stereo"; }
echo "$seg \n";
echo "$segtitle \n";
echo "$flen \n";
echo "$finfo $isstereo \n";
$lresult = db_query("select FileLocation,Filename from locations where FileID = $fileid");
$nlresult = db_num_rows($lresult);
$lr = 0;
while ($lr!=$nlresult) {
$nlresult = db_num_rows($lresult);
$dl = db_result($lresult,$lr,"FileLocation");
$stream = ereg_replace("ftp://", "http://", $dl);
$fname = db_result($lresult,$lr,"Filename");
$streamfmt = 'stream.m3u';
if (ereg("RealAudio", $finfo)) { $streamfmt = 'stream.ram'; $typedata = 'ram'; }
$lr++;
}
echo "HTTP (right click to save) \n";
// echo "Play ";
echo "\n";
echo "";
echo '
';
?>
";
echo " \n";
$f++;
}
echo "
\n\n\n";
}
if ($nvresult>1) {
$v = 0;
$vernum = 1;
$show_script = 0;
while($v!=$nvresult){
$vid = db_result($vresult,$v,"VersionID");
$vtitle = stripslashes(db_result($vresult,$v,"VersionTitle"));
$lang = db_result($vresult,$v,"Language");
$vlen = db_result($vresult,$v,"Length");
$script = db_result($vresult,$v,"Script");
if ($show_script == 0) {
if ($script!="") {
$show_script = ">>
";
}
if ($script == "") {
$show_script = " ";
}
}
$show_script++;
echo " $vtitle \n";
echo "Language: $lang \n";
echo "$show_script
\n";
$va = $v+1;
$fresult = db_query("select * from files where ProgramID = $id and Version = $va order by Segment");
$nfresult = db_num_rows($fresult);
echo "Seg \n";
echo "Title \n";
echo "Length File Info \n";
echo "Download \n";
echo "Play \n";
$f = 0;
while ($f!=$nfresult) {
$fileid = db_result($fresult,$f,"FileID");
$seg = db_result($fresult,$f,"Segment");
$segtitle = stripslashes(db_result($fresult,$f,"Title"));
$flen = db_result($fresult,$f,"Length");
$finfo = db_result($fresult,$f,"Format");
$ster = db_result($fresult,$f,"Stereo");
if ($ster == 1) { $isstereo = " Stereo"; }
echo "$seg \n";
echo "$segtitle \n";
echo "$flen \n";
echo "$finfo $isstereo \n";
$lresult = db_query("select * from locations where FileID = $fileid");
$nlresult = db_num_rows($lresult);
$lr = 0;
while ($lr!=$nlresult) {
$dl = db_result($lresult,$lr,"FileLocation");
$stream = ereg_replace("ftp://", "http://", $dl);
$fname = db_result($lresult,$lr,"Filename");
$streamfmt = 'stream.m3u';
if (ereg("RealAudio", $finfo)) { $streamfmt = 'stream.ram'; $typedata = 'ram'; }
$lr++;
}
echo "HTTP \n";
echo "Play \n";
$f++;
}
echo "
\n\n\n";
$v++;
$vernum++;
}
}
?>
include "includes/elements/play_instruct.php"; ?>
include "includes/elements/nav_foot.php"; ?>