224 lines
7.3 KiB
PHP
Executable File
224 lines
7.3 KiB
PHP
Executable File
<?php
|
|
|
|
# $datei
|
|
|
|
include('config.inc.php');
|
|
|
|
$datei = basename(__FILE__);
|
|
|
|
$heute = date("Y-m-d");
|
|
|
|
$URL=$_SERVER['REQUEST_URI'];
|
|
|
|
#echo $URL;
|
|
|
|
$bild = isset($_GET['bild']) ? $_GET['bild'] : '';
|
|
$linkvon = isset($_GET['linkvon']) ? $_GET['linkvon'] : 'index.php';
|
|
$cam = isset($_GET['cam']) ? $_GET['cam'] : '';
|
|
$anzahl = isset($_GET['anzahl']) ? $_GET['anzahl'] : '';
|
|
$min = isset($_GET['min']) ? $_GET['min'] : '';
|
|
$rotate = isset($_GET['rotate']) ? $_GET['rotate'] : '0';
|
|
$datum = isset($_GET['datum']) ? $_GET['datum'] : $heute;
|
|
$mode = isset($_GET['mode']) ? $_GET['mode'] : 'motion';
|
|
$b = isset($_GET['b']) ? $_GET['b'] : '800';
|
|
$r = isset($_GET['r']) ? $_GET['r'] : '0';
|
|
|
|
if(!isset($breite) or $breite=="" or $breite < 300 or $breite > 2000 ) $breite=800;
|
|
if($linkvon!="index.php" and $linkvon!="allebilder.php" and $linkvon!="letztenbilder.php" and $linkvon!="letztenbildermin.php") $linkvon="index.php";
|
|
|
|
$bildplus="";
|
|
$bildminus="";
|
|
$bildplus2="";
|
|
$bildminus2="";
|
|
$bildplus3="";
|
|
$bildminus3="";
|
|
if($bild != "") {
|
|
$bilder_array=jpg_in_folder($inc_pfad_www.$datum."/".$cam."/");
|
|
asort($bilder_array,SORT_STRING);
|
|
$bildpos = array_search($inc_pfad_www.$bild, $bilder_array);
|
|
$bildcount = count($bilder_array);
|
|
|
|
if( $bildpos < ($bildcount-1) ){
|
|
str_replace("$inc_pfad_www","",$bilder_array[$bildpos-1]);
|
|
$bildplus=str_replace("$inc_pfad_www","",$bilder_array[$bildpos+1]);
|
|
}
|
|
if( $bildpos >= 1 ){
|
|
str_replace("$inc_pfad_www","",$bilder_array[$bildpos-1]);
|
|
$bildminus=str_replace("$inc_pfad_www","",$bilder_array[$bildpos-1]);
|
|
}
|
|
if( $bildpos < ($bildcount-2) ){
|
|
str_replace("$inc_pfad_www","",$bilder_array[$bildpos-2]);
|
|
$bildplus2=str_replace("$inc_pfad_www","",$bilder_array[$bildpos+2]);
|
|
}
|
|
if( $bildpos >= 2 ){
|
|
str_replace("$inc_pfad_www","",$bilder_array[$bildpos-2]);
|
|
$bildminus2=str_replace("$inc_pfad_www","",$bilder_array[$bildpos-2]);
|
|
}
|
|
if( $bildpos < ($bildcount-3) ){
|
|
str_replace("$inc_pfad_www","",$bilder_array[$bildpos-3]);
|
|
$bildplus3=str_replace("$inc_pfad_www","",$bilder_array[$bildpos+3]);
|
|
}
|
|
if( $bildpos >= 3 ){
|
|
str_replace("$inc_pfad_www","",$bilder_array[$bildpos-3]);
|
|
$bildminus3=str_replace("$inc_pfad_www","",$bilder_array[$bildpos-3]);
|
|
}
|
|
|
|
}
|
|
|
|
#print_r($bilder_array);
|
|
|
|
|
|
$taste_bildminus="/motion/"."$datei?bild=$bildminus&cam=$cam&mode=$mode&r=$r&datum=$datum&anzahl=$anzahl&linkvon=$linkvon&b=$b";
|
|
$taste_bildplus="/motion/"."$datei?bild=$bildplus&cam=$cam&mode=$mode&r=$r&datum=$datum&anzahl=$anzahl&linkvon=$linkvon&b=$b";
|
|
$taste_bildminus3="/motion/"."$datei?bild=$bildminus3&cam=$cam&mode=$mode&r=$r&datum=$datum&anzahl=$anzahl&linkvon=$linkvon&b=$b";
|
|
$taste_bildplus3="/motion/"."$datei?bild=$bildplus3&cam=$cam&mode=$mode&r=$r&datum=$datum&anzahl=$anzahl&linkvon=$linkvon&b=$b";
|
|
|
|
|
|
$muster_datum = "/[0-9]{4}-[0-9]{2}-[0-9]{2}/";
|
|
$muster_uhrzeit = "/[0-9]{2}-[0-9]{2}-[0-9]{2}-/";
|
|
preg_match($muster_datum, $bild, $array_datum_bild);
|
|
preg_match($muster_uhrzeit, $bild, $array_uhrzeit_bild);
|
|
preg_match($muster_datum, $bildminus, $array_datum_bild_minus);
|
|
preg_match($muster_uhrzeit, $bildminus, $array_uhrzeit_bild_minus);
|
|
preg_match($muster_datum, $bildplus, $array_datum_bild_plus);
|
|
preg_match($muster_uhrzeit, $bildplus, $array_uhrzeit_bild_plus);
|
|
preg_match($muster_datum, $bildminus2, $array_datum_bild_minus2);
|
|
preg_match($muster_uhrzeit, $bildminus2, $array_uhrzeit_bild_minus2);
|
|
preg_match($muster_datum, $bildplus2, $array_datum_bild_plus2);
|
|
preg_match($muster_uhrzeit, $bildplus2, $array_uhrzeit_bild_plus2);
|
|
preg_match($muster_datum, $bildminus3, $array_datum_bild_minus3);
|
|
preg_match($muster_uhrzeit, $bildminus3, $array_uhrzeit_bild_minus3);
|
|
preg_match($muster_datum, $bildplus3, $array_datum_bild_plus3);
|
|
preg_match($muster_uhrzeit, $bildplus3, $array_uhrzeit_bild_plus3);
|
|
|
|
$datum_bild = $array_datum_bild[0];
|
|
$uhrzeit_bild = str_replace('-',':',rtrim($array_uhrzeit_bild[0],'-'));
|
|
$datum_bild_minus = $array_datum_bild_minus[0];
|
|
$uhrzeit_bild_minus = str_replace('-',':',rtrim($array_uhrzeit_bild_minus[0],'-'));
|
|
$datum_bild_minus2 = $array_datum_bild_minus2[0];
|
|
$uhrzeit_bild_minus2 = str_replace('-',':',rtrim($array_uhrzeit_bild_minus2[0],'-'));
|
|
$datum_bild_minus3 = $array_datum_bild_minus3[0];
|
|
$uhrzeit_bild_minus3 = str_replace('-',':',rtrim($array_uhrzeit_bild_minus3[0],'-'));
|
|
$datum_bild_plus = $array_datum_bild_plus[0];
|
|
$uhrzeit_bild_plus = str_replace('-',':',rtrim($array_uhrzeit_bild_plus[0],'-'));
|
|
$datum_bild_plus2 = $array_datum_bild_plus2[0];
|
|
$uhrzeit_bild_plus2 = str_replace('-',':',rtrim($array_uhrzeit_bild_plus2[0],'-'));
|
|
$datum_bild_plus3 = $array_datum_bild_plus3[0];
|
|
$uhrzeit_bild_plus3 = str_replace('-',':',rtrim($array_uhrzeit_bild_plus3[0],'-'));
|
|
|
|
|
|
|
|
echo "<!DOCTYPE HTML>\n";
|
|
echo "<html>\n";
|
|
echo "<head>\n";
|
|
echo "<title></title>\n";
|
|
if($mode=="live") $refresh=$inc_index_aktuell_refresh;
|
|
else $refresh=$inc_einzel_refresh;
|
|
echo "<meta http-equiv=\"refresh\" content=\"$refresh\">\n";
|
|
echo "<style type=\"text/css\">\n";
|
|
echo "body {\n";
|
|
echo " margin: 0;\n";
|
|
echo " padding: 0;\n";
|
|
echo "}\n";
|
|
echo "iframe {\n";
|
|
echo " display: block;\n";
|
|
echo " background: #000;\n";
|
|
echo " border: none;\n";
|
|
echo " height: 90vh;\n";
|
|
echo " width: 100vw;\n";
|
|
echo "}\n";
|
|
echo "</style>\n";
|
|
echo "</head>\n";
|
|
echo "<body>\n";
|
|
|
|
|
|
echo "<script language=\"Javascript\">\n";
|
|
|
|
echo "function rPressed() {\n";
|
|
if( $bildplus3!="" ) echo "window.location = '".$taste_bildplus3."';\n";
|
|
echo "}\n";
|
|
echo "function qPressed() {\n";
|
|
if( $bildminus3!="" ) echo "window.location = '".$taste_bildminus3."';\n";
|
|
echo "}\n";
|
|
echo "function wPressed() {\n";
|
|
if( $bildminus!="" ) echo "window.location = '".$taste_bildminus."';\n";
|
|
echo "}\n";
|
|
echo "function ePressed() {\n";
|
|
if( $bildplus!="" ) echo "window.location = '".$taste_bildplus."';\n";
|
|
echo "}\n";
|
|
echo "document.onkeydown = function(evt) {\n";
|
|
echo "evt = evt || window.event;\n";
|
|
echo "switch (evt.keyCode) {\n";
|
|
echo "case 81:\n";
|
|
echo "qPressed();\n";
|
|
echo "break;\n";
|
|
echo "case 82:\n";
|
|
echo "rPressed();\n";
|
|
echo "break;\n";
|
|
echo "case 69:\n";
|
|
echo "ePressed();\n";
|
|
echo "break;\n";
|
|
echo "case 87:\n";
|
|
echo "wPressed();\n";
|
|
echo "break;\n";
|
|
echo "}\n";
|
|
echo "};\n";
|
|
|
|
echo "</script>\n";
|
|
|
|
|
|
# outer Geruest
|
|
#echo "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
|
|
#echo "<tr>\n";
|
|
#echo "<td>\n";
|
|
|
|
|
|
|
|
if($b==400) $bold400="<b>400 Pixel</b>";
|
|
else $bold400="400 Pixel";
|
|
if($b==800) $bold800="<b>800 Pixel</b>";
|
|
else $bold800="800 Pixel";
|
|
if($b==1200) $bold1200="<b>1200 Pixel</b>";
|
|
else $bold1200="1200 Pixel";
|
|
if($b==1600) $bold1600="<b>1600 Pixel</b>";
|
|
else $bold1600="1600 Pixel";
|
|
|
|
echo "<iframe src=\"./2015-11-02/cam3/15-24-13-0001.jpg\" frameborder=\"0\"></iframe>\n";
|
|
|
|
# Ende Geruest
|
|
#echo "</td>";
|
|
#echo "</tr>";
|
|
#echo "</table>\n";
|
|
|
|
#echo "</div>\n";
|
|
echo "</body>\n";
|
|
echo "</html>\n";
|
|
|
|
|
|
|
|
|
|
|
|
# gibt pfad+dateiname der jpg in dem ordner
|
|
function jpg_in_folder($d) {
|
|
$files = glob($d."*.jpg");
|
|
return $files;
|
|
}
|
|
|
|
|
|
function scandir_files_live($d,$cam) {
|
|
$array = array_filter(scandir($d), function ($f) use($d,$cam) {
|
|
if($f == ".") return false;
|
|
elseif($f == "..") return false;
|
|
elseif( preg_match("/".$cam."_[0-9]+/", $f) and date("U",filemtime($d.$f)) >= time() - 3) return is_file($d . DIRECTORY_SEPARATOR . $f);
|
|
else return false;
|
|
});
|
|
$array = array_values($array);
|
|
return $array[count($array)-2];
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|
|
|