</script> <h1><?php echo GetMessage("PRMEDIA_TC_COMMENT_EDIT"); ?> </h1> <?$tabControl->Begin(); ?> <form name="form1" method="post" action="<?echo $APPLICATION->GetCurPage()?>?mid=<?php echo urlencode($mid); ?> &lang=<?echo LANGUAGE_ID?>"> <?$tabControl->BeginNextTab();?> <? $ps = $comment->GetByID(intval($ID)); $res = $ps->fetch(); ?> <tr> <td width="20%"> <?php echo GetMessage("PRMEDIA_TC_OBJECT_ID"); ?> </td> <td width="30%"> <input type="text" size="7" maxlength="50" value="<?php echo $res["OBJECT_ID"]; ?> " name="OBJECT_ID" /> </td> </tr>
if ($action == 'deactivate' && isset($id_element)) { $DB->query("UPDATE prmedia_treelike_comments SET ACTIVATED = 0 WHERE ID = $id_element"); $objectId = $obComment->GetObjectData($id_element); @$CACHE_MANAGER->ClearByTag("prmedia_treelike_comments_" . $objectId); LocalRedirect('/bitrix/admin/tc_comment_list.php?result=deactivated'); } if (in_array($action, array("ban", "ban_delete")) && isset($id_element)) { // add user ip into ban $elementId = 5; $obComment = new CTreelikeComments; $rsComment = $obComment->GetByID($id_element); if ($arComment = $rsComment->Fetch()) { $addr = $arComment['REMOTE_ADDR']; $ips = trim(COption::GetOptionString("prmedia.treelikecomments", "ban", "")); $arIPs = explode(",", $ips); foreach ($arIPs as $key => $ip) { $ip = trim($ip); if (empty($ip)) { unset($arIPs[$key]); continue; } $arIPs[$key] = trim($ip); if ($ip == $addr)
// logic CModule::IncludeModule('prmedia.treelikecomments'); CModule::IncludeModule('iblock'); if (empty($arGadgetParams['COUNT'])) { $arGadgetParams['COUNT'] = 10; } // delete comment if (!empty($_GET['delete-comment-id'])) { $commentId = intval($_GET['delete-comment-id']); $obComment = new CTreelikeComments; $rsComment = $obComment->GetByID($commentId); if ($arComment = $rsComment->Fetch()) { $obComment->Delete($commentId); $CACHE_MANAGER->ClearByTag("prmedia_treelike_comments_" . $arComment['OBJECT_ID']); } LocalRedirect($APPLICATION->GetCurPageParam("", array("delete-comment-id"))); } $arResult = array(); $rsComment = CTreelikeComments::GetList(array(), array(), intval($arGadgetParams['COUNT'])); $count = CTreelikeComments::GetList(array(), array(), intval($arGadgetParams['COUNT']), true); if ($count > $arGadgetParams['COUNT']) {