ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilForumPost Class Reference
+ Collaboration diagram for ilForumPost:

Public Member Functions

 __construct ($a_id=0, $a_is_moderator=false, $preventImplicitRead=false)
 ilForumPost constructor. More...
 
 __destruct ()
 
 insert ()
 
 update ()
 
 isAnyParentDeactivated ()
 
 reload ()
 
 setFullname ($a_fullname)
 
 getFullname ()
 
 setLoginName ($a_loginname)
 
 getLoginName ()
 
 activatePost ()
 
 activatePostAndChildPosts ()
 
 activateParentPosts ()
 
 isPostRead ()
 
 isRead ($a_user_id=0)
 
 hasReplies ()
 
 isOwner ($a_user_id=0)
 
 setId ($a_id)
 
 getId ()
 
 setForumId ($a_forum_id)
 
 getForumId ()
 
 setThreadId ($a_thread_id)
 
 getThreadId ()
 
 setDisplayUserId ($a_user_id)
 
 getDisplayUserId ()
 
 setUserAlias ($a_user_alias)
 
 getUserAlias ()
 
 setSubject ($a_subject)
 
 getSubject ()
 
 setMessage ($a_message)
 
 getMessage ()
 
 setCreateDate ($a_createdate)
 
 getCreateDate ()
 
 setChangeDate ($a_changedate)
 
 getChangeDate ()
 
 setUpdateUserId ($a_user_id_update)
 
 getUpdateUserId ()
 
 setCensorship ($a_censorship)
 
 isCensored ()
 
 setCensorshipComment ($a_comment)
 
 getCensorshipComment ()
 
 setNotification ($a_notification)
 
 isNotificationEnabled ()
 
 setImportName ($a_import_name)
 
 getImportName ()
 
 setStatus ($a_status)
 
 isActivated ()
 
 setTreeId ($a_tree_id)
 
 getTreeId ()
 
 setParentId ($a_parent_id)
 
 setIsRead ($a_is_read)
 
 getIsRead ()
 
 getParentId ()
 
 setLft ($a_lft)
 
 getLft ()
 
 setRgt ($a_rgt)
 
 getRgt ()
 
 setDepth ($a_depth)
 
 getDepth ()
 
 setThread (ilForumTopic $thread)
 
 getThread ()
 
 setPosAuthorId ($pos_author_id)
 
 getPosAuthorId ()
 
 getIsAuthorModerator ()
 
 setIsAuthorModerator ($is_author_moderator)
 
 getCensoredDate ()
 
 getPostActivationDate ()
 
 setPostActivationDate ($post_activation_date)
 
 setCensoredDate ($censored_date)
 
 assignData ($row)
 

Static Public Member Functions

static mergePosts ($source_thread_id, $target_thread_id)
 

Protected Member Functions

 buildUserRelatedData ($row)
 

Private Member Functions

 read ()
 
 getUserData ()
 

Private Attributes

 $id = 0
 
 $forum_id = 0
 
 $thread_id = 0
 
 $display_user_id = 0
 
 $user_alias = ''
 
 $subject = ''
 
 $message = ''
 
 $createdate = '0000-00-00 00:00:00'
 
 $changedate = '0000-00-00 00:00:00'
 
 $user_id_update = 0
 
 $censored = 0
 
 $censorship_comment = ''
 
 $censored_date = '0000-00-00 00:00:00'
 
 $notification = 0
 
 $import_name = ''
 
 $status = 1
 
 $tree_id = 0
 
 $parent_id = 0
 
 $lft = 0
 
 $rgt = 0
 
 $depth = 0
 
 $fullname = ''
 
 $loginname = ''
 
 $objThread = null
 
 $db = null
 
 $is_moderator = false
 
 $is_author_moderator = null
 
 $post_read = false
 
 $pos_author_id = 0
 
 $post_activation_date = null
 

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 12 of file class.ilForumPost.php.

Constructor & Destructor Documentation

◆ __construct()

ilForumPost::__construct (   $a_id = 0,
  $a_is_moderator = false,
  $preventImplicitRead = false 
)

ilForumPost constructor.

Parameters
int$a_id
bool$a_is_moderator
bool$preventImplicitRead

Definition at line 91 of file class.ilForumPost.php.

References $ilDB, and read().

92  {
93  global $ilDB;
94 
95  $this->db = $ilDB;
96  $this->id = $a_id;
97 
98  if( !$preventImplicitRead )
99  {
100  $this->read();
101  }
102  }
global $ilDB
+ Here is the call graph for this function:

◆ __destruct()

ilForumPost::__destruct ( )

Definition at line 104 of file class.ilForumPost.php.

105  {
106  unset($this->db);
107  unset($this->objThread);
108  }

Member Function Documentation

◆ activateParentPosts()

ilForumPost::activateParentPosts ( )

Definition at line 368 of file class.ilForumPost.php.

References $query, $result, $row, array, and date.

Referenced by activatePost(), and activatePostAndChildPosts().

369  {
370  if ($this->id)
371  {
372  $query = "SELECT pos_pk FROM frm_posts "
373  . "INNER JOIN frm_posts_tree ON pos_fk = pos_pk "
374  . "WHERE lft < %s AND rgt > %s AND thr_fk = %s";
375  $result = $this->db->queryF(
376  $query,
377  array('integer', 'integer', 'integer'),
378  array($this->lft, $this->rgt, $this->thread_id)
379  );
380 
381  $now = date("Y-m-d H:i:s");
382  while($row = $this->db->fetchAssoc($result))
383  {
384  $this->db->update('frm_posts',
385  array('pos_status' => array('integer', 1),
386  'pos_activation_date' => array('timestamp', $now)),
387  array('pos_pk' => array('integer', $row['pos_pk']))
388  );
389  }
390 
391  return true;
392  }
393 
394  return false;
395  }
$result
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ activatePost()

ilForumPost::activatePost ( )

Definition at line 315 of file class.ilForumPost.php.

References activateParentPosts(), array, date, setPostActivationDate(), and setStatus().

316  {
317  if ($this->id)
318  {
319  $now = date("Y-m-d H:i:s");
320  $this->db->update('frm_posts',
321  array('pos_status' => array('integer', 1),
322  'pos_activation_date' => array('timestamp', $now)),
323  array('pos_pk' => array('integer', $this->id))
324  );
325 
326  $this->activateParentPosts();
327  $this->setPostActivationDate($now);
328  $this->setStatus(1);
329  return true;
330  }
331 
332  return false;
333  }
setPostActivationDate($post_activation_date)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
setStatus($a_status)
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ activatePostAndChildPosts()

ilForumPost::activatePostAndChildPosts ( )

Definition at line 335 of file class.ilForumPost.php.

References $query, $result, $row, activateParentPosts(), array, and date.

336  {
337  if ($this->id)
338  {
339  $query = "SELECT pos_pk FROM frm_posts_tree treea "
340  . "INNER JOIN frm_posts_tree treeb ON treeb.thr_fk = treea.thr_fk "
341  . "AND treeb.lft BETWEEN treea.lft AND treea.rgt "
342  . "INNER JOIN frm_posts ON pos_pk = treeb.pos_fk "
343  . "WHERE treea.pos_fk = %s";
344  $result = $this->db->queryF(
345  $query,
346  array('integer'),
347  array($this->id)
348  );
349 
350  $now = date("Y-m-d H:i:s");
351  while($row = $this->db->fetchAssoc($result))
352  {
353  $this->db->update('frm_posts',
354  array('pos_status' => array('integer', 1),
355  'pos_activation_date' => array('timestamp', $now)),
356  array('pos_pk' => array('integer', $row['pos_pk']))
357  );
358  }
359 
360  $this->activateParentPosts();
361 
362  return true;
363  }
364 
365  return false;
366  }
$result
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ assignData()

ilForumPost::assignData (   $row)
Parameters
$row

Definition at line 696 of file class.ilForumPost.php.

References $row, buildUserRelatedData(), setCensoredDate(), setCensorship(), setCensorshipComment(), setChangeDate(), setCreateDate(), setDepth(), setDisplayUserId(), setForumId(), setImportName(), setIsAuthorModerator(), setIsRead(), setLft(), setMessage(), setNotification(), setParentId(), setPosAuthorId(), setRgt(), setStatus(), setSubject(), setThreadId(), setTreeId(), setUpdateUserId(), and setUserAlias().

697  {
698  $this->setUserAlias($row['pos_usr_alias']);
699  $this->setSubject($row['pos_subject']);
700  $this->setCreateDate($row['pos_date']);
701  $this->setMessage($row['pos_message']);
702  $this->setForumId($row['pos_top_fk']);
703  $this->setThreadId($row['pos_thr_fk']);
704  $this->setChangeDate($row['pos_update']);
705  $this->setUpdateUserId($row['update_user']);
706  $this->setCensorship($row['pos_cens']);
707  $this->setCensoredDate($row['pos_cens_date']);
708  $this->setCensorshipComment($row['pos_cens_com']);
709  $this->setNotification($row['notify']);
710  $this->setImportName($row['import_name']);
711  $this->setStatus($row['pos_status']);
712  $this->setTreeId($row['fpt_pk']);
713  $this->setParentId($row['parent_pos']);
714  $this->setLft($row['lft']);
715  $this->setRgt($row['rgt']);
716  $this->setDepth($row['depth']);
717  $this->setIsRead($row['post_read']);
718  $this->setDisplayUserId($row['pos_display_user_id']);
719  $this->setPosAuthorId($row['pos_author_id']);
720  $this->setIsAuthorModerator($row['is_author_moderator']);
721  $this->buildUserRelatedData($row);
722  }
setCreateDate($a_createdate)
setNotification($a_notification)
setTreeId($a_tree_id)
buildUserRelatedData($row)
setUserAlias($a_user_alias)
setDepth($a_depth)
setImportName($a_import_name)
setForumId($a_forum_id)
setIsAuthorModerator($is_author_moderator)
setThreadId($a_thread_id)
setCensorshipComment($a_comment)
setParentId($a_parent_id)
setDisplayUserId($a_user_id)
setStatus($a_status)
setCensorship($a_censorship)
setPosAuthorId($pos_author_id)
setMessage($a_message)
setSubject($a_subject)
setUpdateUserId($a_user_id_update)
setChangeDate($a_changedate)
setCensoredDate($censored_date)
setIsRead($a_is_read)
+ Here is the call graph for this function:

◆ buildUserRelatedData()

ilForumPost::buildUserRelatedData (   $row)
protected

Definition at line 251 of file class.ilForumPost.php.

References $lng, and $row.

Referenced by assignData().

252  {
253  global $lng;
254 
255  if ($row['pos_display_user_id'] && $row['pos_pk'])
256  {
257  require_once 'Services/User/classes/class.ilObjUser.php';
258  $tmp_user = new ilObjUser();
259  $tmp_user->setFirstname($row['firstname']);
260  $tmp_user->setLastname($row['lastname']);
261  $tmp_user->setUTitle($row['title']);
262  $tmp_user->setLogin($row['login']);
263 
264  $this->fullname = $tmp_user->getFullname();
265  $this->loginname = $tmp_user->getLogin();
266 
267  $this->fullname = $this->fullname ? $this->fullname : ($this->import_name ? $this->import_name : $lng->txt('unknown'));
268  }
269  }
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getCensoredDate()

ilForumPost::getCensoredDate ( )
Returns
string

Definition at line 664 of file class.ilForumPost.php.

References $censored_date.

665  {
666  return $this->censored_date;
667  }

◆ getCensorshipComment()

ilForumPost::getCensorshipComment ( )

Definition at line 542 of file class.ilForumPost.php.

References $censorship_comment.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

543  {
545  }
+ Here is the caller graph for this function:

◆ getChangeDate()

ilForumPost::getChangeDate ( )

Definition at line 518 of file class.ilForumPost.php.

References $changedate.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

519  {
520  return $this->changedate;
521  }
+ Here is the caller graph for this function:

◆ getCreateDate()

ilForumPost::getCreateDate ( )

Definition at line 510 of file class.ilForumPost.php.

References $createdate.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

511  {
512  return $this->createdate;
513  }
+ Here is the caller graph for this function:

◆ getDepth()

ilForumPost::getDepth ( )

Definition at line 617 of file class.ilForumPost.php.

References $depth.

618  {
619  return $this->depth;
620  }

◆ getDisplayUserId()

ilForumPost::getDisplayUserId ( )

Definition at line 478 of file class.ilForumPost.php.

References $display_user_id.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

479  {
480  return $this->display_user_id;
481  }
+ Here is the caller graph for this function:

◆ getForumId()

ilForumPost::getForumId ( )

Definition at line 462 of file class.ilForumPost.php.

References $forum_id.

Referenced by ilObjForumGUI\autosaveThreadDraftAsyncObject().

463  {
464  return $this->forum_id;
465  }
+ Here is the caller graph for this function:

◆ getFullname()

ilForumPost::getFullname ( )

Definition at line 302 of file class.ilForumPost.php.

References $fullname.

303  {
304  return $this->fullname;
305  }

◆ getId()

ilForumPost::getId ( )

Definition at line 454 of file class.ilForumPost.php.

References $id.

Referenced by ilObjForumGUI\autosaveThreadDraftAsyncObject(), ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

455  {
456  return $this->id;
457  }
+ Here is the caller graph for this function:

◆ getImportName()

ilForumPost::getImportName ( )

Definition at line 558 of file class.ilForumPost.php.

References $import_name.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

559  {
560  return $this->import_name;
561  }
+ Here is the caller graph for this function:

◆ getIsAuthorModerator()

ilForumPost::getIsAuthorModerator ( )
Returns
int|null

Definition at line 648 of file class.ilForumPost.php.

References $is_author_moderator.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

649  {
651  }
+ Here is the caller graph for this function:

◆ getIsRead()

ilForumPost::getIsRead ( )

Definition at line 588 of file class.ilForumPost.php.

References $post_read.

Referenced by isPostRead().

589  {
590  return $this->post_read;
591  }
+ Here is the caller graph for this function:

◆ getLft()

ilForumPost::getLft ( )

Definition at line 601 of file class.ilForumPost.php.

References $lft.

Referenced by ilForumTopic\getPostTree().

602  {
603  return $this->lft;
604  }
+ Here is the caller graph for this function:

◆ getLoginName()

ilForumPost::getLoginName ( )

Definition at line 310 of file class.ilForumPost.php.

References $loginname.

311  {
312  return $this->loginname;
313  }

◆ getMessage()

ilForumPost::getMessage ( )

Definition at line 502 of file class.ilForumPost.php.

References $message.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

503  {
504  return $this->message;
505  }
+ Here is the caller graph for this function:

◆ getParentId()

ilForumPost::getParentId ( )

Definition at line 593 of file class.ilForumPost.php.

References $parent_id.

594  {
595  return $this->parent_id;
596  }

◆ getPosAuthorId()

ilForumPost::getPosAuthorId ( )
Returns
int

Definition at line 641 of file class.ilForumPost.php.

References $pos_author_id.

Referenced by ilForumExportGUI\executeCommand(), ilObjForumNotificationDataProvider\getPostAnsweredRecipients(), and ilObjForumGUI\getSubTabs().

642  {
643  return $this->pos_author_id;
644  }
+ Here is the caller graph for this function:

◆ getPostActivationDate()

ilForumPost::getPostActivationDate ( )
Returns
string

Definition at line 672 of file class.ilForumPost.php.

References $post_activation_date.

673  {
675  }

◆ getRgt()

ilForumPost::getRgt ( )

Definition at line 609 of file class.ilForumPost.php.

References $rgt.

Referenced by ilForumTopic\getPostTree().

610  {
611  return $this->rgt;
612  }
+ Here is the caller graph for this function:

◆ getSubject()

ilForumPost::getSubject ( )

Definition at line 494 of file class.ilForumPost.php.

References $subject.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

495  {
496  return $this->subject;
497  }
+ Here is the caller graph for this function:

◆ getThread()

ilForumPost::getThread ( )

Definition at line 625 of file class.ilForumPost.php.

References $objThread.

626  {
627  return $this->objThread;
628  }

◆ getThreadId()

ilForumPost::getThreadId ( )

Definition at line 470 of file class.ilForumPost.php.

References $thread_id.

Referenced by ilObjForumGUI\autosaveThreadDraftAsyncObject(), ilForumTopic\getPostTree(), and ilObjForumGUI\getSubTabs().

471  {
472  return $this->thread_id;
473  }
+ Here is the caller graph for this function:

◆ getTreeId()

ilForumPost::getTreeId ( )

Definition at line 574 of file class.ilForumPost.php.

References $tree_id.

575  {
576  return $this->tree_id;
577  }

◆ getUpdateUserId()

ilForumPost::getUpdateUserId ( )

Definition at line 526 of file class.ilForumPost.php.

References $user_id_update.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

527  {
528  return $this->user_id_update;
529  }
+ Here is the caller graph for this function:

◆ getUserAlias()

ilForumPost::getUserAlias ( )

Definition at line 486 of file class.ilForumPost.php.

References $user_alias.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

487  {
488  return $this->user_alias;
489  }
+ Here is the caller graph for this function:

◆ getUserData()

ilForumPost::getUserData ( )
private

Definition at line 271 of file class.ilForumPost.php.

References $lng, and ilObjForumAccess\getCachedUserInstance().

Referenced by read().

272  {
273  global $lng;
274 
275  if ($this->id && $this->display_user_id)
276  {
277  require_once("Modules/Forum/classes/class.ilObjForumAccess.php");
278  if(($tmp_user = ilObjForumAccess::getCachedUserInstance($this->display_user_id)))
279  {
280  $this->fullname = $tmp_user->getFullname();
281  $this->loginname = $tmp_user->getLogin();
282  unset($tmp_user);
283  }
284 
285  $this->fullname = $this->fullname ? $this->fullname : ($this->import_name ? $this->import_name : $lng->txt('unknown'));
286 
287  return true;
288  }
289 
290  return false;
291  }
static getCachedUserInstance($usr_id)
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasReplies()

ilForumPost::hasReplies ( )

Definition at line 420 of file class.ilForumPost.php.

References $res, and array.

Referenced by ilObjForumGUI\autosaveThreadDraftAsyncObject().

421  {
422  if ($this->id && $this->rgt && $this->lft)
423  {
424  $res = $this->db->queryF('
425  SELECT * FROM frm_posts_tree
426  WHERE lft > %s AND rgt < %s
427  AND thr_fk = %s',
428  array('integer', 'integer', 'integer'),
429  array($this->lft, $this->rgt, $this->thread_id));
430 
431  return $res->numRows() ? true : false;
432  }
433 
434  return false;
435  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ insert()

ilForumPost::insert ( )

Definition at line 110 of file class.ilForumPost.php.

References $ilDB, array, and notification().

111  {
112  global $ilDB;
113 
114  if ($this->forum_id && $this->thread_id)
115  {
116  $this->id = $this->db->nextId('frm_posts');
117 
118  $ilDB->insert('frm_posts', array(
119  'pos_pk' => array('integer', $this->id),
120  'pos_top_fk' => array('integer', $this->forum_id),
121  'pos_thr_fk' => array('integer', $this->thread_id),
122  'pos_display_user_id' => array('integer', $this->display_user_id),
123  'pos_usr_alias' => array('text', $this->user_alias),
124  'pos_subject' => array('text', $this->subject),
125  'pos_message' => array('clob', $this->message),
126  'pos_date' => array('timestamp', $this->createdate),
127  'pos_update' => array('timestamp', $this->createdate),
128  'update_user' => array('integer', $this->user_id_update),
129  'pos_cens' => array('integer', $this->censored),
130  'notify' => array('integer', (int)$this->notification),
131  'import_name' => array('text', (string)$this->import_name),
132  'pos_status' => array('integer', (int)$this->status),
133  'pos_author_id' => array('integer', (int)$this->pos_author_id),
134  'is_author_moderator' => array('integer', $this->is_author_moderator),
135  'pos_activation_date' => array('timestamp', $this->createdate)
136  ));
137 
138  return true;
139  }
140 
141  return false;
142  }
notification()
Definition: notification.php:2
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ isActivated()

ilForumPost::isActivated ( )

Definition at line 566 of file class.ilForumPost.php.

Referenced by ilObjForumGUI\autosaveThreadDraftAsyncObject(), ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

567  {
568  return $this->status == 1 ? true : false;
569  }
+ Here is the caller graph for this function:

◆ isAnyParentDeactivated()

ilForumPost::isAnyParentDeactivated ( )

Definition at line 232 of file class.ilForumPost.php.

References $res, and array.

233  {
234  if ($this->id)
235  {
236  $res = $this->db->queryF('
237  SELECT * FROM frm_posts_tree
238  INNER JOIN frm_posts ON pos_pk = pos_fk
239  WHERE pos_status = %s
240  AND lft < %s AND rgt > %s
241  AND thr_fk = %s',
242  array('integer', 'integer', 'integer', 'integer'),
243  array('0', $this->lft, $this->rgt, $this->thread_id));
244 
245  return $res->numRows();
246  }
247 
248  return false;
249  }
Create styles array
The data for the language used.

◆ isCensored()

ilForumPost::isCensored ( )

Definition at line 534 of file class.ilForumPost.php.

Referenced by ilObjForumGUI\autosaveThreadDraftAsyncObject(), ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

535  {
536  return $this->censored == 1 ? true : false;
537  }
+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilForumPost::isNotificationEnabled ( )

Definition at line 550 of file class.ilForumPost.php.

References notification().

551  {
552  return $this->notification == 1 ? true : false;
553  }
notification()
Definition: notification.php:2
+ Here is the call graph for this function:

◆ isOwner()

ilForumPost::isOwner (   $a_user_id = 0)

Definition at line 437 of file class.ilForumPost.php.

Referenced by ilObjForumGUI\autosaveThreadDraftAsyncObject(), ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

438  {
439  if ($this->pos_author_id && $a_user_id)
440  {
441  if ((int) $this->pos_author_id == (int) $a_user_id)
442  {
443  return true;
444  }
445  return false;
446  }
447  return false;
448  }
+ Here is the caller graph for this function:

◆ isPostRead()

ilForumPost::isPostRead ( )

Definition at line 397 of file class.ilForumPost.php.

References getIsRead().

Referenced by ilObjForumGUI\autosaveThreadDraftAsyncObject(), and ilObjForumGUI\getSubTabs().

398  {
399  return $this->getIsRead();
400  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRead()

ilForumPost::isRead (   $a_user_id = 0)

Definition at line 402 of file class.ilForumPost.php.

References $res, and array.

403  {
404  if ($a_user_id && $this->id)
405  {
406 
407  $res = $this->db->queryF('
408  SELECT * FROM frm_user_read
409  WHERE usr_id = %s
410  AND post_id = %s',
411  array('integer', 'integer'),
412  array($a_user_id, $this->id));
413 
414  return $res->numRows() ? true : false;
415  }
416 
417  return false;
418  }
Create styles array
The data for the language used.

◆ mergePosts()

static ilForumPost::mergePosts (   $source_thread_id,
  $target_thread_id 
)
static
Parameters
$source_thread_id
$target_thread_id

Definition at line 728 of file class.ilForumPost.php.

References $ilDB, and array.

Referenced by ilForum\mergeThreads().

729  {
730  global $ilDB;
731 
732  $ilDB->update('frm_posts',
733  array('pos_thr_fk' => array('integer', $target_thread_id)),
734  array('pos_thr_fk' => array('integer', $source_thread_id)));
735  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilForumPost::read ( )
private

Definition at line 182 of file class.ilForumPost.php.

References $res, $row, array, getUserData(), and notification().

Referenced by __construct(), and reload().

183  {
184  if ($this->id)
185  {
186  $res = $this->db->queryF('
187  SELECT * FROM frm_posts
188  INNER JOIN frm_posts_tree ON pos_fk = pos_pk
189  WHERE pos_pk = %s',
190  array('integer'), array($this->id));
191  $row = $this->db->fetchObject($res);
192 
193  if (is_object($row))
194  {
195  $this->id = $row->pos_pk;
196  $this->forum_id = $row->pos_top_fk;
197  $this->thread_id = $row->pos_thr_fk;
198  $this->display_user_id = $row->pos_display_user_id;
199  $this->user_alias = $row->pos_usr_alias;
200  $this->subject = $row->pos_subject;
201  $this->message = $row->pos_message;
202  $this->createdate = $row->pos_date;
203  $this->changedate = $row->pos_update;
204  $this->user_id_update = $row->update_user;
205  $this->censored = $row->pos_cens;
206  $this->censored_date = $row->pos_cens_date;
207  $this->censorship_comment = $row->pos_cens_com;
208  $this->notification = $row->notify;
209  $this->import_name = $row->import_name;
210  $this->status = $row->pos_status;
211  $this->tree_id = $row->fpt_pk;
212  $this->parent_id = $row->parent_pos;
213  $this->lft = $row->lft;
214  $this->rgt = $row->rgt;
215  $this->depth = $row->depth;
216  $this->pos_author_id = $row->pos_author_id;
217  $this->is_author_moderator = $row->is_author_moderator;
218  $this->post_activation_date = $row->pos_activation_date;
219  $this->getUserData();
220 
221  $this->objThread = new ilForumTopic($this->thread_id, $this->is_moderator);
222 
223  return true;
224  }
225 
226  return false;
227  }
228 
229  return false;
230  }
notification()
Definition: notification.php:2
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reload()

ilForumPost::reload ( )

Definition at line 293 of file class.ilForumPost.php.

References read().

294  {
295  return $this->read();
296  }
+ Here is the call graph for this function:

◆ setCensoredDate()

ilForumPost::setCensoredDate (   $censored_date)
Parameters
string$censored_date

Definition at line 688 of file class.ilForumPost.php.

References $censored_date.

Referenced by assignData().

689  {
690  $this->censored_date = $censored_date;
691  }
+ Here is the caller graph for this function:

◆ setCensorship()

ilForumPost::setCensorship (   $a_censorship)

Definition at line 530 of file class.ilForumPost.php.

Referenced by assignData().

531  {
532  $this->censored = $a_censorship;
533  }
+ Here is the caller graph for this function:

◆ setCensorshipComment()

ilForumPost::setCensorshipComment (   $a_comment)

Definition at line 538 of file class.ilForumPost.php.

Referenced by assignData().

539  {
540  $this->censorship_comment = $a_comment;
541  }
+ Here is the caller graph for this function:

◆ setChangeDate()

ilForumPost::setChangeDate (   $a_changedate)

Definition at line 514 of file class.ilForumPost.php.

Referenced by assignData(), ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

515  {
516  $this->changedate = $a_changedate;
517  }
+ Here is the caller graph for this function:

◆ setCreateDate()

ilForumPost::setCreateDate (   $a_createdate)

Definition at line 506 of file class.ilForumPost.php.

Referenced by assignData().

507  {
508  $this->createdate = $a_createdate;
509  }
+ Here is the caller graph for this function:

◆ setDepth()

ilForumPost::setDepth (   $a_depth)

Definition at line 613 of file class.ilForumPost.php.

Referenced by assignData().

614  {
615  $this->depth = $a_depth;
616  }
+ Here is the caller graph for this function:

◆ setDisplayUserId()

ilForumPost::setDisplayUserId (   $a_user_id)

Definition at line 474 of file class.ilForumPost.php.

Referenced by assignData().

475  {
476  $this->display_user_id = $a_user_id;
477  }
+ Here is the caller graph for this function:

◆ setForumId()

ilForumPost::setForumId (   $a_forum_id)

Definition at line 458 of file class.ilForumPost.php.

Referenced by assignData().

459  {
460  $this->forum_id = $a_forum_id;
461  }
+ Here is the caller graph for this function:

◆ setFullname()

ilForumPost::setFullname (   $a_fullname)

Definition at line 298 of file class.ilForumPost.php.

299  {
300  $this->fullname = $a_fullname;
301  }

◆ setId()

ilForumPost::setId (   $a_id)

Definition at line 450 of file class.ilForumPost.php.

451  {
452  $this->id = $a_id;
453  }

◆ setImportName()

ilForumPost::setImportName (   $a_import_name)

Definition at line 554 of file class.ilForumPost.php.

Referenced by assignData().

555  {
556  $this->import_name = $a_import_name;
557  }
+ Here is the caller graph for this function:

◆ setIsAuthorModerator()

ilForumPost::setIsAuthorModerator (   $is_author_moderator)
Parameters
int|null

Definition at line 656 of file class.ilForumPost.php.

References $is_author_moderator.

Referenced by assignData().

657  {
658  $this->is_author_moderator = $is_author_moderator;
659  }
+ Here is the caller graph for this function:

◆ setIsRead()

ilForumPost::setIsRead (   $a_is_read)

Definition at line 583 of file class.ilForumPost.php.

Referenced by assignData().

584  {
585  $this->post_read = $a_is_read;
586  }
+ Here is the caller graph for this function:

◆ setLft()

ilForumPost::setLft (   $a_lft)

Definition at line 597 of file class.ilForumPost.php.

Referenced by assignData().

598  {
599  $this->lft = $a_lft;
600  }
+ Here is the caller graph for this function:

◆ setLoginName()

ilForumPost::setLoginName (   $a_loginname)

Definition at line 306 of file class.ilForumPost.php.

307  {
308  $this->loginname = $a_loginname;
309  }

◆ setMessage()

ilForumPost::setMessage (   $a_message)

Definition at line 498 of file class.ilForumPost.php.

Referenced by assignData(), ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().

499  {
500  $this->message = $a_message;
501  }
+ Here is the caller graph for this function:

◆ setNotification()

ilForumPost::setNotification (   $a_notification)

Definition at line 546 of file class.ilForumPost.php.

References notification().

Referenced by assignData().

547  {
548  $this->notification = $a_notification;
549  }
notification()
Definition: notification.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setParentId()

ilForumPost::setParentId (   $a_parent_id)

Definition at line 578 of file class.ilForumPost.php.

Referenced by assignData().

579  {
580  $this->parent_id = $a_parent_id;
581  }
+ Here is the caller graph for this function:

◆ setPosAuthorId()

ilForumPost::setPosAuthorId (   $pos_author_id)
Parameters
int$pos_author_id

Definition at line 633 of file class.ilForumPost.php.

References $pos_author_id.

Referenced by assignData().

634  {
635  $this->pos_author_id = $pos_author_id;
636  }
+ Here is the caller graph for this function:

◆ setPostActivationDate()

ilForumPost::setPostActivationDate (   $post_activation_date)
Parameters
string$post_activation_date

Definition at line 680 of file class.ilForumPost.php.

References $post_activation_date.

Referenced by activatePost().

681  {
682  $this->post_activation_date = $post_activation_date;
683  }
+ Here is the caller graph for this function:

◆ setRgt()

ilForumPost::setRgt (   $a_rgt)

Definition at line 605 of file class.ilForumPost.php.

Referenced by assignData().

606  {
607  $this->rgt = $a_rgt;
608  }
+ Here is the caller graph for this function:

◆ setStatus()

ilForumPost::setStatus (   $a_status)

Definition at line 562 of file class.ilForumPost.php.

Referenced by activatePost(), and assignData().

563  {
564  $this->status = $a_status;
565  }
+ Here is the caller graph for this function:

◆ setSubject()

ilForumPost::setSubject (   $a_subject)

Definition at line 490 of file class.ilForumPost.php.

Referenced by assignData().

491  {
492  $this->subject = $a_subject;
493  }
+ Here is the caller graph for this function:

◆ setThread()

ilForumPost::setThread ( ilForumTopic  $thread)

Definition at line 621 of file class.ilForumPost.php.

622  {
623  $this->objThread = $thread;
624  }

◆ setThreadId()

ilForumPost::setThreadId (   $a_thread_id)

Definition at line 466 of file class.ilForumPost.php.

Referenced by assignData().

467  {
468  $this->thread_id = $a_thread_id;
469  }
+ Here is the caller graph for this function:

◆ setTreeId()

ilForumPost::setTreeId (   $a_tree_id)

Definition at line 570 of file class.ilForumPost.php.

Referenced by assignData().

571  {
572  $this->tree_id = $a_tree_id;
573  }
+ Here is the caller graph for this function:

◆ setUpdateUserId()

ilForumPost::setUpdateUserId (   $a_user_id_update)

Definition at line 522 of file class.ilForumPost.php.

Referenced by assignData().

523  {
524  $this->user_id_update = $a_user_id_update;
525  }
+ Here is the caller graph for this function:

◆ setUserAlias()

ilForumPost::setUserAlias (   $a_user_alias)

Definition at line 482 of file class.ilForumPost.php.

Referenced by assignData().

483  {
484  $this->user_alias = $a_user_alias;
485  }
+ Here is the caller graph for this function:

◆ update()

ilForumPost::update ( )

Definition at line 144 of file class.ilForumPost.php.

References $id, $ilDB, array, and notification().

145  {
146  global $ilDB;
147 
148  if($this->id)
149  {
150  $ilDB->update('frm_posts',
151  array(
152  'pos_top_fk' => array('integer', $this->forum_id),
153  'pos_thr_fk' => array('integer', $this->thread_id),
154  'pos_subject' => array('text', $this->subject),
155  'pos_message' => array('clob', $this->message),
156  'pos_update' => array('timestamp', $this->changedate),
157  'update_user' => array('integer', $this->user_id_update),
158  'pos_cens' => array('integer', $this->censored),
159  'pos_cens_date' => array('timestamp', $this->censored_date),
160  'pos_cens_com' => array('text', $this->censorship_comment),
161  'notify' => array('integer', (int)$this->notification),
162  'pos_status' => array('integer', (int)$this->status)
163  ),
164  array(
165  'pos_pk' => array('integer', (int)$this->id)
166  )
167  );
168 
169  if($this->objThread->getFirstPostId() == $this->id)
170  {
171  $this->objThread->setSubject($this->subject);
172  $this->objThread->update();
173  $this->objThread->reload();
174  }
175 
176  return true;
177  }
178 
179  return false;
180  }
notification()
Definition: notification.php:2
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $censored

ilForumPost::$censored = 0
private

Definition at line 34 of file class.ilForumPost.php.

◆ $censored_date

ilForumPost::$censored_date = '0000-00-00 00:00:00'
private

Definition at line 38 of file class.ilForumPost.php.

Referenced by getCensoredDate(), and setCensoredDate().

◆ $censorship_comment

ilForumPost::$censorship_comment = ''
private

Definition at line 36 of file class.ilForumPost.php.

Referenced by getCensorshipComment().

◆ $changedate

ilForumPost::$changedate = '0000-00-00 00:00:00'
private

Definition at line 30 of file class.ilForumPost.php.

Referenced by getChangeDate().

◆ $createdate

ilForumPost::$createdate = '0000-00-00 00:00:00'
private

Definition at line 28 of file class.ilForumPost.php.

Referenced by getCreateDate().

◆ $db

ilForumPost::$db = null
private

Definition at line 65 of file class.ilForumPost.php.

◆ $depth

ilForumPost::$depth = 0
private

Definition at line 54 of file class.ilForumPost.php.

Referenced by getDepth().

◆ $display_user_id

ilForumPost::$display_user_id = 0
private

Definition at line 20 of file class.ilForumPost.php.

Referenced by getDisplayUserId().

◆ $forum_id

ilForumPost::$forum_id = 0
private

Definition at line 16 of file class.ilForumPost.php.

Referenced by getForumId().

◆ $fullname

ilForumPost::$fullname = ''
private

Definition at line 56 of file class.ilForumPost.php.

Referenced by getFullname().

◆ $id

ilForumPost::$id = 0
private

Definition at line 14 of file class.ilForumPost.php.

Referenced by getId(), and update().

◆ $import_name

ilForumPost::$import_name = ''
private

Definition at line 42 of file class.ilForumPost.php.

Referenced by getImportName().

◆ $is_author_moderator

ilForumPost::$is_author_moderator = null
private

Definition at line 77 of file class.ilForumPost.php.

Referenced by getIsAuthorModerator(), and setIsAuthorModerator().

◆ $is_moderator

ilForumPost::$is_moderator = false
private

Definition at line 71 of file class.ilForumPost.php.

◆ $lft

ilForumPost::$lft = 0
private

Definition at line 50 of file class.ilForumPost.php.

Referenced by getLft().

◆ $loginname

ilForumPost::$loginname = ''
private

Definition at line 58 of file class.ilForumPost.php.

Referenced by getLoginName().

◆ $message

ilForumPost::$message = ''
private

Definition at line 26 of file class.ilForumPost.php.

Referenced by getMessage().

◆ $notification

ilForumPost::$notification = 0
private

Definition at line 40 of file class.ilForumPost.php.

◆ $objThread

ilForumPost::$objThread = null
private

Definition at line 63 of file class.ilForumPost.php.

Referenced by getThread().

◆ $parent_id

ilForumPost::$parent_id = 0
private

Definition at line 48 of file class.ilForumPost.php.

Referenced by getParentId().

◆ $pos_author_id

ilForumPost::$pos_author_id = 0
private

Definition at line 81 of file class.ilForumPost.php.

Referenced by getPosAuthorId(), and setPosAuthorId().

◆ $post_activation_date

ilForumPost::$post_activation_date = null
private

Definition at line 83 of file class.ilForumPost.php.

Referenced by getPostActivationDate(), and setPostActivationDate().

◆ $post_read

ilForumPost::$post_read = false
private

Definition at line 79 of file class.ilForumPost.php.

Referenced by getIsRead().

◆ $rgt

ilForumPost::$rgt = 0
private

Definition at line 52 of file class.ilForumPost.php.

Referenced by getRgt().

◆ $status

ilForumPost::$status = 1
private

Definition at line 44 of file class.ilForumPost.php.

◆ $subject

ilForumPost::$subject = ''
private

Definition at line 24 of file class.ilForumPost.php.

Referenced by getSubject().

◆ $thread_id

ilForumPost::$thread_id = 0
private

Definition at line 18 of file class.ilForumPost.php.

Referenced by getThreadId().

◆ $tree_id

ilForumPost::$tree_id = 0
private

Definition at line 46 of file class.ilForumPost.php.

Referenced by getTreeId().

◆ $user_alias

ilForumPost::$user_alias = ''
private

Definition at line 22 of file class.ilForumPost.php.

Referenced by getUserAlias().

◆ $user_id_update

ilForumPost::$user_id_update = 0
private

Definition at line 32 of file class.ilForumPost.php.

Referenced by getUpdateUserId().


The documentation for this class was generated from the following file: