add code
This commit is contained in:
209
letztenbildermin.php
Executable file
209
letztenbildermin.php
Executable file
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
|
||||
# letztenbildermin.php
|
||||
|
||||
|
||||
include('config.inc.php');
|
||||
|
||||
$datei = basename(__FILE__);
|
||||
|
||||
|
||||
$min = isset($_GET['min']) ? $_GET['min'] : '';
|
||||
$linkvon = isset($_GET['linkvon']) ? $_GET['linkvon'] : '';
|
||||
$cam = isset($_GET['cam']) ? $_GET['cam'] : '';
|
||||
$sort = isset($_GET['sort']) ? $_GET['sort'] : '';
|
||||
|
||||
|
||||
if( isset($_GET['n']) ){
|
||||
if (in_array($_GET['n'], $inc_array_n)) $n = $_GET['n'];
|
||||
else $n = reset($inc_array_n);
|
||||
}else{
|
||||
$n = reset($inc_array_n);
|
||||
}
|
||||
if( isset($_GET['m']) ){
|
||||
if (in_array($_GET['m'], $inc_array_m)) $m = $_GET['m'];
|
||||
else $m = reset($inc_array_m);
|
||||
}else{
|
||||
$m = reset($inc_array_m);
|
||||
}
|
||||
|
||||
|
||||
$heute = date("Y-m-d");
|
||||
$uhrzeit_vor_x = date("His",strtotime("-$min minutes"));
|
||||
$soll=(integer)$uhrzeit_vor_x;
|
||||
$bilder_array=jpg_in_folder($inc_pfad_www.$heute."/".$cam."/");
|
||||
|
||||
#Sort
|
||||
if($inc_min_sort=="dsc"){
|
||||
if($sort=="asc") asort($bilder_array,SORT_STRING); #ASC
|
||||
else{
|
||||
arsort($bilder_array,SORT_STRING); #DSC
|
||||
$sort="dsc";
|
||||
}
|
||||
}elseif($inc_min_sort=="asc"){
|
||||
if($sort=="dsc") arsort($bilder_array,SORT_STRING); #DSC
|
||||
else{
|
||||
asort($bilder_array,SORT_STRING); #ASC
|
||||
$sort="asc";
|
||||
}
|
||||
}else{
|
||||
if($sort=="asc") asort($bilder_array,SORT_STRING); #ASC
|
||||
else{
|
||||
arsort($bilder_array,SORT_STRING); #DSC
|
||||
$sort="dsc";
|
||||
}
|
||||
}
|
||||
|
||||
$bilder_gefunden=count($bilder_array);
|
||||
|
||||
|
||||
|
||||
# immer aufrunden
|
||||
#$html_zeilen = ceil($bilder_gefunden / $inc_x_bilder_pro_zeile);
|
||||
|
||||
|
||||
echo "<!DOCTYPE HTML>\n";
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<title></title>\n";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"$inc_letzte_min_refresh\">\n";
|
||||
echo "<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\">\n";
|
||||
#echo "<style type=\"text/css\">\n";
|
||||
#echo "td { font-family: sans-serif; font-size: 16px; }\n";
|
||||
#echo "#td1 { vertical-align: top; }\n";
|
||||
#echo "#imgmini { min-width: 160px; }\n";
|
||||
#echo "</style>\n";
|
||||
echo "</head>\n";
|
||||
echo "<body>\n";
|
||||
#echo "<div style=\"margin-left: 3%;margin-right: 3%;\">\n";
|
||||
|
||||
|
||||
# outer Geruest
|
||||
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td>\n";
|
||||
|
||||
# Kopf
|
||||
echo "<header>\n";
|
||||
echo "<div id=\"divheader\">\n";
|
||||
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
|
||||
echo "<tr>";
|
||||
echo "<td><span id=\"spanheader\">".htmlentities($inc_label_kopf, ENT_QUOTES)."</span></td>";
|
||||
echo "<td align=\"right\">";
|
||||
echo "<img style=\"display:block;\" src=\"./$inc_logo\" width=\"$inc_logo_breite\"></a>";
|
||||
echo "</td>";
|
||||
# echo "<td align=\"right\"><a id=abtnback href=\"index.php\" title=\"\"><span>zurück</span></a></td>";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
echo "</header>\n";
|
||||
|
||||
# inner Geruest
|
||||
#echo "<table border=\"0\" cellpadding=\"20\" cellspacing=\"0\" width=\"100%\">\n";
|
||||
echo "<table border=\"0\" id=\"tableinner\" width=\"100%\">\n";
|
||||
echo "<tr><td align=\"left\"><a id=abtnback href=\"index.php?n=$n&m=$m\" title=\"\"><span>zurück</span></a></td></tr>";
|
||||
echo "<tr>\n";
|
||||
echo "<td>\n";
|
||||
|
||||
|
||||
# Haupt
|
||||
echo "<table border=\"0\" width=\"100%\">\n";
|
||||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo "<span style=\"font-size: 22px;\"><b>$cam</b></span> ( ";
|
||||
|
||||
if($sort=="asc"){
|
||||
$styleasc="aascdecu";
|
||||
$styledsc="aascdec";
|
||||
$bolda1="<b>";
|
||||
$bolda2="</b>";
|
||||
$boldd1="";
|
||||
$boldd2="";
|
||||
}elseif($sort=="dsc"){
|
||||
$styleasc="aascdec";
|
||||
$styledsc="aascdecu";
|
||||
$bolda1="";
|
||||
$bolda2="";
|
||||
$boldd1="<b>";
|
||||
$boldd2="</b>";
|
||||
}else{
|
||||
$styleasc="aascdecu";
|
||||
$styledsc="aascdec";
|
||||
$bolda1="<b>";
|
||||
$bolda2="</b>";
|
||||
$boldd1="";
|
||||
$boldd2="";
|
||||
}
|
||||
|
||||
|
||||
echo "<a id=\"abtnascdsc\" href=\"$datei?cam=$cam&anzahl=$anzahl&min=$min&sort=asc&linkvon=$linkvon&n=$n&m=$m\">".$bolda1."aufsteigend".$bolda2."</a> / ";
|
||||
echo "<a id=\"abtnascdsc\" href=\"$datei?cam=$cam&anzahl=$anzahl&min=$min&sort=dsc&linkvon=$linkvon&n=$n&m=$m\">".$boldd1."absteigend".$boldd2."</a> )";
|
||||
echo "</td>";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>";
|
||||
echo "<td><span id=span16>Die letzten $min min von heute: $bild</span></td>";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
|
||||
$last="";
|
||||
$g=0;
|
||||
$td=0;
|
||||
foreach($bilder_array AS $bilddateiname) {
|
||||
$str=explode("/",strrev($bilddateiname));
|
||||
$ist=(integer)substr(strrev($str[0]),0,2).substr(strrev($str[0]),3,2).substr(strrev($str[0]),6,2);
|
||||
if($ist >= $soll) {
|
||||
$teil=explode($inc_pfad_www.$heute."/".$cam."/", $bilddateiname);
|
||||
$test=$teil[1];
|
||||
$new=substr($test,0,5);
|
||||
#aenderung -> neue tabelle
|
||||
if($last != $new or $td>=$inc_x_bilder_pro_zeile) {
|
||||
$td=0;
|
||||
if($g>0) {
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
}
|
||||
echo "<table border=\"1\" bgcolor=\"#EEEEEE\">\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td><span style=\"font-size: 18px;\">".substr($test,0,2).":".substr($test,3,2)."</span></td>\n";
|
||||
}
|
||||
echo "<td><a href=\"einzelbild.php?bild=".$heute."/".$cam."/".$test."&cam=$cam&anzahl=$anzahl&min=$min&linkvon=$datei&n=$n&m=$m\"> <img id=imgmini src=\"".$heute."/".$cam."/".$test."\" width=\"160\" height=\"120\"></a></td>";
|
||||
$g++;
|
||||
$td++;
|
||||
$last=$new;
|
||||
}
|
||||
}
|
||||
echo "</table>\n";
|
||||
|
||||
|
||||
# Ende Geruest
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>\n";
|
||||
|
||||
# Ende Geruest
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>\n";
|
||||
|
||||
|
||||
#echo "</div>\n";
|
||||
echo "</body>\n";
|
||||
echo "</html>\n";
|
||||
|
||||
|
||||
|
||||
# gibt pfad+dateiname der letzten x jpg in dem ordner
|
||||
function last_x_jpg_in_folder($d,$x) {
|
||||
$files = glob($d."*.jpg");
|
||||
return array_slice($files, -$x);
|
||||
}
|
||||
|
||||
# gibt pfad+dateiname der jpg in dem ordner
|
||||
function jpg_in_folder($d) {
|
||||
$files = glob($d."*.jpg");
|
||||
return $files;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user