changed git call from https to git readonly
[atutor.git] / mods / job_board / sublinks.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
15 if (!defined('AT_INCLUDE_PATH')) { exit; }
16 include(AT_JB_INCLUDE.'classes/Job.class.php');
17
18 global $db;
19
20 //init
21 $link_limit = 3;
22 $cnt = 0;
23 $job = new Job();
24
25 $result = $job->getAllJobs('created_date', 'desc');
26
27 if (is_array($result)) {
28         foreach($result as $row){
29                 if ($cnt >= $link_limit) break;
30                 $cnt++;
31
32                 $title = htmlentities_utf8($row['title']);
33                 $list[] = '<span title="'.strip_tags($title).'">'.'<a href="'.$_base_path.'mods/job_board/view_post.php?jid='.$row['id'].'">'.$title.'</a></span>';
34         }
35         return $list;
36 } else {
37         return 0;
38 }
39
40 ?>