From 2b31e8a6f30ebcd145b3394ac1a2ef8a768924ac Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Fri, 8 Jan 2010 03:10:43 +0000 Subject: The download module mostly works/looks the way it should. Bayonet_SQL now checks for a valid result, and if it is invalid just return. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@460 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- modules/download/index.php | 61 ++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 29 deletions(-) (limited to 'modules') diff --git a/modules/download/index.php b/modules/download/index.php index 0c0ed2e..b819e8d 100644 --- a/modules/download/index.php +++ b/modules/download/index.php @@ -92,40 +92,43 @@ $categoryList = getCategoryList(); echo "\n\n"; CloseContent(); +echo "
"; //spacer between div tags -OpenContent(); -echo "
" . getCategoryName($category) . "
\n"; -echo "
\n"; - +if(isset($category)) +{ OpenContent(); - echo "
Files
\n"; - echo "
\n"; - - if(empty($downloads)) - { - echo "No downloads available.\n"; - return; - } - - foreach($downloads as $file) - { - $download_full_path = $download_absolute_path . $file['filename']; + echo "
" . getCategoryName($category) . "
\n"; + echo "
\n"; + + OpenContent(); + echo "
Files
\n"; + echo "
\n"; + + if(empty($downloads)) + { + echo "No downloads available.\n"; + return; + } - if(!file_exists($download_full_path)) $broken = "(Broken link detected)"; - echo "

"; - echo LinkInternal($file['name'], $file['filename'], $download_relative_path) . " $broken
\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 "

"; + foreach($downloads as $file) + { + $download_full_path = $download_absolute_path . $file['filename']; + + if(!file_exists($download_full_path)) $broken = "(Broken link detected)"; + echo "

"; + echo LinkInternal($file['name'], $file['filename'], $download_relative_path) . " $broken
\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 "

"; + + } + //logQueueFlush(FORCE); - } - //logQueueFlush(FORCE); - + echo "
\n
"; echo "
\n
"; - echo "\n"; - +} CloseContent(); CloseContent(); ?> -- cgit