4require_once 
'./Modules/Forum/classes/class.ilForumTopic.php';
 
   91        public function __construct($a_id = 0, $a_is_moderator = 
false, $preventImplicitRead = 
false)
 
   98                if( !$preventImplicitRead )
 
  107                unset($this->objThread);
 
  114                if ($this->forum_id && $this->thread_id)
 
  116                        $this->
id = $this->db->nextId(
'frm_posts');     
 
  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),
 
  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) 
 
  150                        $ilDB->update(
'frm_posts',
 
  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),
 
  162                                        'pos_status'    => array(
'integer', (
int)$this->status)
 
  165                                        'pos_pk'                => array(
'integer', (
int)$this->
id)
 
  169                        if($this->objThread->getFirstPostId() == $this->id)
 
  171                                $this->objThread->setSubject($this->subject);
 
  172                                $this->objThread->update();
 
  173                                $this->objThread->reload();
 
  186                        $res = $this->db->queryF(
' 
  187                                SELECT * FROM frm_posts 
  188                                INNER JOIN frm_posts_tree ON pos_fk = pos_pk 
  190                                array(
'integer'), array($this->
id));
 
  191                        $row = $this->db->fetchObject(
$res);
 
  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;
 
  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;
 
  221                                $this->objThread = 
new ilForumTopic($this->thread_id, $this->is_moderator);
 
  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 
  242                                array(
'integer', 
'integer', 
'integer', 
'integer'), 
 
  243                                array(
'0', $this->lft, $this->rgt, $this->thread_id));
 
  245                        return $res->numRows();
 
  255                if (
$row[
'pos_display_user_id'] && 
$row[
'pos_pk'])
 
  257                        require_once 
'Services/User/classes/class.ilObjUser.php';
 
  259                        $tmp_user->setFirstname(
$row[
'firstname']);
 
  260                        $tmp_user->setLastname(
$row[
'lastname']);
 
  261                        $tmp_user->setUTitle(
$row[
'title']);
 
  262                        $tmp_user->setLogin(
$row[
'login']);
 
  264                        $this->fullname = $tmp_user->getFullname();
 
  265                        $this->loginname = $tmp_user->getLogin();
 
  267                        $this->fullname = $this->fullname ? $this->fullname : ($this->import_name ? $this->import_name : 
$lng->txt(
'unknown'));
 
  275                if ($this->
id && $this->display_user_id)
 
  277                        require_once(
"Modules/Forum/classes/class.ilObjForumAccess.php");
 
  280                                $this->fullname = $tmp_user->getFullname();
 
  281                                $this->loginname = $tmp_user->getLogin();
 
  285                        $this->fullname = $this->fullname ? $this->fullname : ($this->import_name ? $this->import_name : 
$lng->txt(
'unknown'));
 
  295                return $this->
read();
 
  300                $this->fullname = $a_fullname;
 
  308                $this->loginname = $a_loginname;
 
  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))
 
  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";
 
  350                        $now = 
date(
"Y-m-d H:i:s");
 
  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']))
 
  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";
 
  377                                array(
'integer', 
'integer', 
'integer'),
 
  378                                array($this->lft, $this->rgt, $this->thread_id)
 
  381                        $now = 
date(
"Y-m-d H:i:s");
 
  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']))
 
  404                if ($a_user_id && $this->
id)
 
  407                        $res = $this->db->queryF(
' 
  408                                SELECT * FROM frm_user_read  
  411                                array(
'integer', 
'integer'),
 
  412                                array($a_user_id, $this->
id));
 
  414                        return $res->numRows() ? true : 
false;
 
  422                if ($this->
id && $this->rgt && $this->lft)
 
  424                        $res = $this->db->queryF(
' 
  425                                SELECT * FROM frm_posts_tree                                      
  426                                WHERE lft > %s AND rgt < %s 
  428                                array(
'integer', 
'integer', 
'integer'),
 
  429                                array($this->lft, $this->rgt, $this->thread_id));
 
  431                        return $res->numRows() ? true : 
false;
 
  439                if ($this->pos_author_id && $a_user_id)
 
  441                        if ((
int) $this->pos_author_id == (
int) $a_user_id)
 
  460                $this->forum_id = $a_forum_id;
 
  468                $this->thread_id = $a_thread_id;
 
  476                $this->display_user_id = $a_user_id;            
 
  484                $this->user_alias = $a_user_alias;
 
  492                $this->subject = $a_subject;
 
  500                $this->message = $a_message;
 
  508                $this->createdate = $a_createdate;
 
  516                $this->changedate = $a_changedate;
 
  524                $this->user_id_update = $a_user_id_update;
 
  532                $this->censored = $a_censorship;
 
  536                return $this->censored == 1 ? true : 
false;
 
  540                $this->censorship_comment = $a_comment;
 
  556                $this->import_name = $a_import_name;
 
  564                $this->status = $a_status;
 
  568                return $this->status == 1 ? true : 
false;
 
  572                $this->tree_id = $a_tree_id;
 
  580                $this->parent_id = $a_parent_id;
 
  585                $this->post_read = $a_is_read;
 
  615                $this->depth = $a_depth;
 
  623                $this->objThread = $thread;
 
  728        public static function mergePosts($source_thread_id, $target_thread_id)
 
  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)));
 
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
setNotification($a_notification)
setThread(ilForumTopic $thread)
__construct($a_id=0, $a_is_moderator=false, $preventImplicitRead=false)
ilForumPost constructor.
setCreateDate($a_createdate)
setCensorshipComment($a_comment)
setCensorship($a_censorship)
setThreadId($a_thread_id)
setIsAuthorModerator($is_author_moderator)
setImportName($a_import_name)
setPosAuthorId($pos_author_id)
setParentId($a_parent_id)
setUserAlias($a_user_alias)
setCensoredDate($censored_date)
setUpdateUserId($a_user_id_update)
setDisplayUserId($a_user_id)
setChangeDate($a_changedate)
setPostActivationDate($post_activation_date)
static mergePosts($source_thread_id, $target_thread_id)
activatePostAndChildPosts()
buildUserRelatedData($row)
setLoginName($a_loginname)
static getCachedUserInstance($usr_id)