|
|
Bienvenue - Nous sommes
le
.
Il y a actuellement
/* -------------------------------------------------------- */
/* Script Compteur Temps Réel */
/* Auteur: Matthieu Chevalier */
/* Web-Site: http://matthieu.chevalier.free.fr/ */
/* Email: matthieu.chevalier@free.fr */
/* */
/* -------------------------------------------------------- */
/* Valeur à modifier pour appliquer à votre site */
$tempmax = 180; // temps au bout duquel le visiteur n'est plus compté présent s'il ne racharge pas une page. (en secondes)
$userfile="data/visitonline.dat"; // nom de votre fichier de comptage(recommandé de ne pas le changer)
$tempfile="data/tempfile.dat"; //nom du fichier temporaire
/* Ne plus rien modifier en dessous de cette ligne */
$sec = time();
$expire=$sec + $tempmax;
$ipvisit="$REMOTE_ADDR";
function substrcount($haystack, $needle) {
$offset=0;
$i = 0;
$counter = 0;
while ($i==0) {
$longueur = strlen($haystack);
$position=strpos($haystack,$needle,$offset);
if ($position && ($offset + strlen($needle)) <= $longueur) {
$offset = $position+strlen($needle);
$counter++;
} else {
$i++;
}}
return $counter;
}
$cont=fopen("$userfile","r+");
$contenu="";
while (!feof($cont)) {
$suite=fgets($cont, 4096);
$contenu.="$suite";
}
fclose($cont);
$nbreligne=substrcount("$contenu","\n");
$visit = explode("\n",$contenu);
$j=0;
$ligneecrite="$ipvisit|$expire\n";
$tempfi=fopen("$tempfile","a+");
fwrite($tempfi,"$ligneecrite");
fclose($tempfi);
$nbreonline++;
while ($j < $nbreligne){
$idvisit=explode("|",chop($visit[$j]));
if ($idvisit[0] != $ipvisit){
if ($idvisit[1] >= $sec){
$ligneecrite="$idvisit[0]|$idvisit[1]\n";
$tempfi=fopen("$tempfile","a+");
fputs($tempfi,"$ligneecrite");
fclose($tempfi);
}}
$j++;
}
copy("$tempfile","$userfile");
$conte = fopen("$userfile","r");
$contenu2 = "";
$contenu="";
while (!feof($conte)) {
$suite2=fgets($conte, 4096);
$contenu2.="$suite2";
}
fclose ($conte);
$nbreligne2 = substrcount("$contenu2","\n");
$nbreonline = "$nbreligne2";
$testtemp=fopen("$tempfile","w+");
fseek($testtemp,0);
fputs($testtemp,"");
fclose($testtemp);
if ($nbreonline==1){$afficher="$nbreonline personne";}
if ($nbreonline>1){$afficher="$nbreonline personnes";}
if ($voir=="js"){
print "document.write('".$afficher."');";
}
if ($voir=="php"){
echo("$afficher");
}
if ($voir=="no"){
}
?> sur le site.
Il y a eu
include("compteur.php");
?>
pages vues. |
|
|
|
How do you do
I'm so tired of waiting
I hope it won't take long
My true love is laboring
While I sing this song
A cry from the bed
Where my wife lays her head
And out comes a little head
A face that's red and blue
Now I see that it's a she
A girl, how do you do...
Just off the road, ain't slept all night
Got home just after eight
And the morning mist cleared as
I reached the gate
And as I dragged to bed
To have a well earned kick
I saw the note saying baby's coming
Try to get here quick
I'm so tired of waiting
I hope it won't take long
My true love is laboring
While I sing this song
A cry from the bed
Where my wife lays her head
And out comes a little head
A face that's red and blue
Now I see that it's a she
A girl, how do you do...
A baby girl was born today
And I'm the happy dad
Now it's 4 PM, I'm off to work
And right back on the road
We're so tired of waiting
In fact it was quite long
My wife she was laboring
As time went on and on
And now I feel tired
But I've got my reward
And I'll soon be home to see
My wife and little girl
'Cause now I'll stop a while
From making people whirl
Cut off gigs and one night stands
You know I've done a few
And when I get back I'll say
My dear, how do you do
You do, you do, you do
You do, you do, you do...
|