File Counter Class
1.0 Setup

First thing you should do is edit filecounter.class.php and customize the variables.

If you plan on using filecounter with a MySQL database you will need to create the following table:
CREATE TABLE `filecounter_data` ( `id` int NOT NULL auto_increment, `file` char(255), `count` int, PRIMARY KEY (`id`) );
Edit the host, user, and password to connect to your MySQL server in database.php.
<?php $db = mysql_connect("localhost", "user", "password"); $r = mysql_select_db("database"); ?>

If you plan on using filecounter with a flat file database you will need to make sure the flat file database is readable and writable by your web server.

Edit files.php. This array holds the file number and location.
<?php $filecounter->files = array( 1 => "test.bin", 2 => "test2.bin" ); ?>


2.0 Example (Using a flat file database)

File #1 has been downloaded 857 times (Download)
File #2 has been downloaded 1039 times (Download)

Code:
echo "File #1 has been downloaded " . $filecounter->show(1) . " times (<a href="/download.php?file=1">Download</a>)<br />"; echo "File #2 has been downloaded " . $filecounter->show(2) . " times (<a href="/download.php?file=2">Download</a>)<br />";
Network

Products & Services
BSG Online Games | Copyright © - 2012 | Privacy Policy