mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 05:07:27 +02:00
Downloads: Fix for screenshot links.
This commit is contained in:
@@ -637,7 +637,8 @@ class download_shortcodes extends e_shortcode
|
|||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$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'])
|
if($this->var['download_thumb'])
|
||||||
{
|
{
|
||||||
|
@@ -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.
|
'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(
|
$config['index'] = array(
|
||||||
'regex' => '{alias}/?(.*)$',
|
'regex' => '{alias}/?(.*)$',
|
||||||
|
@@ -13,7 +13,6 @@ $id = FALSE;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!is_numeric(e_QUERY) && empty($_GET['id']))
|
if (!is_numeric(e_QUERY) && empty($_GET['id']))
|
||||||
{
|
{
|
||||||
if ($sql->select('download', 'download_id', "download_url='".$tp->toDB(e_QUERY)."'"))
|
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"))
|
if(strstr(e_QUERY, "mirror"))
|
||||||
{ // Download from mirror
|
{ // Download from mirror
|
||||||
list($action, $download_id, $mirror_id) = explode(".", e_QUERY);
|
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 (preg_match("#.*\.[a-z,A-Z]{3,4}#", e_QUERY))
|
||||||
{
|
{
|
||||||
if(strstr(e_QUERY, "pub_"))
|
if(strstr(e_QUERY, "pub_"))
|
||||||
@@ -137,7 +136,7 @@ if ($type == "file")
|
|||||||
{
|
{
|
||||||
$row = $sql->fetch();
|
$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']))
|
if (check_class($row['download_category_class']) && check_class($row['download_class']))
|
||||||
{
|
{
|
||||||
@@ -325,15 +324,15 @@ else
|
|||||||
|
|
||||||
if (file_exists(e_FILE."download/{$image}"))
|
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}"))
|
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
|
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>";
|
$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}"))
|
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
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user