1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

Multiple Image/Video fix for news_carousel_menu.php

This commit is contained in:
Cameron
2014-01-31 07:09:34 -08:00
parent c0746113b6
commit d5231b3d8c
2 changed files with 14 additions and 5 deletions

View File

@@ -2834,7 +2834,7 @@ class e_parser
if($thumb == 'tag')
{
return "<img class='img-responsive' src='".$thumbSrc."' alt='Youtube Video' style='max-width:".vartrue($parm['w'],'80')."px'/>";
return "<img class='img-responsive' src='".$thumbSrc."' alt='Youtube Video' style='width:".vartrue($parm['w'],'80')."px'/>";
}
if($thumb == 'src')

View File

@@ -94,7 +94,17 @@ $count = 0;
foreach($data as $row)
{
$img = $tp->thumbUrl($row['news_thumbnail']);
$tmp = explode(",",$row['news_thumbnail']); // fix for multiple
if($video = $tp->toVideo($tmp[0],array('thumb'=>'tag', 'w'=>800)))
{
$imgTag = $video;
}
else
{
$img = $tp->thumbUrl($tmp[0]);
$imgTag = '<img class="img-responsive" src="'.$img.'">';
}
$vars = array(
'NEWSTITLE' => $tp->toHtml($row['news_title'],false, 'TITLE'),
@@ -102,15 +112,14 @@ foreach($data as $row)
'NEWSDATE' => $tp->toDate($row['news_datestamp'],'dd MM, yyyy'),
'ACTIVE' => ($count == 0) ? 'active' : '',
'COUNT' => $count,
'NEWSIMAGE' => '<img class="img-responsive" src="'.$img.'">'
'NEWSIMAGE' => '<a href="'.e107::getUrl()->create('news/view/item',$row).'">'.$imgTag.'</a>'
);
$text .= $tp->simpleParse($NEWS_MENU_TEMPLATE['carousel']['item'], $vars);
$nav[] = $tp->simpleParse($navTemplate, $vars);
$count++;
}