remove old readme
[atutor.git] / docs / mods / _standard / social / groups / index.php
1 <?php\r
2 /****************************************************************/\r
3 /* ATutor                                                                                                               */\r
4 /****************************************************************/\r
5 /* Copyright (c) 2002-2009                                                                              */\r
6 /* Inclusive Design Institute                                   */\r
7 /* http://atutor.ca                                                                                             */\r
8 /*                                                              */\r
9 /* This program is free software. You can redistribute it and/or*/\r
10 /* modify it under the terms of the GNU General Public License  */\r
11 /* as published by the Free Software Foundation.                                */\r
12 /****************************************************************/\r
13 // $Id$\r
14 $_user_location = 'public';\r
15 \r
16 define('AT_INCLUDE_PATH', '../../../../include/');\r
17 require(AT_INCLUDE_PATH.'vitals.inc.php');\r
18 require(AT_SOCIAL_INCLUDE.'constants.inc.php');\r
19 require(AT_SOCIAL_INCLUDE.'friends.inc.php');\r
20 require(AT_SOCIAL_INCLUDE.'classes/SocialGroups/SocialGroup.class.php');\r
21 require(AT_SOCIAL_INCLUDE.'classes/SocialGroups/SocialGroups.class.php');\r
22 $_custom_css = $_base_path . AT_SOCIAL_BASENAME . 'module.css'; // use a custom stylesheet\r
23 \r
24 if (!$_SESSION['valid_user']) {\r
25         require(AT_INCLUDE_PATH.'header.inc.php');\r
26         $info = array('INVALID_USER', $_SESSION['course_id']);\r
27         $msg->printInfos($info);\r
28         require(AT_INCLUDE_PATH.'footer.inc.php');\r
29         exit;\r
30 }\r
31 \r
32 //paginator settings\r
33 $page = intval($_GET['p']);\r
34 if (!$page) {\r
35         $page = 1;\r
36 }       \r
37 $count  = (($page-1) * SOCIAL_GROUP_MAX) + 1;\r
38 $offset = ($page-1) * SOCIAL_GROUP_MAX;\r
39 \r
40 // Get activities       \r
41 $act_obj = new Activity();\r
42 $activities = $act_obj->getActivities($id);\r
43 \r
44 // Get social group class\r
45 $social_group = new SocialGroups();\r
46 $my_groups = $social_group->getMemberGroups($_SESSION['member_id']);    //to get the size\r
47 $num_pages = sizeof($my_groups)/SOCIAL_GROUP_MAX;\r
48 $my_groups = $social_group->getMemberGroups($_SESSION['member_id'], $offset);\r
49 \r
50 //Display\r
51 include(AT_INCLUDE_PATH.'header.inc.php');\r
52 $savant->display('social/pubmenu.tmpl.php');\r
53 \r
54 if($num_pages > 1){\r
55 ?>\r
56 <div class="pageinator_box">\r
57 <?php\r
58 print_paginator($page, $num_pages, '', 1); \r
59 ?>\r
60 </div>\r
61 <?php\r
62 }\r
63 $savant->assign('my_groups', $my_groups);\r
64 $savant->display('social/sgroups.tmpl.php');\r
65 include(AT_INCLUDE_PATH.'footer.inc.php');\r
66 ?>\r