1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 11:20:25 +02:00

Downloads: Fix for screenshot links.

This commit is contained in:
Cameron
2017-04-26 10:03:12 -07:00
parent 8135bde5f7
commit 252abfdce6
3 changed files with 13 additions and 8 deletions

View File

@@ -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'])
{

View File

@@ -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}/?(.*)$',

View File

@@ -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 = "<div style='text-align:center'><img class='img-responsive img-fluid' src='".e_FILE."download/{$image}' alt='' /></div>";
$disp = "<div style='text-align:center'><img class='img-responsive img-fluid' src='".e_FILE_ABS."download/{$image}' alt='' /></div>";
}
else if(file_exists(e_FILE."downloadimages/{$image}"))
{
$disp = "<div style='text-align:center'><img class='img-responsive img-fluid' src='".e_FILE."downloadimages/{$image}' alt='' /></div>";
$disp = "<div style='text-align:center'><img class='img-responsive img-fluid' src='".e_FILE_ABS."downloadimages/{$image}' alt='' /></div>";
}
else
{
$image = $tp->replaceConstants($image);
$image = $tp->replaceConstants($image,'abs');
$disp = "<div style='text-align:center'><img class='img-responsive img-fluid' src='".$image."' alt='' /></div>";
}
@@ -350,7 +349,7 @@ else
}
elseif(is_file(e_FILE."downloadimages/{$image}"))
{
echo "<img src='".e_FILE."downloadimages/{$image}' alt='' />";
echo "<img src='".e_FILE_ABS."downloadimages/{$image}' alt='' />";
}
else
{