diff --git a/e107_plugins/download/download_shortcodes.php b/e107_plugins/download/download_shortcodes.php index 98dee471b..1d0ebd766 100644 --- a/e107_plugins/download/download_shortcodes.php +++ b/e107_plugins/download/download_shortcodes.php @@ -637,7 +637,8 @@ class download_shortcodes extends e_shortcode { $tp = e107::getParser(); - $url = e107::url('download', 'get', $this->var); + $url = e107::url('download', 'image', $this->var); + //$url = e_PLUGIN_ABS . "download/request.php?download." . $this->var['download_id']; if($this->var['download_thumb']) { diff --git a/e107_plugins/download/e_url.php b/e107_plugins/download/e_url.php index cf9ef3de3..0faef0e5e 100644 --- a/e107_plugins/download/e_url.php +++ b/e107_plugins/download/e_url.php @@ -114,6 +114,11 @@ class download_url // plugin-folder + '_url' 'redirect' => '{e_PLUGIN}download/request.php?id=$1', // file-path of what to load when the regex returns true. ); + $config['image'] = array( + 'regex' => '^{alias}/image/([\d]*)/(.*)$', + 'sef' => '{alias}/image/{download_id}/{download_sef}', + 'redirect' => '{e_PLUGIN}download/request.php?download.$1', // file-path of what to load when the regex returns true. + ); $config['index'] = array( 'regex' => '{alias}/?(.*)$', diff --git a/e107_plugins/download/request.php b/e107_plugins/download/request.php index 287ed11e0..301278386 100644 --- a/e107_plugins/download/request.php +++ b/e107_plugins/download/request.php @@ -13,7 +13,6 @@ $id = FALSE; - if (!is_numeric(e_QUERY) && empty($_GET['id'])) { if ($sql->select('download', 'download_id', "download_url='".$tp->toDB(e_QUERY)."'")) @@ -36,6 +35,7 @@ if (!is_numeric(e_QUERY) && empty($_GET['id'])) + if(strstr(e_QUERY, "mirror")) { // Download from mirror list($action, $download_id, $mirror_id) = explode(".", e_QUERY); @@ -104,7 +104,6 @@ if(vartrue($_GET['id'])) // SEF URL - if (preg_match("#.*\.[a-z,A-Z]{3,4}#", e_QUERY)) { if(strstr(e_QUERY, "pub_")) @@ -137,7 +136,7 @@ if ($type == "file") { $row = $sql->fetch(); - $row['download_url'] = $tp->replaceConstants($row['download_url']); + $row['download_url'] = $tp->replaceConstants($row['download_url'],'abs'); if (check_class($row['download_category_class']) && check_class($row['download_class'])) { @@ -325,15 +324,15 @@ else if (file_exists(e_FILE."download/{$image}")) { - $disp = "