Пример #1
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'
		);