<span class="header_colm">Lo más reciente</span> <?php $recentNews = Tools::getRecentNews(0, 19); foreach ($recentNews as $news) { if ($news->id == $bannerNewsId) { continue; } Tools::printNews($news, '_left', '', 'initial_img', false, 'initial_link', 1); } ?> </section> <section class="left_colm"> <span class="header_colm">Lo compartido</span> <?php $sharedNews = Tools::getSharedNews(0, 6); foreach ($sharedNews as $news) { if ($news->id == $bannerNewsId) { continue; } Tools::printNews($news, '_left', '', '', true, '', 3); } ?> </section> <section class="right"> <span class="header_colm">Lo más popular</span> <?php $popularNews = Tools::getPopularNews(0, 6); foreach ($popularNews as $news) { if ($news->id == $bannerNewsId) {
if ($col != 'left' && $col != 'center' && $col != 'right') { $col = ''; } // retrieve news $maxRecent = 19; $maxShared = 6; $maxPopular = 5; if ($col == 'left') { $maxRecent += 2; } elseif ($col == 'center') { $maxShared += 1; } elseif ($col == 'right') { $maxPopular += 1; } $recentNews = Tools::getRecentNews($recentOffset, $maxRecent); $sharedNews = Tools::getSharedNews($sharedOffset, $maxShared); $popularNews = Tools::getPopularNews($popularOffset, $maxPopular); $return->status = 'success'; $return->numRecent = count($recentNews); $return->numShared = count($sharedNews); $return->numPopular = count($popularNews); $return->numTotal = $return->numRecent + $return->numShared + $return->numPopular; ob_start(); foreach ($recentNews as $news) { Tools::printNews($news, '_left opacity_0', '', 'initial_img', false, 'initial_link', 1); } $return->recent = ob_get_clean(); ob_start(); foreach ($sharedNews as $news) { Tools::printNews($news, '_left opacity_0', '', '', true, '', 3); }