claroline/claroline/inc/lib/forum.lib.php File Reference

Go to the source code of this file.

Data Structures

class  topicLister
class  postLister

Namespaces

namespace  CLFRM

Enumerations

enum  GROUP_FORUMS_CATEGORY

Functions

 get_total_posts ($id, $type= 'all', $course_id=NULL)
 is_first_post ($topic_id, $post_id)
 error_die ($msg)
 sync ($forumId, $topicId=null)
 datetime_to_timestamp ($dateTime)
 get_forum_settings ($forumId)
 get_topic_settings ($topicId)
 request_forum_notification ($forumId, $userId)
 cancel_forum_notification ($forumId=null, $userId=null)
 is_forum_notification_requested ($forumId, $userId)
 trig_forum_notification ($forumId)
 create_new_topic ($subject, $time, $forumId, $userId, $userFirstname, $userLastname, $course_id=NULL)
 get_post_settings ($postId)
 create_new_post ($topicId, $forumId, $userId, $time, $posterIp, $userLastname, $userFirstname, $message, $course_id=NULL)
 update_post ($post_id, $topic_id, $message, $subject= '')
 delete_post ($postId, $topicId, $forumId)
 request_topic_notification ($topicId, $userId)
 cancel_topic_notification ($topicId=null, $userId=null)
 is_topic_notification_requested ($topicId, $userId)
 trig_topic_notification ($topicId)
 disp_confirmation_message ($message, $forumId=false, $topicId=false)
 disp_mini_pager ($url, $offsetParam, $total, $step, $pageMax=3)
 disp_forum_toolbar ($pagetype, $forum_id, $cat_id=0, $topic_id=0)
 disp_search_box ()
 disp_forum_breadcrumb ($pagetype, $forum_id, $forum_name, $topic_id=0, $topic_name='')
 forum_group_tool_list ($gid, $active=true)
 delete_all_post_in_forum ($forumId)
 update_category_title ($catId, $catTitle)
 update_forum_settings ($forum_id, $forum_name, $forum_desc, $forum_post_allowed, $cat_id)
 create_category ($cat_title, $course_id=NULL)
 delete_category ($cat_id)
 delete_forum ($forum_id)
 create_forum ($forum_name, $forum_desc, $forum_post_allowed, $cat_id, $group_id=null, $course_id=NULL)
 move_forum_rank ($currForumId, $direction)
 move_up_forum ($forum_id)
 move_down_forum ($forum_id)
 get_category_settings ($cat_id)
 move_category_rank ($currCatId, $direction)
 move_up_category ($cat_id)
 move_down_category ($cat_id)
 get_forum_list ()
 get_category_list ()
 increase_topic_view_count ($topicId)
 delete_group_forums ($groupId)
 get_group_forum_list ($groupId)

Enumeration Type Documentation

Gets user data from uid

Parameters:
int user id
Returns:
array user data if it succeeds, boolean false otherwise

Definition at line 28 of file forum.lib.php.


Function Documentation

cancel_forum_notification ( forumId = null,
userId = null 
)
Author:
Dimitri Rambout <dimitri.rambout@uclouvain.be>
Parameters:
int $userId
int $forumId (optionnal)
Returns:
void

Definition at line 328 of file forum.lib.php.

cancel_topic_notification ( topicId = null,
userId = null 
)
Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Parameters:
int $userId
int $topicId (optionnal)
Returns:
void

Definition at line 656 of file forum.lib.php.

create_category ( cat_title,
course_id = NULL 
)

create a new forum category

Parameters:
string $cat_title
context course id $course_id
Returns:
integer catgory id.

Definition at line 1349 of file forum.lib.php.

create_forum ( forum_name,
forum_desc,
forum_post_allowed,
cat_id,
group_id = null,
course_id = NULL 
)

Create a new forum (set of threads)

Parameters:
string $forum_name
string $forum_desc
boolean $forum_post_allowed
integer $cat_id
integer $group_id default null(current)
string $course_id default null(current)
Returns:
integer id of new forum;

Definition at line 1456 of file forum.lib.php.

create_new_post ( topicId,
forumId,
userId,
time,
posterIp,
userLastname,
userFirstname,
message,
course_id = NULL 
)
Author:
Hugues Peeters <peeters@ipm.cl.ac.be>
Parameters:
@return integer id of the new post

Definition at line 503 of file forum.lib.php.

create_new_topic ( subject,
time,
forumId,
userId,
userFirstname,
userLastname,
course_id = NULL 
)

create a new topic

Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Parameters:
string $subject
string $time
int $forumId
int $userId
string $userFirstname
string $userLastname
Returns:
integer id of the new topic

Definition at line 436 of file forum.lib.php.

datetime_to_timestamp ( dateTime  ) 

Convert a SQL date or datetime to a unix time stamp

Parameters:
string SQL DATETIME or DATE
Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Returns:
int unix time stamp

Definition at line 209 of file forum.lib.php.

delete_all_post_in_forum ( forumId  ) 

Delete all post and topics from a sepcific forum

Parameters:
int $forumId forum id
Returns:
boolean - true if it succeed, flase otherwise
Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>

Definition at line 1236 of file forum.lib.php.

delete_category ( cat_id  ) 

Delete the given category

Parameters:
integer $cat_id
Returns:
boolean wheter success

Definition at line 1378 of file forum.lib.php.

delete_forum ( forum_id  ) 

Definition at line 1424 of file forum.lib.php.

delete_group_forums ( groupId  ) 

Deletes forums for ALL or a given group

Parameters:
integer $groupId or ALL If param is 'ALL', all groups forums are returned otherwise the param is use as group id to filter result.
Returns:
true whether false if a forum deletion failed

Definition at line 1766 of file forum.lib.php.

delete_post ( postId,
topicId,
forumId 
)
Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Parameters:
int $postId
int $topciId
int $forumId
Returns:
boolean true if succeeds, false otherwise

Definition at line 603 of file forum.lib.php.

disp_confirmation_message ( message,
forumId = false,
topicId = false 
)

Display formated message with several 'return to ...' possibility

Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Parameters:
string $message
int $forumId (optional)
int $topicId (optional)
Returns:
void

Definition at line 758 of file forum.lib.php.

disp_forum_breadcrumb ( pagetype,
forum_id,
forum_name,
topic_id = 0,
topic_name = '' 
)

Definition at line 1116 of file forum.lib.php.

disp_forum_toolbar ( pagetype,
forum_id,
cat_id = 0,
topic_id = 0 
)

Display a pager tool bar

Author:
Mathieu Laurent <mla@claroline.net>
Returns:
void

Definition at line 1014 of file forum.lib.php.

disp_mini_pager ( url,
offsetParam,
total,
step,
pageMax = 3 
)

Display a mini pager. At the opposite of the claro_sql_pager, it doesn't depend of SQL, but you have to know before the total count of item.

Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Parameters:
string $url - url to be used
string $offsetParam - param to introduce to call the pager offset
int $total - total number of items
int $step - step between each offset
int $pageMax (optionnal) - If the number of page exceeds this param the remaining pages are replaced by a '...' except the last one.
Returns:
void

Definition at line 805 of file forum.lib.php.

disp_search_box (  ) 

Definition at line 1094 of file forum.lib.php.

error_die ( msg  ) 

Displays an error message and exits the script. Used in the posting files.

Definition at line 101 of file forum.lib.php.

forum_group_tool_list ( gid,
active = true 
)
Parameters:
@param boolean $active if set to true, only actvated tool will be considered for display

Definition at line 1185 of file forum.lib.php.

get_category_list (  ) 

Get the list of not empty categories. The query return category only if there is forums inside

Returns:
array (cat_id, cat_title, cat_order);

Definition at line 1718 of file forum.lib.php.

get_category_settings ( cat_id  ) 

get setting of a given category

Parameters:
integer $cat_id
Returns:
array : `cat_id`, `cat_title`, `cat_order`

Definition at line 1581 of file forum.lib.php.

get_forum_list (  ) 

Return the full list of forum

Returns:
array(forum_id, forum_name, forum_desc, forum_access, forum_moderator, forum_topics, forum_posts, forum_last_post_id, cat_id, forum_type, forum_order, poster_id, post_time, group_id)

Definition at line 1692 of file forum.lib.php.

get_forum_settings ( forumId  ) 

Get the forum settings of a forum

Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Parameters:
int $forumId
int $topicId (optional)
Returns:
array forum settings or false

Definition at line 242 of file forum.lib.php.

get_group_forum_list ( groupId  ) 

Get list of forums linked to ALL or a specific group.

Parameters:
integer $groupId or ALL If param is 'ALL', all groups forums are returned otherwise the param is use as group id to filter result.
Returns:
array of integer. Each integer is a forum id.

Definition at line 1786 of file forum.lib.php.

get_post_settings ( postId  ) 

get the main settings of a post

Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Parameters:
int $postId
Returns:
array containing poster_id, forum_id, topic_id and post_time

Definition at line 472 of file forum.lib.php.

get_topic_settings ( topicId  ) 

Get topic settings of a topic

Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Parameters:
int $topicId
Returns:
array topic settings

Definition at line 272 of file forum.lib.php.

get_total_posts ( id,
type = 'all',
course_id = NULL 
)

Returns the total number of posts in the whole system, a forum, or a topic Also can return the number of users on the system.

Parameters:
$id integer id of the item in the type
$type string 'users','forum', 'topic', 'all'
Returns:
integer qty

Definition at line 40 of file forum.lib.php.

increase_topic_view_count ( topicId  ) 

Function to increase the counter of view a topic

Parameters:
integer $topicId
Returns:
Success true whether false

Definition at line 1745 of file forum.lib.php.

is_first_post ( topic_id,
post_id 
)

Check if this is the first post in a topic. Used in editpost.php

Parameters:
$topic_id integer
$post_id integer
Returns:
true if $post_id is first in the $topic_id

Definition at line 82 of file forum.lib.php.

is_forum_notification_requested ( forumId,
userId 
)
Author:
Dimitri Rambout <dimitri.rambout@uclouvain.be>
Parameters:
int $userId
int $forumId
Returns:
bool

Definition at line 356 of file forum.lib.php.

is_topic_notification_requested ( topicId,
userId 
)
Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Parameters:
int $userId
int $topicId
Returns:
bool

Definition at line 681 of file forum.lib.php.

move_category_rank ( currCatId,
direction 
)

Change change rank of a category

Parameters:
integer $currCatId id of category
string $direction (UP|DOWN)
Returns:
boolean true wheater success

Definition at line 1604 of file forum.lib.php.

move_down_category ( cat_id  ) 

Decrease the rank of the given category

Parameters:
integer $cat_id
Returns:
boolean true whether success

Definition at line 1679 of file forum.lib.php.

move_down_forum ( forum_id  ) 

Move down a forum in his category This function is a helper for move_forum_rank()

Parameters:
integer $forum_id id of forum to downrank
See also:
move_forum_rank()
Returns:
boolean true whether success else claro_failure result

Definition at line 1570 of file forum.lib.php.

move_forum_rank ( currForumId,
direction 
)

swap rank of a forum in a category with his neiborgth

Parameters:
integer $currForumId
string $direction (UP|DOWN)
Returns:
boolean true whether success else claro_failure result

Definition at line 1493 of file forum.lib.php.

move_up_category ( cat_id  ) 

Increase the rank of the given category

Parameters:
integer $cat_id
Returns:
boolean

Definition at line 1667 of file forum.lib.php.

move_up_forum ( forum_id  ) 

Move up a forum in his category This function is a helper for move_forum_rank()

Parameters:
integer $forum_id id of forum to uprank
See also:
move_forum_rank()
Returns:
boolean true whether success else claro_failure result

Definition at line 1557 of file forum.lib.php.

request_forum_notification ( forumId,
userId 
)
Author:
Dimitri Rambout <dimitri.rambout@uclouvain.be>
Parameters:
int $userId
int $forumId
Returns:
void

Definition at line 300 of file forum.lib.php.

request_topic_notification ( topicId,
userId 
)
Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>
Parameters:
int $userId
int $topicId
Returns:
void

Definition at line 632 of file forum.lib.php.

sync ( forumId,
topicId = null 
)

Update summary info in forum and topic table

Parameters:
int forumId
int topicId (optionnal)
Returns:
boolean true if succeeds, false otherwise

Definition at line 121 of file forum.lib.php.

trig_forum_notification ( forumId  ) 

Definition at line 371 of file forum.lib.php.

trig_topic_notification ( topicId  ) 

Definition at line 696 of file forum.lib.php.

update_category_title ( catId,
catTitle 
)

Change title of a category

Parameters:
integer $catId
string $catTitle new title
Returns:
boolean true if ok

Definition at line 1298 of file forum.lib.php.

update_forum_settings ( forum_id,
forum_name,
forum_desc,
forum_post_allowed,
cat_id 
)

Set properties of a forum

Parameters:
integer $forum_id
string $forum_name
string $forum_desc
boolean $forum_post_allowed
integer $cat_id
Returns:
boolean true if set.

Definition at line 1325 of file forum.lib.php.

update_post ( post_id,
topic_id,
message,
subject = '' 
)
Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>

Definition at line 570 of file forum.lib.php.

Generated on Tue Jun 8 12:28:37 2010 for Claroline API by  doxygen 1.6.3