Thanks,
-Heather
$counterstyle = "text";
$imagetype = "8";
## -- END OF CONFIG SECTION -- ##
$hitslog = "hits.txt"; # Path to the hits file, leave alone if in the same directory
# $hitslog = "http://localhost/templates/mw_plain001/ ... s/hits.txt"; # Path to the hits file, leave alone if in the same directory
$imagefolder = "http://localhost/templates/mw_plain001/ ... ats/digits"; # The full path to the images directory.
## Get the hitslog file ready
$hits = file($hitslog);
$hits = $hits[0] + 1;
## Opening the hits file and write the number of hits:
$fp = fopen($hitslog, "w");
fwrite($fp, $hits);
$menu = JSite::getMenu();
$menuItem = &$menu->getActive();
if($menuItem->home == 1) {
## Text counter, print the number of hits
if ($counterstyle == "text") { print "<b>Content View Hits </b><br>". "    ". $hits. "</br>"; }
## If Image Counter, get the required type and print them out.
if ($counterstyle == "images") {
$digit = strval($hits);
for ($i = 0; $i < strlen($hits); $i++) {
print "<img src=\"$imagefolder/$imagetype/$digit[$i].gif\" alt=\"There have been $hits visitors to this website\">";
}
}
}
?>