Lo script ? questo: DownloadPRO 1.0 ? uno script free e il sito ? questo:
http://www.explodingpanda.com/downloadpro.php
Da qui si pu? scaricare lo ZIP completo:
http://www.explodingpanda.com/download.php?file=3
Ora vedo se mi ? possibile postare qui i codici PHP perch? son pi? di un file. A dir la verit? ho anche uno script di un singolo file ma non riesco a farlo funzionare e l'autore non mi da supporto.
Questo credo sia il docice principale...presente nel file "download.php":
Codice:
<?php
include('db.php');
if (isset($file)){
dbConnect();
$sql = "select filename from dlcount";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);
for ($x=0;$x<$rows;$x++) {
$urlarray[$x] = mysql_result($result,$x);
}
$request = $urlarray[$file];
if (!$request) {
echo ("Error on url string");
}
else {
header("Location: $request");
}
$query = "UPDATE dlcount SET totalhits=totalhits+1 WHERE FileCode = $file";
$result = mysql_query($query);
if (!$result){
echo("Database Error");
}
$datetime = date('d M Y h:i:s a');
$querystat = "INSERT INTO dlstats SET FileCode='$file', IP='$REMOTE_ADDR', DateTime='$datetime'";
$resultstat = mysql_query($querystat);
if (!$result){
echo("Database Error");
}
}
if (isset($showme)){
dbConnect();
$query = "SELECT totalhits FROM dlcount WHERE FileCode = $showme";
$result = mysql_query($query);
$hitcount = mysql_result($result,0);
echo($hitcount);
}
?>
Perch? questi sono i files componenti:
Main Script Files:
Download.php - The basic engine that processes download requests, and counter display requests.
db.php - Contains all configuration, from user/pass, to db details.
downloadpro.php - The admin backend to add, delete and modify fields, and to view stats.
modify.php - This is the engine that parses all new file, edit file, and delete file requests from the admin backend.
displaystat.php - This file parses and formats full download stats into managable pages.
install.php - The database installation script. Run to install, then delete.
restrict.php - This file regulates access to the admin pages.