Note:

This site is no longer used and is in read-only mode. Instead please go to our new Moodle Developer Resource site.

Rating API: Difference between revisions

From MoodleDocs
Created page with "==Overview== ==File Locations== The primary functions for the RSS API is located in rating/lib.php Additional functions and usage examples can be found in the following files..."
 
Line 4: Line 4:
==File Locations==
==File Locations==


The primary functions for the RSS API is located in rating/lib.php
The primary functions for the Rating API is located in rating/lib.php


Additional functions and usage examples can be found in the following files:
Additional functions and usage examples can be found in the following files:

Revision as of 02:14, 25 January 2012

Overview

File Locations

The primary functions for the Rating API is located in rating/lib.php

Additional functions and usage examples can be found in the following files:

  • rating/rate.php
  • rating/rate_ajax.php

Examples

Below you will find examples on how to use the RSS functions within your own modules.

Creating an RSS feed

This example shows how you can create the content of an RSS Feed. (Example taken from blog/rsslib.php)

$cm = $modinfo->instances['forum'][$forum->id];
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$forum = forum_get_course_forum($this->page->course->id, 'news');
$userid = (!isloggedin()) ? 0 : $USER->id;
$tooltiptext = get_string('rsssubscriberssposts','forum');
echo rss_get_link($context->id, $userid, 'mod_forum', $forum->id, $tooltiptext);

See also