|
|
updated sep 08 2010 |
Home
Musical Archive of originals and arrangements with guitar
or lute
in PDF
by A.Nagytothy-Toth Biblioteca della chitarra e del mandolino
© VP Music Media, Vicchio (Florence), Italy - All rights reserved
Contact:
Hosting:
|
|
|
||
|
VP Music Media focuses on guitar projects. These include works of essential reference for guitarists, music scholars and librarians.
|
||
Visitors:
// insert the full path to your counter text file here
$mpcountfile = "../mpcount.txt";
// should counter be visible or not? select TRUE or FALSE.
$visible = TRUE;
// nothing needs to be changed beyond this line.
if($QUERY_STRING != "")
{
$url = $PHP_SELF.'?'.$QUERY_STRING;
}
else
{
$url = $PHP_SELF;
}
$since = Date("M d, Y");
$written = FALSE;
if (file_exists($mpcountfile))
{
$temparray = file($mpcountfile);
for($index = 0; $index < count($temparray); $index++)
{
$entry = explode("|",$temparray[$index]);
if(!strcmp($entry[1],$url))
{
$entry[0]++;
$tempentry = $entry;
$temparray[$index] = implode($entry,"|");
$fp = fopen($mpcountfile,"w");
if(flock($fp,2))
{
for($index = 0; $index < count($temparray); $index++)
fputs($fp,$temparray[$index]);
}
else
exit("MPCount error: flock write failure!");
if(flock($fp,3))
fclose($fp);
else
exit("MPCount error: flock release failure!");
if($visible == TRUE)
print("$tempentry[0] dal $tempentry[2]");
$written = TRUE;
}
}
if($written == FALSE)
{
$hits = "1";
$entry = "$hits|$url|$since\n";
$fp = fopen($mpcountfile,"a");
if(flock($fp,2))
fputs($fp,$entry,256);
else
exit("MPCount error: flock write failure!");
if(flock($fp,3))
fclose($fp);
else
exit("MPCount error: flock release failure!");
if($visible == TRUE)
print "$hits dal $since";
}
}
else
{
exit("MPCount error: $mpcountfile missing!");
}
?>