From 78ae73fb0865c750908bf2f04015bb7d18cc7543 Mon Sep 17 00:00:00 2001 From: e107steved Date: Sun, 25 May 2008 16:10:55 +0000 Subject: [PATCH] Bugtracker #4309 - mod handling of external download files. Plus a bit of a tidy up. --- e107_admin/download.php | 49 +++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/e107_admin/download.php b/e107_admin/download.php index 05fd01c6f..975fac530 100644 --- a/e107_admin/download.php +++ b/e107_admin/download.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/download.php,v $ -| $Revision: 1.10 $ -| $Date: 2008-05-25 14:51:07 $ +| $Revision: 1.11 $ +| $Date: 2008-05-25 16:10:46 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -707,9 +707,8 @@ class download // --------------------------------------------------------------------------- - function create_download($sub_action, $id) { - - + function create_download($sub_action, $id) + { global $cal,$tp, $sql, $fl, $rs, $ns, $file_array, $image_array, $thumb_array,$pst; require_once(e_FILE."shortcode/batch/download_shortcodes.php"); @@ -797,21 +796,26 @@ class download "; $counter = 0; - while (isset($file_array[$counter])) { - $fpath = str_replace(e_DOWNLOAD,"",$file_array[$counter]['path']).$file_array[$counter]['fname']; - if (stristr($fpath, $download_url) !== FALSE) { - $selected = " selected='selected'"; - $found = 1; - } else { - $selected = ""; - } + while (isset($file_array[$counter])) + { + $fpath = str_replace(e_DOWNLOAD,"",$file_array[$counter]['path']).$file_array[$counter]['fname']; + $selected = ''; + if (stristr($fpath, $download_url) !== FALSE) + { + $selected = " selected='selected'"; + $found = 1; + } - $text .= "\n"; - $counter++; + $text .= "\n"; + $counter++; } - if (preg_match("/http:|ftp:/", $download_url)) { - $download_url_external = $download_url; + $dt = 'display:none'; + if (preg_match("/http:|ftp:/", $download_url)) + { + $download_url_external = $download_url; + $download_url = ''; + $dt = ''; } $etext = " - (".DOWLAN_68.")"; @@ -819,18 +823,19 @@ class download $etext = ""; } - if (!$found && $download_url) { - $text .= "\n"; + if (!$found && $download_url) + { + $text .= "\n"; } $text .= " ".DOWLAN_149." -