Beispiel #1
0
/**
 * Determines which type of SQL query is required, one for posts or one for discussions, and returns the appropriate query
 *
 * @param stdClass $forum the forum object
 * @param stdClass $cm    Course Module object
 * @param int      $time  check for items since this epoch timestamp
 * @return string the SQL query to be used to get the Discussion/Post details from the forum table of the database
 */
function forum_rss_get_sql($forum, $cm, $time=0) {
    if ($forum->rsstype == 1) { // Discussion RSS
        return forum_rss_feed_discussions_sql($forum, $cm, $time);
    } else { // Post RSS
        return forum_rss_feed_posts_sql($forum, $cm, $time);
    }
}
Beispiel #2
0
/**
 * Determines which type of SQL query is required, one for posts or one for discussions, and returns the appropriate query
 *
 * @param stdClass $forum the forum object
 * @param stdClass $cm    Course Module object
 * @param int      $time  check for items since this epoch timestamp
 * @return string the SQL query to be used to get the Discussion/Post details from the forum table of the database
 */
function forum_rss_get_sql($forum, $cm, $time = 0)
{
    $sql = null;
    if (!empty($forum->rsstype)) {
        if ($forum->rsstype == 1) {
            //Discussion RSS
            $sql = forum_rss_feed_discussions_sql($forum, $cm, $time);
        } else {
            //Post RSS
            $sql = forum_rss_feed_posts_sql($forum, $cm, $time);
        }
    }
    return $sql;
}