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'); } }