'; $NEWS_MENU_TEMPLATE['carousel']['item'] = '
{NEWSIMAGE}
';; $navTemplate = '
  • {NEWSSUMMARY}
  • '; $nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'"; $query = " SELECT n.*, nc.category_id, nc.category_name, nc.category_sef, nc.category_icon, nc.category_meta_keywords, nc.category_meta_description FROM #news AS n LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$nobody_regexp.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND FIND_IN_SET(5,n.news_render_type) ORDER BY n.news_sticky DESC, n.news_datestamp DESC LIMIT 5"; $data = $sql->retrieve($query,true); if(count($data) < 1) { e107::getMessage()->addDebug( "No News items found with 'carousel' as the template ")->render(); return; } $count = 0; $tp->setThumbSize(800,0); foreach($data as $row) { $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 = ''; } $vars = array( 'NEWSTITLE' => $tp->toHtml($row['news_title'],false, 'TITLE'), 'NEWSSUMMARY' => vartrue($row['news_summary'],$row['news_title']), 'NEWSDATE' => $tp->toDate($row['news_datestamp'],'dd MM, yyyy'), 'ACTIVE' => ($count == 0) ? 'active' : '', 'COUNT' => $count, 'NEWSIMAGE' => ''.$imgTag.'' ); $text .= $tp->simpleParse($NEWS_MENU_TEMPLATE['carousel']['item'], $vars); $nav[] = $tp->simpleParse($navTemplate, $vars); $count++; } $header = $NEWS_MENU_TEMPLATE['carousel']['start']; $footer = str_replace("{NAV}", implode("\n",$nav), $NEWS_MENU_TEMPLATE['carousel']['end']); e107::getRender()->tablerender('',$header.$text.$footer,'news-carousel'); //TODO Tablerender().