1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Fix for 0-byte images messing up import. New Image now includes HD version. Featurebox counter fix.

This commit is contained in:
Cameron
2016-12-21 14:25:26 -08:00
parent b82ac44d71
commit 2fe231cd92
3 changed files with 23 additions and 4 deletions

View File

@@ -2391,7 +2391,7 @@ class media_admin_ui extends e_admin_ui
$mes->add(IMALAN_113." <b> ".e_IMPORT."</b>", E_MESSAGE_INFO); $mes->add(IMALAN_113." <b> ".e_IMPORT."</b>", E_MESSAGE_INFO);
} }
if(!count($files)) if(!count($files) )
{ {
if(!vartrue($_POST['batch_import_selected'])) if(!vartrue($_POST['batch_import_selected']))
{ {
@@ -2403,6 +2403,7 @@ class media_admin_ui extends e_admin_ui
return; return;
} }
$text = " $text = "
<form method='post' action='".e_SELF."?".e_QUERY."' id='batch_import'> <form method='post' action='".e_SELF."?".e_QUERY."' id='batch_import'>
<fieldset id='core-mediamanager-batch'> <fieldset id='core-mediamanager-batch'>
@@ -2431,8 +2432,16 @@ class media_admin_ui extends e_admin_ui
<tbody>"; <tbody>";
// $c = 0; // $c = 0;
foreach($files as $f) 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']); $default = $this->getFileXml($f['fname']);
$f = $fl->cleanFileName($f,true); $f = $fl->cleanFileName($f,true);

View File

@@ -853,6 +853,7 @@ class news_shortcodes extends e_shortcode
{ {
$src = $tp->thumbUrl($srcPath); $src = $tp->thumbUrl($srcPath);
$dimensions = $tp->thumbDimensions(); $dimensions = $tp->thumbDimensions();
$srcset = $tp->thumbSrcSet($srcPath,array('size'=>'2x'));
} }
else else
@@ -881,6 +882,15 @@ class news_shortcodes extends e_shortcode
$style = !empty($this->param['thumbnail']) ? $this->param['thumbnail'] : ''; $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'])) switch(vartrue($parm['type']))
{ {
case 'src': case 'src':
@@ -888,12 +898,12 @@ class news_shortcodes extends e_shortcode
break; break;
case 'tag': 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; break;
case 'url': case 'url':
default: 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; break;
} }
} }

View File

@@ -203,7 +203,7 @@ class plugin_featurebox_item extends e_model
public function sc_featurebox_counter($parm=1) public function sc_featurebox_counter($parm=1)
{ {
$count = $this->getParam('counter', 1); $count = $this->getParam('counter', 1);
return ($parm == 0) ? $count - 1 : $count; return (empty($parm)) ? $count - 1 : $count;
} }
/** /**