Skip to content

Commit

Permalink
forum MDL-19808 Upgraded deprecated calls
Browse files Browse the repository at this point in the history
  • Loading branch information
samhemelryk committed Oct 16, 2009
1 parent 6d8363c commit 261c6ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mod/forum/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
}

/// Do course wide subscribe/unsubscribe
if (!is_null($subscribe) and !isguestuser() and !isguest()) {
if (!is_null($subscribe) and !isguestuser()) {
foreach ($modinfo->instances['forum'] as $forumid=>$cm) {
$forum = $forums[$forumid];
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
Expand Down Expand Up @@ -396,7 +396,7 @@
$PAGE->set_button($searchform);
echo $OUTPUT->header();

if (!isguest()) {
if (!isguestuser()) {
echo $OUTPUT->box_start('subscription');
echo '<span class="helplink">';
echo '<a href="index.php?id='.$course->id.'&amp;subscribe=1">'.get_string('allsubscribe', 'forum').'</a>';
Expand Down
15 changes: 13 additions & 2 deletions mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ function forum_user_complete($course, $user, $mod, $forum) {
* @param array $htmlarray
*/
function forum_print_overview($courses,&$htmlarray) {
global $USER, $CFG, $DB;
global $USER, $CFG, $DB, $SESSION;

$LIKE = $DB->sql_ilike();

Expand Down Expand Up @@ -1231,7 +1231,18 @@ function forum_print_overview($courses,&$htmlarray) {
foreach ($trackingforums as $track) {
$sql .= '(d.forum = ? AND (d.groupid = -1 OR d.groupid = 0 OR d.groupid = ?)) OR ';
$params[] = $track->id;
$params[] = get_current_group($track->course);
if (isset($SESSION->currentgroup[$track->course])) {
$groupid = $SESSION->currentgroup[$track->course];
} else {
$groupid = groups_get_all_groups($track->course, $USER->id);
if (is_array($groupid)) {
$groupid = array_shift(array_keys($groupid));
$SESSION->currentgroup[$track->course] = $groupid;
} else {
$groupid = 0;
}
}
$params[] = $groupid;
}
$sql = substr($sql,0,-3); // take off the last OR
$sql .= ') AND p.modified >= ? AND r.id is NULL GROUP BY d.forum,d.course';
Expand Down

0 comments on commit 261c6ef

Please sign in to comment.