"; $nr++; } */ //echo "Regnbågsallén, Luleå Tekniska Universitet
"; //viewpic(); //sleep(2); if ($UPDATE==0) { if (($datum[1]!=$ldatum[1])||($datum[2]!=$ldatum[2])||($datum[3]!=$ldatum[3])) { // echo "GET THE NEW PICTURE!
\n"; //$hour,$min,$day,$month,$year wwwcopy($pictureurl,$savefile,$datum[5],$datum[6],$datum[1],$datum[2],$datum[3]); writedate($datum[1],$datum[2],$datum[3],$datum[4],$datum[5],$datum[6]); } } elseif ($UPDATE==1) { $hour=$datum[5]; $lhour=$ldatum[5]; if (($datum[1]!=$ldatum[1])||($datum[2]!=$ldatum[2])||($datum[3]!=$ldatum[3])||($hour!=$lhour)) { wwwcopy($pictureurl,$savefile,$datum[5],$datum[6],$datum[1],$datum[2],$datum[3]); writedate($datum[1],$datum[2],$datum[3],$datum[4],$datum[5],$datum[6]); } } elseif ($UPDATE==2) { $hour=$datum[5]; $lhour=$ldatum[5]; $min=$datum[6]; $lmin=$ldatum[6]; if (($datum[1]!=$ldatum[1])||($datum[2]!=$ldatum[2])||($datum[3]!=$ldatum[3])||($hour!=$lhour)||($min!=$lmin)) { // echo "GET THE NEW PICTURE!
\n"; wwwcopy($pictureurl,$savefile,$datum[5],$datum[6],$datum[1],$datum[2],$datum[3]); writedate($datum[1],$datum[2],$datum[3],$datum[4],$datum[5],$datum[6]); } } elseif ($UPDATE==3) { $hour=$datum[5]; $lhour=$ldatum[5]; $min=$datum[6]; $lmin=$ldatum[6]; $diff=$min-$lmin; if ($hour>$lhour) $diff=16; if (($datum[1]!=$ldatum[1])||($datum[2]!=$ldatum[2])||($datum[3]!=$ldatum[3])||($hour!=$lhour)||($diff>15)) { wwwcopy($pictureurl,$savefile,$datum[5],$datum[6],$datum[1],$datum[2],$datum[3]); // wwwcopy($pictureurl,$savefile); writedate($datum[1],$datum[2],$datum[3],$datum[4],$datum[5],$datum[6]); } } elseif ($UPDATE==4) { // echo "GET THE NEW PICTURE!
\n"; wwwcopy($pictureurl,$savefile,$datum[5],$datum[6],$datum[1],$datum[2],$datum[3]); // wwwcopy($pictureurl,$savefile); writedate($datum[1],$datum[2],$datum[3],$datum[4],$datum[5],$datum[6]); } // Old place for viewpic $ldatum = lastdate(); // writelastdate($ldatum[5],$ldatum[6],$ldatum[1],$ldatum[2],$ldatum[3]); function tudaydate() { // $tudaydate = date("M j G:i Y"); $day = date("j"); $month = date("M"); $year = date("Y"); $time = date("G:i"); $hour = date("G"); $min = date("i"); return array ($tudaydate,$day,$month,$year,$time,$hour,$min); } function lastdate() { // Läsa in aktuellt datum från loggen $lastdate2 = file("lastdate.txt"); $rownr=0; $lday = $lastdate2[$rownr]; $lday = str_replace("\n","",$lday); $rownr++; $lmonth = $lastdate2[$rownr]; $lmonth = str_replace("\n","",$lmonth); $rownr++; $lyear = $lastdate2[$rownr]; $lyear = str_replace("\n","",$lyear); $rownr++; $ltime = $lastdate2[$rownr]; $ltime = str_replace("\n","",$ltime); $rownr++; $lhour = $lastdate2[$rownr]; $lhour = str_replace("\n","",$lhour); $rownr++; $lmin = $lastdate2[$rownr]; $lmin = str_replace("\n","",$lmin); return array ($empty,$lday,$lmonth,$lyear,$ltime,$lhour,$lmin); } function writelastdate($lhour,$lmin,$lday,$lmonth,$lyear) { $lmonth = str_replace("Jan","januari",$lmonth); $lmonth = str_replace("Feb","februari",$lmonth); $lmonth = str_replace("Mar","mars",$lmonth); $lmonth = str_replace("Apr","april",$lmonth); $lmonth = str_replace("May","maj",$lmonth); $lmonth = str_replace("Jun","juni",$lmonth); $lmonth = str_replace("Jul","juli",$lmonth); $lmonth = str_replace("Aug","augusti",$lmonth); $lmonth = str_replace("Sep","september",$lmonth); $lmonth = str_replace("Oct","oktober",$lmonth); $lmonth = str_replace("Nov","november",$lmonth); $lmonth = str_replace("Dec","december",$lmonth); if (($lhour>0)&&($lhour<10)) { $lhour="0$lhour"; // if ($lhour!="00") $lhour = str_replace("0","00",$lhour); } /* if (($lmin>0)&&($lmin<10)) { $lmin="0$lmin"; if ($lmin!="00") $lmin = str_replace("0","00",$lmin); } */ if ($lday=="1") $lday="1:a"; elseif ($lday=="2") $lday="2:a"; elseif ($lday=="21") $lday="21:a"; elseif ($lday=="22") $lday="22:a"; elseif ($lday=="31") $lday="31:a"; elseif ($lday=="32") $lday="32:a"; else $lday="$lday:e"; echo (" $lhour:$lmin den $lday $lmonth $lyear"); } function writedate($day,$month,$year,$time,$hour,$min) { // Skriva aktuellt datum till loggen $lastdate = "lastdate.txt"; $fp = @fopen ($lastdate, "w"); @fwrite($fp, "$day\n$month\n$year\n$time\n$hour\n$min\n"); @fclose ($fp); } function wwwcopy($file,$nfile,$hour,$min,$day,$month,$year) { $fp = @fopen($file,"rb"); /* if (!($fp)) { continue; } else { while(!feof($fp)) { $cont.= fread($fp,1024); } @fclose($fp); $fp2 = @fopen($nfile,"w"); @fwrite($fp2,$cont); @fclose($fp2); } */ if ($fp) { while(!feof($fp)) { $cont.= fread($fp,1024); } @fclose($fp); $fp2 = @fopen($nfile,"w"); @fwrite($fp2,$cont); @fclose($fp2); // copy("webcam.jpg", "webcam/"."webcam$year-$month-$day--$hour-$min.jpg"); } } function viewpic() { $ldatum = lastdate(); // För att byta bild vid mouse over // echo "
"; //Medelstor // ej modifierad // echo "
"; // digital förstoring echo "
"; //Största // echo "
"; }