// THIS SECTION NEEDS TO STAY UPDATED WITH CURRENT INFO
$email1 = "dsherron@nbc.edu";
$email2 = "frphillips@nbc.edu";
$email3 = "";
$brokenlink = "mms://media.dcourseweb.com/brokenlink.wmv";
$querytype = substr($_SERVER["QUERY_STRING"],0,2);
$filename = $_GET[$querytype];
switch (strtoupper($querytype)) {
case "MC":
$thistype = "Chapel";
$urlpath = "mms://media.dcourseweb.com/chapel/";
$realpath = "Chapel\\"; // MUST end with \\
$premedia = "";
$postmedia = "";
$banner = ""; // Banner for below video 192 x 34 pixels
$linkto = ""; // Href for clicks on the banner
$logopic = ""; // Small Logo next to title 16 x 16 pixels GIF
break;
case "TU":
$thistype = "Test";
$urlpath = "mms://media.dcourseweb.com/chapel/";
$realpath = "Chapel\\"; // MUST end with \\
$premedia = "mms://media.dcourseweb.com/brokenlink.asf";
$postmedia = "mms://media.dcourseweb.com/brokenlink.asf";
$banner = "http://www.nbc.edu/bin/chapelvid.gif"; // Banner for below video 192 x 34 pixels
$linkto = "http://online.nbc.edu"; // Href for clicks on the banner
$logopic = "http://www.nbc.edu/bin/nbclogo.gif"; // Small Logo next to title 16 x 16 pixels GIF
break;
case "MQ":
$thistype = "Colloquium";
$urlpath = "mms://media.dcourseweb.com/colloquium/";
$realpath = "Colloquium\\"; // MUST end with \\
$premedia = "";
$postmedia = "";
$banner = ""; // Banner for below video 192 x 34 pixels
$linkto = ""; // Href for clicks on the banner
$logopic = ""; // Small Logo next to title 16 x 16 pixels GIF
break;
case "MN":
$thistype = "NBCVideos";
$urlpath = "mms://media.dcourseweb.com/nbcvideos/";
$realpath = "NBCVideos\\"; // MUST end with \\
$premedia = "";
$postmedia = "";
$banner = ""; // Banner for below video 192 x 34 pixels
$linkto = ""; // Href for clicks on the banner
$logopic = ""; // Small Logo next to title 16 x 16 pixels GIF
break;
case "MV":
$thistype = "Videos";
$urlpath = "mms://media.dcourseweb.com/videos/";
$realpath = "Videos\\"; // MUST end with \\
$premedia = "";
$postmedia = "";
$banner = ""; // Banner for below video 192 x 34 pixels
$linkto = ""; // Href for clicks on the banner
$logopic = ""; // Small Logo next to title 16 x 16 pixels GIF
break;
case "JM":
$thistype = "JAMcConnaughey";
$urlpath = "mms://media.dcourseweb.com/jamcconnaughey/";
$realpath = "JAMcConnaughey\\"; // MUST end with \\
$premedia = "mms://media.dcourseweb.com/jamcconnaughey/intro_hds4.wmv";
$postmedia = "";
$banner = ""; // Banner for below video 192 x 34 pixels
$linkto = ""; // Href for clicks on the banner
$logopic = ""; // Small Logo next to title 16 x 16 pixels GIF
break;
case "WP":
$thistype = "WMPatrick";
$urlpath = "mms://media.dcourseweb.com/wmpatrick/";
$realpath = "WMPATRICK\\"; // MUST end with \\
$premedia = "";
$postmedia = "";
$banner = ""; // Banner for below video 192 x 34 pixels
$linkto = ""; // Href for clicks on the banner
$logopic = ""; // Small Logo next to title 16 x 16 pixels GIF
break;
default:
$badlink = "Y";
}
// END UPDATED SECTION
header("Content-type: video/x-ms-asx");
$verify = file("http://podcasts.nbc.edu/bin/checkmedia.php?urlpath=".urlencode($realpath.$filename));
if ($verify) {
echo "";
if ($premedia != "") {
echo "";
echo "";
echo "";
echo "";
echo "";
}
echo "";
echo "";
echo "";
echo "";
echo "";
if ($postmedia != "") {
echo "";
echo "";
echo "";
echo "";
echo "";
}
if ($banner != "") {
echo "";
if ($linkto != "") {
echo "";
}
echo "";
}
if ($logopic != "") {
echo "";
}
echo "";
} else {
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
require("C:\php\includes\class.phpmailer.php");
Mailit($email1,$email2,$email3,$filename,$thistype,$urlpath,$realpath,$_SERVER[HTTP_REFERRER],$_SERVER[PATH_INFO],$querytype);
}
if (!function_exists('print_r_log')) {
function print_r_log($var) {
###
# USAGE:
# str print_r_log(mixed var)
#
# Allows the output from a print_r command to be placed into a
# variable for use later. Uses an output buffer to capture the output
# and returns a string with the contents.
#
# No error codes will be returned. Blank input variables will result
# in a blank output.
#
###
ob_start();
print_r($var);
$ret_str = ob_get_contents();
ob_end_clean();
return $ret_str;
}
}
function print_r_log($var) {
ob_start();
print_r($var);
$ret_str = ob_get_contents();
ob_end_clean();
return $ret_str;
}
function Mailit($email1,$email2,$email3,$filename,$thistype,$urlpath,$realpath,$referred_from,$this_doc,$querytype) {
$mail = new phpmailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "mail.nbc.edu;student.nbc.edu"; // SMTP servers
$mail->SMTPAuth = false; // turn on SMTP authentication
$mail->From = "linkchecker@nbc.edu";
$mail->FromName = "NBC Website Video Link Checker";
if ($email1 != "") {
$mail->AddAddress($email1);
}
if ($email2 != "") {
$mail->AddAddress($email2);
}
if ($email3 != "") {
$mail->AddAddress($email3);
}
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$filename = stripslashes("\\".$filename);
$body1 = ("There was a bad link to a $thistype media file.
The link was to: ".$_ENV["PATH_INFO"]."?".$_ENV["QUERY_STRING"]."
The file did not exist at ".$realpath.$filename."
Currently, I am unable to determine the page with the link.
Please locate the link, and adjust it accordingly.
".'
Debug info follows:
Server:'.print_r_log(@$_SERVER).'
Session:
'.print_r_log(@$_SESSION));
$body2 = "Bad Link";
$mail->Subject = ("Broken Windows Media Link");
$mail->Body = ($body1);
$mail->AltBody = ($body2);
if(!$mail->Send()) {
// message was not sent
//include("failure.htm");
exit;
}
}
//
//
//
?>