public function strip($str) { if (count($this->_replacements) > 0) { $str = JCommentsText::br2nl($str); $str = preg_replace($this->_replacements['code'], '\\1\\3', $str); $str = JCommentsText::nl2br($str); } return $str; }
function quoteComment($id, $loadForm = 0) { if (JCommentsSecurity::badRequest() == 1) { JCommentsSecurity::notAuth(); } $db =& JCommentsFactory::getDBO(); $acl =& JCommentsFactory::getACL(); $config =& JCommentsFactory::getConfig(); $response =& JCommentsFactory::getAjaxResponse(); $comment = new JCommentsDB($db); $id = (int) $id; if ($comment->load($id)) { $comment_name = JComments::getCommentAuthorName($comment); $comment_text = JCommentsText::br2nl($comment->comment); if ($config->getInt('enable_nested_quotes') == 0) { $bbcode =& JCommentsFactory::getBBCode(); $comment_text = $bbcode->removeQuotes($comment_text); } if ($config->getInt('enable_custom_bbcode')) { $customBBCode =& JCommentsFactory::getCustomBBCode(); $comment_text = $customBBCode->filter($comment_text, true); } if ($acl->getUserId() == 0) { $bbcode =& JCommentsFactory::getBBCode(); $comment_text = $bbcode->removeHidden($comment_text); } if ($comment_text != '') { if ($acl->check('enable_autocensor')) { $comment_text = JCommentsText::censor($comment_text); } if (intval($loadForm) == 1) { $form = JComments::getCommentsForm($comment->object_id, $comment->object_group, true); $response->addAssign('comments-form-link', 'innerHTML', $form); } $comment_text = JCommentsText::jsEscape($comment_text); $text = "[quote name=\"" . $comment_name . "\"]" . $comment_text . "[/quote]\\n"; $response->addScript("jcomments.insertText('" . $text . "');"); } else { $response->addAlert(JText::_('ERROR_NOTHING_TO_QUOTE')); } } unset($comment); return $response; }
public static function edit() { $id = JCommentsInput::getVar('cid', 0); if (is_array($id)) { $id = $id[0]; } $user = JCommentsFactory::getUser(); $db = JCommentsFactory::getDBO(); $row = new JCommentsTableComment($db); if ($row->load(intval($id))) { $row->checkout($user->id); $row->comment = JCommentsText::br2nl($row->comment); $row->comment = htmlspecialchars($row->comment); $row->comment = JCommentsText::nl2br($row->comment); $row->comment = strip_tags(str_replace('<br />', "\n", $row->comment)); $lists['object_title'] = JCommentsBackendObjectHelper::getTitle($row->object_id, $row->object_group, $row->lang); $lists['object_link'] = JCommentsBackendObjectHelper::getLink($row->object_id, $row->object_group, $row->lang); $lists = array(); $query = "SELECT * " . "\n FROM #__jcomments_reports " . "\n WHERE commentid = " . (int) $row->id . "\n ORDER BY date"; $db->setQuery($query); $lists['reports'] = $db->loadObjectList(); HTML_JComments::edit($row, $lists); } else { JCommentsRedirect(JCOMMENTS_INDEX . '?option=com_jcomments&task=comments'); } }
function edit() { global $my, $mainframe; $id = JCommentsInput::getVar('cid', 0); if (is_array($id)) { $id = $id[0]; } $db =& JCommentsFactory::getDBO(); $row = new JCommentsDB($db); if ($row->load($id)) { $row->checkout($my->id); $row->comment = JCommentsText::br2nl($row->comment); $row->comment = htmlspecialchars($row->comment); $row->comment = JCommentsText::nl2br($row->comment); $row->comment = strip_tags(str_replace('<br />', "\n", $row->comment)); $row->object_title = JCommentsObjectHelper::getTitle($row->object_id, $row->object_group, $row->lang); $row->link = $mainframe->getCfg('live_site') . '/' . JCOMMENTS_INDEX . '?option=com_jcomments&task=go2object&object_id=' . $row->object_id . '&object_group=' . $row->object_group . '&no_html=1'; HTML_JComments::edit($row); } else { JCommentsRedirect(JCOMMENTS_INDEX . '?option=com_jcomments&task=comments'); } }
function strip($str) { if (count($this->_smiles) == 0) { return $str; } $str = JCommentsText::br2nl($str); $str = preg_replace($this->_smiles['code'], '\\1\\3', $str); $str = JCommentsText::nl2br($str); return $str; }