function &createChild()
 {
     $commentObject = new XoopsComment();
     $commentObject->setNew();
     $commentObject->set('com_pid', $this->get('com_id'));
     $commentObject->set('com_rootid', $this->get('com_rootid'));
     $commentObject->set('com_modid', $this->get('com_modid'));
     $commentObject->set('com_itemid', $this->get('com_itemid'));
     $commentObject->set('com_exparams', $this->get('com_exparams'));
     $title = $this->get('com_title');
     if (preg_match("/^Re:(.+)\$/", $title, $matches)) {
         $commentObject->set('com_title', "Re[2]: " . $matches[1]);
     } elseif (preg_match("/^Re\\[(\\d+)\\]:(.+)\$/", $title, $matches)) {
         $commentObject->set('com_title', "Re[" . ($matches[1] + 1) . "]: " . $matches[2]);
     }
     return $commentObject;
 }
Beispiel #2
0
 /**
  * Create a responce comment object, and return it.
  * @return XoopsComment
  */
 function &createChild()
 {
     $ret = new XoopsComment();
     $ret->setNew();
     $ret->setVar('com_pid', $this->getVar('com_id'));
     $ret->setVar('com_rootid', $this->getVar('com_rootid'));
     $ret->setVar('com_modid', $this->getVar('com_modid'));
     $ret->setVar('com_itemid', $this->getVar('com_itemid'));
     $ret->setVar('com_exparams', $this->getVar('com_exparams'));
     $title = $this->get('com_title');
     if (preg_match("/^Re:(.+)\$/", $title, $matches)) {
         $ret->set('com_title', "Re[2]: " . $matches[1]);
     } elseif (preg_match("/^Re\\[(\\d+)\\]:(.+)\$/", $title, $matches)) {
         $ret->set('com_title', "Re[" . ($matches[1] + 1) . "]: " . $matches[2]);
     } elseif (!preg_match("/^re:/i", $title)) {
         $ret->set('com_title', "Re: " . xoops_substr($title, 0, 56));
     } else {
         $ret->set('com_title', $title);
     }
     return $ret;
 }