mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
minor bugfix: rebuild picture of fht on every entry in the log (not only on change of measured-temp. Changes in fht.php
logrotate: better warning if there are wrong rights for the pgm3-logrotate git-svn-id: https://svn.fhem.de/fhem/trunk@117 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c89a971a0d
commit
5fbd1b8050
@ -152,3 +152,6 @@ It is not necessary to tell fhem that there are other logs.
|
||||
2007-11-30 (071130)
|
||||
-- feature: RSS-Feeds added
|
||||
|
||||
2007-12-03 (071203)
|
||||
-- minor: rebuild picture of fht on every entry in the log (not only on change of measured-temp.
|
||||
|
||||
|
@ -52,3 +52,7 @@
|
||||
- Martin 2007-11-30
|
||||
- feature: RSS-Feeds added. New include/rssfeeds.php. Changes in index.php and config.php
|
||||
|
||||
- Martin 2007-12-03
|
||||
-- minor bugfix: rebuild picture of fht on every entry in the log (not only on change of measured-temp. Changes in fht.php
|
||||
-- logrotate: better warning if there are wrong rights for the pgm3-logrotate
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
# this is only possible, if the webserver (e.g.wwwrun) has the rights ro write the
|
||||
# files from fh1000.pl. If you want that then run fhz1000.pl as wwwrun too.
|
||||
# if 'yes' then only the needed lines are in the logfiles, the rest will be deleted.
|
||||
$logrotate='yes'; # yes/no default='no'
|
||||
$logrotate='yes'; # yes/no default='yes'
|
||||
|
||||
|
||||
## Kioskmode. Only show but don't switch anything. Values: on/off
|
||||
|
@ -19,6 +19,34 @@ setlocale (LC_ALL, 'de_DE.utf8');
|
||||
$file="$logpath/$drawfht.log";
|
||||
|
||||
if (! file_exists($file)) show_error($file,$drawfht,$imgmaxxfht,$imgmaxyfht);
|
||||
|
||||
|
||||
|
||||
## do we really need a new graphic??
|
||||
$execorder=$tailpath.' -1 '.$file;
|
||||
exec($execorder,$tail1);
|
||||
$parts = explode(" ", $tail1[0]);
|
||||
$date=$parts[0];
|
||||
|
||||
#if the expected graphic already exist then do not redraw the picture
|
||||
|
||||
$savefile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.".$parts[0].".png";
|
||||
if (file_exists($savefile)) {
|
||||
|
||||
$im2 = @ImageCreateFromPNG($savefile);
|
||||
header("Content-type: image/png");
|
||||
imagePng($im2);
|
||||
exit; # ;-)))
|
||||
}
|
||||
else #delete old pngs
|
||||
{
|
||||
$delfile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.*.png";
|
||||
foreach (glob($delfile) as $filename) {
|
||||
unlink($filename);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$_SESSION["arraydata"] = array();
|
||||
|
||||
@ -63,23 +91,23 @@ setlocale (LC_ALL, 'de_DE.utf8');
|
||||
$resultreverse = array_reverse($_SESSION["arraydata"]);
|
||||
|
||||
|
||||
#if the expected graphic alreay exist then do not redraw the picture
|
||||
#if the expected graphic already exist then do not redraw the picture
|
||||
|
||||
$savefile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.".$resultreverse[0][0].".png";
|
||||
if (file_exists($savefile)) {
|
||||
|
||||
$im2 = @ImageCreateFromPNG($savefile);
|
||||
header("Content-type: image/png");
|
||||
imagePng($im2);
|
||||
exit; # ;-)))
|
||||
}
|
||||
else #delete old pngs
|
||||
{
|
||||
$delfile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.*.png";
|
||||
foreach (glob($delfile) as $filename) {
|
||||
unlink($filename);
|
||||
}
|
||||
}
|
||||
# $savefile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.".$resultreverse[0][0].".png";
|
||||
# if (file_exists($savefile)) {
|
||||
#
|
||||
# $im2 = @ImageCreateFromPNG($savefile);
|
||||
# header("Content-type: image/png");
|
||||
# imagePng($im2);
|
||||
# exit; # ;-)))
|
||||
# }
|
||||
# else #delete old pngs
|
||||
# {
|
||||
# $delfile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.*.png";
|
||||
# foreach (glob($delfile) as $filename) {
|
||||
# unlink($filename);
|
||||
# }
|
||||
# }
|
||||
|
||||
|
||||
$im = ImageCreateTrueColor($imgmaxxfht,$imgmaxyfht);
|
||||
|
@ -9,7 +9,7 @@ function LogRotate($array,$file,$logrotatelines)
|
||||
$filename=$file;
|
||||
|
||||
if (!$handle = fopen($filename, "w")) {
|
||||
print "Logrotate: cannot open $filename -- correct rights??";
|
||||
print "Logrotate: cannot open $filename -- correct rights?? Read the chapter in the config.php!";
|
||||
exit;
|
||||
}
|
||||
for ($x = $counter-$logrotatelines; $x < $counter; $x++)
|
||||
|
@ -41,7 +41,7 @@ include "include/gnuplot.php";
|
||||
include "include/functions.php";
|
||||
|
||||
|
||||
$pgm3version='071130';
|
||||
$pgm3version='071203';
|
||||
|
||||
|
||||
$Action = $_POST['Action'];
|
||||
|
Loading…
Reference in New Issue
Block a user