public function getNews() { $news = EasyBlogHelper::getRecentNews(); $content = ''; ob_start(); if ($news) { foreach ($news as $item) { ?> <li> <b><span><?php echo $item->title . ' - ' . $item->date; ?> </span></b> <div><?php echo $item->desc; ?> </div> </li> <?php } } else { ?> <li><?php echo JText::_('Unable to contact news server'); ?> </li> <?php } $content = ob_get_contents(); @ob_end_clean(); $ajax = new Ejax(); $ajax->assign('news-items', $content); // $ajax->script( "$('#news-items").html(\'' . addslashes( $content ) . '\');'); $ajax->send(); }
function getRecentNews() { return EasyBlogHelper::getRecentNews(); }