online webcam
hejjeg har fundet et script på nettet er der nogen der vil hjælpe mig med at sætte den op så jeg kan bruge det på min side?
på forhånd tak
<?
/*******************************************************************************\
* FPWS - Flexible PHP Webcam Script
*
* Introduction:
* *************
* FPWS is a flexible webcam script, written in PHP (www.php.net).
* it's open source and has various config features, such as:
* font face/size, inactive detection, different refresh method's
* And more, it's even understandable for people who are not familiar with
* html or PHP code.
*
*
* Known bug's:
* ************
* On some browsers. IE <5.0 it doesn't load the pic correct. or not at all
* this however only happens when u use the META refresh method.
*
*
* Questions/Sugestions/bug reports/SWEET webcam shots ;), can be dropped here:
*
* dynom@dynom.nl
*
*
* You might want to check,
* http://fpws.dynom.ath.cx/ for the latest source.
*
* Please note:
* ************
* You may use this script as long as you keep it open source.
* (keep the 'show source' link alive!)
* on linux systems a simple ln -s would do the trick.
* name it webcam.phps or webcam.txt if .phps is not supported
* or link it to: http://fpws.dynom.ath.cx (default)
*
\*******************************************************************************/
# Defineer het volgende:
$file = "http://domain.com/cam.jpg"; // url to file (example: http://domein.nl/cam.jpg)
$title = "FWPS"; // titel of the page. (example: FPWS)
# Datum en tijd:
$show_date = "true"; // show time? (true or false)
# Refresh instellingen:
$max_refresh = "20"; // Max refresh the user can select
$min_refresh = "3"; // Min refresh the user can select
$default_refresh = "5"; // default refresh?
$refresh_method = "0"; // 0 Javascript refresh (recommended), 1 is for meta tag refresh.
# Dit werkt alleen als de site en het webcam plaatje op dezelfde server opgeslagen zijn;
$inact_detect = "true"; // Show text if the cam is inactive?
$timeout = "70"; // after how many seconds should i display if the cam is off?
// keep it above 60 seconds to be safe
# Page settings
$page_bgcolor = "#ffffff"; // Page background color (example: #ffffff (white))
$page_bgpic = ""; // Backgrond image (example: background.jpg)
// Font settings
$font_textcolor = "#222222"; // text color (example: #222222 (grey));
$font_size = "2"; // text size (default: 2)
$font_select_type = "4"; // 0 = Arial, Helvetica, sans-serif
// 1 = Times New Roman, Times, serif
// 2 = Courier New, Courier, mono
// 3 = Georgia, Times New Roman, Times, serif
// 4 = Verdana, Arial, Helvetica, sans-serif (default)
// 5 = Geneva, Arial, Helvetica, san-serif
/***********************************
*** Actual code starts here... ***
***********************************/
$refresh = $HTTP_POST_VARS["refresh"]; // 'new' enviroment var's, used $HTTP_POST_VARS for compablity reasons.
$offline = false;
if ($refresh==NULL) {
$refresh = $default_refresh;
$error = "";
}
if (($refresh < $min_refresh) || ($refresh > $max_refresh)) {
$error = "Smartass detected setting refresh back to default! (<b>". $default_refresh ."</b>)!\n";
$refresh = $default_refresh;
}
if ($inact_detect == "true" && !ereg("[:]", $file)) {
$fd = fopen($file,r);
clearstatcache();
if ((filemtime($file)+$timeout) < date(U)) {
$inact_note = "Webcam is inactive.";
$offline = true;
}
fclose($fd);
}
if ($page_bgpic != "") {
$body_line = "background='". $page_bgpic ."'";
} elseif ($page_bgcolor!="") {
$body_line = "bgcolor='". $page_bgcolor ."'";
} else {
$body_line = "bgcolor='#000000'";
}
if ($font_textcolor == "") {
$font_textcolor = "#000000";
}
switch ($font_select_type) {
case "0" :
$font_face = "Arial, Helvetica, sans-serif";
break;
case "1" :
$font_face = "Times New Roman, Times, serif";
break;
case "2" :
$font_face = "Courier New, Courier, mono";
break;
case "3" :
$font_face = "Georgia, Times New Roman, Times, serif";
break;
case "4" :
$font_face = "Verdana, Arial, Helvetica, sans-serif";
break;
default :
$font_face = "Geneva, Arial, Helvetica, san-serif";
}
$page_text = "text='". $font_textcolor ."'";
echo "
<html>
<head>
<meta http-equiv='pragma' content='no-cache'>
<meta http-equiv='expires' content='-1'>
<title>". $title ."</title>\n";
if (($refresh_method == "0") && ($offline == false)) {
echo " <script language='Javascript'>
<!--
function refreshImage(){
rfsh = new Date() ; rfsh = '?'+rfsh.getTime()
document.images['webcam'].src = '". $file ."'+rfsh
setTimeout('refreshImage()', ". ($refresh * 1000) .")
}
-->
</script>\n";
} elseif(($refresh_method == "1") || ($offline != false)) {
$str = "";
if ($offline != false) {
$str = "&offline=false";
}
echo " <meta http-equiv='refresh' content='". $refresh .";URL=". $PHP_SELF ."?refresh=". $refresh . $str."'>\n";
} else {
$error = "Config error. Define a valid refresh method.<br><br>\n";
}
echo " <style type='text/css'>
body { font-family: ". $font_face ."; font-size: ". $font_size ."px; color: ". $font_textcolor ."}
</style>
</head>
<body ". $body_line ." ". $page_text .">
<table border='0' cellspacing='0' cellpadding='0' width='95%' height='95%' align='center'>
<tr>
<td align='center' valign='center'>
<font face='". $font_face ."' size='". $font_size ."'>\n";
if ($offline != false) {
echo " <b>". $inact_note ."</b><br><br>\n";
}
if($error != "") {
echo " ". $error;
} else {
echo " Refreshing every <b>". $refresh ."</b> seconds.<br><br>\n";
echo " <img src='". $file ."' border='1' name='webcam'><br><br>\n";
if ($show_date == "true") {
echo " ". date("D M j G:i:s Y") ."\n";
}
echo " <form method=post>
<select name='refresh'>
<option value=". $refresh .">-select refresh-</option>";
for ($i=$min_refresh; $i <= $max_refresh; $i++) {
echo " <option value='". $i ."'>". $i ." seconds</option>\n";
}
echo " </select>
<input type='submit' value='save'>
</form>
<a href='http://fpws.dynom.ath.cx' target='_blank'>Show source</a>
</font>
</td>
</tr>
</table>\n";
}
if(($refresh_method == "0") && ($offline == false)) {
echo " <script language='JavaScript'>
if( document.images )
refreshImage();
</script>\n";
}
?>
</body>
</html>
