/* __ // .-----.-----.-. .-.-----.--| |-----.-----.-----.-----. // |__ --| - | |_| | | _ | .__| - _| - | | // |_____|_____|_____|__|__|_____|__| |_____|_| |_|_|||_| // . ..: s o u n d r e a m o r g a n i z a t i o n :.. . // . ..Coding Division.. . // // PHP Script..: Download Counter // Made By.....: |The-Crow| - thecrow@impulsive.org // Site........: http://soundream.planet-d.net */ //--------------------------------------------------------// // PLEASE DEFINE THE VARIABLES // //--------------------------------------------------------// $extension = ""; //leave this blank if you have various extensions. $counterdir = ""; //change this if you want other directory for the counter files. $textfont = "Verdana,Arial"; //text font for the error msg //--------------------------------------------------------// // DO NOT EDIT ANYTHING FROM HERE // //--------------------------------------------------------// if ($fd = fopen($_GET['get'], "r")) { header("location: ".$_GET['get']); // download the file [download.php?get=name_of_file] $file = fopen($_GET['get'].".txt","r+"); // download counter $count = fread($file, filesize($_GET['get'].".txt")); fclose($file); $count += 1; $file = fopen($_GET['get'].".txt","w+"); fputs($file, $count); fclose($file); //increment current hour count //get the hour $CurrentHour = intval(date("H")); //get the type $pos = stripos($_GET['get'], "/"); $type = substr($_GET['get'], 0, $pos); //get the counter file $file = fopen($type.$CurrentHour.".txt","r+"); $count = fread($file, filesize($type.$CurrentHour.".txt")); fclose($file); $count += 1; $file = fopen($type.$CurrentHour.".txt","w+"); fputs($file, $count); fclose($file); //zero the next hour count //get the hour $NextHour = intval(date("H")) + 1; if ($NextHour >= 24) { $NextHour = 0; }; //get the type $pos = stripos($_GET['get'], "/"); $type = substr($_GET['get'], 0, $pos); //get the counter file $count = 0; $file = fopen($type.$NextHour.".txt","w+"); fputs($file, $count); fclose($file); } else { echo ""; echo "