コード例 #1
0
ファイル: subscription.php プロジェクト: sergy444/joomla
 function store($updateNulls = false)
 {
     if ($this->userid != 0 && empty($this->email)) {
         $user = JCommentsFactory::getUser($this->userid);
         $this->email = $user->email;
         unset($user);
     }
     if (empty($this->lang)) {
         $this->lang = JCommentsMultilingual::getLanguage();
     }
     $this->hash = $this->getHash();
     return parent::store($updateNulls);
 }
コード例 #2
0
ファイル: comment.php プロジェクト: sergy444/joomla
 public function store($updateNulls = false)
 {
     $config = JCommentsFactory::getConfig();
     if ($this->parent > 0) {
         $parent = new JCommentsTableComment($this->_db);
         if ($parent->load($this->parent)) {
             if (empty($this->title) && $config->getInt('comment_title') == 1) {
                 if (!empty($parent->title)) {
                     if (strpos($parent->title, JText::_('COMMENT_TITLE_RE')) === false) {
                         $this->title = JText::_('COMMENT_TITLE_RE') . ' ' . $parent->title;
                     } else {
                         $this->title = $parent->title;
                     }
                 }
             }
             $this->thread_id = $parent->thread_id ? $parent->thread_id : $parent->id;
             $this->level = $parent->level + 1;
             $this->path = $parent->path . ',' . $parent->id;
         }
     } else {
         if (empty($this->title) && $config->getInt('comment_title') == 1) {
             $title = JCommentsObjectHelper::getTitle($this->object_id, $this->object_group, $this->lang);
             if (!empty($title)) {
                 $this->title = JText::_('COMMENT_TITLE_RE') . ' ' . $title;
             }
         }
         $this->path = '0';
     }
     if (isset($this->datetime)) {
         unset($this->datetime);
     }
     if (isset($this->author)) {
         unset($this->author);
     }
     return parent::store($updateNulls);
 }