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 file_storage_news() {
19 global $db, $enrolled_courses, $system_courses;
22 if ($enrolled_courses == ''){
26 $sql = "SELECT date, file_id, file_name, owner_id, description FROM ".TABLE_PREFIX."files WHERE owner_id IN $enrolled_courses ORDER BY date DESC";
27 $result = mysql_query($sql, $db);
29 while($row = mysql_fetch_assoc($result)){
30 $row['course_id'] = $row['owner_id'];
31 if($row['description'] !=""){
32 $filetext = $row['description'];
34 $filetext = $row['file_name'];
36 $news[] = array('time'=>$row['date'],
38 'course'=>$system_courses[$row['owner_id']]['title'],
39 'alt'=>_AT('download'),
40 'thumb'=>'images/application_get.png',
41 'link'=>'<a href="bounce.php?course='.$row['owner_id'].SEP.'p='.urlencode('mods/_standard/file_storage/index.php?download=1'.SEP.'files[]='. $row['file_id']).'"'.
42 (strlen($filetext) > SUBLINK_TEXT_LEN ? ' title="'.AT_print($filetext, 'input.text').'"' : '') .'>'.
43 AT_print(validate_length($filetext, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'input.text') .'</a>');