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