2 /***********************************************************************/
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
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 /***********************************************************************/
15 * Get the latest updates of this module
16 * @return list of news, [timestamp]=>
18 function links_news() {
19 global $db, $enrolled_courses, $system_courses;
22 if ($enrolled_courses == ''){
26 $sql = "SELECT * FROM ".TABLE_PREFIX."links L INNER JOIN ".TABLE_PREFIX."links_categories C ON C.cat_id = L.cat_id WHERE owner_id IN $enrolled_courses AND L.Approved=1 ORDER BY SubmitDate DESC";
27 $result = mysql_query($sql, $db);
29 while($row = mysql_fetch_assoc($result)){
31 'time'=>$row['SubmitDate'],
34 'course'=>$system_courses[$row['owner_id']]['title'],
35 'thumb'=>'images/home-links_sm.png',
36 'link'=>'<a href="bounce.php?course='.$row['owner_id'].'&p='.urlencode('mods/_standard/links/index.php?view='.$row['link_id']).'"'.
37 (strlen($row['LinkName']) > SUBLINK_TEXT_LEN ? ' title="'.$row['LinkName'].'"' : '') .'>'.
38 validate_length($row['LinkName'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>');