Skip to content

Commit

Permalink
Merge branch 'MDL-61068-33' of git://github.com/andrewnicols/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_33_STABLE
  • Loading branch information
stronk7 committed Jan 8, 2018
2 parents 504bde6 + ff0edf2 commit 1a7ded0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions mod/forum/lib.php
Expand Up @@ -2025,7 +2025,7 @@ function forum_search_posts($searchterms, $courseid=0, $limitfrom=0, $limitnum=5
return false;
}

$now = round(time(), -2); // db friendly
$now = floor(time() / 60) * 60; // DB Cache Friendly.

$fullaccess = array();
$where = array();
Expand Down Expand Up @@ -2467,7 +2467,7 @@ function forum_count_discussions($forum, $cm, $course) {

static $cache = array();

$now = round(time(), -2); // db cache friendliness
$now = floor(time() / 60) * 60; // DB Cache Friendly.

$params = array($course->id);

Expand Down Expand Up @@ -2567,7 +2567,7 @@ function forum_get_discussions($cm, $forumsort="", $fullpost=true, $unused=-1, $

$timelimit = '';

$now = round(time(), -2);
$now = floor(time() / 60) * 60;
$params = array($cm->instance);

$modcontext = context_module::instance($cm->id);
Expand Down Expand Up @@ -2721,7 +2721,7 @@ function forum_get_discussion_neighbours($cm, $discussion, $forum) {
}

$neighbours = array('prev' => false, 'next' => false);
$now = round(time(), -2);
$now = floor(time() / 60) * 60;
$params = array();

$modcontext = context_module::instance($cm->id);
Expand Down Expand Up @@ -2889,7 +2889,7 @@ function forum_get_default_sort_order($desc = true, $compare = 'd.timemodified',
function forum_get_discussions_unread($cm) {
global $CFG, $DB, $USER;

$now = round(time(), -2);
$now = floor(time() / 60) * 60;
$cutoffdate = $now - ($CFG->forum_oldpostdays*24*60*60);

$params = array();
Expand Down Expand Up @@ -2961,7 +2961,7 @@ function forum_get_discussions_unread($cm) {
function forum_get_discussions_count($cm) {
global $CFG, $DB, $USER;

$now = round(time(), -2);
$now = floor(time() / 60) * 60;
$params = array($cm->instance);
$groupmode = groups_get_activity_groupmode($cm);
$currentgroup = groups_get_activity_group($cm);
Expand Down Expand Up @@ -6376,7 +6376,7 @@ function forum_tp_is_post_old($post, $time=null) {
function forum_tp_get_course_unread_posts($userid, $courseid) {
global $CFG, $DB;

$now = round(time(), -2); // DB cache friendliness.
$now = floor(time() / 60) * 60; // DB cache friendliness.
$cutoffdate = $now - ($CFG->forum_oldpostdays * 24 * 60 * 60);
$params = array($userid, $userid, $courseid, $cutoffdate, $userid);

Expand Down Expand Up @@ -6475,7 +6475,7 @@ function forum_tp_count_forum_unread_posts($cm, $course, $resetreadcache = false

list ($groups_sql, $groups_params) = $DB->get_in_or_equal($mygroups);

$now = round(time(), -2); // db cache friendliness
$now = floor(time() / 60) * 60; // DB Cache friendliness.
$cutoffdate = $now - ($CFG->forum_oldpostdays*24*60*60);
$params = array($USER->id, $forumid, $cutoffdate);

Expand Down Expand Up @@ -7635,7 +7635,7 @@ function forum_get_posts_by_user($user, array $courses, $musthaveaccess = false,
// Will record forums where the user can freely access everything
$forumsearchfullaccess = array();
// DB caching friendly
$now = round(time(), -2);
$now = floor(time() / 60) * 60;
// For each course to search we want to find the forums the user has posted in
// and providing the current user can access the forum create a search condition
// for the forum to get the requested users posts.
Expand Down
2 changes: 1 addition & 1 deletion mod/forum/rsslib.php
Expand Up @@ -146,7 +146,7 @@ function forum_rss_feed_discussions_sql($forum, $cm, $newsince=0) {

$modcontext = null;

$now = round(time(), -2);
$now = floor(time() / 60) * 60; // DB Cache Friendly.
$params = array();

$modcontext = context_module::instance($cm->id);
Expand Down

0 comments on commit 1a7ded0

Please sign in to comment.