77 $this->error = $DIC[
'ilErr'];
78 $this->lng = $DIC->language();
79 $this->db = $DIC->database();
80 $this->
user = $DIC->user();
102 static $lngCache = array();
107 if (!isset($lngCache[$languageShorthandle])) {
108 $lngCache[$languageShorthandle] =
new ilLanguage($languageShorthandle);
109 $lngCache[$languageShorthandle]->loadLanguageModule(
'forum');
112 return $lngCache[$languageShorthandle];
122 if (!isset($a_obj_id)) {
123 $message = get_class($this) .
"::setForumId(): No obj_id given!";
124 $this->error->raiseError(
$message, $this->error->WARNING);
127 $this->
id = $a_obj_id;
137 if (!isset($a_ref_id)) {
138 $message = get_class($this) .
"::setForumRefId(): No ref_id given!";
139 $this->error->raiseError(
$message, $this->error->WARNING);
142 $this->ref_id = $a_ref_id;
162 return $this->ref_id;
174 die($this->className .
"::setOrderField(): No orderField given.");
200 die($this->className .
"::setDbTable(): No database table given.");
227 $this->mdb2Query = $query_string;
228 $this->mdb2DataValue = $data_value;
229 $this->mdb2DataType = $data_type;
240 if ($this->mdb2Query !=
'') {
251 if ($this->mdb2DataValue !=
'') {
262 if ($this->mdb2DataType !=
'') {
299 $data_type = array();
300 $data_value = array();
302 $query =
'SELECT * FROM frm_data WHERE ';
309 $res = $this->db->queryf(
$query, $data_type, $data_value);
310 $row = $this->db->fetchAssoc(
$res);
316 $row[
"top_name"] = trim($row[
"top_name"]);
317 $row[
"top_description"] = nl2br($row[
"top_description"]);
324 $row = $this->db->fetchAssoc(
$res);
326 if (!is_array($row) || !count($row)) {
330 $row[
'top_name'] = trim($row[
'top_name']);
331 $row[
'top_description'] = nl2br($row[
'top_description']);
344 $data_type = array();
345 $data_value = array();
347 $query =
'SELECT * FROM frm_threads WHERE ';
354 $sql_res = $this->db->queryf(
$query, $data_type, $data_value);
355 $result = $this->db->fetchAssoc($sql_res);
370 $res = $this->db->queryf(
372 SELECT frm_posts.*, usr_data.lastname FROM frm_posts, usr_data 374 AND pos_display_user_id = usr_id',
379 $row = $this->db->fetchAssoc(
$res);
381 $row[
"pos_date"] = $this->
convertDate($row[
"pos_date"]);
382 $row[
"pos_message"] = nl2br($row[
"pos_message"]);
390 $ilDB = $DIC->database();
394 SELECT * FROM frm_posts WHERE pos_pk = %s',
399 while ($row =
$ilDB->fetchObject(
$res)) {
400 return $row->pos_message;
421 public function generatePost($forum_id, $thread_id, $author_id, $display_user_id,
$message, $parent_pos, $notify, $subject =
'', $alias =
'', $date =
'', $status = 1, $send_activation_mail = 0)
424 $objNewPost->setForumId($forum_id);
425 $objNewPost->setThreadId($thread_id);
426 $objNewPost->setSubject($subject);
428 $objNewPost->setDisplayUserId($display_user_id);
429 $objNewPost->setUserAlias($alias);
430 $objNewPost->setPosAuthorId($author_id);
434 if ($frm_settings->getMarkModeratorPosts() == 1) {
435 self::_isModerator($this->
getForumRefId(), $author_id) ? $is_moderator = true : $is_moderator =
false;
437 $is_moderator =
false;
439 $objNewPost->setIsAuthorModerator($is_moderator);
442 $objNewPost->setCreateDate(date(
"Y-m-d H:i:s"));
444 if (strpos($date,
"-") > 0) {
445 $objNewPost->setCreateDate($date);
447 $objNewPost->setCreateDate(date(
"Y-m-d H:i:s", $date));
451 $objNewPost->setPostActivationDate($objNewPost->getCreateDate());
455 $objNewPost->setNotification($notify);
456 $objNewPost->setStatus($status);
457 $objNewPost->insert();
460 if ($parent_pos == 0) {
461 $this->
addPostTree($objNewPost->getThreadId(), $objNewPost->getId(), $objNewPost->getCreateDate());
463 $this->
insertPostNode($objNewPost->getId(), $parent_pos, $objNewPost->getThreadId(), $objNewPost->getCreateDate());
467 $lastPost = $objNewPost->getForumId() .
"#" . $objNewPost->getThreadId() .
"#" . $objNewPost->getId();
470 $this->db->manipulateF(
473 SET thr_num_posts = thr_num_posts + 1, 476 array(
'text',
'integer'),
477 array($lastPost, $objNewPost->getThreadId())
481 $this->db->manipulateF(
484 SET top_num_posts = top_num_posts + 1, 487 array(
'text',
'integer'),
488 array($lastPost, $objNewPost->getForumId())
493 $forum_obj->markPostRead($objNewPost->getPosAuthorId(), $objNewPost->getThreadId(), $objNewPost->getId());
496 if ($status && $parent_pos > 0) {
498 $news_item->setContext($forum_obj->getId(),
'frm', $objNewPost->getId(),
'pos');
500 $news_item->setTitle($objNewPost->getSubject());
502 if ($objNewPost->getMessage() != strip_tags($objNewPost->getMessage())) {
503 $news_item->setContentHtml(
true);
506 $news_item->setUserId($display_user_id);
508 $news_item->create();
511 return $objNewPost->getId();
529 bool $withFirstVisibleEntry =
true 538 if ($notify_posts == 1) {
542 $this->db->manipulateF(
545 SET top_num_threads = top_num_threads + 1 566 if (!$withFirstVisibleEntry) {
595 public function moveThreads($thread_ids = array(), $src_ref_id = 0, $dest_top_frm_fk = 0)
599 $errorMessages = array();
601 if (is_numeric($src_top_frm_fk) && $src_top_frm_fk > 0 && is_numeric($dest_top_frm_fk) && $dest_top_frm_fk > 0) {
610 if ($oldFrmData[
'top_pk'] && $newFrmData[
'top_pk']) {
615 foreach ($thread_ids as
$id) {
619 $numPosts = $objTmpThread->movePosts(
621 $oldFrmData[
'top_pk'],
623 $newFrmData[
'top_pk']
626 if (($last_post_string = $objTmpThread->getLastPostString()) !=
'') {
627 $last_post_string = explode(
'#', $last_post_string);
628 $last_post_string[0] = $newFrmData[
'top_pk'];
629 $last_post_string = implode(
'#', $last_post_string);
630 $objTmpThread->setLastPostString($last_post_string);
633 $visits += $objTmpThread->getVisits();
635 $moved_posts += $numPosts;
638 $objTmpThread->setForumId($newFrmData[
'top_pk']);
639 $objTmpThread->update();
641 unset($objTmpThread);
643 $errorMessages[] = sprintf($this->lng->txt(
'frm_move_invalid_file_type'), $objTmpThread->getSubject());
648 if ($moved_threads > 0 || $moved_posts > 0 || $visits > 0) {
650 $this->db->setLimit(1);
651 $res = $this->db->queryf(
653 SELECT pos_thr_fk, pos_pk 655 WHERE pos_top_fk = %s 656 ORDER BY pos_date DESC',
658 array($oldFrmData[
'top_pk'])
661 $row = $this->db->fetchObject(
$res);
662 $last_post_src = $oldFrmData[
'top_pk'] .
'#' . $row->pos_thr_fk .
'#' . $row->pos_pk;
664 $this->db->manipulateF(
667 SET top_num_posts = top_num_posts - %s, 668 top_num_threads = top_num_threads - %s, 669 visits = visits - %s, 672 array(
'integer',
'integer',
'integer',
'text',
'integer'),
677 $oldFrmData[
'top_pk'])
681 $this->db->setLimit(1);
682 $res = $this->db->queryf(
684 SELECT pos_thr_fk, pos_pk 686 WHERE pos_top_fk = %s 687 ORDER BY pos_date DESC',
689 array($newFrmData[
'top_kp'])
692 $row = $this->db->fetchObject(
$res);
693 $last_post_dest = $newFrmData[
'top_pk'] .
'#' . $row->pos_thr_fk .
'#' . $row->pos_pk;
695 $this->db->manipulateF(
698 SET top_num_posts = top_num_posts + %s, 699 top_num_threads = top_num_threads + %s, 700 visits = visits + %s, 703 array(
'integer',
'integer',
'integer',
'text',
'integer'),
704 array($moved_posts, $moved_threads, $visits, $last_post_dest, $newFrmData[
'top_pk'])
709 return $errorMessages;
723 $cens_date = date(
"Y-m-d H:i:s");
725 $this->db->manipulateF(
728 SET pos_cens_com = %s, 733 array(
'text',
'timestamp',
'integer',
'integer',
'integer'),
734 array(
$message, $cens_date, $cens,
$GLOBALS[
'DIC'][
'ilUser']->getId(), $pos_pk)
750 $news_item->setContentHtml(
true);
752 $news_item->setContentHtml(
false);
755 $news_item->update();
758 $res = $this->db->queryf(
760 SELECT * FROM frm_posts 766 $rec = $this->db->fetchAssoc(
$res);
770 $news_item->setContent(nl2br($this->
prepareText($rec[
"pos_message"], 0)));
771 if ($rec[
"pos_message"] != strip_tags($rec[
"pos_message"])) {
772 $news_item->setContentHtml(
true);
774 $news_item->setContentHtml(
false);
777 $news_item->update();
781 $GLOBALS[
'ilAppEventHandler']->raise(
799 public function deletePost($postIdOrArray, $raiseEvents =
true)
801 if (is_numeric($postIdOrArray)) {
804 $p_node = $postIdOrArray;
808 $is_deleted_thread = ($p_node[
"parent"] == 0) ?
true :
false;
809 $num_visible_active_posts = 0;
810 if ($is_deleted_thread) {
812 SELECT COUNT(*) AS cnt 814 INNER JOIN frm_posts_tree ON pos_pk = pos_fk 815 WHERE frm_posts_tree.parent_pos != 0 816 AND pos_thr_fk = ' . $this->db->quote($p_node[
'pos_thr_fk'],
'integer') .
' 817 AND pos_status = ' . $this->db->quote(1,
'integer');
819 $row = $this->db->fetchAssoc(
$res);
820 $num_visible_active_posts = (int) ($row[
'cnt'] ?? 0);
823 $GLOBALS[
'ilAppEventHandler']->raise(
829 'thread_deleted' => $is_deleted_thread,
830 'num_visible_active_posts' => $num_visible_active_posts
840 $obj_history->deleteHistoryByPostIds($del_id);
843 $obj_draft->deleteDraftsByPostIds($del_id);
846 foreach ($del_id as $post_id) {
853 $dead_pos = count($del_id);
857 if ($p_node[
"parent"] == 0) {
862 $dead_thr = $p_node[
"tree"];
864 $this->db->manipulateF(
866 DELETE FROM frm_threads 869 array($p_node[
'tree'])
873 $this->db->manipulateF(
876 SET top_num_threads = top_num_threads - 1 877 WHERE top_frm_fk = %s',
883 $posset = $this->db->queryf(
885 SELECT * FROM frm_posts 886 WHERE pos_thr_fk = %s',
888 array($p_node[
'tree'])
891 while ($posrec = $this->db->fetchAssoc($posset)) {
900 $news_item->delete();
905 foreach (
$mobs as $mob) {
917 $this->db->manipulateF(
919 DELETE FROM frm_posts 920 WHERE pos_thr_fk = %s',
922 array($p_node[
'tree'])
926 for (
$i = 0;
$i < $dead_pos;
$i++) {
927 $this->db->manipulateF(
929 DELETE FROM frm_posts 944 $news_item->delete();
949 foreach (
$mobs as $mob) {
961 $this->db->manipulateF(
964 SET thr_num_posts = thr_num_posts - %s 966 array(
'integer',
'integer'),
967 array($dead_pos, $p_node[
'tree'])
971 $res1 = $this->db->queryf(
973 SELECT * FROM frm_posts 974 WHERE pos_thr_fk = %s 975 ORDER BY pos_date DESC',
977 array($p_node[
'tree'])
980 if ($res1->numRows() == 0) {
985 while ($selData = $this->db->fetchAssoc($res1)) {
990 $lastPost_thr = $selData[
"pos_top_fk"] .
"#" . $selData[
"pos_thr_fk"] .
"#" . $selData[
"pos_pk"];
995 $this->db->manipulateF(
998 SET thr_last_post = %s 1000 array(
'text',
'integer'),
1001 array($lastPost_thr, $p_node[
'tree'])
1006 $this->db->manipulateF(
1009 SET top_num_posts = top_num_posts - %s 1010 WHERE top_frm_fk = %s',
1011 array(
'integer',
'integer'),
1012 array($dead_pos, $this->
id)
1016 $res2 = $this->db->queryf(
1018 SELECT * FROM frm_posts, frm_data 1019 WHERE pos_top_fk = top_pk 1021 ORDER BY pos_date DESC',
1026 if ($res2->numRows() == 0) {
1031 while ($selData = $this->db->fetchAssoc($res2)) {
1036 $lastPost_top = $selData[
"pos_top_fk"] .
"#" . $selData[
"pos_thr_fk"] .
"#" . $selData[
"pos_pk"];
1041 $this->db->manipulateF(
1044 SET top_last_post = %s 1045 WHERE top_frm_fk = %s',
1046 array(
'text',
'integer'),
1047 array($lastPost_top, $this->
id)
1060 public function getAllThreads($a_topic_id, array $params = array(), $limit = 0, $offset = 0)
1062 $frm_overview_setting = (int) $this->
settings->get(
'forum_overview');
1064 $is_post_activation_enabled = $frm_props->isPostActivationEnabled();
1066 $user_id = $this->
user->getId();
1068 $excluded_ids_condition =
'';
1069 if (isset($params[
'excluded_ids']) && is_array($params[
'excluded_ids']) && $params[
'excluded_ids']) {
1070 $excluded_ids_condition =
' AND ' . $this->db->in(
'thr_pk', $params[
'excluded_ids'],
true,
'integer') .
' ';
1073 if (!in_array(strtolower($params[
'order_column']), array(
'lp_date',
'rating',
'thr_subject',
'num_posts',
'num_visit'))) {
1074 $params[
'order_column'] =
'post_date';
1076 if (!in_array(strtolower($params[
'order_direction']), array(
'asc',
'desc'))) {
1077 $params[
'order_direction'] =
'desc';
1080 $cnt_active_pos_query =
'';
1081 $cnt_join_type =
'LEFT';
1082 if ($is_post_activation_enabled && !$params[
'is_moderator']) {
1083 $cnt_active_pos_query =
" AND (pos_status = {$this->db->quote(1, 'integer')} OR pos_author_id = {$this->db->quote($user_id, 'integer')}) ";
1084 $cnt_join_type =
"INNER";
1087 "SELECT COUNT(DISTINCT(thr_pk)) cnt 1089 {$cnt_join_type} JOIN frm_posts 1090 ON pos_thr_fk = thr_pk {$cnt_active_pos_query} 1091 WHERE thr_top_fk = %s {$excluded_ids_condition} 1093 $res = $this->db->queryF(
$query, array(
'integer'), array($a_topic_id));
1094 $cntData = $this->db->fetchAssoc(
$res);
1095 $cnt = (int) $cntData[
'cnt'];
1098 $active_inner_query =
'';
1100 if ($is_post_activation_enabled && !$params[
'is_moderator']) {
1101 $active_query =
' AND (pos_status = %s OR pos_author_id = %s) ';
1102 $active_inner_query =
' AND (ipos.pos_status = %s OR ipos.pos_author_id = %s) ';
1103 $having =
' HAVING num_posts > 0';
1108 $data_types = array();
1110 $optional_fields =
'';
1111 if ($frm_props->isIsThreadRatingEnabled()) {
1112 $optional_fields =
',avg_rating';
1114 if ($frm_props->getThreadSorting() == 1) {
1115 $optional_fields =
',thread_sorting';
1118 $additional_sort =
'';
1119 if ($frm_props->getThreadSorting()) {
1120 $additional_sort .=
' , thread_sorting ASC ';
1123 if ($params[
'order_column'] ==
'thr_subject') {
1124 $dynamic_columns = array(
', thr_subject ' . $params[
'order_direction']);
1125 } elseif ($params[
'order_column'] ==
'num_posts') {
1126 $dynamic_columns = array(
', thr_num_posts ' . $params[
'order_direction']);
1127 } elseif ($params[
'order_column'] ==
'num_visit') {
1128 $dynamic_columns = array(
', visits ' . $params[
'order_direction']);
1130 $dynamic_columns = array(
', post_date ' . $params[
'order_direction']);
1133 if ($frm_props->isIsThreadRatingEnabled()) {
1134 $dynamic_columns[] =
' ,avg_rating ' . $params[
'order_direction'];
1136 if (
'rating' == strtolower($params[
'order_column'])) {
1137 $dynamic_columns = array_reverse($dynamic_columns);
1139 $additional_sort .= implode(
' ', $dynamic_columns);
1141 if (!$this->
user->isAnonymous()) {
1143 (CASE WHEN COUNT(DISTINCT(notification_id)) > 0 THEN 1 ELSE 0 END) usr_notification_is_enabled, 1144 MAX(pos_date) post_date, 1145 SUM(tree1.parent_pos != 0) num_posts, 1146 SUM(tree1.parent_pos != 0) - SUM(tree1.parent_pos != 0 AND postread.post_id IS NOT NULL) num_unread_posts, ";
1151 (SELECT COUNT(DISTINCT(ipos.pos_pk)) 1153 INNER JOIN frm_posts_tree treenew 1154 ON treenew.pos_fk = ipos.pos_pk 1155 LEFT JOIN frm_user_read iread ON iread.post_id = ipos.pos_pk AND iread.usr_id = %s 1156 LEFT JOIN frm_thread_access iacc ON (iacc.thread_id = ipos.pos_thr_fk AND iacc.usr_id = %s) 1157 WHERE ipos.pos_thr_fk = thr_pk 1158 AND treenew.parent_pos != 0 1159 AND (ipos.pos_update > iacc.access_old_ts 1161 (iacc.access_old IS NULL AND (ipos.pos_update > " . $this->db->quote(date(
'Y-m-d H:i:s', NEW_DEADLINE),
'timestamp') .
")) 1164 AND ipos.pos_author_id != %s 1165 AND iread.usr_id IS NULL $active_inner_query 1169 $query .=
" thr_pk, thr_top_fk, thr_subject, thr_author_id, thr_display_user_id, thr_usr_alias, thr_num_posts, thr_last_post, thr_date, thr_update, visits, frm_threads.import_name, is_sticky, is_closed 1173 LEFT JOIN frm_notification 1174 ON frm_notification.thread_id = thr_pk 1175 AND frm_notification.user_id = %s 1178 ON pos_thr_fk = thr_pk $active_query 1179 LEFT JOIN frm_posts_tree tree1 1180 ON tree1.pos_fk = frm_posts.pos_pk 1181 LEFT JOIN frm_user_read postread 1182 ON postread.post_id = pos_pk 1183 AND postread.usr_id = %s";
1185 $query .=
" WHERE thr_top_fk = %s 1186 {$excluded_ids_condition} 1187 GROUP BY thr_pk, thr_top_fk, thr_subject, thr_author_id, thr_display_user_id, thr_usr_alias, thr_num_posts, thr_last_post, thr_date, thr_update, visits, frm_threads.import_name, is_sticky, is_closed 1190 ORDER BY is_sticky DESC {$additional_sort}, thr_date DESC";
1195 $data_types[] =
'integer';
1196 $data_types[] =
'integer';
1197 $data_types[] =
'integer';
1198 if ($is_post_activation_enabled && !$params[
'is_moderator']) {
1199 array_push($data_types,
'integer',
'integer');
1202 $data_types[] =
'integer';
1203 if ($is_post_activation_enabled && !$params[
'is_moderator']) {
1204 array_push($data_types,
'integer',
'integer');
1206 $data_types[] =
'integer';
1207 $data_types[] =
'integer';
1214 if ($is_post_activation_enabled && !$params[
'is_moderator']) {
1215 array_push(
$data,
'1', $user_id);
1219 if ($is_post_activation_enabled && !$params[
'is_moderator']) {
1220 array_push(
$data,
'1', $user_id);
1223 $data[] = $a_topic_id;
1226 0 usr_notification_is_enabled, 1227 MAX(pos_date) post_date, 1228 COUNT(DISTINCT(tree1.pos_fk)) num_posts, 1229 COUNT(DISTINCT(tree1.pos_fk)) num_unread_posts, 1230 COUNT(DISTINCT(tree1.pos_fk)) num_new_posts, 1231 thr_pk, thr_top_fk, thr_subject, thr_author_id, thr_display_user_id, thr_usr_alias, thr_num_posts, thr_last_post, thr_date, thr_update, visits, frm_threads.import_name, is_sticky, is_closed 1236 ON pos_thr_fk = thr_pk $active_query 1237 LEFT JOIN frm_posts_tree tree1 1238 ON tree1.pos_fk = frm_posts.pos_pk AND tree1.parent_pos != 0 1241 $query .=
" WHERE thr_top_fk = %s 1242 {$excluded_ids_condition} 1243 GROUP BY thr_pk, thr_top_fk, thr_subject, thr_author_id, thr_display_user_id, thr_usr_alias, thr_num_posts, thr_last_post, thr_date, thr_update, visits, frm_threads.import_name, is_sticky, is_closed 1246 ORDER BY is_sticky DESC {$additional_sort}, thr_date DESC";
1248 if ($is_post_activation_enabled && !$params[
'is_moderator']) {
1249 array_push($data_types,
'integer',
'integer');
1251 $data_types[] =
'integer';
1252 if ($is_post_activation_enabled && !$params[
'is_moderator']) {
1253 array_push(
$data,
'1', $user_id);
1255 $data[] = $a_topic_id;
1258 if ($limit || $offset) {
1259 $this->db->setLimit($limit, $offset);
1264 while ($row = $this->db->fetchAssoc(
$res)) {
1265 $thread =
new ilForumTopic($row[
'thr_pk'], $params[
'is_moderator'],
true);
1266 $thread->assignData($row);
1267 $threads[$row[
'thr_pk']] = $thread;
1268 $threadIds[] = $row[
'thr_pk'];
1271 $inner_last_active_post_condition =
"";
1272 if ($is_post_activation_enabled && !$params[
'is_moderator']) {
1273 $inner_last_active_post_condition = sprintf(
1274 " AND (iposts.pos_status = %s OR (iposts.pos_status = %s AND iposts.pos_author_id = %s)) ",
1275 $this->db->quote(1,
'integer'),
1276 $this->db->quote(0,
'integer'),
1277 $this->db->quote($this->
user->getId(),
'integer')
1281 $post_res = $this->db->query(
1286 SELECT pos_thr_fk, MAX(iposts.pos_date) i_pos_date 1287 FROM frm_posts iposts 1288 WHERE ' . $this->db->in(
'iposts.pos_thr_fk', $threadIds,
false,
'integer') .
' 1289 ' . $inner_last_active_post_condition .
' 1291 ) opost ON frm_posts.pos_thr_fk = opost.pos_thr_fk AND frm_posts.pos_date = opost.i_pos_date' 1294 while ($post_row = $this->db->fetchAssoc($post_res)) {
1295 $tmp_obj =
new ilForumPost($post_row[
'pos_pk'], $params[
'is_moderator'],
true);
1297 $tmp_obj->setPosAuthorId($post_row[
'pos_author_id']);
1298 $tmp_obj->setDisplayUserId($post_row[
'pos_display_user_id']);
1299 $tmp_obj->setUserAlias($post_row[
'pos_usr_alias']);
1300 $tmp_obj->setImportName($post_row[
'import_name']);
1301 $tmp_obj->setId($post_row[
'pos_pk']);
1302 $tmp_obj->setCreateDate($post_row[
'pos_date']);
1304 $threads[$post_row[
'pos_thr_fk']]->setLastPostForThreadOverview($tmp_obj);
1308 'items' => $threads,
1319 $statistic = array();
1321 $data_types = array();
1324 $query =
"SELECT COUNT(f.pos_display_user_id) ranking, u.login, p.value, u.lastname, u.firstname 1326 INNER JOIN frm_posts_tree t 1327 ON f.pos_pk = t.pos_fk 1328 INNER JOIN frm_threads th 1329 ON t.thr_fk = th.thr_pk 1330 INNER JOIN usr_data u 1331 ON u.usr_id = f.pos_display_user_id 1332 INNER JOIN frm_data d 1333 ON d.top_pk = f.pos_top_fk 1334 LEFT JOIN usr_pref p 1335 ON p.usr_id = u.usr_id AND p.keyword = %s 1336 WHERE 1 = 1 AND t.parent_pos != 0";
1338 array_push($data_types,
'text');
1339 array_push(
$data,
'public_profile');
1341 if (!$is_moderator) {
1342 $query .=
' AND (pos_status = %s 1344 AND pos_author_id = %s ))';
1346 array_push($data_types,
'integer',
'integer',
'integer');
1347 array_push(
$data,
'1',
'0', $this->
user->getId());
1350 $query .=
' AND d.top_frm_fk = %s 1351 GROUP BY pos_display_user_id, u.login, p.value,u.lastname, u.firstname';
1353 array_push($data_types,
'integer');
1359 while ($row = $this->db->fetchAssoc(
$res)) {
1360 $statistic[$counter][] = $row[
'ranking'];
1361 $statistic[$counter][] = $row[
'login'];
1365 if (!$this->
user->isAnonymous() && in_array($row[
'value'], array(
'y',
'g')) ||
1366 $this->
user->isAnonymous() &&
'g' == $row[
'value']) {
1367 $lastname = $row[
'lastname'];
1368 $firstname = $row[
'firstname'];
1371 $statistic[$counter][] = $lastname;
1372 $statistic[$counter][] = $firstname;
1377 return is_array($statistic) ? $statistic : array();
1389 $res = $this->db->queryf(
1391 SELECT * FROM frm_posts_tree 1393 AND parent_pos = %s',
1394 array(
'integer',
'integer'),
1395 array($a_thread_id,
'0')
1398 $row = $this->db->fetchObject(
$res);
1400 return $row->pos_fk ? $row->pos_fk : 0;
1424 $rbacreview = $DIC->rbac()->review();
1426 $role_arr = $rbacreview->getRolesOfRoleFolder($a_ref_id);
1427 foreach ($role_arr as $role_id) {
1429 return $rbacreview->assignedUsers($role_id);
1446 if (!self::$moderators_by_ref_id_map[$a_ref_id]) {
1447 self::$moderators_by_ref_id_map[$a_ref_id] = self::_getModerators($a_ref_id);
1449 return in_array($a_usr_id, self::$moderators_by_ref_id_map[$a_ref_id]);
1461 $res = $this->db->queryf(
1463 SELECT * FROM frm_data 1464 INNER JOIN frm_posts ON pos_top_fk = top_pk 1465 INNER JOIN frm_posts_tree tree1 1466 ON tree1.pos_fk = frm_posts.pos_pk 1467 AND tree1.parent_pos != 0 1468 WHERE top_frm_fk = %s 1469 AND pos_author_id = %s',
1470 array(
'integer',
'integer'),
1474 return $res->numRows();
1479 $res = $this->db->queryf(
1481 SELECT * FROM frm_data 1482 INNER JOIN frm_posts ON pos_top_fk = top_pk 1483 INNER JOIN frm_posts_tree tree1 1484 ON tree1.pos_fk = frm_posts.pos_pk 1485 AND tree1.parent_pos != 0 1486 WHERE top_frm_fk = %s 1487 AND (pos_status = %s 1489 AND pos_author_id = %s 1492 AND pos_author_id = %s',
1493 array(
'integer',
'integer',
'integer',
'integer',
'integer'),
1494 array($this->
getForumId(),
'1',
'0', $this->
user->getId(), $a_user_id)
1497 return $res->numRows();
1518 public function addPostTree($a_tree_id, $a_node_id = -1, $a_date =
'')
1520 $a_date = $a_date ? $a_date : date(
"Y-m-d H:i:s");
1522 if ($a_node_id <= 0) {
1523 $a_node_id = $a_tree_id;
1526 $nextId = $this->db->nextId(
'frm_posts_tree');
1528 $this->db->manipulateF(
1530 INSERT INTO frm_posts_tree 1540 VALUES(%s, %s, %s, %s, %s, %s, %s, %s )',
1541 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'timestamp'),
1542 array($nextId, $a_tree_id, $a_node_id,
'0',
'1',
'2',
'1', $a_date)
1557 $a_date = $a_date ? $a_date : date(
"Y-m-d H:i:s");
1560 $sql_res = $this->db->queryf(
1562 SELECT * FROM frm_posts_tree 1565 array(
'integer',
'integer'),
1566 array($a_parent_id, $tree_id)
1569 $res = $this->db->fetchObject($sql_res);
1577 $this->db->manipulateF(
1579 UPDATE frm_posts_tree 1591 array(
'integer',
'integer',
'integer'),
1592 array($left, $left, $tree_id)
1595 $depth = $this->
getPostDepth($a_parent_id, $tree_id) + 1;
1598 $nextId = $this->db->nextId(
'frm_posts_tree');
1599 $this->db->manipulateF(
1601 INSERT INTO frm_posts_tree 1611 VALUES(%s,%s,%s, %s, %s, %s,%s, %s)',
1612 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'timestamp'),
1634 $sql_res = $this->db->queryf(
1636 SELECT depth FROM frm_posts_tree 1639 array(
'integer',
'integer'),
1640 array($a_node_id, $tree_id)
1643 $res = $this->db->fetchObject($sql_res);
1659 $res = $this->db->queryf(
1661 SELECT * FROM frm_posts, frm_posts_tree 1662 WHERE pos_pk = pos_fk 1665 array(
'integer',
'integer'),
1666 array(
'0', $tree_id)
1669 $row = $this->db->fetchObject(
$res);
1682 $res = $this->db->queryf(
1684 SELECT * FROM frm_posts, frm_posts_tree 1685 WHERE pos_pk = pos_fk 1691 $row = $this->db->fetchObject(
$res);
1705 $tmp_user =
new ilObjUser($a_row->pos_display_user_id);
1706 $fullname = $tmp_user->getFullname();
1707 $loginname = $tmp_user->getLogin();
1710 $fullname = $fullname ? $fullname : ($a_row->import_name ? $a_row->import_name : $this->lng->txt(
"unknown"));
1713 "pos_pk" => $a_row->pos_pk,
1714 'pos_thr_fk' => (
int) $a_row->pos_thr_fk,
1715 "child" => $a_row->pos_pk,
1716 "author" => $a_row->pos_display_user_id,
1717 "alias" => $a_row->pos_usr_alias,
1718 "title" => $fullname,
1719 "loginname" => $loginname,
1721 "message" => $a_row->pos_message,
1722 "subject" => $a_row->pos_subject,
1723 "pos_cens_com" => $a_row->pos_cens_com,
1724 "pos_cens" => $a_row->pos_cens,
1726 "date" => $a_row->fpt_date,
1727 "create_date" => $a_row->pos_date,
1728 "update" => $a_row->pos_update,
1729 "update_user" => $a_row->update_user,
1730 "tree" => $a_row->thr_fk,
1731 "parent" => $a_row->parent_pos,
1732 "lft" => $a_row->lft,
1733 "rgt" => $a_row->rgt,
1734 "depth" => $a_row->depth,
1735 "id" => $a_row->fpt_pk,
1736 "notify" => $a_row->notify,
1737 "import_name" => $a_row->import_name,
1738 "pos_status" => $a_row->pos_status
1753 $res = $this->db->queryf(
1755 SELECT * FROM frm_posts_tree 1758 AND parent_pos = %s',
1759 array(
'integer',
'integer',
'integer'),
1760 array($a_node[
'tree'], $a_node[
'pos_pk'], $a_node[
'parent'])
1763 while ($row = $this->db->fetchObject(
$res)) {
1764 $a_node[
"lft"] = $row->lft;
1765 $a_node[
"rgt"] = $row->rgt;
1768 $diff = $a_node[
"rgt"] - $a_node[
"lft"] + 1;
1773 SELECT * FROM frm_posts_tree 1774 WHERE lft BETWEEN %s AND %s 1776 array(
'integer',
'integer',
'integer'),
1777 array($a_node[
'lft'], $a_node[
'rgt'], $a_node[
'tree'])
1782 while ($treeData = $this->db->fetchAssoc(
$result)) {
1783 $del_id[] = $treeData[
"pos_fk"];
1787 $this->db->manipulateF(
1789 DELETE FROM frm_posts_tree 1790 WHERE lft BETWEEN %s AND %s 1792 array(
'integer',
'integer',
'integer'),
1793 array($a_node[
'lft'], $a_node[
'rgt'], $a_node[
'tree'])
1797 $this->db->manipulateF(
1799 UPDATE frm_posts_tree 1811 array(
'integer',
'integer',
'integer',
'integer',
'integer'),
1812 array($a_node[
'lft'], $diff, $a_node[
'lft'], $diff, $a_node[
'tree'])
1825 $checkTime = time() - (60 * 60);
1827 if (
$_SESSION[
"frm_visit_" . $this->dbTable .
"_" . $ID] < $checkTime) {
1828 $_SESSION[
"frm_visit_" . $this->dbTable .
"_" . $ID] = time();
1829 $query =
'UPDATE ' . $this->dbTable .
' SET visits = visits + 1 WHERE ';
1831 $data_type = array();
1832 $data_value = array();
1839 $res = $this->db->queryf(
$query, $data_type, $data_value);
1853 if (
$type ==
'export') {
1854 $this->replQuote1 =
"<blockquote class=\"quote\"><hr size=\"1\" color=\"#000000\">";
1855 $this->replQuote2 =
"<hr size=\"1\" color=\"#000000\"/></blockquote>";
1860 $lname = ($quote_user !=
"")
1861 ?
'="' . $quote_user .
'"' 1864 $text =
"[quote$lname]" . $text .
"[/quote]";
1867 $startZ = substr_count($text,
"[quote");
1868 $endZ = substr_count($text,
"[/quote]");
1870 if ($startZ > 0 || $endZ > 0) {
1872 if ($startZ > $endZ) {
1873 $diff = $startZ - $endZ;
1875 for (
$i = 0;
$i < $diff;
$i++) {
1876 if (
$type ==
'export') {
1879 $text .=
"[/quote]";
1882 } elseif ($startZ < $endZ) {
1883 $diff = $endZ - $startZ;
1885 for (
$i = 0;
$i < $diff;
$i++) {
1886 if (
$type ==
'export') {
1887 $text = $this->txtQuote1 . $text;
1889 $text =
"[quote]" . $text;
1895 $text = preg_replace(
1896 '@\[(quote\s*?=\s*?"([^"]*?)"\s*?)\]@i',
1897 $this->replQuote1 .
'<div class="ilForumQuoteHead">' . $this->lng->txt(
'quote') .
' ($2)</div>',
1901 $text = str_replace(
1903 $this->replQuote1 .
'<div class="ilForumQuoteHead">' . $this->lng->txt(
"quote") .
'</div>',
1907 $text = str_replace(
"[/quote]", $this->replQuote2, $text);
1912 if (
$type !=
'export') {
1921 $text = str_replace(
"{",
"{", $text);
1922 $text = str_replace(
"}",
"}", $text);
1930 if (!is_array($a_ids)) {
1935 foreach ($a_ids as $pos_id) {
1936 $tmp_file_obj->setPosId($pos_id);
1937 $files = $tmp_file_obj->getFilesOfPost();
1938 foreach ($files as $file) {
1939 $tmp_file_obj->unlinkFile($file[
"name"]);
1942 unset($tmp_file_obj);
1948 return $this->import_name;
1952 $this->import_name = $a_import_name;
1966 $res = $this->db->queryf(
1968 SELECT frm_notification.thread_id FROM frm_data, frm_notification, frm_threads 1969 WHERE frm_notification.user_id = %s 1970 AND frm_notification.thread_id = frm_threads.thr_pk 1971 AND frm_threads.thr_top_fk = frm_data.top_pk 1972 AND frm_data.top_frm_fk = %s 1973 GROUP BY frm_notification.thread_id',
1974 array(
'integer',
'integer'),
1975 array($user_id, $this->
id)
1978 if (is_object(
$res) &&
$res->numRows() > 0) {
1979 $thread_data = array();
1980 $thread_data_types = array();
1982 $query =
' DELETE FROM frm_notification 1984 AND thread_id IN (';
1986 array_push($thread_data, $user_id);
1987 array_push($thread_data_types,
'integer');
1991 while ($row = $this->db->fetchAssoc(
$res)) {
1992 if ($counter < $res->numRows()) {
1994 array_push($thread_data, $row[
'thread_id']);
1995 array_push($thread_data_types,
'integer');
1998 if ($counter ==
$res->numRows()) {
2000 array_push($thread_data, $row[
'thread_id']);
2001 array_push($thread_data_types,
'integer');
2006 $this->db->manipulateF(
$query, $thread_data_types, $thread_data);
2011 $nextId = $this->db->nextId(
'frm_notification');
2013 $this->db->manipulateF(
2015 INSERT INTO frm_notification 2020 VALUES(%s, %s, %s)',
2021 array(
'integer',
'integer',
'integer'),
2022 array($nextId, $user_id, $this->
id)
2036 $this->db->manipulateF(
2038 DELETE FROM frm_notification 2041 array(
'integer',
'integer'),
2042 array($user_id, $this->
id)
2056 'SELECT COUNT(*) cnt FROM frm_notification WHERE user_id = %s AND frm_id = %s',
2057 array(
'integer',
'integer'),
2058 array($user_id, $this->
id)
2061 while ($record = $this->db->fetchAssoc(
$result)) {
2062 return (
bool) $record[
'cnt'];
2081 $nextId = $this->db->nextId(
'frm_notification');
2082 $this->db->manipulateF(
2084 INSERT INTO frm_notification 2089 VALUES (%s, %s, %s)',
2090 array(
'integer',
'integer',
'integer'),
2091 array($nextId, $user_id, $thread_id)
2108 SELECT COUNT(*) cnt FROM frm_notification 2110 AND thread_id = %s',
2111 array(
'integer',
'integer'),
2112 array($user_id, $thread_id)
2116 while ($record = $this->db->fetchAssoc(
$result)) {
2117 return (
bool) $record[
'cnt'];
2129 public static function _getThreads($a_obj_id, $a_sort_mode = self::SORT_DATE)
2132 $ilDB = $DIC->database();
2134 switch ($a_sort_mode) {
2135 case self::SORT_DATE:
2139 case self::SORT_TITLE:
2141 $sort =
'thr_subject';
2147 SELECT * FROM frm_threads 2148 JOIN frm_data ON top_pk = thr_top_fk 2149 WHERE top_frm_fk = %s 2151 array(
'integer',
'text'),
2152 array($a_obj_id, $sort)
2155 while ($row =
$ilDB->fetchObject(
$res)) {
2156 $threads[$row->thr_pk] = $row->thr_subject;
2158 return $threads ? $threads : array();
2164 $ilDB = $DIC->database();
2168 SELECT top_frm_fk FROM frm_data 2175 return $fdata[
"top_frm_fk"];
2183 $ilDB = $DIC->database();
2186 $res2 =
$ilDB->queryf(
2188 SELECT pos_top_fk, pos_thr_fk, pos_pk FROM frm_posts, frm_data 2189 WHERE pos_top_fk = top_pk 2191 ORDER BY pos_date DESC',
2196 if ($res2->numRows() == 0) {
2201 while ($selData =
$ilDB->fetchAssoc($res2)) {
2206 $lastPost_top = $selData[
"pos_top_fk"] .
"#" . $selData[
"pos_thr_fk"] .
"#" . $selData[
"pos_pk"];
2213 array(
'top_last_post' => array(
'text', $lastPost_top)),
2214 array(
'top_frm_fk' => array(
'integer', $a_obj_id))
2226 $sourceThread = new \ilForumTopic((
int) $source_id);
2227 $targetThread = new \ilForumTopic((
int)
$target_id);
2229 if ($sourceThread->getForumId() != $targetThread->getForumId()) {
2230 throw new \ilException(
'not_allowed_to_merge_into_another_forum');
2234 if ($sourceThread->getCreateDate() > $targetThread->getCreateDate()) {
2235 $sourceThreadForMerge = $sourceThread;
2236 $targetThreadForMerge = $targetThread;
2238 $sourceThreadForMerge = $targetThread;
2239 $targetThreadForMerge = $sourceThread;
2242 $threadSubject = $targetThreadForMerge->getSubject();
2244 $targetWasClosedBeforeMerge = (bool) $targetThreadForMerge->isClosed();
2245 $sourceThreadForMerge->close();
2247 if (
false === $targetWasClosedBeforeMerge) {
2248 $targetThreadForMerge->close();
2251 $allSourcePostings = $sourceThreadForMerge->getAllPosts();
2252 $sourceThreadRootNode = $sourceThreadForMerge->getFirstPostNode();
2253 $targetThreadRootNode = $targetThreadForMerge->getFirstPostNode();
2255 $sourceThreadRootArray = $this->
getPostNode($sourceThreadRootNode->getId());
2257 $ilAtomQuery = $this->db->buildAtomQuery();
2258 $ilAtomQuery->addTableLock(
'frm_posts');
2259 $ilAtomQuery->addTableLock(
'frm_posts_tree');
2260 $ilAtomQuery->addTableLock(
'frm_threads');
2261 $ilAtomQuery->addTableLock(
'frm_data');
2264 $targetThreadForMerge,
2265 $sourceThreadForMerge,
2266 $targetThreadRootNode,
2267 $sourceThreadRootNode,
2270 $targetRootNodeRgt = $targetThreadRootNode->getRgt();
2271 $targetRootNodeId = $targetThreadRootNode->getId();
2275 $targetThreadRootNode->getId(),
2276 ($targetThreadRootNode->getRgt() + $sourceThreadRootNode->getRgt() - 2)
2280 foreach ($allSourcePostings as $post) {
2283 if ((
int) $post_obj->getId() === (int) $sourceThreadRootNode->getId()) {
2288 $tree = new \ilForumPostsTree();
2289 $tree->setPosFk($post->pos_pk);
2291 if ((
int) $post_obj->getParentId() === (int) $sourceThreadRootNode->getId()) {
2292 $tree->setParentPos($targetRootNodeId);
2294 $tree->setParentPos($post_obj->getParentId());
2297 $tree->setLft(($post_obj->getLft() + $targetRootNodeRgt) - 2);
2298 $tree->setRgt(($post_obj->getRgt() + $targetRootNodeRgt) - 2);
2300 $tree->setDepth($post_obj->getDepth());
2301 $tree->setTargetThreadId($targetThreadForMerge->getId());
2302 $tree->setSourceThreadId($sourceThreadForMerge->getId());
2309 (
int) $sourceThreadForMerge->getId(),
2310 (int) $targetThreadForMerge->getId(),
2311 [(int) $sourceThreadRootNode->getId(),]
2314 $ilAtomQuery->run();
2326 $lastPostString = $targetThreadForMerge->getLastPostString();
2327 $exp = explode(
'#', $lastPostString);
2328 if (array_key_exists(2, $exp)) {
2329 $exp[2] = $targetThreadForMerge->getLastPost()->getId();
2330 $lastPostString = implode(
'#', $exp);
2333 $frm_topic_obj = new \ilForumTopic(0,
false,
true);
2334 $frm_topic_obj->setNumPosts((
int) $sourceThreadForMerge->getNumPosts() + (int) $targetThreadForMerge->getNumPosts());
2335 $frm_topic_obj->setVisits((
int) $sourceThreadForMerge->getVisits() + (int) $targetThreadForMerge->getVisits());
2336 $frm_topic_obj->setLastPostString($lastPostString);
2337 $frm_topic_obj->setSubject($threadSubject);
2338 $frm_topic_obj->setId($targetThreadForMerge->getId());
2339 $frm_topic_obj->updateMergedThread();
2341 if (!$targetWasClosedBeforeMerge) {
2342 $targetThreadForMerge->reopen();
2346 $GLOBALS[
'ilAppEventHandler']->raise(
2350 'source_thread_id' => $sourceThreadForMerge->getId(),
2351 'target_thread_id' => $targetThreadForMerge->getId()
2355 $this->
deletePost($sourceThreadRootArray,
false);
getAllThreads($a_topic_id, array $params=array(), $limit=0, $offset=0)
insert()
Inserts the object data into database.
static _isModerator($a_ref_id, $a_usr_id)
checks whether a user is moderator of a given forum object
static mergeForumUserRead($merge_source_thread_id, $merge_target_thread_id)
setForumId($a_obj_id)
set object id which refers to ILIAS obj_id
static _lookupObjIdForForumId($a_for_id)
Class Forum core functions for forum.
getOnePost($post)
get one post-dataset
deletePost($postIdOrArray, $raiseEvents=true)
Delete post and sub-posts.
static _lookupPostMessage($a_id)
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
countUserArticles($a_user_id)
get number of articles from given user-ID
getForumRefId()
get forum ref_id public
disableForumNotification($user_id)
Disable a user's notification about new posts in this forum.
postCensorship($message, $pos_pk, $cens=0)
update dataset in frm_posts with censorship info
getMDB2DataType()
get content of additional condition
getPostDepth($a_node_id, $tree_id)
Return depth of an object private.
insertPostNode($a_node_id, $a_parent_id, $tree_id, $a_date='')
insert node under parent node public
static mergePosts(int $sourceThreadId, int $targetThreadId, array $excludedPostIds=[])
static _lookupTitle($a_id)
lookup object title
static updateTargetRootRgt($root_node_id, $rgt)
getFirstPostByThread($a_thread_id)
Get first post of thread.
mergeThreads($source_id, $target_id)
updateVisits($ID)
update page hits of given forum- or thread-ID public
getUserStatistic($is_moderator=false)
getFirstPostNode($tree_id)
get data of the first node from frm_posts_tree and frm_posts public
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
fetchPostNodeData($a_row)
get data of parent node from frm_posts_tree and frm_posts private
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
enableForumNotification($user_id)
Enable a user's notification about new posts in this forum.
static mergeThreadNotificiations($merge_source_thread_id, $merge_target_thread_id)
Class ilForumDraftHistory.
setCreateDate($a_createdate)
static _lookupObjectId($a_ref_id)
lookup object id
setImportName($a_import_name)
setDbTable($dbTable)
set database table
static _deleteReadEntries($a_post_id)
__deletePostFiles($a_ids)
static getInstance($a_obj_id=0)
generatePost($forum_id, $thread_id, $author_id, $display_user_id, $message, $parent_pos, $notify, $subject='', $alias='', $date='', $status=1, $send_activation_mail=0)
generate new dataset in frm_posts
setMDB2WhereCondition($query_string, $data_type, $data_value)
set content for additional condition
foreach($_POST as $key=> $value) $res
getOneThread()
get one thread-dataset by WhereCondition
prepareText($text, $edit=0, $quote_user='', $type='')
prepares given string public
generateThread(ilForumTopic $thread, $message, $notify, $notify_posts, $status=1, bool $withFirstVisibleEntry=true)
enableThreadNotification($user_id, $thread_id)
no usage? ..delete .
static updateLastPostByObjId($a_obj_id)
getOrderField()
get name of orderField
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
getModerators()
get all users assigned to local role il_frm_moderator_<frm_ref_id>
deletePostTree($a_node)
delete node and the whole subtree under this node public
getForumId()
get forum id public
isForumNotificationEnabled($user_id)
Check whether a user's notification about new posts in this forum is enabled (result > 0) or not (res...
convertDate($date)
converts the date format
static _getThreads($a_obj_id, $a_sort_mode=self::SORT_DATE)
Get thread infos of object.
getOneTopic()
get one topic-dataset by WhereCondition
countActiveUserArticles($a_user_id)
getMDB2Query()
get content of additional condition
addPostTree($a_tree_id, $a_node_id=-1, $a_date='')
create a new post-tree
static _deleteAccessEntries($a_thread_id)
isThreadNotificationEnabled($user_id, $thread_id)
Check whether a user's notification about new posts in a thread is enabled (result > 0) or not (resul...
const FORUM_OVERVIEW_WITH_NEW_POSTS
static getFirstNewsIdForContext( $a_context_obj_id, $a_context_obj_type, $a_context_sub_obj_id="", $a_context_sub_obj_type="")
Get first new id of news set related to a certain context.
moveThreads($thread_ids=array(), $src_ref_id=0, $dest_top_frm_fk=0)
Moves all chosen threads and their posts to a new forum.
static _lookupLanguage($a_usr_id)
static getInstance()
Singleton: get instance.
This class handles all operations on files for the forum object.
static $moderators_by_ref_id_map
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
getDbTable()
get name of database table
static _getModerators($a_ref_id)
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static)
static _getLanguageInstanceByUsrId($usr_id)
Get the ilLanguage instance for the passed user id.
getMDB2DataValue()
get content of additional condition
getPageHits()
get number of max.
enableNotification($a_user_id)
Enable a user's notification about new posts in a thread.
setForumRefId($a_ref_id)
set reference id which refers to ILIAS obj_id
setImportName($a_import_name)
setOrderField($orderField)
set database field for sorting results
Class to report exception.
__construct()
Constructor public.
getPostNode($post_id)
get data of given node from frm_posts_tree and frm_posts public