mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Fix for 0-byte images messing up import. New Image now includes HD version. Featurebox counter fix.
This commit is contained in:
@@ -2391,7 +2391,7 @@ class media_admin_ui extends e_admin_ui
|
||||
$mes->add(IMALAN_113." <b> ".e_IMPORT."</b>", E_MESSAGE_INFO);
|
||||
}
|
||||
|
||||
if(!count($files))
|
||||
if(!count($files) )
|
||||
{
|
||||
if(!vartrue($_POST['batch_import_selected']))
|
||||
{
|
||||
@@ -2403,6 +2403,7 @@ class media_admin_ui extends e_admin_ui
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$text = "
|
||||
<form method='post' action='".e_SELF."?".e_QUERY."' id='batch_import'>
|
||||
<fieldset id='core-mediamanager-batch'>
|
||||
@@ -2431,8 +2432,16 @@ class media_admin_ui extends e_admin_ui
|
||||
<tbody>";
|
||||
|
||||
// $c = 0;
|
||||
|
||||
foreach($files as $f)
|
||||
{
|
||||
if(empty($f))
|
||||
{
|
||||
e107::getMessage()->addWarning("0 byte file found in: ".e_IMPORT."<br />Please remove before proceeding.");
|
||||
////rename(e_IMPORT.$f['path'].$f['fname'],e_IMPOT.$f['path'].$f['fname']."-bad");
|
||||
continue;
|
||||
}
|
||||
|
||||
$default = $this->getFileXml($f['fname']);
|
||||
$f = $fl->cleanFileName($f,true);
|
||||
|
||||
|
@@ -853,6 +853,7 @@ class news_shortcodes extends e_shortcode
|
||||
{
|
||||
$src = $tp->thumbUrl($srcPath);
|
||||
$dimensions = $tp->thumbDimensions();
|
||||
$srcset = $tp->thumbSrcSet($srcPath,array('size'=>'2x'));
|
||||
|
||||
}
|
||||
else
|
||||
@@ -881,6 +882,15 @@ class news_shortcodes extends e_shortcode
|
||||
|
||||
$style = !empty($this->param['thumbnail']) ? $this->param['thumbnail'] : '';
|
||||
|
||||
$imgParms = array(
|
||||
'class'=>$class,
|
||||
'alt'=>basename($src),
|
||||
'style'=>$style
|
||||
);
|
||||
|
||||
|
||||
$imgTag = $tp->toImage($srcPath,$imgParms);
|
||||
|
||||
switch(vartrue($parm['type']))
|
||||
{
|
||||
case 'src':
|
||||
@@ -888,12 +898,12 @@ class news_shortcodes extends e_shortcode
|
||||
break;
|
||||
|
||||
case 'tag':
|
||||
return "<img class='{$class}' src='".$src."' alt='' style='".$style."' {$dimensions} {$srcset} />";
|
||||
return ".$imgTag."; // "<img class='{$class}' src='".$src."' alt='' style='".$style."' {$dimensions} {$srcset} />";
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
default:
|
||||
return "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'><img class='{$class}' src='".$src."' alt='' style='".$style."' {$dimensions} {$srcset} /></a>";
|
||||
return "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'>".$imgTag."</a>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -203,7 +203,7 @@ class plugin_featurebox_item extends e_model
|
||||
public function sc_featurebox_counter($parm=1)
|
||||
{
|
||||
$count = $this->getParam('counter', 1);
|
||||
return ($parm == 0) ? $count - 1 : $count;
|
||||
return (empty($parm)) ? $count - 1 : $count;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user