TABELAS DE PREÇOS POR ACTIVIDADE
### How many files to show? ###
// i.e. "Newest 5 Files", "Newest 10 Files", etc...
$filelim = "10";
### Directory to look in for files ###
/*
Directory, from the base http URL your files are in.
Include BOTH starting and trailing slashes ( / ).
i.e. If your files are at http://yoursite.com/downloads,
put "/downloads/" - WITH BOTH SLASHES!
*/
# $checkdir = "/"; // base directory (http://yoursite.com/)
$checkdir = "/home/adelaide/adelaideferreira.pt/html/tabelas/";
$checkdir2 = "/tabelas/";
### File extensions to include ###
// Turns feature "on" or "off"
$extlim = "on";
/*
Allows you to limit which types of files will be included
Separate each by quotes/comma, you may use as many as you like
INCLUDE the beginning period ( . )!
Note: Only includes text from the LAST period on (i.e. If you want to
include ".tar.gz" files, put ".gz" only. This is a bug that not even the
PHP file extension function can read, and it something that cannot
be fixed without extensive coding)
*/
# $extarr = array(".exe", ".zip", ".rar"); // Only accepts EXE, ZIP, and RAR files
$extarr = array(".pdf", ".PDF");
### Table Properties ###
// Width of output table
$tblwidth = "50%"; // can be a number, or a percent
// Background color of output table
$tblbg = ""; // hexidecimal format (i.e. "#FFFFFF")
### No need to edit below this line ###
### Put starting & trailing slash on incase user forgot
if(strrpos($checkdir, "/") != (strlen($checkdir)-1)) { $checkdir .= "/"; }
if(strpos($checkdir, "/") != "0") { $checkdir = "/$checkdir"; }
### Get full root path of the file directory
$filedir = "$DOCUMENT_ROOT$checkdir";
### Get the name of this file, without the beginning slash
$thisfile = basename($PHP_SELF);
### Make sure directory exists
if(!file_exists($filedir)) { print "No such directory!
Check to make sure the \$checkdir variable is correct.
Current: \$checkdir = \"$checkdir\";"; exit; }
### Open folder, get file names and load them into an array
if ($handle = opendir($filedir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != $thisfile && !is_dir("$filedir$file")) {
if($extlim == "on") {
if(in_array(strrchr($file, "."), $extarr)) {
$farr[$file] = date ("U", filemtime("$filedir$file"));
}
} else {
$farr[$file] = date ("U", filemtime("$filedir$file"));
}
}
}
closedir($handle);
}
### Check to make sure there are actually items in the folder
$farrc = count($farr);
if ($farrc != "0") {
if($farrc < $filelim) { $filelim = $farrc; }
?>
-  | $filename |