hallo
diesmal kann ich sagen der code funtzt halba. die dateien die ich brauche gibts. der counter wird schön angezeigt. jedoch zählt er nicht...
ich habe ka why?
kann ma jemand schaun... THX!!!
mfg ![]()
code:
PHP
<?php
// PNG-Grafik definieren
header("Content-type: image/png");
// Breite/Höhe des bildes
$imgBreite=70;
$imgHoehe=170;
// Image-Objekt erzeugen und Farben definieren
$bild=imagecreate($imgHoehe, $imgBreite);
$farbeGrau=imagecolorallocate($bild, 255, 153, 0);
$farbeWeiss=imagecolorallocate($bild, 255, 255, 255);
$farbeBlau=imagecolorallocate($bild, 0, 50, 255);
$farbeRot=imagecolorallocate($bild, 255, 0, 0);
//imagecolortransparent($bild,$farbeBlau);
// ende bild sachen vorerst
$CookieTimeOut = "1"; // Cookie Timeout in Sekunden
$Num_Save_IP = "1000000"; // IP Adressen die gespeichert werden sollen
$IPFile = "IPs.txt"; // Datei in der die IPs gespeichert werden sollen
$LogFile = "stat.htm"; // Datei in der die Counterdaten gespeichert werden.
$DispLen = 6; // Mindestanzahl der Counterstellen
$BackCol = ""; //Hintergrundfarbe des Counters
$Border = "0"; // Rahmenbreite des Counters
$imgHeight = 20; // Höhe des Ziffern Bildes
$imgWidth = 15; // Breite des Ziffern Bildes
//Bilder für die Ziffern 0-9
$img[0]="img/ani0.gif";
$img[1]="img/ani1.gif";
$img[2]="img/ani2.gif";
$img[3]="img/ani3.gif";
$img[4]="img/ani4.gif";
$img[5]="img/ani5.gif";
$img[6]="img/ani6.gif";
$img[7]="img/ani7.gif";
$img[8]="img/ani8.gif";
$img[9]="img/ani9.gif";
//*************
//* Quelltext *
//*************
$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);
}
if ($DispLen > strlen($CurrentCount))
{
$dsize=$DispLen-strlen($CurrentCount);
for ($i=0; $i < $dsize; $i++)
{
$CurrentCount="0".$CurrentCount;
}
}
//$CurrentCount = "003456";
$count = strval($CurrentCount);
$countpos = 40;
$y = 0;
$number = chunk_split($count);
//WEiter mit dem bild
imagettftext($bild, 15, 0, 5, 17, $farbeRot, "font1.ttf", "Besucher Nr.:");
for ($i=0; $i < strlen($count); $i++)
{
imagettftext($bild, 12, 0, $countpos, 35, $farbeBlau, "zahlen.ttf", $number[$i]);
Alles anzeigen
$y ++;
$countpos = $countpos + 12;
}
// Diagramm ausgeben und Grafik
// aus dem Speicher entfernen
imagepng($bild);
imagedestroy($bild);
?>
[/code]