From 0fcac008cb03503edac892f7e6fd9ce4f27ffb36 Mon Sep 17 00:00:00 2001 From: patrickslee Date: Fri, 18 Nov 2005 05:34:29 +0000 Subject: [PATCH] Reverted changes in ver 1.401, as this is ultimately fixed by bumping the version number --- mod/forum/lib.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index a91fb1e452b..4bcaf26ddfe 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1158,7 +1158,7 @@ function forum_get_unmailed_posts($starttime, $endtime) { AND p.discussion = d.id AND ((d.timestart = 0 OR d.timestart <= '$now') AND (d.timeend = 0 OR d.timeend > '$now')) - ORDER BY p.modified ASC");/**/ + ORDER BY p.modified ASC"); } function forum_mark_old_posts_as_mailed($endtime) { @@ -1305,10 +1305,8 @@ function forum_get_discussions($forum="0", $forumsort="d.timemodified DESC", $user=0, $fullpost=true, $visiblegroups=-1, $limit=0, $userlastmodified=false) { /// Get all discussions in a forum global $CFG, $USER; - //fix for bug #4336 - $thisforum = get_record('forum','id',$forum); - //fix for bug #4336 - if ((isadmin() and !empty($CFG->admineditalways)) || isteacher(get_field('forum', 'course', 'id', $forum)) || $thisforum->type == 'news') { + + if ((isadmin() and !empty($CFG->admineditalways)) || isteacher(get_field('forum', 'course', 'id', $forum))) { $timelimit = ''; } else { $now = time(); @@ -1364,8 +1362,8 @@ function forum_get_discussions($forum="0", $forumsort="d.timemodified DESC", $umtable WHERE d.forum = '$forum' AND p.parent = 0 - $timelimit $groupselect $userselect - ORDER BY $forumsort $limit");/**/ + $timelimit $groupselect $userselect + ORDER BY $forumsort $limit"); } else { return get_records_sql("SELECT $postdata, d.name, d.timemodified, d.usermodified, d.groupid, u.firstname, u.lastname, u.email, u.picture $umfields @@ -1377,8 +1375,8 @@ function forum_get_discussions($forum="0", $forumsort="d.timemodified DESC", AND p.discussion = d.id AND p.parent = 0 AND p.userid = u.id - $timelimit $groupselect $userselect - ORDER BY $forumsort $limit");/**/ + $timelimit $groupselect $userselect + ORDER BY $forumsort $limit"); } } @@ -1771,7 +1769,6 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link $age = time() - $post->created; /// Hack for allow to edit news posts those are not displayed yet until they are displayed - if (!$post->parent && get_field('forum', 'type', 'id', $post->forum) == 'news' && get_field_sql("SELECT id FROM {$CFG->prefix}forum_discussions WHERE id = $post->discussion AND timestart > ".time())) {