<?php
// -----------------------------------------------------------------------------------------------
// nested_menu.php
// -----------------------------------------------------------------------------------------------
// Project: Cascading menu with image buttons using on-the-fly image creation.
// Author: Copyright (c) Urs <admin@circle.ch>
// Version: 1.0.0
// Update: 20-7-2000
// Licence: ?
// PHP: php-4.0.0-win32
//
// Source: http://www.circle.ch/scripts/code/button_menu.zip
// Reference: "menu class" written by: <zakj@i.am>,
// modified "menu class" for image use by: <admin@circle.ch>
// Syntax: for testing:
// http://localhost/nested_menu.php
// for inclusion (see also nested_menu.php):
// <img src="button.php?fg=990000&bg=ffffff&txt=button one" border="0" alt="">
// Settings: $bg = background color , hexadecimal
// $fg = foreground color , hexadecimal
// hexadecimal order : RGB (each 2byte)
//
// Enjoy!
// -----------------------------------------------------------------------------------------------
// Be aware of the patented GIF format! Adapt the routines to PNG. <http://www.libpng.org/pub/png>
// -----------------------------------------------------------------------------------------------
include('menu.php');
$main = new menu('<img src="button.php?fg=f00000&bg=dddddd&txt=AKTUELL" border="0" alt="AKTUELL">', 'menu 1');
$main->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Neuigkeiten" border="0" alt="Neuigkeiten">', 'news.html', 'main');
$main->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Angebote" border="0" alt="Angebote">', 'angebote.html', 'main');
$main2 = new menu('<img src="button.php?fg=f00000&bg=dddddd&txt=SHOPPING" border="0" alt="SHOPPING">', 'menu 2');
$main2->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Auktionen" border="0" alt="Auktionen">', 'http://members.ebay.de/aboutme/pyro-computer', '_blank');
$main2->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Online-Shop" border="0" alt="Online-Shop">', 'shop.html', 'main');
$main2->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Preisliste" border="0" alt="Preisliste">', 'preisliste.html', 'main');
$main2->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20AGBs" border="0" alt="AGBs">', 'agb.html', 'main');
$Links = new menu('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Links" border="0" alt="Links">', 'menu 3 1');
$Links->add('<img src="button.php?fg=aaaaaa&bg=eeeeee&txt=%20%20Hardware" border="0" alt="Hardware">', 'hwlinks.html', 'main');
$Links->add('<img src="button.php?fg=aaaaaa&bg=eeeeee&txt=%20%20Software" border="0" alt="Software">', 'swlinks.html', 'main');
$Support = new menu('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Support" border="0" alt="Support">', 'menu 3 2');
$Support->add('<img src="button.php?fg=aaaaaa&bg=eeeeee&txt=%20%20Formular" border="0" alt="Formular">', 'formular.html', 'main');
$Support->add('<img src="button.php?fg=aaaaaa&bg=eeeeee&txt=%20%20Kontakt" border="0" alt="Kontakt">', 'support.html', 'main');
$main3 = new menu('<img src="button.php?fg=f00000&bg=dddddd&txt=SUPPORT" border="0" alt="SUPPORT">', 'menu 3');
$main3->add($Support);
$main3->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Treiber" border="0" alt="Treiber">', 'treiber.html', 'main');
$main3->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Helpdesk" border="0" alt="Helpdesk">', 'helpdesk.html', 'main');
$main3->add($Links);
$main4 = new menu('<img src="button.php?fg=f00000&bg=dddddd&txt=IMPRESSUM" border="0" alt="IMPRESSUM">', 'menu 4');
$main4->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Kontakt" border="0" alt="Kontakt">', 'kontakt.html', 'main');
$main4->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Disclaimer" border="0" alt="Disclaimer">', 'disclaimer.html', 'main');
$main4->add('<img src="button.php?fg=666666&bg=eeeeee&txt=%20Copyright" border="0" alt="Copyright">', 'copyright.html', 'main');
// COUNTER START
$CookieTimeOut = "400"; // Cookie Timeout in Sekunden
$Num_Save_IP = "80"; // IP Adressen die gespeichert werden sollen
$IPFile = "IPs.dat"; // Datei in der die IPs gespeichert werden sollen
$LogFile = "Stat.dat"; // Datei in der die Counterdaten gespeichert werden.
$CurrentIP=$REMOTE_ADDR;
if(file_exists($IPFile))
{
$IPF=fopen($IPFile,"r+");
$IPData=fgets($IPF,2000);
$IPArray=explode("#",$IPData);
if(in_array($CurrentIP,$IPArray))
{
$Action="read";
}
else
{
$SavedIPs=count($IPArray);
if($SavedIPs<=$Num_Save_IP)
{
fputs($IPF,$CurrentIP."#");
fclose($IPF);
$Action="update";
}
else
{
$arrayp=array_pop($IPArray);
$IPArray=array_reverse($IPArray);
array_push($IPArray,$CurrentIP);
$IPArray=array_reverse($IPArray);
$AddIP=implode("#",$CurrentIP);
$IPF=fopen($IPFile,"w+");
fputs($IPF,$CurrentIP);
fclose($IPF);
$Action="update";
}
}
}
else
{
$Counter=fopen($LogFile,"w+");
fputs($Counter,1);
fclose($Counter);
$IPF=fopen($IPFile,"w^");
fputs($IPF,$CurrentIP."#");
$CurrentCount=1;
}
if($Action=="update")
{
$Counter=fopen($LogFile,"r+");
$CurrentCount=fgets($Counter,20);
$CurrentCount++;
fseek($Counter,0);
fputs($Counter,$CurrentCount);
fclose($Counter);
}
if($Action=="read")
{
$Counter=fopen($LogFile,"r+");
$CurrentCount=fgets($Counter,20);
fclose($Counter);
}
// COUNTER STOP
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Pyro Computer</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<?php
$main->show();
echo "<br>";
$main2->show();
echo "<br>";
$main3->show();
echo "<br>";
$main4->show();
?>
<br>
<font face="Verdana" color="#000000" size="1"><center>
Besucher # <?php echo $CurrentCount; ?>
</center></font>
</BODY>
</HTML>