remove old readme
[atutor.git] / docs / mods / _standard / social / 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_once(AT_INCLUDE_PATH.'../mods/_standard/social/lib/friends.inc.php');
16
17 /*
18  * Get the latest updates of this module
19  * @return list of news, [timestamp]=>
20  */
21 function social_news() {
22         global $db;
23         $news = array();
24
25         $actvity_obj = new Activity();
26         $activities = $actvity_obj->getFriendsActivities($_SESSION['member_id']);
27         foreach($activities as $row){
28                 $link_title = printSocialName($row['member_id']).' '. $row['title'];
29                 $news[] = array('time'=>$row['created_date'], 
30                                                 'object'=>$row, 
31                                                 'thumb'=>'images/home-directory_sm.png',
32                                                 'link'=>'<span title="'.strip_tags($link_title).'">'.$link_title."</span>");
33         }
34         return $news;
35 }
36
37 ?>