Location: PHPKode > scripts > Silentum Counter Plus > counter_plus.php
<?PHP
	/*
	Silentum Counter Plus v1.2
	Modified July 8, 2012
	counter_plus.php copyright 2006-2012 HyperSilence
	*/

	$visits_file = "visits_plus.txt";
	$uniques_file = "uniques_plus.txt";
	
	// Change the following number to change which style of counter you want
	// 1 is Regular font
	// 2 is Digital font
	// 3 is Alternate Digital font

	$type = "1";

	$counter = @fopen($visits_file, "r");
	$total = @fread($counter, filesize($visits_file));
	@fclose($counter);
	if($total == "") { $total = 0; }
	$total++;
	$counter = @fopen($visits_file, "w");
	@fwrite($counter, $total);
	@fclose($counter);

	$unique_hits = @fopen($uniques_file, "r");
	$total_uniques = @fread($unique_hits, filesize($uniques_file));
	if($total_uniques == "") { $total_uniques = 0; }
	if($_COOKIE["dailyHitPlus"] != date(Md)) {
	@setcookie("dailyHitPlus", date(Md), mktime(23, 59, 59, date("m"), date("d"), date("y")));
	$total_uniques++;
	}
	$uniques_hits = @fopen($uniques_file, "w");
	@fwrite($uniques_hits, $total_uniques);
	@fclose($uniques_hits);

	if($type == "2") $digital = "_digital";
	if($type == "3") $digital = "_digital_alt";

	$total_numbers = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
	$total_images = array("<img alt=\"0\" src=\"number_images/0$digital.png\" title=\"0\">", "<img alt=\"1\" src=\"number_images/1$digital.png\" title=\"1\">", "<img alt=\"2\" src=\"number_images/2$digital.png\" title=\"2\">", "<img alt=\"3\" src=\"number_images/3$digital.png\" title=\"3\">", "<img alt=\"4\" src=\"number_images/4$digital.png\" title=\"4\">", "<img alt=\"5\" src=\"number_images/5$digital.png\" title=\"5\">", "<img alt=\"6\" src=\"number_images/6$digital.png\" title=\"6\">", "<img alt=\"7\" src=\"number_images/7$digital.png\" title=\"7\">", "<img alt=\"8\" src=\"number_images/8$digital.png\" title=\"8\">", "<img alt=\"9\" src=\"number_images/9$digital.png\" title=\"9\">");

	$total = str_replace($total_numbers, $total_images, $total);

	$total_uniques_numbers = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
	$total_uniques_images = array("<img alt=\"0\" src=\"number_images/0$digital.png\" title=\"0\">", "<img alt=\"1\" src=\"number_images/1$digital.png\" title=\"1\">", "<img alt=\"2\" src=\"number_images/2$digital.png\" title=\"2\">", "<img alt=\"3\" src=\"number_images/3$digital.png\" title=\"3\">", "<img alt=\"4\" src=\"number_images/4$digital.png\" title=\"4\">", "<img alt=\"5\" src=\"number_images/5$digital.png\" title=\"5\">", "<img alt=\"6\" src=\"number_images/6$digital.png\" title=\"6\">", "<img alt=\"7\" src=\"number_images/7$digital.png\" title=\"7\">", "<img alt=\"8\" src=\"number_images/8$digital.png\" title=\"8\">", "<img alt=\"9\" src=\"number_images/9$digital.png\" title=\"9\">");

	$total_uniques = str_replace($total_uniques_numbers, $total_uniques_images, $total_uniques);
?>
Return current item: Silentum Counter Plus