From 752d40ac119723885e7923fc37f2e6f0db086f21 Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Fri, 25 Dec 2009 05:38:03 +0000 Subject: Debugging was incomplete. Apparently I forgot to double-check to make certain that arrays and objects were being parsed out in the correct fashion. That has been fixed, so decho will properly insert both types into the message stack. logQueueFlush can now be forced to operate if debugging is disabled globally Example: logQueueFlush(FORCE); The inital commit of the download module has been added. It works, but the MySQL back-end needs to be beefed up with more file information. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@399 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- modules/download/index.php | 65 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 modules/download/index.php (limited to 'modules/download/index.php') diff --git a/modules/download/index.php b/modules/download/index.php new file mode 100644 index 0000000..1fa99e5 --- /dev/null +++ b/modules/download/index.php @@ -0,0 +1,65 @@ +. + */ + +if(!defined("MODULE_FILE")) +{ + die("Access denied..."); +} +global $db; +$download = NULL; +$download_relative_path = "modules/" . basename(dirname(__FILE__)) . "/files/"; +$download_absolute_path = dirname(__FILE__) . "/files/"; + +$result = $db->Query("SELECT uid, name, description, filename FROM bayonet_downloads"); +while(($row = $db->Fetch($result)) !== false) +{ + $download[] = $row; +} + +OpenTable(); +echo "
Downloads
"; +echo "
"; +foreach($download as $file) +{ + $download_full_path = $download_absolute_path . $file['filename']; + + if(file_exists($download_full_path)) + { + echo "

"; + echo LinkInternal($file['name'], $file['filename'], $download_relative_path) . "
\n"; + echo "Filename: {$file['filename']}
\n"; + printf("Size: %.2fKB
\n", filesize($download_full_path) / 1024); + echo "MD5 Hash: " . md5_file($download_full_path) . "
\n"; + echo "Description: {$file['description']}
\n"; + echo "

"; + } + else + { + decho("File $download_absolute_path{$file['filename']} does not exist! Not listing for download."); + } +} +decho($download); +//logQueueFlush(FORCE); + +echo "
"; + +CloseTable(); + + +?> \ No newline at end of file -- cgit