@@ 382-398 (lines=17) @@ | ||
379 | * @author Patrick Cool <[email protected]>, Ghent University, Belgium |
|
380 | * @version April 2008 |
|
381 | */ |
|
382 | function get_number_of_group_users() |
|
383 | { |
|
384 | global $current_group; |
|
385 | $course_id = api_get_course_int_id(); |
|
386 | ||
387 | // Database table definition |
|
388 | $table = Database :: get_course_table(TABLE_GROUP_USER); |
|
389 | ||
390 | // Query |
|
391 | $sql = "SELECT count(iid) AS number_of_users |
|
392 | FROM ".$table." |
|
393 | WHERE c_id = $course_id AND group_id='".intval($current_group['id'])."'"; |
|
394 | $result = Database::query($sql); |
|
395 | $return = Database::fetch_array($result, 'ASSOC'); |
|
396 | ||
397 | return $return['number_of_users']; |
|
398 | } |
|
399 | ||
400 | /** |
|
401 | * Get the details of the users in a group |
@@ 5368-5378 (lines=11) @@ | ||
5365 | * @author Christian Fasanando |
|
5366 | * @author Julio Montoya <[email protected]> Adding security |
|
5367 | */ |
|
5368 | function get_name_thread_by_id($thread_id) |
|
5369 | { |
|
5370 | $t_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD); |
|
5371 | $course_id = api_get_course_int_id(); |
|
5372 | $sql = "SELECT thread_title FROM ".$t_forum_thread." |
|
5373 | WHERE c_id = $course_id AND thread_id = '".intval($thread_id)."' "; |
|
5374 | $result = Database::query($sql); |
|
5375 | $row = Database::fetch_array($result); |
|
5376 | ||
5377 | return $row[0]; |
|
5378 | } |
|
5379 | ||
5380 | /** |
|
5381 | * This function gets all the post written by an user |
@@ 4601-4617 (lines=17) @@ | ||
4598 | * @param int $item_id |
|
4599 | * @param array $course_info |
|
4600 | */ |
|
4601 | function makeInvisible($item_id, $course_info) |
|
4602 | { |
|
4603 | $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); |
|
4604 | $item_id = intval($item_id); |
|
4605 | $course_id = $course_info['real_id']; |
|
4606 | $sql = "UPDATE " . $work_table . " |
|
4607 | SET accepted = 0 |
|
4608 | WHERE c_id = $course_id AND id = '" . $item_id . "'"; |
|
4609 | Database::query($sql); |
|
4610 | api_item_property_update( |
|
4611 | $course_info, |
|
4612 | 'work', |
|
4613 | $item_id, |
|
4614 | 'invisible', |
|
4615 | api_get_user_id() |
|
4616 | ); |
|
4617 | } |
|
4618 | ||
4619 | /** |
|
4620 | * @param int $item_id |
@@ 23-39 (lines=17) @@ | ||
20 | * |
|
21 | * @return String Blog Title |
|
22 | */ |
|
23 | public static function getBlogTitle($blog_id) |
|
24 | { |
|
25 | $course_id = api_get_course_int_id(); |
|
26 | ||
27 | if (is_numeric($blog_id)) { |
|
28 | $tbl_blogs = Database::get_course_table(TABLE_BLOGS); |
|
29 | ||
30 | $sql = "SELECT blog_name |
|
31 | FROM ".$tbl_blogs." |
|
32 | WHERE c_id = $course_id AND blog_id = ".intval($blog_id); |
|
33 | ||
34 | $result = Database::query($sql); |
|
35 | $blog = Database::fetch_array($result); |
|
36 | ||
37 | return stripslashes($blog['blog_name']); |
|
38 | } |
|
39 | } |
|
40 | ||
41 | /** |
|
42 | * Get the description of a blog |
|
@@ 49-59 (lines=11) @@ | ||
46 | * |
|
47 | * @return String Blog description |
|
48 | */ |
|
49 | public static function getBlogSubtitle($blog_id) |
|
50 | { |
|
51 | $tbl_blogs = Database::get_course_table(TABLE_BLOGS); |
|
52 | $course_id = api_get_course_int_id(); |
|
53 | $sql = "SELECT blog_subtitle FROM $tbl_blogs |
|
54 | WHERE c_id = $course_id AND blog_id ='".intval($blog_id)."'"; |
|
55 | $result = Database::query($sql); |
|
56 | $blog = Database::fetch_array($result); |
|
57 | ||
58 | return stripslashes($blog['blog_subtitle']); |
|
59 | } |
|
60 | ||
61 | /** |
|
62 | * Get the users of a blog |
@@ 3678-3695 (lines=18) @@ | ||
3675 | * @author Patrick Cool <[email protected]>, Ghent University |
|
3676 | * @version January 2007 |
|
3677 | */ |
|
3678 | public static function get_number_of_survey_invitations() |
|
3679 | { |
|
3680 | $course_id = api_get_course_int_id(); |
|
3681 | ||
3682 | // Database table definition |
|
3683 | $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION); |
|
3684 | ||
3685 | $sql = "SELECT count(user) AS total |
|
3686 | FROM $table_survey_invitation |
|
3687 | WHERE |
|
3688 | c_id = $course_id AND |
|
3689 | survey_id='".intval($_GET['survey_id'])."' AND |
|
3690 | session_id='".api_get_session_id()."' "; |
|
3691 | $res = Database::query($sql); |
|
3692 | $row = Database::fetch_array($res,'ASSOC'); |
|
3693 | ||
3694 | return $row['total']; |
|
3695 | } |
|
3696 | ||
3697 | /** |
|
3698 | * Save the invitation mail |