mirror of
https://github.com/e107inc/e107.git
synced 2025-04-19 20:21:51 +02:00
Downloads: Legacy Upgrade image-path fixes.
This commit is contained in:
parent
6eefc91a9b
commit
03a6a63694
@ -3739,6 +3739,7 @@ class e_parser
|
||||
* Render an <img> tag.
|
||||
* @param string $file
|
||||
* @param array $parm legacy|w|h|alt|class|id|crop
|
||||
* @param array $parm['legacy'] Usually a legacy path like {e_FILE}
|
||||
* @return string
|
||||
* @example $tp->toImage('welcome.png', array('legacy'=>{e_IMAGE}newspost_images/','w'=>200));
|
||||
*/
|
||||
@ -3806,6 +3807,7 @@ class e_parser
|
||||
{
|
||||
$log = e107::getAdminLog();
|
||||
$log->addDebug('Broken Image Path: '.$legacyPath."\n".print_r(debug_backtrace(null,2), true), false)->save('IMALAN_00');
|
||||
e107::getDebug()->log("Broken Image Path: ".$legacyPath);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -321,8 +321,20 @@ class download_shortcodes extends e_shortcode
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
$img = ($this->var['download_thumb']) ? "<img class='download-thumb img-responsive' src='".$tp->thumbUrl($this->var['download_thumb'])."' alt=\"".$this->var['download_name']."\" />" : "";
|
||||
|
||||
$img = "";
|
||||
|
||||
if(!empty($this->var['download_thumb']))
|
||||
{
|
||||
$opts = array(
|
||||
'legacy' => "{e_FILE}downloadthumbs/",
|
||||
'class' => 'download-image img-responsive',
|
||||
'alt' => $this->var['download_name']
|
||||
);
|
||||
|
||||
$img = $tp->toImage($this->var['download_thumb'], $opts);
|
||||
}
|
||||
|
||||
|
||||
if ($parm == "link" && $this->var['download_thumb'])
|
||||
{
|
||||
$url = e107::getUrl()->create('download/view/item',array('id'=>$this->var['download_id'], 'name'=>$this->var['download_sef']));
|
||||
@ -392,8 +404,13 @@ class download_shortcodes extends e_shortcode
|
||||
function sc_download_list_imagefull($parm='')
|
||||
{
|
||||
|
||||
$img = ($this->var['download_image']) ? "<img class='download-image dl_image img-responsive' src='".e107::getParser()->thumbUrl($this->var['download_image'])."' alt=\"".$this->var['download_name']."\" />" : "";
|
||||
|
||||
$img = "";
|
||||
|
||||
if(!empty($this->var['download_image']))
|
||||
{
|
||||
$img = $this->sc_download_view_imagefull();
|
||||
}
|
||||
|
||||
if($parm == "link" && $this->var['download_image'])
|
||||
{
|
||||
$url = e107::getUrl()->create('download/view/item',array('id'=>$this->var['download_id'], 'name'=>$this->var['download_sef']));
|
||||
@ -556,32 +573,50 @@ class download_shortcodes extends e_shortcode
|
||||
{
|
||||
return $this->sc_download_view_date('long');
|
||||
}
|
||||
|
||||
|
||||
function sc_download_view_image()
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
if ($this->var['download_thumb'])
|
||||
$tp = e107::getParser();
|
||||
|
||||
|
||||
if($this->var['download_thumb'])
|
||||
{
|
||||
return ($this->var['download_image'] ? "<a href='".e_PLUGIN_ABS."download/request.php?download.".$this->var['download_id']."'><img class='download-image dl_image img-responsive' src='".$tp->thumbUrl($this->var['download_thumb'])."' alt='*' /></a>" : "<img class='download-image dl_image img-responsive' src='".$tp->thumbUrl($this->var['download_thumb'])."' alt='*' />");
|
||||
$opts = array(
|
||||
'legacy' => "{e_FILE}downloadthumbs/",
|
||||
'class' => 'download-image dl_image img-responsive'
|
||||
);
|
||||
$image = $tp->toImage($this->var['download_thumb'], $opts);
|
||||
|
||||
return ($this->var['download_image'] ? "<a href='" . e_PLUGIN_ABS . "download/request.php?download." . $this->var['download_id'] . "'>" . $image . "</a>" : $image);
|
||||
}
|
||||
elseif ($this->var['download_image'])
|
||||
{
|
||||
return "<a href='".e_PLUGIN_ABS."download/request.php?download.".$this->var['download_id']."'>".LAN_dl_40."</a>";
|
||||
elseif($this->var['download_image'])
|
||||
{
|
||||
return "<a href='" . e_PLUGIN_ABS . "download/request.php?download." . $this->var['download_id'] . "'>" . LAN_dl_40 . "</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
return LAN_dl_75;
|
||||
return LAN_dl_75;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {DOWNLOAD_VIEW_LINK: class=thumbnail}
|
||||
*/
|
||||
function sc_download_view_imagefull($parm)
|
||||
function sc_download_view_imagefull($parm=array())
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
return ($this->var['download_image']) ? "<img class='download-image dl_image download-view-image img-responsive ".vartrue($parm['class'])."' src='".$tp->thumbUrl($this->var['download_image'])."' alt='*' />" : "";
|
||||
|
||||
if(!empty($this->var['download_image']))
|
||||
{
|
||||
|
||||
$opts = array(
|
||||
'legacy' => "{e_FILE}downloadimages/",
|
||||
'class' => 'download-image dl_image download-view-image img-responsive '.vartrue($parm['class']),
|
||||
'alt' => basename($this->var['download_image'])
|
||||
);
|
||||
|
||||
return e107::getParser()->toImage($this->var['download_image'], $opts);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user