paFileDB now has a feature to allow you to show top lists anywhere on your site. On your homepage, you can have the X newest files, or X most popular files, with X being whatever number you want. The file that handles the top lists is toplist.php.
Configuration
There are only 3 things to configure:
$path = "/usr/local/apache2/htdocs/pafiledb";
$show = "10"; //How many files do you want to show on the list
$template = "<b>{number}.</b> <a href=\"{filelink}\">{filename} ({info})</a><br>"; //Template for each line.
$path is the full server path to your paFileDB directory. You will either
have to use phpinfo() or ask your host for the path.
The variable $show is how many files to
show on the list (the X number mentioned before the config section) So if you
set this to 5, paFileDB will show the top 5 newest/popular files.
$template lets you customize the actual list. You can use the following
variables to change the look:
{number} - This is the file's position in the list (If it's the newest or most popular file it's 1. If out of 10 shown files it's the 5th newest or popular, the number is 5)
{filelink} - This is the URL to paFileDB's View File page. You will have to put the <a href=""> tag around it.
{filename} - This is the name of the file that will be shown.
{info} - This is info about the file. For the newest files, it's the date added. For the most popular files, it's either the rating or total number of downloads.
Usage
If you are using .php files for your site, you can use this code to show the
list:
<?php
$list = "TYPE";
include("/full/path/to/toplist.php");
?>
TYPE: Set this to one of the following options to set the type of list:
newest - This will show the top X newest files.
downloads - This will show the top X popular files based on the amount of downloads each file has had
rating - This will show the top X popular files based on the rating visitors to your site have given them.
/full/path/to/ - This is the full path to toplist.php. If you do not know the path to your files, you will have to ask your host. *NIX server paths are "/full/path/to/toplist.php" and Windows server paths are "C:/full/path/to/toplist.php"