Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)

Functions

 forum_rss_delete_file ($forum)
 Given a forum object, deletes all cached RSS files associated with it.
 
 forum_rss_feed_contents ($forum, $sql, $params, $context)
 This function return the XML rss contents about the forum It returns false if something is wrong.
 
 forum_rss_feed_discussions_sql ($forum, $cm, $newsince=0)
 Generates the SQL query used to get the Discussion details from the forum table of the database.
 
 forum_rss_feed_posts_sql ($forum, $cm, $newsince=0)
 Generates the SQL query used to get the Post details from the forum table of the database.
 
 forum_rss_get_feed ($context, $args)
 This file adds support to rss feeds generation.
 
 forum_rss_get_group_sql ($cm, $groupmode, $currentgroup, $modcontext=null)
 Retrieve the correct SQL snippet for group-only forums.
 
 forum_rss_get_sql ($forum, $cm, $time=0)
 Determines which type of SQL query is required, one for posts or one for discussions, and returns the appropriate query.
 
 forum_rss_newstuff ($forum, $cm, $time)
 If there is new stuff in the forum since $time this returns true Otherwise it returns false.
 

Detailed Description

Function Documentation

◆ forum_rss_delete_file()

forum_rss_delete_file ( $forum)

Given a forum object, deletes all cached RSS files associated with it.

Parameters
stdClass$forum

◆ forum_rss_feed_contents()

forum_rss_feed_contents ( $forum,
$sql,
$params,
$context )

This function return the XML rss contents about the forum It returns false if something is wrong.

Parameters
stdClass$forumthe forum object
string$sqlthe SQL used to retrieve the contents from the database
array$paramsthe SQL parameters used
object$contextthe context this forum relates to
Return values
bool|stringfalse if the contents is empty, otherwise the contents of the feed is returned

@Todo MDL-31129 implement post attachment handling

◆ forum_rss_feed_discussions_sql()

forum_rss_feed_discussions_sql ( $forum,
$cm,
$newsince = 0 )

Generates the SQL query used to get the Discussion details from the forum table of the database.

Parameters
stdClass$forumthe forum object
stdClass$cmCourse Module object
int$newsincecheck for items since this epoch timestamp
Return values
stringthe SQL query to be used to get the Discussion details from the forum table of the database

◆ forum_rss_feed_posts_sql()

forum_rss_feed_posts_sql ( $forum,
$cm,
$newsince = 0 )

Generates the SQL query used to get the Post details from the forum table of the database.

Parameters
stdClass$forumthe forum object
stdClass$cmCourse Module object
int$newsincecheck for items since this epoch timestamp
Return values
stringthe SQL query to be used to get the Post details from the forum table of the database

◆ forum_rss_get_feed()

forum_rss_get_feed ( $context,
$args )

This file adds support to rss feeds generation.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later Returns the path to the cached rss feed contents. Creates/updates the cache if necessary.
Parameters
stdClass$contextthe context
array$argsthe arguments received in the url
Return values
stringthe full path to the cached RSS feed directory. Null if there is a problem.

◆ forum_rss_get_group_sql()

forum_rss_get_group_sql ( $cm,
$groupmode,
$currentgroup,
$modcontext = null )

Retrieve the correct SQL snippet for group-only forums.

Parameters
stdClass$cmCourse Module object
int$groupmodethe mode in which the forum's groups are operating
bool$currentgrouptrue if the user is from the a group enabled on the forum
stdClass$modcontextThe context instance of the forum module
Return values
stringSQL Query for group details of the forum

◆ forum_rss_get_sql()

forum_rss_get_sql ( $forum,
$cm,
$time = 0 )

Determines which type of SQL query is required, one for posts or one for discussions, and returns the appropriate query.

Parameters
stdClass$forumthe forum object
stdClass$cmCourse Module object
int$timecheck for items since this epoch timestamp
Return values
stringthe SQL query to be used to get the Discussion/Post details from the forum table of the database

◆ forum_rss_newstuff()

forum_rss_newstuff ( $forum,
$cm,
$time )

If there is new stuff in the forum since $time this returns true Otherwise it returns false.

Parameters
stdClass$forumthe forum object
stdClass$cmCourse Module object
int$timecheck for items since this epoch timestamp
Return values
boolTrue for new items