示例#1
0
			{
				$arIPs[] = $addr;
			}
			COption::SetOptionString("prmedia.treelikecomments", "ban", implode(", ", $arIPs));

			$addr = $arComment['REMOTE_ADDR'];
			if ($action == 'ban_delete')
			{
				// delete all comments for ip
				$arFilter = array(
					"REMOTE_ADDR" => $addr
				);
				$rsComment = $obComment->GetList(false, $arFilter);
				while ($arComment = $rsComment->Fetch())
				{
					$objectId = $obComment->GetObjectData($arComment['ID']);
					$obComment->Delete($arComment['ID']);
					@$CACHE_MANAGER->ClearByTag("prmedia_treelike_comments_" . $objectId);
				}
				LocalRedirect('/bitrix/admin/tc_comment_list.php?result=ban_delete');
				return;
			}
			LocalRedirect('/bitrix/admin/tc_comment_list.php?result=ban');
		}
	}
}
else
{
	LocalRedirect('/bitrix/admin/tc_comment_list.php');
}
示例#2
0
?>

<?

$MODULE_ID = "prmedia.treelikecomments";
CModule::IncludeModule($MODULE_ID);

$AxObject = new CTreelikeComments;
global $CACHE_MANAGER;
global $USER;


// activate (moderator action)
if(isset($_POST['ACTIVATE_ON']))
{
    $objectID = $AxObject->GetObjectData($_POST['ACTIVATE_ON']);
    $AxObject->Activate($_POST['ACTIVATE_ON']);
    @$CACHE_MANAGER->ClearByTag("prmedia_treelike_comments_".$objectID);
}


// vote up
if(isset($_POST['VoteUp']))
{
	if(!$AxObject->IsUserVoted($_POST['VoteUp'], $USER->GetID()))
	{
		$users = array(
			"USER_ID" => $USER->GetID(),
			"COMMENT_ID" => $_POST['VoteUp'],
			"VOTE_TYPE" => 'UP'
		);
示例#3
0
    if($_REQUEST['action_target']=='selected')
	{
		$rsData = $OComments->GetList(array($by=>$order), $arFilter, "", false, true);
		while($arRes = $rsData->Fetch())
			$arID[] = $arRes['ID'];
	}

  foreach($arID as $ID)
  {

    if(strlen($ID)<=0)
      continue;

      $ID = IntVal($ID);

      $objectID = $OComments->GetObjectData($ID);

      $OComments->Delete($ID, false);
      $CACHE_MANAGER->ClearByTag("prmedia_treelike_comments_".$objectID);
  }

}

$lAdmin->AddHeaders(array(
  array(  "id"    =>"ID",
    "content"  =>"ID",
    "sort"    =>"id",
    "align"    =>"center",
    "default"  =>true,
  ),