ILIAS
release_4-3 Revision
|
Class Forum core functions for forum. More...
Public Member Functions | |
__construct () | |
Constructor public. | |
setLanguage ($lng) | |
setForumId ($a_obj_id) | |
set object id which refers to ILIAS obj_id | |
setForumRefId ($a_ref_id) | |
set reference id which refers to ILIAS obj_id | |
getForumId () | |
get forum id public | |
getForumRefId () | |
get forum ref_id public | |
getOrderField () | |
get name of orderField | |
setDbTable ($dbTable) | |
set database table | |
getDbTable () | |
get name of database table | |
setMDB2WhereCondition ($query_string, $data_type, $data_value) | |
set content for additional condition | |
getMDB2Query () | |
get content of additional condition | |
getMDB2DataValue () | |
/* get content of additional condition | |
getMDB2DataType () | |
get content of additional condition | |
setPageHits ($pageHits) | |
set number of max. | |
getPageHits () | |
get number of max. | |
getOneTopic () | |
get one topic-dataset by WhereCondition | |
getOneThread () | |
get one thread-dataset by WhereCondition | |
getOnePost ($post) | |
get one post-dataset | |
_lookupPostMessage ($a_id) | |
generatePost ($forum_id, $thread_id, $user, $message, $parent_pos, $notify, $subject= '', $alias= '', $date= '', $status=1, $send_activation_mail=0) | |
generate new dataset in frm_posts | |
generateThread ($forum_id, $user, $subject, $message, $notify, $notify_posts, $alias= '', $date= '') | |
generate new dataset in frm_threads | |
moveThreads ($thread_ids=array(), $src_ref_id=0, $dest_top_frm_fk=0) | |
Moves all chosen threads and their posts to a new forum. | |
postCensorship ($message, $pos_pk, $cens=0) | |
update dataset in frm_posts with censorship info | |
deletePost ($post) | |
delete post and sub-posts | |
getAllThreads ($a_topic_id, $is_moderator=false, $limit=0, $offset=0) | |
getUserStatistic ($is_moderator=false) | |
getFirstPostByThread ($a_thread_id) | |
Get first post of thread. | |
getModerators () | |
get all users assigned to local role il_frm_moderator_<frm_ref_id> | |
_getModerators ($a_ref_id) | |
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static) | |
countUserArticles ($a_user_id) | |
get number of articles from given user-ID | |
countActiveUserArticles ($a_user_id) | |
convertDate ($date) | |
converts the date format | |
addPostTree ($a_tree_id, $a_node_id=-1, $a_date= '') | |
create a new post-tree | |
insertPostNode ($a_node_id, $a_parent_id, $tree_id, $a_date= '') | |
insert node under parent node public | |
getPostDepth ($a_node_id, $tree_id) | |
Return depth of an object private. | |
getFirstPostNode ($tree_id) | |
get data of the first node from frm_posts_tree and frm_posts public | |
getPostNode ($post_id) | |
get data of given node from frm_posts_tree and frm_posts public | |
fetchPostNodeData ($a_row) | |
get data of parent node from frm_posts_tree and frm_posts private | |
deletePostTree ($a_node) | |
delete node and the whole subtree under this node public | |
updateVisits ($ID) | |
update page hits of given forum- or thread-ID public | |
prepareText ($text, $edit=0, $quote_user= '', $type= '') | |
prepares given string public | |
getModeratorFromPost ($pos_pk) | |
get one post-dataset | |
__deletePostFiles ($a_ids) | |
__sendMessage ($a_parent_pos, $post_data=array()) | |
getImportName () | |
setImportName ($a_import_name) | |
enableForumNotification ($user_id) | |
Enable a user's notification about new posts in this forum. | |
disableForumNotification ($user_id) | |
Disable a user's notification about new posts in this forum. | |
isForumNotificationEnabled ($user_id) | |
Check whether a user's notification about new posts in this forum is enabled (result > 0) or not (result == 0) | |
enableThreadNotification ($user_id, $thread_id) | |
Enable a user's notification about new posts in a thread. | |
isThreadNotificationEnabled ($user_id, $thread_id) | |
Check whether a user's notification about new posts in a thread is enabled (result > 0) or not (result == 0) | |
sendThreadNotifications ($post_data) | |
sendForumNotifications ($post_data) | |
sendPostActivationNotification ($post_data) | |
formatNotificationSubject ($post_data) | |
formatNotification ($post_data, $cron=0, $attachments=array(), $user_id) | |
_lookupObjIdForForumId ($a_for_id) |
Static Public Member Functions | |
static | _getLanguageInstanceByUsrId ($usr_id) |
Get the ilLanguage instance for the passed user id. | |
static | _isModerator ($a_ref_id, $a_usr_id) |
checks whether a user is moderator of a given forum object | |
static | _getThreads ($a_obj_id, $a_sort_mode=self::SORT_DATE) |
Get thread infos of object. |
Data Fields | |
const | SORT_TITLE = 1 |
const | SORT_DATE = 2 |
$ilias | |
$lng |
Private Member Functions | |
setOrderField ($orderField) | |
set database field for sorting results | |
__formatMessage ($thread_data, $post_data=array(), $user_obj) | |
generates the notificiation message, if a post has been answered | |
formatPostActivationNotification ($post_data, $user_id) |
Private Attributes | |
$dbTable | |
$className = "ilForum" | |
$orderField | |
$mdb2Query | |
$mdb2DataValue | |
$mdb2DataType | |
$txtQuote1 = "[quote]" | |
$txtQuote2 = "[/quote]" | |
$replQuote1 = '<blockquote class="ilForumQuote">' | |
$replQuote2 = '</blockquote>' | |
$pageHits = 30 | |
$id |
ilForum::__construct | ( | ) |
ilForum::__deletePostFiles | ( | $a_ids | ) |
Definition at line 1811 of file class.ilForum.php.
References $file, and getForumId().
Referenced by deletePost().
|
private |
generates the notificiation message, if a post has been answered
array | $thread_data | |
array | $post_data | |
object | $user_obj | ilObjUser |
Definition at line 1873 of file class.ilForum.php.
References $title, ilMail\_getInstallationSignature(), _getLanguageInstanceByUsrId(), getForumRefId(), ilObjectFactory\getInstanceByRefId(), and ilMail\getSalutation().
Referenced by __sendMessage().
ilForum::__sendMessage | ( | $a_parent_pos, | |
$post_data = array() |
|||
) |
Definition at line 1834 of file class.ilForum.php.
References $ilUser, __formatMessage(), formatNotificationSubject(), getOnePost(), getOneThread(), and setMDB2WhereCondition().
|
static |
Get the ilLanguage instance for the passed user id.
integer | $usr_id | a user id |
Definition at line 96 of file class.ilForum.php.
References $usr_id, and ilObjUser\_lookupLanguage().
Referenced by __formatMessage(), formatNotification(), formatPostActivationNotification(), and ilCronForumNotification\sendMails().
ilForum::_getModerators | ( | $a_ref_id | ) |
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static)
int | $a_ref_id | reference id |
Definition at line 1266 of file class.ilForum.php.
References $title, and ilObject\_lookupTitle().
Referenced by _isModerator(), and getModerators().
|
static |
Get thread infos of object.
public
int | obj_id of forum |
int | sort mode SORT_TITLE or SORT_DATE |
Definition at line 2468 of file class.ilForum.php.
Referenced by ilObjForumGUI\cloneWizardPageObject().
|
static |
checks whether a user is moderator of a given forum object
int | $a_ref_id | reference id |
int | $a_usr_id | user id |
Definition at line 1295 of file class.ilForum.php.
References _getModerators().
ilForum::_lookupObjIdForForumId | ( | $a_for_id | ) |
Definition at line 2498 of file class.ilForum.php.
References $res.
Referenced by ilObjMediaObject\getParentObjectIdForUsage(), ilForumTopic\movePosts(), sendForumNotifications(), and sendThreadNotifications().
ilForum::_lookupPostMessage | ( | $a_id | ) |
ilForum::addPostTree | ( | $a_tree_id, | |
$a_node_id = -1 , |
|||
$a_date = '' |
|||
) |
create a new post-tree
integer | a_tree_id: id where tree belongs to |
integer | a_node_id: root node of tree (optional; default is tree_id itself) |
Definition at line 1360 of file class.ilForum.php.
Referenced by generatePost().
ilForum::convertDate | ( | $date | ) |
converts the date format
string | $date |
Definition at line 1348 of file class.ilForum.php.
References ilDatePresentation\formatDate(), and IL_CAL_DATETIME.
Referenced by getOnePost().
ilForum::countActiveUserArticles | ( | $a_user_id | ) |
Definition at line 1322 of file class.ilForum.php.
References $ilUser, $res, and getForumId().
ilForum::countUserArticles | ( | $a_user_id | ) |
get number of articles from given user-ID
integer | $user,: | user-ID |
Definition at line 1307 of file class.ilForum.php.
References $res, and getForumId().
ilForum::deletePost | ( | $post | ) |
delete post and sub-posts
integer | $post,: | ID public |
Definition at line 780 of file class.ilForum.php.
References $mobs, __deletePostFiles(), ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), deletePostTree(), ilNewsItem\getFirstNewsIdForContext(), and getPostNode().
ilForum::deletePostTree | ( | $a_node | ) |
delete node and the whole subtree under this node public
array | node_data of a node |
Definition at line 1601 of file class.ilForum.php.
References $res, $result, and $row.
Referenced by deletePost().
ilForum::disableForumNotification | ( | $user_id | ) |
Disable a user's notification about new posts in this forum.
integer | user_id A user's ID |
Definition at line 1992 of file class.ilForum.php.
ilForum::enableForumNotification | ( | $user_id | ) |
Enable a user's notification about new posts in this forum.
integer | user_id A user's ID |
Definition at line 1913 of file class.ilForum.php.
References $query, $res, $row, and isForumNotificationEnabled().
ilForum::enableThreadNotification | ( | $user_id, | |
$thread_id | |||
) |
Enable a user's notification about new posts in a thread.
integer | user_id A user's ID |
integer | thread_id ID of the thread |
Definition at line 2034 of file class.ilForum.php.
References isThreadNotificationEnabled().
ilForum::fetchPostNodeData | ( | $a_row | ) |
get data of parent node from frm_posts_tree and frm_posts private
object | db db result object containing node_data |
Definition at line 1546 of file class.ilForum.php.
References $data, $lng, and ilObject\_exists().
Referenced by getFirstPostNode(), and getPostNode().
ilForum::formatNotification | ( | $post_data, | |
$cron = 0 , |
|||
$attachments = array() , |
|||
$user_id | |||
) |
$post_data | ||
int | $cron | |
array | $attachments | |
int | $user_id | user_id of mail-recipient |
Definition at line 2388 of file class.ilForum.php.
References $ilIliasIniFile, _getLanguageInstanceByUsrId(), and ilMail\getSalutation().
Referenced by sendForumNotifications(), and sendThreadNotifications().
ilForum::formatNotificationSubject | ( | $post_data | ) |
array | $post_data | use $post_data['top_name'] for forum-title |
Definition at line 2376 of file class.ilForum.php.
Referenced by __sendMessage(), sendForumNotifications(), sendPostActivationNotification(), and sendThreadNotifications().
|
private |
$post_data | |
$user_id |
Definition at line 2273 of file class.ilForum.php.
References _getLanguageInstanceByUsrId(), and ilMail\getSalutation().
Referenced by sendPostActivationNotification().
ilForum::generatePost | ( | $forum_id, | |
$thread_id, | |||
$user, | |||
$message, | |||
$parent_pos, | |||
$notify, | |||
$subject = '' , |
|||
$alias = '' , |
|||
$date = '' , |
|||
$status = 1 , |
|||
$send_activation_mail = 0 |
|||
) |
generate new dataset in frm_posts
integer | $topic | |
integer | $thread | |
integer | $user | |
string | $message | |
integer | $parent_pos | |
integer | $notify | |
integer | $anonymize | |
string | $subject | |
datetime | $date |
Definition at line 444 of file class.ilForum.php.
References $ilUser, $result, ilRTE\_replaceMediaObjectImageSrc(), addPostTree(), getForumRefId(), getImportName(), ilObjectFactory\getInstanceByRefId(), insertPostNode(), NEWS_NOTICE, NEWS_USERS, prepareText(), and sendPostActivationNotification().
Referenced by generateThread().
ilForum::generateThread | ( | $forum_id, | |
$user, | |||
$subject, | |||
$message, | |||
$notify, | |||
$notify_posts, | |||
$alias = '' , |
|||
$date = '' |
|||
) |
generate new dataset in frm_threads
integer | $topic | |
integer | $user | |
string | $subject | |
string | $message | |
integer | $notify | |
integer | $notify_posts | |
integer | $anonymize | |
datetime | $date |
Definition at line 554 of file class.ilForum.php.
References generatePost(), and getImportName().
ilForum::getAllThreads | ( | $a_topic_id, | |
$is_moderator = false , |
|||
$limit = 0 , |
|||
$offset = 0 |
|||
) |
$a_topic_id | ||
bool | $is_moderator | |
int | $limit | |
int | $offset |
Definition at line 1005 of file class.ilForum.php.
References $data, $ilUser, $query, $res, and $row.
ilForum::getDbTable | ( | ) |
get name of database table
Definition at line 218 of file class.ilForum.php.
References $dbTable.
ilForum::getFirstPostByThread | ( | $a_thread_id | ) |
Get first post of thread.
public
int | thread id |
Definition at line 1231 of file class.ilForum.php.
ilForum::getFirstPostNode | ( | $tree_id | ) |
get data of the first node from frm_posts_tree and frm_posts public
integer | tree id |
Definition at line 1501 of file class.ilForum.php.
References $res, $row, and fetchPostNodeData().
ilForum::getForumId | ( | ) |
get forum id public
Definition at line 150 of file class.ilForum.php.
References $id.
Referenced by __deletePostFiles(), countActiveUserArticles(), countUserArticles(), and getUserStatistic().
ilForum::getForumRefId | ( | ) |
get forum ref_id public
Definition at line 160 of file class.ilForum.php.
References $ref_id.
Referenced by __formatMessage(), generatePost(), and getModerators().
ilForum::getImportName | ( | ) |
Definition at line 1898 of file class.ilForum.php.
Referenced by generatePost(), and generateThread().
ilForum::getMDB2DataType | ( | ) |
get content of additional condition
Definition at line 275 of file class.ilForum.php.
References $mdb2DataType.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getMDB2DataValue | ( | ) |
/* get content of additional condition
Definition at line 262 of file class.ilForum.php.
References $mdb2DataValue.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getMDB2Query | ( | ) |
get content of additional condition
Definition at line 248 of file class.ilForum.php.
References $mdb2Query.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getModeratorFromPost | ( | $pos_pk | ) |
get one post-dataset
integer | post id |
Definition at line 1795 of file class.ilForum.php.
ilForum::getModerators | ( | ) |
get all users assigned to local role il_frm_moderator_<frm_ref_id>
Definition at line 1252 of file class.ilForum.php.
References _getModerators(), and getForumRefId().
Referenced by sendPostActivationNotification().
ilForum::getOnePost | ( | $post | ) |
get one post-dataset
integer | post id |
Definition at line 396 of file class.ilForum.php.
References $res, $row, and convertDate().
Referenced by __sendMessage().
ilForum::getOneThread | ( | ) |
get one thread-dataset by WhereCondition
Definition at line 367 of file class.ilForum.php.
References $query, $result, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
Referenced by __sendMessage().
ilForum::getOneTopic | ( | ) |
get one topic-dataset by WhereCondition
Definition at line 320 of file class.ilForum.php.
References $query, $res, $row, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
Referenced by moveThreads().
ilForum::getOrderField | ( | ) |
get name of orderField
Definition at line 189 of file class.ilForum.php.
References $orderField.
ilForum::getPageHits | ( | ) |
get number of max.
visible datasets
Definition at line 308 of file class.ilForum.php.
References $pageHits.
ilForum::getPostDepth | ( | $a_node_id, | |
$tree_id | |||
) |
Return depth of an object private.
integer | node_id of parent's node_id |
integer | node_id of parent's node parent_id |
Definition at line 1472 of file class.ilForum.php.
References $res.
Referenced by insertPostNode().
ilForum::getPostNode | ( | $post_id | ) |
get data of given node from frm_posts_tree and frm_posts public
integer | post_id |
Definition at line 1524 of file class.ilForum.php.
References $res, $row, and fetchPostNodeData().
Referenced by deletePost().
ilForum::getUserStatistic | ( | $is_moderator = false | ) |
Definition at line 1155 of file class.ilForum.php.
References $data, $ilUser, $query, $res, $row, and getForumId().
ilForum::insertPostNode | ( | $a_node_id, | |
$a_parent_id, | |||
$tree_id, | |||
$a_date = '' |
|||
) |
insert node under parent node public
integer | node_id |
integer | tree_id |
integer | parent_id (optional) |
Definition at line 1398 of file class.ilForum.php.
References $res, and getPostDepth().
Referenced by generatePost().
ilForum::isForumNotificationEnabled | ( | $user_id | ) |
Check whether a user's notification about new posts in this forum is enabled (result > 0) or not (result == 0)
integer | user_id A user's ID |
Definition at line 2012 of file class.ilForum.php.
References $result.
Referenced by enableForumNotification().
ilForum::isThreadNotificationEnabled | ( | $user_id, | |
$thread_id | |||
) |
Check whether a user's notification about new posts in a thread is enabled (result > 0) or not (result == 0)
integer | user_id A user's ID |
integer | thread_id ID of the thread |
Definition at line 2062 of file class.ilForum.php.
References $result.
Referenced by enableThreadNotification().
ilForum::moveThreads | ( | $thread_ids = array() , |
|
$src_ref_id = 0 , |
|||
$dest_top_frm_fk = 0 |
|||
) |
Moves all chosen threads and their posts to a new forum.
array | chosen thread pks |
integer | object id of src forum |
integer | object id of dest forum public |
Definition at line 604 of file class.ilForum.php.
References $id, $res, $row, ilObject\_lookupObjectId(), getOneTopic(), and setMDB2WhereCondition().
ilForum::postCensorship | ( | $message, | |
$pos_pk, | |||
$cens = 0 |
|||
) |
update dataset in frm_posts with censorship info
string | message |
integer | pos_pk |
Definition at line 727 of file class.ilForum.php.
References $_SESSION, $res, ilNewsItem\getFirstNewsIdForContext(), and prepareText().
ilForum::prepareText | ( | $text, | |
$edit = 0 , |
|||
$quote_user = '' , |
|||
$type = '' |
|||
) |
prepares given string public
string | |
integer |
Definition at line 1706 of file class.ilForum.php.
References $lng, $txtQuote2, and ilUtil\insertLatexImages().
Referenced by generatePost(), and postCensorship().
ilForum::sendForumNotifications | ( | $post_data | ) |
Definition at line 2174 of file class.ilForum.php.
References $ilUser, $lng, $ref_id, $res, $result, $row, ilObject\_getAllReferences(), ilObjUser\_lookupLogin(), _lookupObjIdForForumId(), formatNotification(), formatNotificationSubject(), and setLanguage().
ilForum::sendPostActivationNotification | ( | $post_data | ) |
Definition at line 2314 of file class.ilForum.php.
References $ilUser, $lng, $result, ilObjUser\_lookupLogin(), formatNotificationSubject(), formatPostActivationNotification(), getModerators(), and setLanguage().
Referenced by generatePost().
ilForum::sendThreadNotifications | ( | $post_data | ) |
Definition at line 2082 of file class.ilForum.php.
References $_SESSION, $lng, $ref_id, $res, $result, $row, ilObject\_getAllReferences(), ilObjUser\_lookupLogin(), _lookupObjIdForForumId(), formatNotification(), formatNotificationSubject(), and setLanguage().
ilForum::setDbTable | ( | $dbTable | ) |
set database table
string | $dbTable | database table |
Definition at line 200 of file class.ilForum.php.
References $dbTable.
ilForum::setForumId | ( | $a_obj_id | ) |
set object id which refers to ILIAS obj_id
integer | object id public |
Definition at line 117 of file class.ilForum.php.
ilForum::setForumRefId | ( | $a_ref_id | ) |
set reference id which refers to ILIAS obj_id
integer | object id public |
Definition at line 134 of file class.ilForum.php.
ilForum::setImportName | ( | $a_import_name | ) |
Definition at line 1902 of file class.ilForum.php.
ilForum::setLanguage | ( | $lng | ) |
Definition at line 81 of file class.ilForum.php.
References $lng.
Referenced by sendForumNotifications(), sendPostActivationNotification(), and sendThreadNotifications().
ilForum::setMDB2WhereCondition | ( | $query_string, | |
$data_type, | |||
$data_value | |||
) |
set content for additional condition
string | $query_string | |
array | $data_type | |
array | $data_value |
Definition at line 233 of file class.ilForum.php.
Referenced by __sendMessage(), and moveThreads().
|
private |
set database field for sorting results
string | $orderField | database field for sorting |
Definition at line 171 of file class.ilForum.php.
References $orderField.
ilForum::setPageHits | ( | $pageHits | ) |
set number of max.
visible datasets
integer | $pageHits |
Definition at line 289 of file class.ilForum.php.
References $pageHits.
ilForum::updateVisits | ( | $ID | ) |
update page hits of given forum- or thread-ID public
integer |
Definition at line 1672 of file class.ilForum.php.
References $_SESSION, $query, $res, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
|
private |
Definition at line 44 of file class.ilForum.php.
|
private |
Definition at line 37 of file class.ilForum.php.
Referenced by getDbTable(), and setDbTable().
|
private |
Definition at line 67 of file class.ilForum.php.
Referenced by getForumId(), and moveThreads().
ilForum::$ilias |
Definition at line 28 of file class.ilForum.php.
Referenced by __construct().
ilForum::$lng |
Definition at line 29 of file class.ilForum.php.
Referenced by __construct(), fetchPostNodeData(), prepareText(), sendForumNotifications(), sendPostActivationNotification(), sendThreadNotifications(), and setLanguage().
|
private |
Definition at line 56 of file class.ilForum.php.
Referenced by getMDB2DataType().
|
private |
Definition at line 55 of file class.ilForum.php.
Referenced by getMDB2DataValue().
|
private |
Definition at line 54 of file class.ilForum.php.
Referenced by getMDB2Query().
|
private |
Definition at line 52 of file class.ilForum.php.
Referenced by getOrderField(), and setOrderField().
|
private |
Definition at line 64 of file class.ilForum.php.
Referenced by getPageHits(), and setPageHits().
|
private |
Definition at line 60 of file class.ilForum.php.
|
private |
Definition at line 61 of file class.ilForum.php.
|
private |
Definition at line 58 of file class.ilForum.php.
|
private |
Definition at line 59 of file class.ilForum.php.
Referenced by prepareText().
const ilForum::SORT_DATE = 2 |
Definition at line 21 of file class.ilForum.php.
const ilForum::SORT_TITLE = 1 |
Definition at line 20 of file class.ilForum.php.
Referenced by ilObjForumGUI\cloneWizardPageObject().