| 67 | | */ |
| 68 | | public function rss() |
| | 67 | */ |
| | 68 | public function rss() |
| | 69 | { |
| | 70 | |
| | 71 | $channelData = array('title' => 'Karamelo eLearning Portal ', |
| | 72 | 'link' => array('controller' => 'news', 'action' => 'display'), |
| | 73 | 'url' => array('controller' => 'news', 'action' => 'display'), |
| | 74 | 'description' => 'Latest news on Karamelo', |
| | 75 | 'language' => 'en-us' |
| | 76 | ); |
| | 77 | |
| | 78 | $conditions = array("News.status"=>1); |
| | 79 | |
| | 80 | $fields = array("News.id", "News.title", "News.body", "News.created", "News.theme_id", "News.user_id"); |
| | 81 | |
| | 82 | $order = "News.id DESC"; |
| | 83 | |
| | 84 | $limit = 15; |
| | 85 | |
| | 86 | $this->News->unbindModel(array('hasMany'=>array('Discussion'))); |
| | 87 | |
| | 88 | $news = $this->News->findAll($conditions, $fields, $order, $limit); |
| | 89 | |
| | 90 | $this->set(compact('channelData', 'news')); |
| | 91 | } |
| | 92 | |
| | 93 | public function category($id=null, $order=null) |
| | 94 | { |
| | 95 | $this->layout = 'portal'; |
| | 96 | |
| | 97 | if ($id == null) |
| 70 | | $this->layout = 'rss'; |
| 71 | | |
| 72 | | $conditions = array("News.status"=>1); |
| 73 | | |
| 74 | | $fields = array("News.id", "News.title", "News.body", "News.created", "News.theme_id", "News.user_id"); |
| 75 | | |
| 76 | | $order = "News.id DESC"; |
| 77 | | |
| 78 | | $limit = 15; |
| 79 | | |
| 80 | | $this->News->unbindModel(array("hasMany"=>array("Comentnews"))); |
| 81 | | |
| 82 | | $this->set('data', $this->News->findAll($conditions, $fields, $order, $limit)); |
| 83 | | |
| 84 | | } |
| 85 | | |
| 86 | | public function category($id=null, $order=null) |
| 87 | | { |
| 88 | | $this->layout = 'portal'; |
| 89 | | |
| 90 | | if ($id == null) |
| 91 | | { |