[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/forum/ -> deprecatedlib.php (summary)

(no description)

Copyright: 2014 Andrew Robert Nicols <[email protected]>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 710 lines (25 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 27 functions

  forum_count_unrated_posts()
  forum_tp_count_discussion_read_records()
  forum_get_user_discussions()
  forum_tp_count_forum_posts()
  forum_tp_count_forum_read_records()
  forum_get_open_modes()
  forum_get_child_posts()
  forum_get_discussion_posts()
  forum_get_ratings()
  forum_get_tracking_link()
  forum_tp_count_discussion_unread_posts()
  forum_convert_to_roles()
  forum_tp_get_read_records()
  forum_tp_get_discussion_read_records()
  forum_user_enrolled()
  forum_user_can_view_post()
  forum_shorten_post()
  forum_is_subscribed()
  forum_subscribe()
  forum_unsubscribe()
  forum_subscribed_users()
  forum_is_forcesubscribed()
  forum_forcesubscribe()
  forum_get_forcesubscribed()
  forum_get_subscribed_forums()
  forum_get_optional_subscribed_forums()
  forum_get_potential_subscribers()

Functions
Functions that are not part of a class:

forum_count_unrated_posts($discussionid, $userid)   X-Ref
How many posts by other users are unrated by a given user in the given discussion?

param: int $discussionid
param: int $userid
return: mixed

forum_tp_count_discussion_read_records($userid, $discussionid)   X-Ref
Returns the count of records for the provided user and discussion.

param: int $userid
param: int $discussionid
return: bool

forum_get_user_discussions($courseid, $userid, $groupid=0)   X-Ref
Get all discussions started by a particular user in a course (or group)

param: int $courseid
param: int $userid
param: int $groupid
return: array

forum_tp_count_forum_posts($forumid, $groupid=false)   X-Ref
Returns the count of posts for the provided forum and [optionally] group.

param: int $forumid
param: int|bool $groupid
return: int

forum_tp_count_forum_read_records($userid, $forumid, $groupid=false)   X-Ref
Returns the count of records for the provided user and forum and [optionally] group.

param: int $userid
param: int $forumid
param: int|bool $groupid
return: int

forum_get_open_modes()   X-Ref
Returns array of forum open modes.

return: array

forum_get_child_posts($parent, $forumid)   X-Ref
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.

param: int $parent
param: int $forumid
return: array

forum_get_discussion_posts($discussion, $sort, $forumid)   X-Ref
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.

return: mixed array of posts or false

forum_get_ratings($context, $postid, $sort = "u.firstname ASC")   X-Ref
Returns a list of ratings for a particular post - sorted.

param: stdClass $context
param: int $postid
param: string $sort
return: array Array of ratings or false

forum_get_tracking_link($forum, $messages=array()   X-Ref
Generate and return the track or no track link for a forum.

param: object $forum the forum. Fields used are $forum->id and $forum->forcesubscribe.
param: array $messages
param: bool $fakelink
return: string

forum_tp_count_discussion_unread_posts($userid, $discussionid)   X-Ref
Returns the count of records for the provided user and discussion.

param: int $userid
param: int $discussionid
return: int

forum_convert_to_roles()   X-Ref
Converts a forum to use the Roles System


forum_tp_get_read_records($userid=-1, $postid=-1, $discussionid=-1, $forumid=-1)   X-Ref
Returns all records in the 'forum_read' table matching the passed keys, indexed
by userid.

param: int $userid
param: int $postid
param: int $discussionid
param: int $forumid
return: array

forum_tp_get_discussion_read_records($userid, $discussionid)   X-Ref
Returns all read records for the provided user and discussion, indexed by postid.

param: inti $userid
param: int $discussionid

forum_user_enrolled($cp)   X-Ref
This function gets run whenever user is enrolled into course

param: stdClass $cp
return: void

forum_user_can_view_post($post, $course, $cm, $forum, $discussion, $user=null)   X-Ref
Checks to see if a user can view a particular post.

param: object $post
param: object $course
param: object $cm
param: object $forum
param: object $discussion
param: object $user
return: boolean

forum_shorten_post($message)   X-Ref


forum_is_subscribed($userid, $forum)   X-Ref

param: int $userid
param: object $forum
return: bool

forum_subscribe($userid, $forumid, $context = null, $userrequest = false)   X-Ref
Adds user to the subscriber list

param: int $userid
param: int $forumid
param: context_module|null $context Module context, may be omitted if not known or if called for the current module set in page.
param: boolean $userrequest Whether the user requested this change themselves. This has an effect on whether

forum_unsubscribe($userid, $forumid, $context = null, $userrequest = false)   X-Ref
Removes user from the subscriber list

param: int $userid
param: int $forumid
param: context_module|null $context Module context, may be omitted if not known or if called for the current module set in page.
param: boolean $userrequest Whether the user requested this change themselves. This has an effect on whether

forum_subscribed_users($course, $forum, $groupid = 0, $context = null, $fields = null)   X-Ref
Returns list of user objects that are subscribed to this forum.

param: stdClass $course the course
param: stdClass $forum the forum
param: int $groupid group id, or 0 for all.
param: context_module $context the forum context, to save re-fetching it where possible.
param: string $fields requested user fields (with "u." table prefix)
param: boolean $considerdiscussions Whether to take discussion subscriptions and unsubscriptions into consideration.
return: array list of users.

forum_is_forcesubscribed($forum)   X-Ref
Determine whether the forum is force subscribed.

param: object $forum
return: bool

forum_forcesubscribe($forumid, $value = 1)   X-Ref
Set the subscription mode for a forum.

param: int $forumid
param: mixed $value
return: bool

forum_get_forcesubscribed($forum)   X-Ref
Get the current subscription mode for the forum.

param: int|stdClass $forumid
param: mixed $value
return: bool

forum_get_subscribed_forums($course)   X-Ref
Get a list of forums in the specified course in which a user can change
their subscription preferences.

param: stdClass $course The course from which to find subscribable forums.
return: array

forum_get_optional_subscribed_forums()   X-Ref
Returns an array of forums that the current user is subscribed to and is allowed to unsubscribe from

return: array An array of unsubscribable forums

forum_get_potential_subscribers($forumcontext, $groupid, $fields, $sort = '')   X-Ref
Get the list of potential subscribers to a forum.

param: object $forumcontext the forum context.
param: integer $groupid the id of a group, or 0 for all groups.
param: string $fields the list of fields to return for each user. As for get_users_by_capability.
param: string $sort sort order. As for get_users_by_capability.
return: array list of users.



Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1