Exemple #1
0
function blogs_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = "SELECT G.group_id, G.title, G.modules, T.course_id FROM " . TABLE_PREFIX . "groups G INNER JOIN " . TABLE_PREFIX . "groups_types  T USING (type_id) WHERE T.course_id IN {$enrolled_courses} ORDER BY G.title";
    $result = mysql_query($sql, $db);
    if ($result) {
        if (mysql_num_rows($result) > 0) {
            while ($row = mysql_fetch_assoc($result)) {
                if (strpos($row['modules'], '_standard/blogs') !== FALSE) {
                    // retrieve the last posted date/time from this blog
                    $sql = "SELECT MAX(date) AS date FROM " . TABLE_PREFIX . "blog_posts WHERE owner_type=" . BLOGS_GROUP . " AND owner_id={$row['group_id']}";
                    $date_result = mysql_query($sql, $db);
                    $row2 = mysql_fetch_assoc($date_result);
                    $last_updated = ' - ' . _AT('last_updated', AT_date(_AT('forum_date_format'), $row2['date'], AT_DATE_MYSQL_DATETIME));
                    $link_title = $row['title'];
                    $news[] = array('time' => $row2['date'], 'object' => $row, 'alt' => _AT('blogs'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-blogs_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/blogs/view.php?ot=' . BLOGS_GROUP . SEP . 'oid=' . $row['group_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'blog_posts.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'blog_posts.title') . '</a>');
                }
            }
        }
    }
    return $news;
}
Exemple #2
0
function blogs_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = "SELECT G.group_id, G.title, G.modules, T.course_id FROM %sgroups G INNER JOIN %sgroups_types  T USING (type_id) WHERE T.course_id IN %s ORDER BY G.title";
    $rows_enrolled = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $enrolled_courses));
    if (count($rows_enrolled) > 0) {
        foreach ($rows_enrolled as $row) {
            if (strpos($row['modules'], '_standard/blogs') !== FALSE) {
                // check for group membership before showing news.
                $sql = "SELECT member_id FROM %sgroups_members WHERE member_id=%d AND group_id= %d";
                $row_group_member = queryDB($sql, array(TABLE_PREFIX, $_SESSION['member_id'], $row['group_id']), TRUE);
                // check for course instructor, show blog news if so
                $sql = "SELECT member_id from %scourses WHERE member_id =%d";
                $row_instructor = queryDB($sql, array(TABLE_PREFIX, $_SESSION['member_id']));
                if (count($row_group_member) > 0 || count($row_instructor) > 0) {
                    // retrieve the last posted date/time from this blog
                    $sql = "SELECT MAX(date) AS date FROM %sblog_posts WHERE owner_type=%d AND owner_id=%d";
                    $row2 = queryDB($sql, array(TABLE_PREFIX, BLOGS_GROUP, $row['group_id']), TRUE);
                    $last_updated = ' - ' . _AT('last_updated', AT_date(_AT('forum_date_format'), $row2['date'], AT_DATE_MYSQL_DATETIME));
                    $link_title = $row['title'];
                    $news[] = array('time' => $row2['date'], 'object' => $row, 'alt' => _AT('blogs'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-blogs_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/blogs/view.php?ot=' . BLOGS_GROUP . SEP . 'oid=' . $row['group_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'blog_posts.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'blog_posts.title') . '</a>');
                }
            }
        }
    }
    return $news;
}
function select_categories($categories, $cat_id, $current_cat_id, $exclude, $depth = 0)
{
    if ($cat_id == 0 && is_array($categories[0])) {
        foreach ($categories[0] as $child_cat_id) {
            select_categories($categories, $child_cat_id, $current_cat_id, $exclude);
        }
    } else {
        if ($exclude && $cat_id == $current_cat_id) {
            return;
        }
        echo '<option value="' . $cat_id . '"';
        if ($exclude && is_array($categories[$cat_id]['children']) && in_array($current_cat_id, $categories[$cat_id]['children'])) {
            echo ' selected="selected"';
        } else {
            if (!$exclude && $cat_id == $current_cat_id) {
                echo ' selected="selected"';
            }
        }
        echo '>';
        echo str_repeat("&nbsp;", $depth * 4);
        echo validate_length($categories[$cat_id]['cat_name'], 45, VALIDATE_LENGTH_FOR_DISPLAY) . '</option>';
        if (isset($categories[$cat_id]['children']) && is_array($categories[$cat_id]['children'])) {
            foreach ($categories[$cat_id]['children'] as $child_cat_id) {
                select_categories($categories, $child_cat_id, $current_cat_id, $exclude, $depth + 1);
            }
        }
    }
}
function links_news() {
	global $db, $enrolled_courses, $system_courses;
	$news = array();

	if ($enrolled_courses == ''){
		return $news;
	} 

	$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";
	$result = mysql_query($sql, $db);
	if($result){
		while($row = mysql_fetch_assoc($result)){
			$news[] = array(
							'time'=>$row['SubmitDate'], 
							'object'=>$row, 
							'alt'=>_AT('links'),
							'course'=>$system_courses[$row['owner_id']]['title'],
							'thumb'=>'images/home-links_sm.png', 
							'link'=>'<a href="bounce.php?course='.$row['owner_id'].'&p='.urlencode('mods/_standard/links/index.php?view='.$row['link_id']).'"'.
									(strlen($row['LinkName']) > SUBLINK_TEXT_LEN ? ' title="'.$row['LinkName'].'"' : '') .'>'. 
									validate_length($row['LinkName'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>');
		}
	}
	return $news;
}
Exemple #5
0
function forums_news()
{
    require_once AT_INCLUDE_PATH . '../mods/_standard/forums/lib/forums.inc.php';
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = 'SELECT E.approved, E.last_cid, C.* FROM ' . TABLE_PREFIX . 'course_enrollment E, ' . TABLE_PREFIX . 'courses C WHERE C.course_id in ' . $enrolled_courses . '  AND E.member_id=' . $_SESSION['member_id'] . ' AND E.course_id=C.course_id ORDER BY C.title';
    $rows_en_courses = queryDB($sql, array());
    if (count($rows_en_courses) > 0) {
        foreach ($rows_en_courses as $row) {
            $all_forums = get_forums($row['course_id']);
            if (is_array($all_forums)) {
                foreach ($all_forums as $forums) {
                    if (is_array($forums)) {
                        foreach ($forums as $forum_obj) {
                            $forum_obj['course_id'] = $row['course_id'];
                            $link_title = $forum_obj['title'];
                            $news[] = array('time' => $forum_obj['last_post'], 'object' => $forum_obj, 'alt' => _AT('forum'), 'thumb' => 'images/pin.png', 'course' => $system_courses[$row['course_id']]['title'], 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'pu=' . urlencode('mods/_standard/forums/forum/index.php?fid=' . $forum_obj['forum_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'forums.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'forums.title') . '</a>');
                        }
                    }
                }
            }
        }
    }
    return $news;
}
Exemple #6
0
function file_storage_news()
{
    global $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    // As personal files are listed in any enrolled courses of the student,
    // randomly pick one course for bouce.php
    $end_of_first_course = strpos($enrolled_courses, ",") - 1;
    $any_one_enrolled_course = substr($enrolled_courses, 1, $end_of_first_course ? $end_of_first_course : -1);
    $sql = "(SELECT date, file_id, file_name, owner_id course_id, description \n\t           FROM " . TABLE_PREFIX . "files \n\t          WHERE owner_type = " . WORKSPACE_COURSE . " AND owner_id IN " . $enrolled_courses . ")\n\t        UNION\n\t        (SELECT date, file_id, file_name, " . $any_one_enrolled_course . " course_id, description \n\t           FROM " . TABLE_PREFIX . "files\n\t          WHERE owner_type = " . WORKSPACE_PERSONAL . " AND owner_id = " . $_SESSION['member_id'] . ")\n\t        UNION\n\t        (SELECT f.date, f.file_id, f.file_name, gt.course_id, f.description \n\t           FROM " . TABLE_PREFIX . "files f, " . TABLE_PREFIX . "groups g, " . TABLE_PREFIX . "groups_types gt\n\t          WHERE owner_type = " . WORKSPACE_GROUP . " \n\t            AND f.owner_id = g.group_id \n\t            AND g.type_id = gt.type_id \n\t            AND gt.course_id IN " . $enrolled_courses . "\n\t            AND " . $_SESSION['member_id'] . " in \n\t               (select member_id \n\t                from " . TABLE_PREFIX . "groups_members gm \n\t                where gm.group_id = g.group_id))\n\t         ORDER BY date DESC";
    $rows_files = queryDB($sql, array());
    if (count($rows_files) > 0) {
        foreach ($rows_files as $row) {
            if ($row['description'] != "") {
                $filetext = $row['description'];
            } else {
                $filetext = $row['file_name'];
            }
            $sql = "SELECT course_id, home_links, main_links from %scourses WHERE course_id = %d";
            $row2 = queryDB($sql, array(TABLE_PREFIX, $row['course_id']), TRUE);
            // check if course has file storage enabled
            if (strstr($row2['home_links'], 'file_storage') || strstr($row2['main_links'], 'file_storage')) {
                $news[] = array('time' => $row['date'], 'object' => $row, 'course' => $system_courses[$row['course_id']]['title'], 'alt' => _AT('download'), 'thumb' => 'images/application_get.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/file_storage/index.php?download=1' . SEP . 'files[]=' . $row['file_id']) . '"' . (strlen($filetext) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($filetext, 'input.text') . '"' : '') . '>' . AT_print(validate_length($filetext, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'input.text') . '</a>');
            }
        }
    }
    return $news;
}
function tests_news() {
	global $db, $enrolled_courses, $system_courses;
	$news = array();

	if ($enrolled_courses == ''){
		return $news;
	} 
	$sql = "SELECT T.test_id, T.course_id, T.title, T.start_date as start_date, UNIX_TIMESTAMP(T.start_date) AS sd, UNIX_TIMESTAMP(T.end_date) AS ed 
          FROM ".TABLE_PREFIX."tests T, ".TABLE_PREFIX."tests_questions_assoc Q 
         WHERE Q.test_id=T.test_id 
           AND T.course_id IN $enrolled_courses 
         GROUP BY T.test_id 
         ORDER BY T.start_date DESC";
	$result = mysql_query($sql, $db);
	if($result){
		while($row = mysql_fetch_assoc($result)){
			//show only the visible tests
			if ( ($row['sd'] <= time()) && ($row['ed'] >= time())){
				$news[] = array('time'=>$row['start_date'], 
								'object'=>$row,
								'alt'=>_AT('tests'),
								'course'=>$system_courses[$row['course_id']]['title'],
								'thumb'=>'images/home-tests_sm.png',
								'link'=>'<a href="bounce.php?course='.$row['course_id'].'&p='.urlencode('mods/_standard/tests/test_intro.php?tid='.$row['test_id']).'" '
										.(strlen($row['title']) > SUBLINK_TEXT_LEN ? ' title="'.$row['title'].'"' : '') .'>'
										.validate_length($row['title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a> <small>('._AT('start_date').':'.AT_DATE('%F %j, %g:%i',$row['start_date']).')</small>');
			}
		}
	}
	return $news;
}
Exemple #8
0
function links_news()
{
    global $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $result = queryDB('SELECT * FROM %slinks L INNER JOIN %slinks_categories C ON C.cat_id = L.cat_id WHERE owner_id IN %s AND L.Approved=1 ORDER BY SubmitDate DESC', array(TABLE_PREFIX, TABLE_PREFIX, $enrolled_courses));
    foreach ($result as $row) {
        $news[] = array('time' => $row['SubmitDate'], 'object' => $row, 'alt' => _AT('links'), 'course' => $system_courses[$row['owner_id']]['title'], 'thumb' => 'images/home-links_sm.png', 'link' => '<a href="bounce.php?course=' . $row['owner_id'] . SEP . 'p=' . urlencode('mods/_standard/links/index.php?view=' . $row['link_id']) . '"' . (strlen($row['LinkName']) > SUBLINK_TEXT_LEN ? ' title="' . $row['LinkName'] . '"' : '') . '>' . validate_length($row['LinkName'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a> <small>');
    }
    return $news;
}
Exemple #9
0
function reading_list_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    $sql = "SELECT * FROM " . TABLE_PREFIX . "reading_list R INNER JOIN " . TABLE_PREFIX . "external_resources E ON E.resource_id = R.resource_id WHERE R.course_id in " . $enrolled_courses . " ORDER BY R.reading_id DESC";
    $result = mysql_query($sql, $db);
    if (@mysql_num_rows($result) > 0) {
        while ($row = mysql_fetch_assoc($result)) {
            $news[] = array('time' => $row['date_end'], 'object' => $row, 'alt' => _AT('reading_list'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-reading_list_sm.png', 'link' => '<a href="' . url_rewrite('mods/_standard/reading_list/display_resource.php?id=' . $row['resource_id'], AT_PRETTY_URL_IS_HEADER) . '"' . (strlen($row['title']) > SUBLINK_TEXT_LEN ? ' title="' . $row['title'] . '"' : '') . '>' . validate_length($row['title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a>');
        }
    }
    return $news;
}
function file_storage_news() {
	global $db, $enrolled_courses, $system_courses;
	$news = array();

	if ($enrolled_courses == '') {
		return $news;
	}
	
	// As personal files are listed in any enrolled courses of the student,
	// randomly pick one course for bouce.php
	$end_of_first_course = strpos($enrolled_courses, ",") - 1;
	$any_one_enrolled_course = substr($enrolled_courses, 1, $end_of_first_course ? $end_of_first_course : -1);
	
	$sql = "(SELECT date, file_id, file_name, owner_id course_id, description 
	           FROM ".TABLE_PREFIX."files 
	          WHERE owner_type = ".WORKSPACE_COURSE." AND owner_id IN ".$enrolled_courses.")
	        UNION
	        (SELECT date, file_id, file_name, ".$any_one_enrolled_course." course_id, description 
	           FROM ".TABLE_PREFIX."files
	          WHERE owner_type = ".WORKSPACE_PERSONAL." AND owner_id = ".$_SESSION['member_id'].")
	        UNION
	        (SELECT f.date, f.file_id, f.file_name, gt.course_id, f.description 
	           FROM ".TABLE_PREFIX."files f, ".TABLE_PREFIX."groups g, ".TABLE_PREFIX."groups_types gt
	          WHERE owner_type = ".WORKSPACE_GROUP." 
	            AND f.owner_id = g.group_id 
	            AND g.type_id = gt.type_id 
	            AND gt.course_id IN ".$enrolled_courses.")
	         ORDER BY date DESC";
	$result = mysql_query($sql, $db);
	
	if($result){
		while($row = mysql_fetch_assoc($result)){
			if($row['description'] !=""){
				$filetext = $row['description'];
			} else {
				$filetext = $row['file_name'];
			}
			$news[] = array('time'=>$row['date'], 
			      'object'=>$row, 
			      'course'=>$system_courses[$row['course_id']]['title'],
			      'alt'=>_AT('download'),
			      'thumb'=>'images/application_get.png', 
			      'link'=>'<a href="bounce.php?course='.$row['course_id'].SEP.'p='.urlencode('mods/_standard/file_storage/index.php?download=1'.SEP.'files[]='. $row['file_id']).'"'.
		          (strlen($filetext) > SUBLINK_TEXT_LEN ? ' title="'.AT_print($filetext, 'input.text').'"' : '') .'>'. 
		          AT_print(validate_length($filetext, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'input.text') .'</a>');
		}
	}
	return $news;
}
Exemple #11
0
function reading_list_news()
{
    global $enrolled_courses, $system_courses;
    $news = array();
    if (isset($enrolled_courses)) {
        $sql = "SELECT * FROM %sreading_list R INNER JOIN %sexternal_resources E ON E.resource_id = R.resource_id WHERE R.course_id in %s ORDER BY R.reading_id DESC";
        $rows_resources = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $enrolled_courses));
        if (count($rows_resources) > 0) {
            foreach ($rows_resources as $row) {
                $news[] = array('time' => $row['date_end'], 'object' => $row, 'alt' => _AT('reading_list'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-reading_list_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=mods/_standard/reading_list/display_resource.php?id=' . $row['resource_id'] . '"' . (strlen($row['title']) > SUBLINK_TEXT_LEN ? ' title="' . $row['title'] . '"' : '') . '>' . validate_length($row['title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a>');
            }
        }
        return $news;
    }
}
Exemple #12
0
function polls_news()
{
    global $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = "SELECT * FROM %spolls WHERE course_id IN %s ORDER BY created_date DESC";
    $rows_polls = queryDB($sql, array(TABLE_PREFIX, $enrolled_courses));
    if (count($rows_polls) > 0) {
        foreach ($rows_polls as $row) {
            $news[] = array('time' => $row['created_date'], 'object' => $row, 'alt' => _AT('polls'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-polls_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/polls/index.php#' . $row['poll_id']) . '"' . (strlen($row['question']) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($row['question'], 'polls.question') . '"' : '') . '>' . AT_print(validate_length($row['question'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'polls.question') . '</a>');
        }
    }
    return $news;
}
Exemple #13
0
function polls_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'polls WHERE course_id IN' . $enrolled_courses . ' ORDER BY created_date DESC';
    $result = mysql_query($sql, $db);
    if ($result) {
        while ($row = mysql_fetch_assoc($result)) {
            $news[] = array('time' => $row['created_date'], 'object' => $row, 'alt' => _AT('polls'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-polls_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/polls/index.php#' . $row['poll_id']) . '"' . (strlen($row['question']) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($row['question'], 'polls.question') . '"' : '') . '>' . AT_print(validate_length($row['question'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'polls.question') . '</a>');
        }
    }
    return $news;
}
Exemple #14
0
function faq_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = "SELECT * FROM %sfaq_topics T INNER JOIN %sfaq_entries E ON T.topic_id = E.topic_id WHERE T.course_id IN %s ORDER BY E.revised_date DESC";
    $rows_faqs = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $enrolled_courses));
    if (count($rows_faqs) > 0) {
        foreach ($rows_faqs as $row) {
            $news[] = array('time' => $row['revised_date'], 'alt' => _AT('faq'), 'object' => $row, 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-faq_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/faq/index.php#' . $row['entry_id']) . '"' . (strlen($row['question']) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($row['question'], 'faqs.question') . '"' : '') . '>' . AT_print(validate_length($row['question'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'faqs.question') . '</a>');
        }
    }
    return $news;
}
Exemple #15
0
function tests_news()
{
    global $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = "SELECT T.test_id, T.course_id, T.title, T.start_date as start_date, UNIX_TIMESTAMP(T.start_date) AS sd, UNIX_TIMESTAMP(T.end_date) AS ed \n          FROM %stests T, %stests_questions_assoc Q \n         WHERE Q.test_id=T.test_id \n           AND T.course_id IN %s \n         GROUP BY T.test_id \n         ORDER BY T.start_date DESC";
    $rows_tests = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $enrolled_courses));
    if (count($rows_tests) > 0) {
        foreach ($rows_tests as $row) {
            //show only the visible tests
            if ($row['sd'] <= time() && $row['ed'] >= time()) {
                $news[] = array('time' => $row['start_date'], 'object' => $row, 'alt' => _AT('tests'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-tests_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/tests/test_intro.php?tid=' . $row['test_id']) . '" ' . (strlen($row['title']) > SUBLINK_TEXT_LEN ? ' title="' . $row['title'] . '"' : '') . '>' . validate_length($row['title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a> <small>(' . _AT('start_date') . ':' . AT_DATE('%F %j, %g:%i', $row['start_date']) . ')</small>');
            }
        }
    }
    return $news;
}
function get_additions($sql, $sqlParams, $module, $module_name, $group_id)
{
    global $_base_path;
    $record_limit = 3;
    $str = '';
    $rows = queryDB($sql, $sqlParams);
    if (count($rows) > 0) {
        echo "<h4 class = 'page-title'>" . $module->getName() . "</h4>";
        $str .= '<ol id = "tools"><li class = "top-tool">';
        foreach ($rows as $row) {
            switch ($module_name) {
                case _AT('forums'):
                    $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/forums/forum/view.php?fid=' . $row[forum_id] . SEP . 'pid=' . $row['post_id']) . '" title="' . AT_print($full_subject, 'forums_threads.subject') . '">' . $row['subject'] . '</a></br>';
                    break;
                case _AT('file_storage'):
                    if ($row['description'] != "") {
                        $filetext = $row['description'];
                    } else {
                        $filetext = $row['file_name'];
                    }
                    $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/file_storage/index.php?download=1' . SEP . 'files[]=' . $row['file_id']) . '"' . (strlen($filetext) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($filetext, 'input.text') . '"' : '') . '>' . AT_print(validate_length($filetext, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'input.text') . '</a><br/>';
                    break;
                case _AT('blogs'):
                    $link_title = $row['title'];
                    $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/blogs/post.php?ot=' . BLOGS_GROUP . SEP . 'oid=' . $group_id . SEP . 'id=' . $row['post_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'blog_posts.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'blog_posts.title') . '</a><br/>';
                    break;
                case _AT('links'):
                    $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/links/index.php?view=' . $row['link_id']) . '"' . (strlen($row['LinkName']) > SUBLINK_TEXT_LEN ? ' title="' . $row['LinkName'] . '"' : '') . '>' . validate_length($row['LinkName'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a><br/>';
                    break;
                default:
                    return 0;
                    break;
            }
        }
        $str .= "</li></ol>";
        echo $str;
        return 1;
    } else {
        return 0;
    }
}
Exemple #17
0
function forums_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = 'SELECT E.approved, E.last_cid, C.* FROM ' . TABLE_PREFIX . 'course_enrollment E, ' . TABLE_PREFIX . 'courses C WHERE C.course_id in ' . $enrolled_courses . '  AND E.member_id=' . $_SESSION['member_id'] . ' AND E.course_id=C.course_id ORDER BY C.title';
    $rows_en_courses = queryDB($sql, array());
    if (count($rows_en_courses) > 0) {
        foreach ($rows_en_courses as $row) {
            $all_forums = get_forums($row['course_id']);
            if (is_array($all_forums)) {
                foreach ($all_forums as $forums) {
                    if (is_array($forums)) {
                        foreach ($forums as $forum_obj) {
                            $latest_post = get_last_post($forum_obj['forum_id']);
                            $forum_obj['course_id'] = $row['course_id'];
                            $link_title = $forum_obj['title'];
                            // attached the first 120 characters of the message to the news item
                            if (strlen($latest_post[0]['body']) > 120) {
                                $last_post = substr($latest_post[0]['body'], 0, 120) . '...';
                            } else {
                                $last_post = $latest_post[0]['body'];
                            }
                            // if this is the only message in a thread, replace parent_id with the post_id
                            if ($latest_post[0]['parent_id'] == 0) {
                                $latest_post[0]['parent_id'] = $latest_post[0]['post_id'];
                            }
                            if ($latest_post[0]['subject'] != '') {
                                $news[] = array('time' => $forum_obj['last_post'], 'object' => $forum_obj, 'alt' => _AT('forum'), 'thumb' => 'images/pin.png', 'course' => $system_courses[$row['course_id']]['title'], 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'pu=' . urlencode('mods/_standard/forums/forum/view.php?fid=' . $forum_obj['forum_id'] . SEP . 'pid=' . $latest_post[0]['parent_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'forums.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'forums.title') . ': ' . $latest_post[0]['subject'] . ' </a> - ' . $last_post);
                            }
                        }
                    }
                }
            }
        }
    }
    return $news;
}
Exemple #18
0
<?php

if (!defined('AT_INCLUDE_PATH')) {
    exit;
}
global $contentManager;
$record_limit = 3;
// number of sublinks to display at module home "detail view"
$sql = "SELECT content_id FROM %smember_track WHERE course_id=%d AND member_id=%d ORDER BY last_accessed DESC limit %d";
$rows_tracks = queryDB($sql, array(TABLE_PREFIX, $_SESSION['course_id'], $_SESSION['member_id'], $record_limit));
if (count($rows_tracks) > 0) {
    foreach ($rows_tracks as $row) {
        $link_title = $contentManager->_menu_info[$row['content_id']]['title'];
        $list[] = '<a href="' . url_rewrite('content.php?cid=' . $row['content_id'], AT_PRETTY_URL_IS_HEADER) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . $link_title . '"' : '') . '>' . validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a>';
    }
    return $list;
} else {
    return 0;
}
    for ($i = 0; $i < $length; $i++) {
        $key .= $charset[mt_rand(0, strlen($charset) - 1)];
    }
    return $key;
}
// Main process
if (isset($_REQUEST['auto_enroll_id'])) {
    $auto_enroll_id = $_REQUEST['auto_enroll_id'];
} else {
    $auto_enroll_id = 0;
}
if (isset($_POST['save']) || isset($_POST['add'])) {
    /* insert or update a category */
    $name = trim($_POST['name']);
    $name = $addslashes($name);
    $name = validate_length($name, 50);
    if (isset($_POST['add']) && !$_POST['add_ids']) {
        $msg->addError('NO_ITEM_SELECTED');
    }
    if (!$msg->containsErrors()) {
        if ($auto_enroll_id == 0) {
            $sql = "INSERT INTO %sauto_enroll(associate_string, name)  VALUES ('%s', '%s')";
            $rows_inserted = queryDB($sql, array(TABLE_PREFIX, get_random_string(6, 10), $name));
            $auto_enroll_id = at_insert_id();
            write_to_log(AT_ADMIN_LOG_INSERT, 'auto_enroll', $rows_inserted, $sqlout);
        } else {
            $sql = "UPDATE %sauto_enroll SET name = '%s' WHERE auto_enroll_id = %d";
            $rows_updated = queryDB($sql, array(TABLE_PREFIX, $name, $auto_enroll_id));
            write_to_log(AT_ADMIN_LOG_UPDATE, 'auto_enroll', $rows_updated, $sqlout);
        }
        if (isset($_POST['add'])) {
 if ($_POST['question'] == '') {
     $msg->addError(array('EMPTY_FIELDS', _AT('question')));
 }
 if (!$msg->containsErrors()) {
     $choice_new = array();
     // stores the non-blank choices
     $answer_new = array();
     // stores the associated "answer" for the choices
     for ($i = 0; $i < 10; $i++) {
         //$_POST['choice'][$i] = $addslashes(trim($_POST['choice'][$i]));
         $_POST['choice'][$i] = trim($_POST['choice'][$i]);
         /**
          * Db defined it to be 255 length, chop strings off it it's less than that
          * @harris
          */
         $_POST['choice'][$i] = validate_length($_POST['choice'][$i], 255);
         $_POST['answer'][$i] = intval($_POST['answer'][$i]);
         if ($_POST['choice'][$i] == '') {
             /* an empty option can't be correct */
             $_POST['answer'][$i] = 0;
         } else {
             /* filter out empty choices/ remove gaps */
             $choice_new[] = $_POST['choice'][$i];
             $answer_new[] = $_POST['answer'][$i];
         }
     }
     $_POST['answer'] = $answer_new;
     $_POST['choice'] = $choice_new;
     $_POST['answer'] = array_pad($_POST['answer'], 10, 0);
     $_POST['choice'] = array_pad($_POST['choice'], 10, '');
     $sql = "UPDATE %stests_questions SET\n            category_id=%d,\n            feedback='%s',\n            question='%s',\n            choice_0='%s',\n            choice_1='%s',\n            choice_2='%s',\n            choice_3='%s',\n            choice_4='%s',\n            choice_5='%s',\n            choice_6='%s',\n            choice_7='%s',\n            choice_8='%s',\n            choice_9='%s',\n            answer_0=%d,\n            answer_1=%d,\n            answer_2=%d,\n            answer_3=%d,\n            answer_4=%d,\n            answer_5=%d,\n            answer_6=%d,\n            answer_7=%d,\n            answer_8=%d,\n            answer_9=%d,\n            remedial_content='%s'\n            WHERE question_id=%d AND course_id=%d";
define('AT_INCLUDE_PATH', '../../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
require AT_INCLUDE_PATH . '../mods/_core/themes/lib/themes.inc.php';
admin_authenticate(AT_ADMIN_PRIV_CATEGORIES);
require AT_INCLUDE_PATH . '../mods/_core/cats_categories/lib/admin_categories.inc.php';
if (isset($_POST['submit'])) {
    /* insert or update a category */
    $cat_id = intval($_POST['cat_id']);
    $cat_parent_id = intval($_POST['cat_parent_id']);
    $cat_name = trim($_POST['cat_name']);
    $cat_name = $addslashes($cat_name);
    $cat_theme = $addslashes($_POST['cat_theme']);
    if ($cat_name == '') {
        $msg->addError(array('EMPTY_FIELDS', _AT('title')));
    }
    $cat_name = validate_length($cat_name, 100);
    if ($_POST['theme_parent']) {
        $sql = "SELECT theme FROM " . TABLE_PREFIX . "course_cats WHERE cat_id={$cat_parent_id}";
        $result = mysql_query($sql, $db);
        if ($row = mysql_fetch_assoc($result)) {
            $cat_theme = $row['theme'];
        }
    }
    if (!$msg->containsErrors()) {
        $sql = "INSERT INTO " . TABLE_PREFIX . "course_cats VALUES (NULL, '{$cat_name}', {$cat_parent_id}, '{$cat_theme}')";
        $result = mysql_query($sql, $db);
        $cat_id = mysql_insert_id($db);
        $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
        write_to_log(AT_ADMIN_LOG_INSERT, 'course_cats', mysql_affected_rows($db), $sql);
        header('Location: course_categories.php');
        exit;
Exemple #22
0
/* Inclusive Design Institute                                           */
/* http://atutor.ca                                                     */
/* This program is free software. You can redistribute it and/or        */
/* modify it under the terms of the GNU General Public License          */
/* as published by the Free Software Foundation.                        */
/************************************************************************/
if (!defined('AT_INCLUDE_PATH')) {
    exit;
}
$record_limit = 3;
// Number of sublinks to display for this module on course home page -> detail view
$cnt = 0;
// count number of sublinks pushed into $list
if ($dir = @opendir(AT_CONTENT_DIR . 'chat/' . $_SESSION['course_id'] . '/tran/')) {
    while (($file = readdir($dir)) !== false) {
        if ($cnt >= $record_limit) {
            break;
        }
        // quit the loop when reaching the record limit
        if (substr($file, -strlen('.html')) == '.html') {
            $file = str_replace('.html', '', $file);
            $list[] = '<a href="' . url_rewrite('mods/_standard/chat/view_transcript.php?t=' . $file, AT_PRETTY_URL_IS_HEADER) . '"' . (strlen($file) > SUBLINK_TEXT_LEN ? ' title="' . $file . '"' : '') . '>' . validate_length($file, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a>';
            $cnt++;
        }
    }
}
if (count($list) > 0) {
    return $list;
} else {
    return 0;
}
Exemple #23
0
require AT_INCLUDE_PATH . 'vitals.inc.php';
authenticate(AT_PRIV_GLOSSARY);
if ($_POST['cancel']) {
    $msg->addFeedback('CANCELLED');
    Header('Location: index.php');
    exit;
}
if ($_POST['submit']) {
    $missing_fields = array();
    $_POST['word'] = trim($_POST['word']);
    $_POST['definition'] = trim($_POST['definition']);
    if ($_POST['word'] == '') {
        $missing_fields[] = _AT('glossary_term');
    } else {
        //60 is defined by the sql
        $_POST['word'] = validate_length($_POST['word'], 60);
    }
    if ($_POST['definition'] == '') {
        $missing_fields[] = _AT('glossary_definition');
    }
    if ($missing_fields) {
        $missing_fields = implode(', ', $missing_fields);
        $msg->addError(array('EMPTY_FIELDS', $missing_fields));
    }
    $_POST['related_term'] = intval($_POST['related_term']);
    if (!$msg->containsErrors()) {
        $_POST['word'] = $addslashes($_POST['word']);
        $_POST['definition'] = $addslashes($_POST['definition']);
        $_POST['gid'] = intval($_POST['gid']);
        $sql = "UPDATE %sglossary SET word='%s', definition='%s', related_word_id=%d WHERE word_id=%d AND course_id=%d";
        $result = queryDB($sql, array(TABLE_PREFIX, $_POST['word'], $_POST['definition'], $_POST['related_term'], $_POST['gid'], $_SESSION['course_id']));
Exemple #24
0
}
if (isset($_POST['cancel'])) {
    $msg->addFeedback('CANCELLED');
    header('Location: ' . url_rewrite('mods/_standard/forums/forum/index.php?fid=' . $fid, AT_PRETTY_URL_IS_HEADER));
    exit;
} else {
    if (isset($_POST['submit'])) {
        $missing_fields = array();
        $_POST['subject'] = htmlentities(addslashes($_POST['subject']), ENT_QUOTES, 'UTF-8');
        $_POST['body'] = htmlspecialchars(strip_tags($_POST['body']), ENT_QUOTES, 'UTF-8');
        $_POST['replytext'] = htmlspecialchars(strip_tags($_POST['replytext']), ENT_QUOTES, 'UTF-8');
        if ($_POST['subject'] == '') {
            $missing_fields[] = _AT('subject');
        } else {
            //60 was set by db
            $_POST['subject'] = validate_length($_POST['subject'], 60);
        }
        if ($_POST['body'] == '') {
            $missing_fields[] = _AT('body');
        }
        if ($missing_fields) {
            $missing_fields = implode(', ', $missing_fields);
            $msg->addError(array('EMPTY_FIELDS', $missing_fields));
        }
        if (!$msg->containsErrors()) {
            if ($_POST['replytext'] != '') {
                $_POST['body'] .= "\n\n" . '[reply][b]' . _AT('in_reply_to') . ': [/b]' . "\n";
                if ($strlen($_POST['replytext']) > 200) {
                    $_POST['body'] .= $substr($_POST['replytext'], 0, 200) . '...';
                } else {
                    $_POST['body'] .= $_POST['replytext'];
Exemple #25
0
} else {
    $poll_id = intval($_POST['poll_id']);
}
if ($_POST['edit_poll']) {
    if (trim($_POST['question']) == '') {
        $msg->addError(array('EMPTY_FIELDS', _AT('question')));
    }
    if (trim($_POST['c1']) == '' || trim($_POST['c2']) == '') {
        $msg->addError('POLL_QUESTION_MINIMUM');
    }
    if (!$msg->containsErrors()) {
        //$_POST['question'] = $addslashes($_POST['question']);
        //Check if the question has exceeded the words amount - 100, decided in the db
        $_POST['question'] = validate_length($_POST['question'], 100);
        for ($i = 1; $i <= AT_NUM_POLL_CHOICES; $i++) {
            $trimmed_word = validate_length($_POST['c' . $i], 100);
            //$trimmed_word = $addslashes($trimmed_word);
            $choices .= "choice{$i} = '" . $trimmed_word . "',";
        }
        $choices = substr($choices, 0, -1);
        $sql = "UPDATE %spolls SET question='%s', created_date=created_date, {$choices} WHERE poll_id=%d AND course_id=%d";
        $result = queryDB($sql, array(TABLE_PREFIX, $_POST['question'], $poll_id, $_SESSION['course_id']));
        if ($result > 0) {
            $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
        }
        header('Location: index.php');
        exit;
    }
    for ($i = 1; $i <= AT_NUM_POLL_CHOICES; $i++) {
        $_POST['c' . $i] = $stripslashes($_POST['c' . $i]);
    }
Exemple #26
0
// $Id$
define('AT_INCLUDE_PATH', '../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
authenticate(AT_PRIV_FORUMS);
require AT_INCLUDE_PATH . '../mods/_standard/forums/lib/forums.inc.php';
if (isset($_POST['cancel'])) {
    $msg->addFeedback('CANCELLED');
    header('Location: ' . AT_BASE_HREF . 'mods/_standard/forums/index.php');
    exit;
} else {
    if (isset($_POST['edit_forum'])) {
        $_POST['fid'] = intval($_POST['fid']);
        if ($_POST['title'] == '') {
            $msg->addError(array('EMPTY_FIELDS', _AT('title')));
        } else {
            $_POST['title'] = validate_length($_POST['title'], 60);
        }
        if (!$msg->containsErrors()) {
            if (!is_shared_forum($_POST['fid'])) {
                edit_forum($_POST);
                $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
            } else {
                $msg->addError('FORUM_NO_EDIT_SHARE');
            }
            header('Location: ' . AT_BASE_HREF . 'mods/_standard/forums/index.php');
            exit;
        }
    }
}
$onload = 'document.form.title.focus();';
require AT_INCLUDE_PATH . 'header.inc.php';
Exemple #27
0
            $missing_fields[] = _AT('question');
        }
        if (!$_POST['answer']) {
            $missing_fields[] = _AT('answer');
        }
        if ($missing_fields) {
            $missing_fields = implode(', ', $missing_fields);
            $msg->addError(array('EMPTY_FIELDS', $missing_fields));
        }
        if (!$msg->containsErrors()) {
            $_POST['question'] = $addslashes($_POST['question']);
            $_POST['answer'] = $addslashes($_POST['answer']);
            $_POST['topic_id'] = intval($_POST['topic_id']);
            //These will truncate the content of the length to 240 as defined in the db.
            $_POST['question'] = validate_length($_POST['question'], 250);
            $_POST['answer'] = validate_length($_POST['answer'], 250);
            // check that this topic_id belongs to this course:
            $sql = "SELECT topic_id FROM " . TABLE_PREFIX . "faq_topics WHERE topic_id={$_POST['topic_id']} AND course_id={$_SESSION['course_id']}";
            $result = mysql_query($sql, $db);
            if ($row = mysql_fetch_assoc($result)) {
                $sql = "INSERT INTO " . TABLE_PREFIX . "faq_entries VALUES (NULL, {$_POST['topic_id']}, NOW(), 1, '{$_POST['question']}', '{$_POST['answer']}')";
                $result = mysql_query($sql, $db);
            }
            $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
            header('Location: index_instructor.php');
            exit;
        }
    }
}
$onload = 'document.form.topic.focus();';
require AT_INCLUDE_PATH . 'header.inc.php';
Exemple #28
0
<?php

if (!defined('AT_INCLUDE_PATH')) {
    exit;
}
$tests_limit = 3;
//Numero massimo dei possibili sottocontenuti visualizzabili nella home-page
$sql = "SELECT T.test_id, T.title, UNIX_TIMESTAMP(T.start_date) AS sd, UNIX_TIMESTAMP(T.end_date) AS ed \n          FROM %stests T, %stests_questions_assoc Q \n         WHERE Q.test_id=T.test_id \n           AND T.course_id=%d \n         GROUP BY T.test_id \n         ORDER BY T.end_date DESC";
$rows_tests = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $_SESSION['course_id']));
$cnt = 0;
if (count($rows_tests) > 0) {
    foreach ($rows_tests as $row) {
        if ($row['sd'] <= time() && $row['ed'] >= time() && $cnt < $tests_limit) {
            //Solo i test "On Going" dovranno essere visualizzati, per questo vengono controllate le date di inizio e fine in riferimento alla data odierna
            $list[] = '<a href="' . url_rewrite('mods/_standard/tests/test_intro.php?tid=' . $row['test_id'], AT_PRETTY_URL_IS_HEADER) . '"' . (strlen($row['title']) > SUBLINK_TEXT_LEN ? ' title="' . $row['title'] . '"' : '') . '>' . validate_length($row['title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a>';
        }
        $cnt++;
    }
    return $list;
} else {
    return 0;
}
Exemple #29
0
<?php

if (!defined('AT_INCLUDE_PATH')) {
    exit;
}
$polls_limit = 3;
//Numero massimo dei possibili sottocontenuti visualizzabili nella home-page
$sql = "SELECT poll_id, question FROM %spolls WHERE course_id=%d ORDER BY created_date DESC LIMIT %d";
$rows_polls = queryDB($sql, array(TABLE_PREFIX, $_SESSION['course_id'], $polls_limit));
if (count($rows_polls) > 0) {
    foreach ($rows_polls as $row) {
        $list[] = '<a href="' . url_rewrite('mods/_standard/polls/index.php#' . $row['poll_id'], AT_PRETTY_URL_IS_HEADER) . '"' . (strlen($row['question']) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($row['question'], 'polls.question') . '"' : '') . '>' . AT_print(validate_length($row['question'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'polls.question') . '</a>';
    }
    return $list;
} else {
    return 0;
}
	if($response['messageKey'] == 'checksumError'){
		$msg->addError("CHECKSUM_ERROR_BBB");
	}
	else{
		$msg = $response['message'];
	}
}
else{//"The meeting was created, and the user will now be joined "
	$bbb_joinURL = BigBlueButton::joinURL($meetingID,$username,"ap", $salt, $url);
	
}
 
$sql = "SELECT * from ".TABLE_PREFIX."bigbluebutton WHERE course_id = '$meetingID'";
$result = mysql_query($sql, $db);

if (mysql_num_rows($result) > 0) {
	while ($row = mysql_fetch_assoc($result)) {
		/****
		* SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY are defined in include/lib/constance.lib.inc
		* SUBLINK_TEXT_LEN determins the maxium length of the string to be displayed on "detail view" box.
		*****/
		$list[] = '<a href="'.$bbb_joinURL.'"'.
		          (strlen(htmlentities_utf8($row['message'])) > SUBLINK_TEXT_LEN ? ' title="'.htmlentities_utf8($row['course_timing']).'"' : '') .' title="'.htmlentities_utf8($row['course_timing']).'">'. 
		          validate_length(htmlentities_utf8($row['message']), SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>';
	}
	return $list;	
} else {
	return 0;
}

?>