7ade6d495d18dc6a829d4c0350f01da3c8ae14aa
[atutor.git] / mods / job_board / module_news.php
1 <?php
2 /***********************************************************************/
3 /* ATutor                                                                                                                          */
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010                                             */
6 /* Inclusive Design Institute                                          */
7 /* http://atutor.ca                                                                                                        */
8 /*                                                                                                                                         */
9 /* This program is free software. You can redistribute it and/or           */
10 /* modify it under the terms of the GNU General Public License             */
11 /* as published by the Free Software Foundation.                                           */
12 /***********************************************************************/
13 // $Id$
14 if (!defined('AT_INCLUDE_PATH')) { exit; }
15 include(AT_JB_INCLUDE.'classes/Job.class.php');
16
17 /*
18  * Get the latest updates of this module
19  * @return list of news, [timestamp]=>
20  */
21 function job_board_news() {
22         global $db;
23         $news = array();
24         $job = new Job();
25
26         $result = $job->getAllJobs('created_date', 'desc');
27
28         if(is_array($result)){
29                 foreach ($result as $row){
30                         $title = htmlentities_utf8($row['title']);
31
32                         $news[] = array('time'=>$row['revised_date'], 
33                                                         'object'=>$row, 
34                                                         'thumb'=>AT_JB_BASENAME.'images/jb_icon_tiny.png',
35                                                         'link'=>'<span title="'.strip_tags($title).'"><a href="'.AT_JB_BASENAME.'view_post.php?jid='.$row['id'].'">'.$title."</a></span>");
36                 }
37         }
38         return $news;
39 }
40
41 ?>