Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/forum/lib.php File Reference

Go to the source code of this file.

Data Structures

class  forum_subscriber_selector_base
class  forum_potential_subscriber_selector
class  forum_existing_subscriber_selector

Namespaces

namespace  mod
 

Local Library of functions for module scorm.


Enumerations

enum  FORUM_MODE_FLATOLDEST
 CONSTANTS ///////////////////////////////////////////////////////////. More...
enum  FORUM_MODE_FLATNEWEST
enum  FORUM_MODE_THREADED
enum  FORUM_MODE_NESTED
enum  FORUM_CHOOSESUBSCRIBE
enum  FORUM_FORCESUBSCRIBE
enum  FORUM_INITIALSUBSCRIBE
enum  FORUM_DISALLOWSUBSCRIBE
enum  FORUM_TRACKING_OFF
enum  FORUM_TRACKING_OPTIONAL
enum  FORUM_TRACKING_ON

Functions

 forum_add_instance ($forum, $mform)
 STANDARD FUNCTIONS ///////////////////////////////////////////////////////////.
 forum_update_instance ($forum, $mform)
 forum_delete_instance ($id)
 forum_supports ($feature)
 forum_get_completion_state ($course, $cm, $userid, $type)
 forum_cron ()
 forum_make_mail_text ($course, $cm, $forum, $discussion, $post, $userfrom, $userto, $bare=false)
 forum_make_mail_html ($course, $cm, $forum, $discussion, $post, $userfrom, $userto)
 forum_user_outline ($course, $user, $mod, $forum)
 forum_user_complete ($course, $user, $mod, $forum)
 forum_print_overview ($courses, &$htmlarray)
 forum_print_recent_activity ($course, $viewfullnames, $timestart)
 forum_get_user_grades ($forum, $userid=0)
 forum_update_grades ($forum, $userid=0, $nullifnone=true)
 forum_upgrade_grades ()
 forum_grade_item_update ($forum, $grades=NULL)
 forum_grade_item_delete ($forum)
 forum_get_participants ($forumid)
 forum_scale_used ($forumid, $scaleid)
 forum_scale_used_anywhere ($scaleid)
 forum_get_post_full ($postid)
 forum_get_discussion_posts ($discussion, $sort, $forumid)
 forum_get_all_discussion_posts ($discussionid, $sort, $tracking=false)
 forum_get_child_posts ($parent, $forumid)
 forum_get_readable_forums ($userid, $courseid=0)
 forum_search_posts ($searchterms, $courseid=0, $limitfrom=0, $limitnum=50, &$totalcount, $extrasql='')
 forum_get_ratings ($context, $postid, $sort="u.firstname ASC")
 forum_get_unmailed_posts ($starttime, $endtime, $now=null)
 forum_mark_old_posts_as_mailed ($endtime, $now=null)
 forum_get_user_posts ($forumid, $userid)
 forum_get_user_involved_discussions ($forumid, $userid)
 forum_count_user_posts ($forumid, $userid)
 forum_get_post_from_log ($log)
 forum_get_firstpost_from_discussion ($discussionid)
 forum_count_discussion_replies ($forumid, $forumsort="", $limit=-1, $page=-1, $perpage=0)
 forum_count_discussions ($forum, $cm, $course)
 forum_count_unrated_posts ($discussionid, $userid)
 forum_get_discussions ($cm, $forumsort="d.timemodified DESC", $fullpost=true, $unused=-1, $limit=-1, $userlastmodified=false, $page=-1, $perpage=0)
 forum_get_discussions_unread ($cm)
 forum_get_discussions_count ($cm)
 forum_get_user_discussions ($courseid, $userid, $groupid=0)
 forum_get_potential_subscribers ($forumcontext, $groupid, $fields, $sort)
 forum_subscribed_users ($course, $forum, $groupid=0, $context=null, $fields=null)
 forum_get_course_forum ($courseid, $type)
 forum_make_mail_post ($course, $cm, $forum, $discussion, $post, $userfrom, $userto, $ownpost=false, $reply=false, $link=false, $rate=false, $footer="")
 forum_print_post ($post, $discussion, $forum, &$cm, $course, $ownpost=false, $reply=false, $link=false, $footer="", $highlight="", $postisread=null, $dummyifcantsee=true, $istracked=null, $return=false)
 forum_rating_permissions ($contextid, $component, $ratingarea)
 forum_rating_validate ($params)
 forum_print_discussion_header (&$post, $forum, $group=-1, $datestring="", $cantrack=true, $forumtracked=true, $canviewparticipants=true, $modcontext=NULL)
 forum_shorten_post ($message)
 forum_print_mode_form ($id, $mode, $forumtype='')
 forum_search_form ($course, $search='')
 forum_set_return ()
 forum_go_back_to ($default)
 forum_move_attachments ($discussion, $forumfrom, $forumto)
 forum_print_attachments ($post, $cm, $type)
 forum_get_file_areas ($course, $cm, $context)
 forum_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename)
 forum_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload)
 forum_add_attachment ($post, $forum, $cm, $mform=null, &$message=null)
 forum_add_new_post ($post, $mform, &$message)
 forum_update_post ($post, $mform, &$message)
 forum_add_discussion ($discussion, $mform=null, &$message=null, $userid=null)
 forum_delete_discussion ($discussion, $fulldelete, $course, $cm, $forum)
 forum_delete_post ($post, $children, $course, $cm, $forum, $skipcompletion=false)
 forum_count_replies ($post, $children=true)
 forum_forcesubscribe ($forumid, $value=1)
 forum_is_forcesubscribed ($forum)
 forum_get_forcesubscribed ($forum)
 forum_is_subscribed ($userid, $forum)
 forum_get_subscribed_forums ($course)
 forum_subscribe ($userid, $forumid)
 forum_unsubscribe ($userid, $forumid)
 forum_post_subscription ($post, $forum)
 forum_get_subscribe_link ($forum, $context, $messages=array(), $cantaccessagroup=false, $fakelink=true, $backtoindex=false, $subscribed_forums=null)
 forum_get_tracking_link ($forum, $messages=array(), $fakelink=true)
 forum_user_has_posted_discussion ($forumid, $userid)
 forum_discussions_user_has_posted_in ($forumid, $userid)
 forum_user_has_posted ($forumid, $did, $userid)
 forum_get_user_posted_time ($did, $userid)
 forum_user_can_post_discussion ($forum, $currentgroup=null, $unused=-1, $cm=NULL, $context=NULL)
 forum_user_can_post ($forum, $discussion, $user=NULL, $cm=NULL, $course=NULL, $context=NULL)
 forum_user_can_view_post ($post, $course, $cm, $forum, $discussion, $user=NULL)
 forum_user_can_see_discussion ($forum, $discussion, $context, $user=NULL)
 forum_user_can_see_post ($forum, $discussion, $post, $user=NULL, $cm=NULL)
 forum_print_latest_discussions ($course, $forum, $maxdiscussions=-1, $displayformat='plain', $sort='', $currentgroup=-1, $groupmode=-1, $page=-1, $perpage=100, $cm=NULL)
 forum_print_discussion ($course, $cm, $forum, $discussion, $post, $mode, $canreply=NULL, $canrate=false)
 forum_print_posts_flat ($course, &$cm, $forum, $discussion, $post, $mode, $reply, $forumtracked, $posts)
 forum_print_posts_threaded ($course, &$cm, $forum, $discussion, $parent, $depth, $reply, $forumtracked, $posts)
 forum_print_posts_nested ($course, &$cm, $forum, $discussion, $parent, $reply, $forumtracked, $posts)
 forum_get_recent_mod_activity (&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0)
 forum_print_recent_mod_activity ($activity, $courseid, $detail, $modnames, $viewfullnames)
 forum_change_discussionid ($postid, $discussionid)
 forum_update_subscriptions_button ($courseid, $forumid)
 forum_user_enrolled ($cp)
 forum_user_unenrolled ($cp)
 forum_tp_mark_posts_read ($user, $postids)
 forum_tp_add_read_record ($userid, $postid)
 forum_tp_get_read_records ($userid=-1, $postid=-1, $discussionid=-1, $forumid=-1)
 forum_tp_get_discussion_read_records ($userid, $discussionid)
 forum_tp_mark_post_read ($userid, $post, $forumid)
 forum_tp_mark_forum_read ($user, $forumid, $groupid=false)
 forum_tp_mark_discussion_read ($user, $discussionid)
 forum_tp_is_post_read ($userid, $post)
 forum_tp_is_post_old ($post, $time=null)
 forum_tp_count_discussion_read_records ($userid, $discussionid)
 forum_tp_count_discussion_unread_posts ($userid, $discussionid)
 forum_tp_count_forum_posts ($forumid, $groupid=false)
 forum_tp_count_forum_read_records ($userid, $forumid, $groupid=false)
 forum_tp_get_course_unread_posts ($userid, $courseid)
 forum_tp_count_forum_unread_posts ($cm, $course)
 forum_tp_delete_read_records ($userid=-1, $postid=-1, $discussionid=-1, $forumid=-1)
 forum_tp_get_untracked_forums ($userid, $courseid)
 forum_tp_can_track_forums ($forum=false, $user=false)
 forum_tp_is_tracked ($forum, $user=false)
 forum_tp_start_tracking ($forumid, $userid=false)
 forum_tp_stop_tracking ($forumid, $userid=false)
 forum_tp_clean_read_records ()
 forum_discussion_update_last_post ($discussionid)
 forum_get_view_actions ()
 forum_get_post_actions ()
 forum_get_separate_modules ($courseid)
 forum_check_throttling ($forum, $cm=null)
 forum_reset_gradebook ($courseid, $type='')
 forum_reset_userdata ($data)
 forum_reset_course_form_definition (&$mform)
 forum_reset_course_form_defaults ($course)
 forum_convert_to_roles ($forum, $forummodid, $teacherroles=array(), $studentroles=array(), $guestroles=array(), $cmid=NULL)
 forum_get_layout_modes ()
 forum_get_forum_types ()
 forum_get_forum_types_all ()
 forum_get_open_modes ()
 forum_get_extra_capabilities ()
 forum_extend_settings_navigation (settings_navigation $settingsnav, navigation_node $forumnode)
 forum_cm_info_view (cm_info $cm)
 forum_page_type_list ($pagetype, $parentcontext, $currentcontext)
 forum_get_courses_user_posted_in ($user, $discussionsonly=false, $includecontexts=true, $limitfrom=null, $limitnum=null)
 forum_get_forums_user_posted_in ($user, array $courseids=null, $discussionsonly=false, $limitfrom=null, $limitnum=null)
 forum_get_posts_by_user ($user, array $courses, $musthaveaccess=false, $discussionsonly=false, $limitfrom=0, $limitnum=50)

Enumeration Type Documentation

Definition at line 38 of file lib.php.

Definition at line 41 of file lib.php.

Definition at line 39 of file lib.php.

Definition at line 40 of file lib.php.

Definition at line 34 of file lib.php.

CONSTANTS ///////////////////////////////////////////////////////////.

Include required files

Definition at line 33 of file lib.php.

Definition at line 36 of file lib.php.

Definition at line 35 of file lib.php.

Definition at line 43 of file lib.php.

Definition at line 45 of file lib.php.

Definition at line 44 of file lib.php.


Function Documentation

forum_add_attachment ( post,
forum,
cm,
mform = null,
&$  message = null 
)

If successful, this function returns the name of the file

object

Parameters:
object$postis a full post record, including course and forum
object$forum
object$cm
mixed$mform
string$message
Returns:
bool

Definition at line 4164 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_add_discussion ( discussion,
mform = null,
&$  message = null,
userid = null 
)

Given an object containing all the necessary data, create a new discussion and return the id

object object object

Parameters:
object$post
mixed$mform
string$message
int$userid
Returns:
object

Definition at line 4284 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_add_instance ( forum,
mform 
)

STANDARD FUNCTIONS ///////////////////////////////////////////////////////////.

Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will create a new instance and return the id number of the new instance.

object object

Parameters:
object$forumadd forum instance (with magic quotes)
Returns:
int intance id

all users should be subscribed initially Note: forum_get_potential_subscribers should take the forum context, but that does not exist yet, becuase the forum is only half build at this stage. However, because the forum is brand new, we know that there are no role assignments or overrides in the forum context, so using the course context gives the same list of users.

Definition at line 60 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_add_new_post ( post,
mform,
&$  message 
)

Add a new post in an existing discussion.

object object object

Parameters:
object$post
mixed$mform
string$message
Returns:
int

Definition at line 4197 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_change_discussionid ( postid,
discussionid 
)

recursively sets the discussion field to $discussionid on $postid and all its children used when pruning a post

object

Parameters:
int$postid
int$discussionid
Returns:
bool

Definition at line 5891 of file lib.php.

forum_check_throttling ( forum,
cm = null 
)

object object object

Parameters:
object$forum
object$cm
Returns:
bool

Definition at line 6791 of file lib.php.

Here is the call graph for this function:

Adds information about unread messages, that is only required for the course view page (and similar), to the course-module object.

Parameters:
cm_info$cmCourse-module object

Definition at line 7738 of file lib.php.

Here is the call graph for this function:

forum_convert_to_roles ( forum,
forummodid,
teacherroles = array(),
studentroles = array(),
guestroles = array(),
cmid = NULL 
)

Converts a forum to use the Roles System

object object

Parameters:
object$foruma forum object with the same attributes as a record from the forum database table
int$forummodidthe id of the forum module, from the modules table
array$teacherrolesarray of roles that have archetype teacher
array$studentrolesarray of roles that have archetype student
array$guestrolesarray of roles that have archetype guest
int$cmidthe course_module id for this forum instance
Returns:
boolean forum was converted or not

Definition at line 7077 of file lib.php.

Here is the call graph for this function:

forum_count_discussion_replies ( forumid,
forumsort = "",
limit = -1,
page = -1,
perpage = 0 
)

Returns an array of counts of replies to each discussion

object object

Parameters:
int$forumid
string$forumsort
int$limit
int$page
int$perpage
Returns:
array

Definition at line 2328 of file lib.php.

Here is the caller graph for this function:

forum_count_discussions ( forum,
cm,
course 
)

object object object array $cache

Parameters:
object$forum
object$cm
object$course
Returns:
mixed

Definition at line 2382 of file lib.php.

Here is the call graph for this function:

forum_count_replies ( post,
children = true 
)

object

Parameters:
object$post
bool$children
Returns:
int

Definition at line 4472 of file lib.php.

forum_count_unrated_posts ( discussionid,
userid 
)

How many posts by other users are unrated by a given user in the given discussion?

TODO: Is this function still used anywhere?

Parameters:
int$discussionid
int$userid
Returns:
mixed

Definition at line 2479 of file lib.php.

forum_count_user_posts ( forumid,
userid 
)

Get all the posts for a user in a forum suitable for forum_print_post

object object

Parameters:
int$forumid
int$userid
Returns:
array of counts or false

Definition at line 2230 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Function to be run periodically according to the moodle cron Finds all posts that have yet to be mailed out, and mails them out to all subscribers

object object object CONTEXT_MODULE CONTEXT_COURSE SITEID FORMAT_PLAIN

Returns:
void

Finished iteration, let's close the resultset

We have finishied all digest emails, update $CFG->digestmailtimelast

Definition at line 383 of file lib.php.

Here is the call graph for this function:

forum_delete_discussion ( discussion,
fulldelete,
course,
cm,
forum 
)

Deletes a discussion and handles all associated cleanup.

object

Parameters:
object$discussionDiscussion to delete
bool$fulldeleteTrue when deleting entire forum
object$courseCourse
object$cmCourse-module
object$forumForum
Returns:
bool

Definition at line 4359 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.

object

Parameters:
int$idforum instance id
Returns:
bool success

Definition at line 227 of file lib.php.

Here is the call graph for this function:

forum_delete_post ( post,
children,
course,
cm,
forum,
skipcompletion = false 
)

Deletes a single forum post.

object

Parameters:
object$postForum post object
mixed$childrenWhether to delete children. If false, returns false if there are any children (without deleting the post). If true, recursively deletes all children. If set to special value 'ignore', deletes post regardless of children (this is for use only when deleting all posts in a disussion).
object$courseCourse
object$cmCourse-module
object$forumForum
bool$skipcompletionTrue to skip updating completion state if it would otherwise be updated, i.e. when deleting entire forum anyway.
Returns:
bool

Definition at line 4412 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_discussion_update_last_post ( discussionid)

Sets the last post for a given discussion

object object

Parameters:
into$discussionid
Returns:
bool|int

Definition at line 6717 of file lib.php.

Here is the caller graph for this function:

forum_discussions_user_has_posted_in ( forumid,
userid 
)

object object

Parameters:
int$forumid
int$userid
Returns:
array

Definition at line 4807 of file lib.php.

Here is the caller graph for this function:

This function is used to extend the global navigation by add forum nodes if there is relevant content.

Parameters:
navigation_node$navref
stdClass$course
stdClass$module
stdClass$cmAdds module specific settings to the settings block
settings_navigation$settingsThe settings navigation object
navigation_node$forumnodeThe node to add module settings to

Definition at line 7417 of file lib.php.

Here is the call graph for this function:

forum_forcesubscribe ( forumid,
value = 1 
)

object

Parameters:
int$forumid
mixed$value
Returns:
bool

Definition at line 4497 of file lib.php.

forum_get_all_discussion_posts ( discussionid,
sort,
tracking = false 
)

Gets all posts in discussion including top parent.

object object object

Parameters:
int$discussionid
string$sort
bool$trackingdoes user track the forum?
Returns:
array of posts

Definition at line 1744 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_get_child_posts ( parent,
forumid 
)

Gets posts with all info ready for forum_print_post We pass forumid in because we always know it so no need to make a complicated join to find it out.

object object

Parameters:
int$parent
int$forumid
Returns:
array

Definition at line 1801 of file lib.php.

forum_get_completion_state ( course,
cm,
userid,
type 
)

Obtains the automatic completion state for this forum based on any conditions in forum settings.

object object

Parameters:
object$courseCourse
object$cmCourse-module
int$useridUser ID
bool$typeType of comparison (or/and; can be used as return value if no conditions)
Returns:
bool True if completed, false if not. (If no conditions, then return value depends on comparison type)

Definition at line 318 of file lib.php.

forum_get_course_forum ( courseid,
type 
)

object object

Parameters:
int$courseid
string$type

Definition at line 2912 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_get_courses_user_posted_in ( user,
discussionsonly = false,
includecontexts = true,
limitfrom = null,
limitnum = null 
)

Gets all of the courses where the provided user has posted in a forum.

moodle_database $DB The database connection

Parameters:
stdClass$userThe user who's posts we are looking for
bool$discussionsonlyIf true only look for discussions started by the user
bool$includecontextsIf set to trye contexts for the courses will be preloaded
int$limitfromThe offset of records to return
int$limitnumThe number of records to return
Returns:
array An array of courses

Definition at line 7791 of file lib.php.

Here is the call graph for this function:

forum_get_discussion_posts ( discussion,
sort,
forumid 
)

Gets posts with all info ready for forum_print_post We pass forumid in because we always know it so no need to make a complicated join to find it out.

object object

Returns:
mixed array of posts or false

Definition at line 1723 of file lib.php.

forum_get_discussions ( cm,
forumsort = "d.timemodified DESC",
fullpost = true,
unused = -1,
limit = -1,
userlastmodified = false,
page = -1,
perpage = 0 
)

Get all discussions in a forum

object object object CONTEXT_MODULE VISIBLEGROUPS

Parameters:
object$cm
string$forumsort
bool$fullpost
int$unused
int$limit
bool$userlastmodified
int$page
int$perpage
Returns:
array

User must have perms to view discussions

Users must fulfill timed posts

Definition at line 2531 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

object object object CONEXT_MODULE VISIBLEGROUPS

Parameters:
object$cm
Returns:
array

Definition at line 2711 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

object object object CONTEXT_MODULE VISIBLEGROUPS

Parameters:
object$cm
Returns:
array

Definition at line 2639 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns all other caps used in module

Returns:
array

Definition at line 7343 of file lib.php.

forum_get_file_areas ( course,
cm,
context 
)

Lists all browsable file areas

Parameters:
object$course
object$cm
object$context
Returns:
array

Definition at line 4014 of file lib.php.

forum_get_file_info ( browser,
areas,
course,
cm,
context,
filearea,
itemid,
filepath,
filename 
)

File browsing support for forum module.

Parameters:
object$browser
object$areas
object$course
object$cm
object$context
string$filearea
int$itemid
string$filepath
string$filename
Returns:
object file_info instance or null if not found

Definition at line 4033 of file lib.php.

Here is the call graph for this function:

Given a discussion id, return the first post from the discussion

object object

Parameters:
int$dicsussionid
Returns:
array

Definition at line 2306 of file lib.php.

Here is the caller graph for this function:

Definition at line 4516 of file lib.php.

Here is the caller graph for this function:

Returns array of forum types chooseable on the forum editing form

Returns:
array

Definition at line 7304 of file lib.php.

Here is the caller graph for this function:

Returns array of all forum layout modes

Returns:
array

Definition at line 7317 of file lib.php.

Here is the caller graph for this function:

forum_get_forums_user_posted_in ( user,
array courseids = null,
discussionsonly = false,
limitfrom = null,
limitnum = null 
)

Gets all of the forums a user has posted in for one or more courses.

moodle_database $DB

Parameters:
stdClass$user
array$courseidsAn array of courseids to search or if not provided all courses the user has posted within
bool$discussionsonlyIf true then only forums where the user has started a discussion will be returned.
int$limitfromThe offset of records to return
int$limitnumThe number of records to return
Returns:
array An array of forums the user has posted within in the provided courses

Definition at line 7843 of file lib.php.

Here is the caller graph for this function:

Returns array of forum layout modes

Returns:
array

Definition at line 7292 of file lib.php.

Here is the caller graph for this function:

Returns array of forum open modes

Returns:
array

Definition at line 7332 of file lib.php.

forum_get_participants ( forumid)

Returns the users with data in one forum (users with records in forum_subscriptions, forum_posts, students)

Todo:
: deprecated - to be deleted in 2.2
Parameters:
int$forumid
Returns:
mixed array or false if none

Definition at line 1604 of file lib.php.

Returns:
array

Definition at line 6758 of file lib.php.

Given a log entry, return the forum post details for it.

object object

Parameters:
object$log
Returns:
array|null

Definition at line 2263 of file lib.php.

forum_get_post_full ( postid)

Gets a post with all info ready for forum_print_post Most of these joins are just to get the forum id

object object

Parameters:
int$postid
Returns:
mixed array of posts or false

Definition at line 1704 of file lib.php.

forum_get_posts_by_user ( user,
array courses,
musthaveaccess = false,
discussionsonly = false,
limitfrom = 0,
limitnum = 50 
)

Returns posts made by the selected user in the requested courses.

This method can be used to return all of the posts made by the requested user within the given courses. For each course the access of the current user and requested user is checked and then for each post access to the post and forum is checked as well.

This function is safe to use with usercapabilities.

moodle_database $DB

Parameters:
stdClass$userThe user whose posts we want to get
array$coursesThe courses to search
bool$musthaveaccessIf set to true errors will be thrown if the user cannot access one or more of the courses to search
bool$discussionsonlyIf set to true only discussion starting posts will be returned.
int$limitfromThe offset of records to return
int$limitnumThe number of records to return
Returns:
stdClass An object the following properties ->totalcount: the total number of posts made by the requested user that the current user can see. ->courses: An array of courses the current user can see that the requested user has posted in. ->forums: An array of forums relating to the posts returned in the property below. ->posts: An array containing the posts to show for this request.

Definition at line 7901 of file lib.php.

Here is the call graph for this function:

forum_get_potential_subscribers ( forumcontext,
groupid,
fields,
sort 
)

Get the list of potential subscribers to a forum.

Parameters:
object$forumcontextthe forum context.
integer$groupidthe id of a group, or 0 for all groups.
string$fieldsthe list of fields to return for each user. As for get_users_by_capability.
string$sortsort order. As for get_users_by_capability.
Returns:
array list of users.

Definition at line 2819 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_get_ratings ( context,
postid,
sort = "u.firstname ASC" 
)

Returns a list of ratings for a particular post - sorted.

TODO: Check if this function is actually used anywhere. Up until the fix for MDL-27471 this function wasn't even returning.

Parameters:
stdClass$context
int$postid
string$sort
Returns:
array Array of ratings or false

Definition at line 2075 of file lib.php.

forum_get_readable_forums ( userid,
courseid = 0 
)

An array of forum objects that the user is allowed to read/search through.

object object object

Parameters:
int$userid
int$courseidif 0, we look for forums throughout the whole site.
Returns:
array of forum objects, or false if no matches Forum objects have the following attributes: id, type, course, cmid, cmvisible, cmgroupmode, accessallgroups, viewhiddentimedposts

group access

hidden timed discussions

qanda access

Definition at line 1824 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_get_recent_mod_activity ( &$  activities,
&$  index,
timestart,
courseid,
cmid,
userid = 0,
groupid = 0 
)

Returns all forum posts since a given time in specified forum.

Todo:
Document this functions args object object object object

Definition at line 5726 of file lib.php.

Here is the call graph for this function:

forum_get_separate_modules ( courseid)

this function returns all the separate forum ids, given a courseid

object object

Parameters:
int$courseid
Returns:
array

Definition at line 6770 of file lib.php.

forum_get_subscribe_link ( forum,
context,
messages = array(),
cantaccessagroup = false,
fakelink = true,
backtoindex = false,
subscribed_forums = null 
)

Generate and return the subscribe or unsubscribe link for a forum.

Parameters:
object$forumthe forum. Fields used are $forum->id and $forum->forcesubscribe.
object$contextthe context object for this forum.
array$messagestext used for the link in its various states (subscribed, unsubscribed, forcesubscribed or cantsubscribe). Any strings not passed in are taken from the $defaultmessages array at the top of the function.
bool$cantaccessagroup
bool$fakelink
bool$backtoindex
array$subscribed_forums
Returns:
string

Definition at line 4664 of file lib.php.

Here is the call graph for this function:

Definition at line 4542 of file lib.php.

forum_get_tracking_link ( forum,
messages = array(),
fakelink = true 
)

Generate and return the track or no track link for a forum.

object object object

Parameters:
object$forumthe forum. Fields used are $forum->id and $forum->forcesubscribe.
array$messages
bool$fakelink
Returns:
string

Definition at line 4736 of file lib.php.

Here is the call graph for this function:

forum_get_unmailed_posts ( starttime,
endtime,
now = null 
)

Returns a list of all new posts that have not been mailed yet

Parameters:
int$starttimeposts created after this time
int$endtimeposts created before this
int$nowused for timed discussions only
Returns:
array

Definition at line 2095 of file lib.php.

Here is the caller graph for this function:

forum_get_user_discussions ( courseid,
userid,
groupid = 0 
)

Get all discussions started by a particular user in a course (or group) This function no longer used ...

Todo:
Remove this function if no longer used object object
Parameters:
int$courseid
int$userid
int$groupid
Returns:
array

Definition at line 2785 of file lib.php.

forum_get_user_grades ( forum,
userid = 0 
)

Return grade for given user or all users.

object object

Parameters:
object$forum
int$useridoptional user id, 0 means all users
Returns:
array array of grades, false if none

Definition at line 1458 of file lib.php.

Here is the caller graph for this function:

forum_get_user_involved_discussions ( forumid,
userid 
)

Get all the discussions user participated in

object object CONTEXT_MODULE

Parameters:
int$forumid
int$userid
Returns:
array Array or false

Definition at line 2197 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_get_user_posted_time ( did,
userid 
)

Returns creation time of the first user's post in given discussion object $DB

Parameters:
int$didDiscussion id
int$useridUser id
Returns:
int|bool post creation time stamp or return false

Definition at line 4851 of file lib.php.

Here is the caller graph for this function:

forum_get_user_posts ( forumid,
userid 
)

Get all the posts for a user in a forum suitable for forum_print_post

object object CONTEXT_MODULE

Returns:
array

Definition at line 2160 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
array

Definition at line 6751 of file lib.php.

forum_go_back_to ( default)

object

Parameters:
string$default
Returns:
string

Definition at line 3856 of file lib.php.

Delete grade item for given forum

object

Parameters:
object$forumobject
Returns:
object grade_item

Definition at line 1587 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_grade_item_update ( forum,
grades = NULL 
)

Create/update grade item for given forum

object GRADE_TYPE_NONE GRADE_TYPE_VALUE GRADE_TYPE_SCALE

Parameters:
object$forumobject with extra cmidnumber
mixed$gradesoptional array/object of grade(s); 'reset' means reset grades in gradebook
Returns:
int 0 if ok

Definition at line 1551 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

object

Parameters:
object$forum
Returns:
bool

Definition at line 4507 of file lib.php.

Here is the caller graph for this function:

forum_is_subscribed ( userid,
forum 
)

object

Parameters:
int$userid
object$forum
Returns:
bool

Definition at line 4531 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_make_mail_html ( course,
cm,
forum,
discussion,
post,
userfrom,
userto 
)

Builds and returns the body of the email notification in html format.

object

Parameters:
object$course
object$cm
object$forum
object$discussion
object$post
object$userfrom
object$userto
Returns:
string The email text in HTML format

Definition at line 1064 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_make_mail_post ( course,
cm,
forum,
discussion,
post,
userfrom,
userto,
ownpost = false,
reply = false,
link = false,
rate = false,
footer = "" 
)

Given the data about a posting, builds up the HTML to display it and returns the HTML in a string. This is designed for sending via HTML email.

object

Parameters:
object$course
object$cm
object$forum
object$discussion
object$post
object$userform
object$userto
bool$ownpost
bool$reply
bool$link
bool$rate
string$footer
Returns:
string

Definition at line 3005 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_make_mail_text ( course,
cm,
forum,
discussion,
post,
userfrom,
userto,
bare = false 
)

Builds and returns the body of the email notification in plain text.

object object CONTEXT_MODULE

Parameters:
object$course
object$cm
object$forum
object$discussion
object$post
object$userfrom
object$userto
boolean$bare
Returns:
string The email body in plain text format.

Definition at line 985 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_mark_old_posts_as_mailed ( endtime,
now = null 
)

Marks posts before a certain time as being mailed already

object object

Parameters:
int$endtime
int$nowDefaults to time()
Returns:
bool

Definition at line 2129 of file lib.php.

Here is the caller graph for this function:

forum_move_attachments ( discussion,
forumfrom,
forumto 
)

Given a discussion object that is being moved to $forumto, this function checks all posts in that discussion for attachments, and if any are found, these are moved to the new forum directory.

object

Parameters:
object$discussion
int$forumfromsource forum id
int$forumtotarget forum id
Returns:
bool success

Definition at line 3880 of file lib.php.

Here is the call graph for this function:

forum_page_type_list ( pagetype,
parentcontext,
currentcontext 
)

Return a list of page types

Parameters:
string$pagetypecurrent page type
stdClass$parentcontextBlock's parent context
stdClass$currentcontextCurrent context of block

Definition at line 7771 of file lib.php.

forum_pluginfile ( course,
cm,
context,
filearea,
args,
forcedownload 
)

Serves the forum attachments. Implements needed access control ;-)

Parameters:
object$course
object$cm
object$context
string$filearea
array$args
bool$forcedownload
Returns:
bool false if file not found, does not return if found - justsend the file

Definition at line 4096 of file lib.php.

Here is the call graph for this function:

forum_post_subscription ( post,
forum 
)

Given a new post, subscribes or unsubscribes as appropriate. Returns some text which describes what happened.

objec

Parameters:
object$post
object$forum

Definition at line 4601 of file lib.php.

Here is the call graph for this function:

forum_print_attachments ( post,
cm,
type 
)

Returns attachments as formated text/html optionally with separate images

object object object

Parameters:
object$post
object$cm
string$typehtml/text/separateimages
Returns:
mixed string or array of (html text withouth images and image HTML)

Definition at line 3924 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_print_discussion ( course,
cm,
forum,
discussion,
post,
mode,
canreply = NULL,
canrate = false 
)

Prints a forum discussion

CONTEXT_MODULE FORUM_MODE_FLATNEWEST FORUM_MODE_FLATOLDEST FORUM_MODE_THREADED FORUM_MODE_NESTED

Parameters:
stdClass$course
stdClass$cm
stdClass$forum
stdClass$discussion
stdClass$post
int$mode
mixed$canreply
bool$canrate

Definition at line 5485 of file lib.php.

Here is the call graph for this function:

forum_print_discussion_header ( &$  post,
forum,
group = -1,
datestring = "",
cantrack = true,
forumtracked = true,
canviewparticipants = true,
modcontext = NULL 
)

This function prints the overview of a discussion in the forum listing. It needs some discussion information and some post information, these happen to be combined for efficiency in the $post parameter by the function that calls this one: forum_print_latest_discussions()

object object

Parameters:
object$postThe post object (passed by reference for speed).
object$forumThe forum object.
int$groupCurrent group.
string$datestringFormat to use for the dates.
boolean$cantrackIs tracking enabled for this forum.
boolean$forumtrackedIs the user tracking this forum.
boolean$canviewparticipantsTrue if user has the viewparticipants permission for this course

Definition at line 3612 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_print_latest_discussions ( course,
forum,
maxdiscussions = -1,
displayformat = 'plain',
sort = '',
currentgroup = -1,
groupmode = -1,
page = -1,
perpage = 100,
cm = NULL 
)

Prints the discussion view screen for a forum.

object object

Parameters:
object$courseThe current course object.
object$forumForum to be printed.
int$maxdiscussions.
string$displayformatThe display format to use (optional).
string$sortSort arguments for database query (optional).
int$groupmodeGroup mode of the forum (optional).
void$unused(originally current group)
int$pagePage mode, page to display (optional).
int$perpageThe maximum number of discussions per page(optional)

Get the number of discussions found

Show the paging bar

Show the paging bar

Definition at line 5197 of file lib.php.

Here is the call graph for this function:

forum_print_mode_form ( id,
mode,
forumtype = '' 
)

Print the drop down that allows the user to select how they want to have the discussion displayed.

Parameters:
int$idforum id if $forumtype is 'single', discussion id for any other forum type
mixed$modeforum layout mode
string$forumtypeoptional

Definition at line 3793 of file lib.php.

Here is the call graph for this function:

forum_print_overview ( courses,
&$  htmlarray 
)

object object object

Parameters:
array$courses
array$htmlarray

Definition at line 1213 of file lib.php.

Here is the call graph for this function:

forum_print_post ( post,
discussion,
forum,
&$  cm,
course,
ownpost = false,
reply = false,
link = false,
footer = "",
highlight = "",
postisread = null,
dummyifcantsee = true,
istracked = null,
return = false 
)

Print a forum post

object object FORUM_MODE_THREADED PORTFOLIO_FORMAT_PLAINHTML PORTFOLIO_FORMAT_FILE PORTFOLIO_FORMAT_RICHHTML PORTFOLIO_ADD_TEXT_LINK CONTEXT_MODULE

Parameters:
object$postThe post to print.
object$discussion
object$forum
object$cm
object$course
boolean$ownpostWhether this post belongs to the current user.
boolean$replyWhether to print a 'reply' link at the bottom of the message.
boolean$linkJust print a shortened version of the post as a link to the full post.
string$footerExtra stuff to print after the message.
string$highlightSpace-separated list of terms to highlight.
int$post_readtrue, false or -99. If we already know whether this user has read this post, pass that in, otherwise, pass in -99, and this function will work it out.
boolean$dummyifcantseeWhen forum_user_can_see_post says that the current user can't see this post, if this argument is true (the default) then print a dummy 'you can't see this post' post. If false, don't output anything at all.
bool | null$istracked
Returns:
void

Definition at line 3136 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_print_posts_flat ( course,
&$  cm,
forum,
discussion,
post,
mode,
reply,
forumtracked,
posts 
)

object object FORUM_MODE_FLATNEWEST

Parameters:
object$course
object$cm
object$forum
object$discussion
object$post
object$mode
bool$reply
bool$forumtracked
array$posts
Returns:
void

Definition at line 5598 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_print_posts_nested ( course,
&$  cm,
forum,
discussion,
parent,
reply,
forumtracked,
posts 
)
Todo:
Document this function object object
Returns:
void

Definition at line 5689 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_print_posts_threaded ( course,
&$  cm,
forum,
discussion,
parent,
depth,
reply,
forumtracked,
posts 
)
Todo:
Document this function

object object CONTEXT_MODULE

Returns:
void

Definition at line 5631 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_print_recent_activity ( course,
viewfullnames,
timestart 
)

Given a course and a date, prints a summary of all the new messages posted in the course since that date

object object object CONTEXT_MODULE VISIBLEGROUPS

Parameters:
object$course
bool$viewfullnamescapability
int$timestart
Returns:
bool success

Definition at line 1346 of file lib.php.

Here is the call graph for this function:

forum_print_recent_mod_activity ( activity,
courseid,
detail,
modnames,
viewfullnames 
)
Todo:
Document this function object

Definition at line 5847 of file lib.php.

Here is the call graph for this function:

forum_rating_permissions ( contextid,
component,
ratingarea 
)

Return rating related permissions

Parameters:
string$optionsthe context id
Returns:
array an associative array of the user's rating permissions

Definition at line 3480 of file lib.php.

Here is the call graph for this function:

forum_rating_validate ( params)

Validates a submitted rating

Parameters:
array$paramssubmitted data context => object the context in which the rated items exists [required] component => The component for this module - should always be mod_forum [required] ratingarea => object the context in which the rated items exists [required] itemid => int the ID of the object being rated [required] scaleid => int the scale from which the user can select a rating. Used for bounds checking. [required] rating => int the submitted rating [required] rateduserid => int the id of the user whose items have been rated. NOT the user who submitted the ratings. 0 to update all. [required] aggregation => int the aggregation method to apply when calculating grades ie RATING_AGGREGATE_AVERAGE [required]
Returns:
boolean true if the rating is valid. Will throw rating_exception if not

Definition at line 3508 of file lib.php.

Here is the call graph for this function:

Course reset form defaults.

Returns:
array

Definition at line 7059 of file lib.php.

Called by course/reset.php

Parameters:
$mformform passed by reference

Definition at line 7035 of file lib.php.

Here is the call graph for this function:

forum_reset_gradebook ( courseid,
type = '' 
)

Removes all grades from gradebook

object object

Parameters:
int$courseid
string$typeoptional

Definition at line 6853 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_reset_userdata ( data)

This function is used by the reset_course_userdata function in moodlelib. This function will remove all posts from the specified forum and clean up any related data.

object object

Parameters:
$datathe data submitted from the reset course.
Returns:
array status array

updating dates - shift may be negative too

Definition at line 6884 of file lib.php.

Here is the call graph for this function:

forum_scale_used ( forumid,
scaleid 
)

This function returns if a scale is being used by one forum

object

Parameters:
int$forumid
int$scaleidnegative number
Returns:
bool

Definition at line 1662 of file lib.php.

forum_scale_used_anywhere ( scaleid)

Checks if scale is being used by any instance of forum

This is used to find out if scale used anywhere

object

Parameters:
$scaleidint
Returns:
boolean True if the scale is used by any forum

Definition at line 1684 of file lib.php.

forum_search_form ( course,
search = '' 
)

object

Parameters:
object$course
string$search
Returns:
string

Definition at line 3810 of file lib.php.

forum_search_posts ( searchterms,
courseid = 0,
limitfrom = 0,
limitnum = 50,
&$  totalcount,
extrasql = '' 
)

Returns a list of posts found using an array of search terms.

object object object

Parameters:
array$searchtermsarray of search terms, e.g. word +word -word
int$courseidif 0, we search through the whole site
int$limitfrom
int$limitnum
int&$totalcount
string$extrasql
Returns:
array|bool Array of posts found or false

Definition at line 1933 of file lib.php.

Here is the call graph for this function:

object object

Definition at line 3834 of file lib.php.

forum_shorten_post ( message)

Given a post object that we already know has a long message this function truncates the message nicely to the first sane place between $CFG->forum_longpost and $CFG->forum_shortpost

object

Parameters:
string$message
Returns:
string

Definition at line 3737 of file lib.php.

Here is the caller graph for this function:

forum_subscribe ( userid,
forumid 
)

Adds user to the subscriber list

object

Parameters:
int$userid
int$forumid

Definition at line 4567 of file lib.php.

Here is the caller graph for this function:

forum_subscribed_users ( course,
forum,
groupid = 0,
context = null,
fields = null 
)

Returns list of user objects that are subscribed to this forum

object object

Parameters:
object$coursethe course
forum$forumthe forum
integer$groupidgroup id, or 0 for all.
object$contextthe forum context, to save re-fetching it where possible.
string$fieldsrequested user fields (with "u." table prefix)
Returns:
array list of users.

Definition at line 2849 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_supports ( feature)

Indicates API features that the forum supports.

FEATURE_GROUPS FEATURE_GROUPINGS FEATURE_GROUPMEMBERSONLY FEATURE_MOD_INTRO FEATURE_COMPLETION_TRACKS_VIEWS FEATURE_COMPLETION_HAS_RULES FEATURE_GRADE_HAS_GRADE FEATURE_GRADE_OUTCOMES

Parameters:
string$feature
Returns:
mixed True if yes (some features may use other values)

Definition at line 286 of file lib.php.

forum_tp_add_read_record ( userid,
postid 
)

Mark post as read. object object

Parameters:
int$userid
int$postid

Definition at line 6062 of file lib.php.

Here is the caller graph for this function:

forum_tp_can_track_forums ( forum = false,
user = false 
)

Determine if a user can track forums and optionally a particular forum. Checks the site settings, the user settings and the forum settings (if requested).

object object object

Parameters:
mixed$forumThe forum object to test, or the int id (optional).
mixed$useridThe user object to check for (optional).
Returns:
boolean

Definition at line 6562 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Clean old records from the forum_read table. object object

Returns:
void

Definition at line 6682 of file lib.php.

Here is the caller graph for this function:

forum_tp_count_discussion_read_records ( userid,
discussionid 
)

Returns the count of records for the provided user and discussion.

object object

Parameters:
int$userid
int$discussionid
Returns:
bool

Definition at line 6253 of file lib.php.

forum_tp_count_discussion_unread_posts ( userid,
discussionid 
)

Returns the count of records for the provided user and discussion.

object object

Parameters:
int$userid
int$discussionid
Returns:
int

Definition at line 6277 of file lib.php.

forum_tp_count_forum_posts ( forumid,
groupid = false 
)

Returns the count of posts for the provided forum and [optionally] group. object object

Parameters:
int$forumid
int | bool$groupid
Returns:
int

Definition at line 6299 of file lib.php.

forum_tp_count_forum_read_records ( userid,
forumid,
groupid = false 
)

Returns the count of records for the provided user and forum and [optionally] group. object object

Parameters:
int$userid
int$forumid
int | bool$groupid
Returns:
int

Definition at line 6324 of file lib.php.

forum_tp_count_forum_unread_posts ( cm,
course 
)

Returns the count of records for the provided user and forum and [optionally] group.

object object object

Parameters:
object$cm
object$course
Returns:
int

Definition at line 6403 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_tp_delete_read_records ( userid = -1,
postid = -1,
discussionid = -1,
forumid = -1 
)

Deletes read records for the specified index. At least one parameter must be specified.

object

Parameters:
int$userid
int$postid
int$discussionid
int$forumid
Returns:
bool

Definition at line 6488 of file lib.php.

Here is the caller graph for this function:

forum_tp_get_course_unread_posts ( userid,
courseid 
)

Returns the count of records for the provided user and course. Please note that group access is ignored!

object object

Parameters:
int$userid
int$courseid
Returns:
array

Definition at line 6357 of file lib.php.

Here is the caller graph for this function:

forum_tp_get_discussion_read_records ( userid,
discussionid 
)

Returns all read records for the provided user and discussion, indexed by postid.

object

Parameters:
inti$userid
int$discussionid

Definition at line 6132 of file lib.php.

forum_tp_get_read_records ( userid = -1,
postid = -1,
discussionid = -1,
forumid = -1 
)

Returns all records in the 'forum_read' table matching the passed keys, indexed by userid.

object

Parameters:
int$userid
int$postid
int$discussionid
int$forumid
Returns:
array

Definition at line 6096 of file lib.php.

forum_tp_get_untracked_forums ( userid,
courseid 
)

Get a list of forums not tracked by the user.

object object

Parameters:
int$useridThe id of the user to use.
int$courseidThe id of the course being checked.
Returns:
mixed An array indexed by forum id, or false.

Definition at line 6529 of file lib.php.

forum_tp_is_post_old ( post,
time = null 
)

object

Parameters:
object$post
int$timeDefautls to time()

Definition at line 6235 of file lib.php.

Here is the caller graph for this function:

forum_tp_is_post_read ( userid,
post 
)

object

Parameters:
int$userid
object$post

Definition at line 6224 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_tp_is_tracked ( forum,
user = false 
)

Tells whether a specific forum is tracked by the user. A user can optionally be specified. If not specified, the current user is assumed.

object object object

Parameters:
mixed$forumIf int, the id of the forum being checked; if object, the forum object
int$useridThe id of the user being checked (optional).
Returns:
boolean

Definition at line 6608 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_tp_mark_discussion_read ( user,
discussionid 
)

Marks a whole discussion as read, for a given user

object object

Parameters:
object$user
int$discussionid
Returns:
bool

Definition at line 6200 of file lib.php.

Here is the call graph for this function:

forum_tp_mark_forum_read ( user,
forumid,
groupid = false 
)

Marks a whole forum as read, for a given user

object object

Parameters:
object$user
int$forumid
int | bool$groupid
Returns:
bool

Definition at line 6162 of file lib.php.

Here is the call graph for this function:

forum_tp_mark_post_read ( userid,
post,
forumid 
)

If its an old post, do nothing. If the record exists, the maintenance will clear it up later.

Returns:
bool

Definition at line 6144 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_tp_mark_posts_read ( user,
postids 
)

Mark posts as read.

object object

Parameters:
object$userobject
array$postidsarray of post ids
Returns:
boolean success

Definition at line 5985 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_tp_start_tracking ( forumid,
userid = false 
)

object object

Parameters:
int$forumid
int$userid

Definition at line 6642 of file lib.php.

forum_tp_stop_tracking ( forumid,
userid = false 
)

object object

Parameters:
int$forumid
int$userid

Definition at line 6658 of file lib.php.

Here is the call graph for this function:

forum_unsubscribe ( userid,
forumid 
)

Removes user from the subscriber list

object

Parameters:
int$userid
int$forumid

Definition at line 4588 of file lib.php.

Here is the caller graph for this function:

forum_update_grades ( forum,
userid = 0,
nullifnone = true 
)

Update activity grades

object object

Parameters:
object$forum
int$useridspecific user only, 0 means all
boolean$nullifnonereturn null if grade does not exist
Returns:
void

Definition at line 1490 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_update_instance ( forum,
mform 
)

Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data.

object

Parameters:
object$forumforum instance (with magic quotes)
Returns:
bool success

Definition at line 131 of file lib.php.

Here is the call graph for this function:

forum_update_post ( post,
mform,
&$  message 
)

Update a post

object object object

Parameters:
object$post
mixed$mform
string$message
Returns:
bool

Definition at line 4237 of file lib.php.

Here is the call graph for this function:

forum_update_subscriptions_button ( courseid,
forumid 
)

Prints the editing button on subscribers page

object object

Parameters:
int$courseid
int$forumid
Returns:
string

Definition at line 5911 of file lib.php.

Update all grades in gradebook. object

Definition at line 1515 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_user_can_post ( forum,
discussion,
user = NULL,
cm = NULL,
course = NULL,
context = NULL 
)

This function checks whether the user can reply to posts in a forum discussion. Use forum_user_can_post_discussion() to check whether the user can start discussions.

object object DEBUG_DEVELOPER CONTEXT_MODULE VISIBLEGROUPS

Parameters:
object$forumforum object
object$discussion
object$user
object$cm
object$course
object$context
Returns:
bool

Definition at line 4949 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_user_can_post_discussion ( forum,
currentgroup = null,
unused = -1,
cm = NULL,
context = NULL 
)

object

Parameters:
object$forum
object$currentgroup
int$unused
object$cm
object$context
Returns:
bool

Definition at line 4870 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_user_can_see_discussion ( forum,
discussion,
context,
user = NULL 
)

object object DEBUG_DEVELOPER

Parameters:
object$forum
object$discussion
object$context
object$user
Returns:
bool

Definition at line 5071 of file lib.php.

Here is the call graph for this function:

forum_user_can_see_post ( forum,
discussion,
post,
user = NULL,
cm = NULL 
)

object object

Parameters:
object$forum
object$discussion
object$post
object$user
object$cm
Returns:
bool

Definition at line 5115 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

forum_user_can_view_post ( post,
course,
cm,
forum,
discussion,
user = NULL 
)

checks to see if a user can view a particular post

object object CONTEXT_MODULE SEPARATEGROUPS

Parameters:
object$post
object$course
object$cm
object$forum
object$discussion
object$user

Definition at line 5037 of file lib.php.

Here is the call graph for this function:

forum_user_complete ( course,
user,
mod,
forum 
)

object object

Parameters:
object$coure
object$user
object$mod
object$forum

Definition at line 1168 of file lib.php.

Here is the call graph for this function:

This function gets run whenever user is enrolled into course

Parameters:
stdClass$cp
Returns:
void

Definition at line 5934 of file lib.php.

Here is the call graph for this function:

forum_user_has_posted ( forumid,
did,
userid 
)

object object

Parameters:
int$forumid
int$did
int$userid
Returns:
bool

Definition at line 4829 of file lib.php.

Here is the caller graph for this function:

forum_user_has_posted_discussion ( forumid,
userid 
)

Returns true if user created new discussion already

object object

Parameters:
int$forumid
int$userid
Returns:
bool

Definition at line 4790 of file lib.php.

Here is the caller graph for this function:

forum_user_outline ( course,
user,
mod,
forum 
)
Parameters:
object$course
object$user
object$modTODO this is not used in this function, refactor
object$forum
Returns:
object A standard object with 2 variables: info (number of posts for this user) and time (last modified)

Definition at line 1121 of file lib.php.

Here is the call graph for this function:

This function gets run whenever user is unenrolled from course

Parameters:
stdClass$cp
Returns:
void

Definition at line 5959 of file lib.php.

 All Data Structures Namespaces Files Functions Variables Enumerations