$expire = 600;
$filename = "counter.txt";
if (file_exists($filename))
{
$ignore = false;
$current_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? addslashes(trim($_SERVER['HTTP_USER_AGENT'])) : "no agent";
$current_time = time();
$current_ip = $_SERVER['REMOTE_ADDR'];
// daten einlesen
$c_file = array();
$handle = fopen($filename, "r");
if ($handle)
{
while (!feof($handle))
{
$line = trim(fgets($handle, 4096));
if ($line != "")
$c_file[] = $line;
}
fclose ($handle);
}
else
$ignore = true;
// bots ignorieren
if (substr_count($current_agent, "bot") > 0)
$ignore = true;
// hat diese ip einen eintrag in den letzten expire sec gehabt, dann igornieren?
for ($i = 1; $i < sizeof($c_file); $i++)
{
list($counter_ip, $counter_time) = explode("||", $c_file[$i]);
$counter_time = trim($counter_time);
if ($counter_ip == $current_ip && $current_time-$expire < $counter_time)
{
// besucher wurde bereits gezählt, daher hier abbruch
$ignore = true;
break;
}
}
// counter hochzählen
if ($ignore == false)
{
if (sizeof($c_file) == 0)
{
// wenn counter leer, dann füllen
$add_line1 = date("z") . ":1||" . date("W") . ":1||" . date("n") . ":1||" . date("Y") . ":1||1||1||" . $current_time . "\n";
$add_line2 = $current_ip . "||" . $current_time . "\n";
// daten schreiben
$fp = fopen($filename,"w+");
if ($fp)
{
flock($fp, LOCK_EX);
fwrite($fp, $add_line1);
fwrite($fp, $add_line2);
flock($fp, LOCK_UN);
fclose($fp);
}
// werte zur verfügung stellen
$day = $week = $month = $year = $all = $record = 1;
$record_time = $current_time;
$online = 1;
}
else
{
// counter hochzählen
list($day_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode("||", $c_file[0]);
// day
$day_data = explode(":", $day_arr);
$day = $day_data[1];
if ($day_data[0] == date("z")) $day++; else $day = 1;
// week
$week_data = explode(":", $week_arr);
$week = $week_data[1];
if ($week_data[0] == date("W")) $week++; else $week = 1;
// month
$month_data = explode(":", $month_arr);
$month = $month_data[1];
if ($month_data[0] == date("n")) $month++; else $month = 1;
// year
$year_data = explode(":", $year_arr);
$year = $year_data[1];
if ($year_data[0] == date("Y")) $year++; else $year = 1;
// all
$all++;
// neuer record?
$record_time = trim($record_time);
if ($day > $record)
{
$record = $day;
$record_time = $current_time;
}
// speichern und aufräumen und anzahl der online leute bestimmten
$online = 1;
// daten schreiben
$fp = fopen($filename,"w+");
if ($fp)
{
flock($fp, LOCK_EX);
$add_line1 = date("z") . ":" . $day . "||" . date("W") . ":" . $week . "||" . date("n") . ":" . $month . "||" . date("Y") . ":" . $year . "||" . $all . "||" . $record . "||" . $record_time . "\n";
fwrite($fp, $add_line1);
for ($i = 1; $i < sizeof($c_file); $i++)
{
list($counter_ip, $counter_time) = explode("||", $c_file[$i]);
// übernehmen
if ($current_time-$expire < $counter_time)
{
$counter_time = trim($counter_time);
$add_line = $counter_ip . "||" . $counter_time . "\n";
fwrite($fp, $add_line);
$online++;
}
}
$add_line = $current_ip . "||" . $current_time . "\n";
fwrite($fp, $add_line);
flock($fp, LOCK_UN);
fclose($fp);
}
}
}
else
{
// nur zum anzeigen lesen
if (sizeof($c_file) > 0)
list($day_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode("||", $c_file[0]);
else
list($day_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode("||", date("z") . ":1||" . date("W") . ":1||" . date("n") . ":1||" . date("Y") . ":1||1||1||" . $current_time);
// day
$day_data = explode(":", $day_arr);
$day = $day_data[1];
// week
$week_data = explode(":", $week_arr);
$week = $week_data[1];
// month
$month_data = explode(":", $month_arr);
$month = $month_data[1];
// year
$year_data = explode(":", $year_arr);
$year = $year_data[1];
$record_time = trim($record_time);
$online = sizeof($c_file) - 1;
}
?>
Users online echo $online; ?>
Total so far today
Mon, 06 Feb 2012
echo $day; ?>
}
?>
David Kearns © 2003-2008
A guide to building regulations relevant to new boilers and heating systems
Major change to boiler regulations
From April 2005 all new and replacement boilers will have to be high efficiency condensing boilers (with exemption in certain circumstances). This is the date when another amendment to Part L Building Regulations will come into force. All new and replacement boilers will have to be within the A and B energy efficiency rating bands.
|
OIL BOILERS
It is now clear that oil fired boilers will be exempt from the new building regulations until 2007. Apparently this is to give manufacturers more time to develop condensing boilers, many do not currently have oil condensing boilers in their range.
There will be exemptions in the gas sector too but installations will have to meet a strict points system to gain exemption. |
Below is a brief guide to the building regulations that now apply to the installation of replacement boilers, new installations and system upgrades.
The replacement of gas and oil fired boilers and hot water cylinders are now covered under building regulations Approved Document Part L 1, England and Wales. Certification of compliance to Part L 1 can be made by a competent person, for gas, a CORGI registered installer and for oil, an OFTEC registered installer. A log book should also be kept of work undertaken. Alternatively local building control notices can be obtained.
General requirements:-
New boilers must meet energy efficiency standards.
Hot water cylinders must meet energy efficiency standards.
Minimum requirements are set for controls and systems.
Fully pumped systems should be used.
Older gravity system will require upgrading to a fully pumped system.
Thermostatic radiator valves should be fitted to at least the bedroom radiators.
An automatic bypass valve should be fitted.
A room thermostat is required.
A cylinder thermostat is required.
Wired interlocking is required switching off both the pump and boiler when there is no demand for heat.
This is not a comprehensive list
For combination boilers not all of the above is applicable.
Further information can be obtained from your local building control office or on the internet.
(Try the ODPM website or your district council website.)
If work has not been certified there may be problems if you should try to sell the property.
Check www.boilers.org.uk/ for more information on boiler efficiency ratings, running costs etc.
DIY gas work, what you should know
Home