Exemple #1
0
 public function dsThongBaoMoi()
 {
     $bizThongBao = new Default_Model_ThongBao();
     $result = array();
     $result = $bizThongBao->getTBMoi();
     $link = new Zend_View_Helper_Url();
     $str = '<ul id="scroller">';
     foreach ($result as $thong_bao) {
         $url = $link->url(array('controller' => 'thong-bao', 'action' => 'chi-tiet', 'id' => $thong_bao['id']), null, true);
         $str .= '<li><a class="Normal" href="' . $url . '" target="_self">' . $thong_bao['tieu_de'] . '</a>' . ' (' . $thong_bao['ngay_tao'] . ')</li>';
     }
     $str .= '</ul>';
     return $str;
 }
 public function rssAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->layout()->disableLayout();
     $entries = array();
     $bizThongBao = new Default_Model_ThongBao();
     $bizTinTuc = new Default_Model_TinTuc();
     $domain = Khcn_Api::_()->getApi('settings', 'default')->getSetting('domain', '');
     $thongBaos = $bizThongBao->getDSTBForRSS();
     $tinTucs = $bizTinTuc->getDSTTForRSS();
     foreach ($tinTucs as $tin_tuc) {
         $entries[] = array('title' => $tin_tuc['tieu_de'] . ' (' . $tin_tuc['ngay_tao'] . ')', 'link' => $domain . '/public/tin-tuc/chi-tiet/id/' . $tin_tuc['id'], 'description' => $tin_tuc['mo_ta_tom_tat']);
     }
     foreach ($thongBaos as $thong_bao) {
         $entries[] = array('title' => $thong_bao['tieu_de'] . ' (' . $thong_bao['ngay_tao'] . ')', 'link' => $domain . '/public/thong-bao/chi-tiet/id/' . $thong_bao['id'], 'description' => $thong_bao['tieu_de']);
     }
     $feedData = array('title' => 'Phòng Khoa học - Công nghệ - SGU', 'description' => 'Tin tức - Sự kiện', 'link' => $domain, 'charset' => 'utf-8', 'entries' => $entries);
     $feed = Zend_Feed::importArray($feedData, 'rss');
     // set the Content Type of the document
     header('Content-type: text/xml');
     // echo the contents of the RSS xml document
     echo $feed->send();
 }