counter von modxcms
Counter zählt merkwürdigerweise nicht
Hallo alle,
ich hab bei MODXCMS folgenden Counter gefunden (und schon zum Teil angepasst...), aber irgendwie zählt er nicht...
Vielleicht hat ja jemand von euch eine Idee:
Schon mal Danke für Tipps,
Norbert
ich hab bei MODXCMS folgenden Counter gefunden (und schon zum Teil angepasst...), aber irgendwie zählt er nicht...
Vielleicht hat ja jemand von euch eine Idee:
<?php
session_start();
$pathtxt="contatore/counter.txt";
$visual="img";
$pathimg="http://www.meinewebseite.de/contatore/img";
@ $sessione = $_SESSION['session_id'];
if ($sessione == "sessione"){
$fp=fopen("$pathtxt","r+") OR DIE ("Die Datei counter.txt konnte nicht geöffnet werden...");
flock($fp,2);
$countxt=fgets($fp,1024);
flock($fp,3);
//visualizza il counter
if($visual=='text'){
echo"$countxt";} else {
$lenght=strlen($countxt) - 1;
$contimg=array();
for($i=0;$i < $lenght;$i++){$contimg[$i] = substr($countxt,$i,1); }
for ($i = 0;$i < $lenght;$i++){
$countimg= "<img src=\"".$pathimg."/".$contimg[$i].".gif\""
." alt=\"".$contimg[$i]."\" />";
echo"$countimg";}}
} else {
$_SESSION['session_id']="sessione";
$fp=fopen("$pathtxt","r+") OR DIE ("impossibile aprire il file");
flock($fp,2);
$countxt=fgets($fp,1024);
flock($fp,3);
$countxt++;
$fp=fopen("$pathtxt","w+") OR DIE ("impossibile aprire il file");
flock($fp,2);
fputs($fp,"$countxt");
flock($fp,3);
fclose($fp);
//visualizza il counter
if($visual=='text'){
echo"$countxt";}else{
$lenght=strlen($countxt) - 1;
$contimg=array();
for($i=0;$i < $lenght;$i++){$contimg[$i] = substr($countxt,$i,1); }
for ($i = 0;$i < $lenght;$i++){
$countimg= "<img src=\"".$pathimg."/".$contimg[$i].".gif\""
." alt=\"".$contimg[$i]."\" />";
echo"$countimg";}}
}
?>
Schon mal Danke für Tipps,
Norbert
Please also mark the comments that contributed to the solution of the article
Content-Key: 75510
Url: https://administrator.de/contentid/75510
Printed on: April 26, 2024 at 03:04 o'clock